z_sram_NES with 2 NON_MATCHINGs and 1 NON_EQUIVALENTs (#531)

* Rename Sram_InitDebugSave

* Sram_InitDebugSave

* err

* Sram_IncrementDay

* non_matchings

* func_80146F5C and protos

* func_80146EE8

* func_80145698

* func_80143A54

* Split SaveContext

* problems with bss

* Fix bss

* more

* a small bunch

* Fix warnings

* almost everything

* two attempts

* at least compiles

* import data

* bss

* format

* stuff?

* Progress?

* More progress

* clean up data a little

* More progress

* disaster

* re split data

* A bit less of a disaster

* Fix renamed stuff

* data stuff

* fix conflicts

* format

* CycleSceneFlags

* some enums

* cleanup

* Fix merge issues

* format

* some changes

* format

* Lots of progress on z_sram_NES, but no matches yet

* SaveContent Documentation

* Oops

* Oops2

* Document more SaveContext

* Oops, don't need that anymore

* add small comment

* Another comment

* dekuPlaygroundPlayerName

* Fix merge issues

* format

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* remove magic number

* format

* fix merge issues

* bss

* format

* macro cleanup

* review

* merge issues

* review

* cleanup

* UNK_TYPE1

* Fix

* Remove comment

* small change

* conflicts

* review

* fix

* fixes

* format

* Update actorCtx renames part

* Match func_80143B0C thanks to Petrie and Anon

* minor cleaning pass

* format

* cleanup

* more minor cleanups

* Macros for accessing gSaveContext.save.stolenItems

* Introduce STOLEN_ITEM_NONE and remove CLEAR_STOLEN_ITEM_

* format

* Update include/macros.h

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Update src/code/z_sram_NES.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Update src/code/z_sram_NES.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Update src/code/z_sram_NES.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Update src/code/z_sram_NES.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Update src/code/z_sram_NES.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Update src/code/z_sram_NES.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Update src/code/z_sram_NES.c

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* @hensldm review

* Update include/functions.h

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update include/functions.h

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Rename QUEST_SONG_NEW_WAVE

* Add scene name comments to D_801C5FC0

* rename horseData.yaw

* Update include/functions.h

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Update src/code/z_sram_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* // = CUR_UPG_VALUE(UPG_WALLET);

* run actorfixer and format

* fix bss

* Fix merge problems and run format

* Some improvements to func_801457CC by anon

* bss

* format

* run actorfixer

* actorfixer, bss and format

* Use original names for the RESPAWN_MODE enum because the current ones are bad

* QUEST_SONG_BOSSA_NOVA

* some minor fixes on the SaveContext struct according to the debug rom

* Merge Inventory.items and Inventory.masks

* a

* simplify saveBuf accesses

* A few func renames

* actorfixer

* bss

* fixes

* bss

* actorfixer

* actorfixer and format

* actorfixer

* whoops

* whops

* bss

Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
This commit is contained in:
Anghelo Carvajal
2022-03-27 12:37:02 -03:00
committed by GitHub
parent 95c6ddbcc8
commit b08880f7a7
201 changed files with 4584 additions and 2880 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
#include "global.h"
#include "PR/ultratypes.h"
#include "ultra64/vi.h"
// This file is currently required to fix bss reordering in idle.c. It is not resolved by prevent_bss_reordering.h .
// Hopefully it will not be permanent.
+24 -21
View File
@@ -504,7 +504,7 @@ void Inventory_ChangeEquipment(s16 value) {
u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) {
Player* player = GET_PLAYER(globalCtx);
if (CUR_EQUIP_VALUE_VOID(EQUIP_SHIELD) != 0) {
if (GET_CUR_EQUIP_VALUE(EQUIP_SHIELD) != 0) {
SET_EQUIP_VALUE(EQUIP_SHIELD, 0);
Player_SetEquipmentData(globalCtx, player);
return true;
@@ -514,12 +514,12 @@ u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) {
}
void Inventory_ChangeUpgrade(s16 upgrade, u32 value) {
u32 upgrades = gSaveContext.inventory.upgrades;
u32 upgrades = gSaveContext.save.inventory.upgrades;
upgrades &= gUpgradeNegMasks[upgrade];
upgrades |= value << gUpgradeShifts[upgrade];
gSaveContext.inventory.upgrades = upgrades;
gSaveContext.save.inventory.upgrades = upgrades;
}
s32 Inventory_IsMapVisible(s16 sceneNum) {
@@ -546,7 +546,7 @@ s32 Inventory_IsMapVisible(s16 sceneNum) {
}
}
if (gSaveContext.scenesVisible[index] & gBitFlags[sceneNum - (index << 5)]) {
if (gSaveContext.save.scenesVisible[index] & gBitFlags[sceneNum - (index << 5)]) {
return true;
}
@@ -659,23 +659,23 @@ void Inventory_SetMapVisibility(s16 tingleIndex) {
index = 6;
}
gSaveContext.scenesVisible[index] =
gSaveContext.scenesVisible[index] | gBitFlags[(s16)(*tingleMapSceneIndices)[i] - (index << 5)];
gSaveContext.save.scenesVisible[index] =
gSaveContext.save.scenesVisible[index] | gBitFlags[(s16)(*tingleMapSceneIndices)[i] - (index << 5)];
i++;
}
if ((*tingleMapSceneIndices) == sScenesPerTingleMap[0]) {
gSaveContext.mapsVisible |= 3;
gSaveContext.save.mapsVisible |= 3;
} else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[1]) {
gSaveContext.mapsVisible |= 0x1C;
gSaveContext.save.mapsVisible |= 0x1C;
} else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[2]) {
gSaveContext.mapsVisible |= 0xE0;
gSaveContext.save.mapsVisible |= 0xE0;
} else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[3]) {
gSaveContext.mapsVisible |= 0x100;
gSaveContext.save.mapsVisible |= 0x100;
} else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[4]) {
gSaveContext.mapsVisible |= 0x1E00;
gSaveContext.save.mapsVisible |= 0x1E00;
} else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[5]) {
gSaveContext.mapsVisible |= 0x6000;
gSaveContext.save.mapsVisible |= 0x6000;
}
}
@@ -688,32 +688,34 @@ void Inventory_SetMapVisibility(s16 tingleIndex) {
void Inventory_SaveDekuPlaygroundHighScore(s16 timerId) {
s16 i;
gSaveContext.dekuPlaygroundHighScores[CURRENT_DAY - 1] = gSaveContext.unk_3DE0[timerId];
gSaveContext.save.dekuPlaygroundHighScores[CURRENT_DAY - 1] = gSaveContext.unk_3DE0[timerId];
for (i = 0; i < 8; i++) {
gSaveContext.inventory.dekuPlaygroundPlayerName[CURRENT_DAY - 1][i] = gSaveContext.playerName[i];
gSaveContext.save.inventory.dekuPlaygroundPlayerName[CURRENT_DAY - 1][i] =
gSaveContext.save.playerData.playerName[i];
}
}
void Inventory_IncrementSkullTokenCount(s16 sceneIndex) {
if (sceneIndex == SCENE_KINSTA1) {
// Swamp Spider House (increment high bits of skullTokenCount)
gSaveContext.skullTokenCount = ((u16)(((gSaveContext.skullTokenCount & 0xFFFF0000) >> 0x10) + 1) << 0x10) |
(gSaveContext.skullTokenCount & 0xFFFF);
gSaveContext.save.skullTokenCount =
((u16)(((gSaveContext.save.skullTokenCount & 0xFFFF0000) >> 0x10) + 1) << 0x10) |
(gSaveContext.save.skullTokenCount & 0xFFFF);
} else {
// Ocean Spider House (increment low bits of skullTokenCount)
gSaveContext.skullTokenCount =
(((u16)gSaveContext.skullTokenCount + 1) & 0xFFFF) | (gSaveContext.skullTokenCount & 0xFFFF0000);
gSaveContext.save.skullTokenCount =
(((u16)gSaveContext.save.skullTokenCount + 1) & 0xFFFF) | (gSaveContext.save.skullTokenCount & 0xFFFF0000);
}
}
s16 Inventory_GetSkullTokenCount(s16 sceneIndex) {
if (sceneIndex == SCENE_KINSTA1) {
// Swamp Spider House
return (gSaveContext.skullTokenCount & 0xFFFF0000) >> 0x10;
return (gSaveContext.save.skullTokenCount & 0xFFFF0000) >> 0x10;
} else {
// Ocean Spider House
return gSaveContext.skullTokenCount & 0xFFFF;
return gSaveContext.save.skullTokenCount & 0xFFFF;
}
}
@@ -723,5 +725,6 @@ void Inventory_SaveLotteryCodeGuess(GlobalContext* globalCtx) {
lotteryCodeGuess = ((globalCtx->msgCtx.unk12054[0] & 0xF) << 8); // First Digit
lotteryCodeGuess |= ((globalCtx->msgCtx.unk12054[1] & 0xF) << 4); // Second Digit
lotteryCodeGuess |= (globalCtx->msgCtx.unk12054[2] & 0xF); // Third Digit
gSaveContext.lotteryCodeGuess = (gSaveContext.lotteryCodeGuess & 0xFFFF0000) | (lotteryCodeGuess & 0xFFFF);
gSaveContext.save.lotteryCodeGuess =
(gSaveContext.save.lotteryCodeGuess & 0xFFFF0000) | (lotteryCodeGuess & 0xFFFF);
}
+102 -102
View File
@@ -12,106 +12,106 @@
#include "global.h"
static FlagSetEntry sFlagEntries[] = {
{ &gSaveContext.weekEventReg[0], "week_event_reg[0]" },
{ &gSaveContext.weekEventReg[1], "week_event_reg[1]" },
{ &gSaveContext.weekEventReg[2], "week_event_reg[2]" },
{ &gSaveContext.weekEventReg[3], "week_event_reg[3]" },
{ &gSaveContext.weekEventReg[4], "week_event_reg[4]" },
{ &gSaveContext.weekEventReg[5], "week_event_reg[5]" },
{ &gSaveContext.weekEventReg[6], "week_event_reg[6]" },
{ &gSaveContext.weekEventReg[7], "week_event_reg[7]" },
{ &gSaveContext.weekEventReg[8], "week_event_reg[8]" },
{ &gSaveContext.weekEventReg[9], "week_event_reg[9]" },
{ &gSaveContext.weekEventReg[10], "week_event_reg[10]" },
{ &gSaveContext.weekEventReg[11], "week_event_reg[11]" },
{ &gSaveContext.weekEventReg[12], "week_event_reg[12]" },
{ &gSaveContext.weekEventReg[13], "week_event_reg[13]" },
{ &gSaveContext.weekEventReg[14], "week_event_reg[14]" },
{ &gSaveContext.weekEventReg[15], "week_event_reg[15]" },
{ &gSaveContext.weekEventReg[16], "week_event_reg[16]" },
{ &gSaveContext.weekEventReg[17], "week_event_reg[17]" },
{ &gSaveContext.weekEventReg[18], "week_event_reg[18]" },
{ &gSaveContext.weekEventReg[19], "week_event_reg[19]" },
{ &gSaveContext.weekEventReg[20], "week_event_reg[20]" },
{ &gSaveContext.weekEventReg[21], "week_event_reg[21]" },
{ &gSaveContext.weekEventReg[22], "week_event_reg[22]" },
{ &gSaveContext.weekEventReg[23], "week_event_reg[23]" },
{ &gSaveContext.weekEventReg[24], "week_event_reg[24]" },
{ &gSaveContext.weekEventReg[25], "week_event_reg[25]" },
{ &gSaveContext.weekEventReg[26], "week_event_reg[26]" },
{ &gSaveContext.weekEventReg[27], "week_event_reg[27]" },
{ &gSaveContext.weekEventReg[28], "week_event_reg[28]" },
{ &gSaveContext.weekEventReg[29], "week_event_reg[29]" },
{ &gSaveContext.weekEventReg[30], "week_event_reg[30]" },
{ &gSaveContext.weekEventReg[31], "week_event_reg[31]" },
{ &gSaveContext.weekEventReg[32], "week_event_reg[32]" },
{ &gSaveContext.weekEventReg[33], "week_event_reg[33]" },
{ &gSaveContext.weekEventReg[34], "week_event_reg[34]" },
{ &gSaveContext.weekEventReg[35], "week_event_reg[35]" },
{ &gSaveContext.weekEventReg[36], "week_event_reg[36]" },
{ &gSaveContext.weekEventReg[37], "week_event_reg[37]" },
{ &gSaveContext.weekEventReg[38], "week_event_reg[38]" },
{ &gSaveContext.weekEventReg[39], "week_event_reg[39]" },
{ &gSaveContext.weekEventReg[40], "week_event_reg[40]" },
{ &gSaveContext.weekEventReg[41], "week_event_reg[41]" },
{ &gSaveContext.weekEventReg[42], "week_event_reg[42]" },
{ &gSaveContext.weekEventReg[43], "week_event_reg[43]" },
{ &gSaveContext.weekEventReg[44], "week_event_reg[44]" },
{ &gSaveContext.weekEventReg[45], "week_event_reg[45]" },
{ &gSaveContext.weekEventReg[46], "week_event_reg[46]" },
{ &gSaveContext.weekEventReg[47], "week_event_reg[47]" },
{ &gSaveContext.weekEventReg[48], "week_event_reg[48]" },
{ &gSaveContext.weekEventReg[49], "week_event_reg[49]" },
{ &gSaveContext.weekEventReg[50], "week_event_reg[50]" },
{ &gSaveContext.weekEventReg[51], "week_event_reg[51]" },
{ &gSaveContext.weekEventReg[52], "week_event_reg[52]" },
{ &gSaveContext.weekEventReg[53], "week_event_reg[53]" },
{ &gSaveContext.weekEventReg[54], "week_event_reg[54]" },
{ &gSaveContext.weekEventReg[55], "week_event_reg[55]" },
{ &gSaveContext.weekEventReg[56], "week_event_reg[56]" },
{ &gSaveContext.weekEventReg[57], "week_event_reg[57]" },
{ &gSaveContext.weekEventReg[58], "week_event_reg[58]" },
{ &gSaveContext.weekEventReg[59], "week_event_reg[59]" },
{ &gSaveContext.weekEventReg[60], "week_event_reg[60]" },
{ &gSaveContext.weekEventReg[61], "week_event_reg[61]" },
{ &gSaveContext.weekEventReg[62], "week_event_reg[62]" },
{ &gSaveContext.weekEventReg[63], "week_event_reg[63]" },
{ &gSaveContext.weekEventReg[64], "week_event_reg[64]" },
{ &gSaveContext.weekEventReg[65], "week_event_reg[65]" },
{ &gSaveContext.weekEventReg[66], "week_event_reg[66]" },
{ &gSaveContext.weekEventReg[67], "week_event_reg[67]" },
{ &gSaveContext.weekEventReg[68], "week_event_reg[68]" },
{ &gSaveContext.weekEventReg[69], "week_event_reg[69]" },
{ &gSaveContext.weekEventReg[70], "week_event_reg[70]" },
{ &gSaveContext.weekEventReg[71], "week_event_reg[71]" },
{ &gSaveContext.weekEventReg[72], "week_event_reg[72]" },
{ &gSaveContext.weekEventReg[73], "week_event_reg[73]" },
{ &gSaveContext.weekEventReg[74], "week_event_reg[74]" },
{ &gSaveContext.weekEventReg[75], "week_event_reg[75]" },
{ &gSaveContext.weekEventReg[76], "week_event_reg[76]" },
{ &gSaveContext.weekEventReg[77], "week_event_reg[77]" },
{ &gSaveContext.weekEventReg[78], "week_event_reg[78]" },
{ &gSaveContext.weekEventReg[79], "week_event_reg[79]" },
{ &gSaveContext.weekEventReg[80], "week_event_reg[80]" },
{ &gSaveContext.weekEventReg[81], "week_event_reg[81]" },
{ &gSaveContext.weekEventReg[82], "week_event_reg[82]" },
{ &gSaveContext.weekEventReg[83], "week_event_reg[83]" },
{ &gSaveContext.weekEventReg[84], "week_event_reg[84]" },
{ &gSaveContext.weekEventReg[85], "week_event_reg[85]" },
{ &gSaveContext.weekEventReg[86], "week_event_reg[86]" },
{ &gSaveContext.weekEventReg[87], "week_event_reg[87]" },
{ &gSaveContext.weekEventReg[88], "week_event_reg[88]" },
{ &gSaveContext.weekEventReg[89], "week_event_reg[89]" },
{ &gSaveContext.weekEventReg[90], "week_event_reg[90]" },
{ &gSaveContext.weekEventReg[91], "week_event_reg[91]" },
{ &gSaveContext.weekEventReg[92], "week_event_reg[92]" },
{ &gSaveContext.weekEventReg[93], "week_event_reg[93]" },
{ &gSaveContext.weekEventReg[94], "week_event_reg[94]" },
{ &gSaveContext.weekEventReg[95], "week_event_reg[95]" },
{ &gSaveContext.weekEventReg[96], "week_event_reg[96]" },
{ &gSaveContext.weekEventReg[97], "week_event_reg[97]" },
{ &gSaveContext.weekEventReg[98], "week_event_reg[98]" },
{ &gSaveContext.weekEventReg[99], "week_event_reg[99]" },
{ &gSaveContext.save.weekEventReg[0], "week_event_reg[0]" },
{ &gSaveContext.save.weekEventReg[1], "week_event_reg[1]" },
{ &gSaveContext.save.weekEventReg[2], "week_event_reg[2]" },
{ &gSaveContext.save.weekEventReg[3], "week_event_reg[3]" },
{ &gSaveContext.save.weekEventReg[4], "week_event_reg[4]" },
{ &gSaveContext.save.weekEventReg[5], "week_event_reg[5]" },
{ &gSaveContext.save.weekEventReg[6], "week_event_reg[6]" },
{ &gSaveContext.save.weekEventReg[7], "week_event_reg[7]" },
{ &gSaveContext.save.weekEventReg[8], "week_event_reg[8]" },
{ &gSaveContext.save.weekEventReg[9], "week_event_reg[9]" },
{ &gSaveContext.save.weekEventReg[10], "week_event_reg[10]" },
{ &gSaveContext.save.weekEventReg[11], "week_event_reg[11]" },
{ &gSaveContext.save.weekEventReg[12], "week_event_reg[12]" },
{ &gSaveContext.save.weekEventReg[13], "week_event_reg[13]" },
{ &gSaveContext.save.weekEventReg[14], "week_event_reg[14]" },
{ &gSaveContext.save.weekEventReg[15], "week_event_reg[15]" },
{ &gSaveContext.save.weekEventReg[16], "week_event_reg[16]" },
{ &gSaveContext.save.weekEventReg[17], "week_event_reg[17]" },
{ &gSaveContext.save.weekEventReg[18], "week_event_reg[18]" },
{ &gSaveContext.save.weekEventReg[19], "week_event_reg[19]" },
{ &gSaveContext.save.weekEventReg[20], "week_event_reg[20]" },
{ &gSaveContext.save.weekEventReg[21], "week_event_reg[21]" },
{ &gSaveContext.save.weekEventReg[22], "week_event_reg[22]" },
{ &gSaveContext.save.weekEventReg[23], "week_event_reg[23]" },
{ &gSaveContext.save.weekEventReg[24], "week_event_reg[24]" },
{ &gSaveContext.save.weekEventReg[25], "week_event_reg[25]" },
{ &gSaveContext.save.weekEventReg[26], "week_event_reg[26]" },
{ &gSaveContext.save.weekEventReg[27], "week_event_reg[27]" },
{ &gSaveContext.save.weekEventReg[28], "week_event_reg[28]" },
{ &gSaveContext.save.weekEventReg[29], "week_event_reg[29]" },
{ &gSaveContext.save.weekEventReg[30], "week_event_reg[30]" },
{ &gSaveContext.save.weekEventReg[31], "week_event_reg[31]" },
{ &gSaveContext.save.weekEventReg[32], "week_event_reg[32]" },
{ &gSaveContext.save.weekEventReg[33], "week_event_reg[33]" },
{ &gSaveContext.save.weekEventReg[34], "week_event_reg[34]" },
{ &gSaveContext.save.weekEventReg[35], "week_event_reg[35]" },
{ &gSaveContext.save.weekEventReg[36], "week_event_reg[36]" },
{ &gSaveContext.save.weekEventReg[37], "week_event_reg[37]" },
{ &gSaveContext.save.weekEventReg[38], "week_event_reg[38]" },
{ &gSaveContext.save.weekEventReg[39], "week_event_reg[39]" },
{ &gSaveContext.save.weekEventReg[40], "week_event_reg[40]" },
{ &gSaveContext.save.weekEventReg[41], "week_event_reg[41]" },
{ &gSaveContext.save.weekEventReg[42], "week_event_reg[42]" },
{ &gSaveContext.save.weekEventReg[43], "week_event_reg[43]" },
{ &gSaveContext.save.weekEventReg[44], "week_event_reg[44]" },
{ &gSaveContext.save.weekEventReg[45], "week_event_reg[45]" },
{ &gSaveContext.save.weekEventReg[46], "week_event_reg[46]" },
{ &gSaveContext.save.weekEventReg[47], "week_event_reg[47]" },
{ &gSaveContext.save.weekEventReg[48], "week_event_reg[48]" },
{ &gSaveContext.save.weekEventReg[49], "week_event_reg[49]" },
{ &gSaveContext.save.weekEventReg[50], "week_event_reg[50]" },
{ &gSaveContext.save.weekEventReg[51], "week_event_reg[51]" },
{ &gSaveContext.save.weekEventReg[52], "week_event_reg[52]" },
{ &gSaveContext.save.weekEventReg[53], "week_event_reg[53]" },
{ &gSaveContext.save.weekEventReg[54], "week_event_reg[54]" },
{ &gSaveContext.save.weekEventReg[55], "week_event_reg[55]" },
{ &gSaveContext.save.weekEventReg[56], "week_event_reg[56]" },
{ &gSaveContext.save.weekEventReg[57], "week_event_reg[57]" },
{ &gSaveContext.save.weekEventReg[58], "week_event_reg[58]" },
{ &gSaveContext.save.weekEventReg[59], "week_event_reg[59]" },
{ &gSaveContext.save.weekEventReg[60], "week_event_reg[60]" },
{ &gSaveContext.save.weekEventReg[61], "week_event_reg[61]" },
{ &gSaveContext.save.weekEventReg[62], "week_event_reg[62]" },
{ &gSaveContext.save.weekEventReg[63], "week_event_reg[63]" },
{ &gSaveContext.save.weekEventReg[64], "week_event_reg[64]" },
{ &gSaveContext.save.weekEventReg[65], "week_event_reg[65]" },
{ &gSaveContext.save.weekEventReg[66], "week_event_reg[66]" },
{ &gSaveContext.save.weekEventReg[67], "week_event_reg[67]" },
{ &gSaveContext.save.weekEventReg[68], "week_event_reg[68]" },
{ &gSaveContext.save.weekEventReg[69], "week_event_reg[69]" },
{ &gSaveContext.save.weekEventReg[70], "week_event_reg[70]" },
{ &gSaveContext.save.weekEventReg[71], "week_event_reg[71]" },
{ &gSaveContext.save.weekEventReg[72], "week_event_reg[72]" },
{ &gSaveContext.save.weekEventReg[73], "week_event_reg[73]" },
{ &gSaveContext.save.weekEventReg[74], "week_event_reg[74]" },
{ &gSaveContext.save.weekEventReg[75], "week_event_reg[75]" },
{ &gSaveContext.save.weekEventReg[76], "week_event_reg[76]" },
{ &gSaveContext.save.weekEventReg[77], "week_event_reg[77]" },
{ &gSaveContext.save.weekEventReg[78], "week_event_reg[78]" },
{ &gSaveContext.save.weekEventReg[79], "week_event_reg[79]" },
{ &gSaveContext.save.weekEventReg[80], "week_event_reg[80]" },
{ &gSaveContext.save.weekEventReg[81], "week_event_reg[81]" },
{ &gSaveContext.save.weekEventReg[82], "week_event_reg[82]" },
{ &gSaveContext.save.weekEventReg[83], "week_event_reg[83]" },
{ &gSaveContext.save.weekEventReg[84], "week_event_reg[84]" },
{ &gSaveContext.save.weekEventReg[85], "week_event_reg[85]" },
{ &gSaveContext.save.weekEventReg[86], "week_event_reg[86]" },
{ &gSaveContext.save.weekEventReg[87], "week_event_reg[87]" },
{ &gSaveContext.save.weekEventReg[88], "week_event_reg[88]" },
{ &gSaveContext.save.weekEventReg[89], "week_event_reg[89]" },
{ &gSaveContext.save.weekEventReg[90], "week_event_reg[90]" },
{ &gSaveContext.save.weekEventReg[91], "week_event_reg[91]" },
{ &gSaveContext.save.weekEventReg[92], "week_event_reg[92]" },
{ &gSaveContext.save.weekEventReg[93], "week_event_reg[93]" },
{ &gSaveContext.save.weekEventReg[94], "week_event_reg[94]" },
{ &gSaveContext.save.weekEventReg[95], "week_event_reg[95]" },
{ &gSaveContext.save.weekEventReg[96], "week_event_reg[96]" },
{ &gSaveContext.save.weekEventReg[97], "week_event_reg[97]" },
{ &gSaveContext.save.weekEventReg[98], "week_event_reg[98]" },
{ &gSaveContext.save.weekEventReg[99], "week_event_reg[99]" },
{ &gSaveContext.eventInf[0], "event_inf[0]" },
{ &gSaveContext.eventInf[1], "event_inf[1]" },
@@ -245,8 +245,8 @@ void FlagSet_Update(GameState* gameState) {
if (CHECK_BTN_ALL(input->cur.button, BTN_START)) {
if (CHECK_BTN_ALL(input->press.button, BTN_B)) {
s16 i;
for (i = 0; i < ARRAY_COUNT(gSaveContext.weekEventReg); i++) {
gSaveContext.weekEventReg[i] = 0;
for (i = 0; i < ARRAY_COUNT(gSaveContext.save.weekEventReg); i++) {
gSaveContext.save.weekEventReg[i] = 0;
}
for (i = 0; i < ARRAY_COUNT(gSaveContext.eventInf); i++) {
gSaveContext.eventInf[i] = 0;
-1
View File
@@ -1,4 +1,3 @@
#include "prevent_bss_reordering.h"
#include "global.h"
#define RSP_DONE_MSG 667
+4 -4
View File
@@ -2224,7 +2224,7 @@ void func_800B90F4(GlobalContext* globalCtx) {
void func_800B9120(ActorContext* actorCtx) {
s32 phi_v0 = CURRENT_DAY * 2;
if (gSaveContext.time < CLOCK_TIME(6, 0) || gSaveContext.time > CLOCK_TIME(18, 0)) {
if (gSaveContext.save.time < CLOCK_TIME(6, 0) || gSaveContext.save.time > CLOCK_TIME(18, 0)) {
phi_v0++;
}
@@ -2236,7 +2236,7 @@ void Actor_InitContext(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEn
CycleSceneFlags* cycleFlags;
s32 i;
gSaveContext.weekEventReg[92] |= 0x80;
gSaveContext.save.weekEventReg[92] |= 0x80;
cycleFlags = &gSaveContext.cycleSceneFlags[Play_GetOriginalSceneNumber(globalCtx->sceneNum)];
bzero(actorCtx, sizeof(ActorContext));
@@ -2252,8 +2252,8 @@ void Actor_InitContext(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEn
}
actorCtx->flags.chest = cycleFlags->chest;
actorCtx->flags.switches[0] = cycleFlags->swch0;
actorCtx->flags.switches[1] = cycleFlags->swch1;
actorCtx->flags.switches[0] = cycleFlags->switch0;
actorCtx->flags.switches[1] = cycleFlags->switch1;
if (globalCtx->sceneNum == SCENE_INISIE_R) {
cycleFlags = &gSaveContext.cycleSceneFlags[globalCtx->sceneNum];
}
+5 -5
View File
@@ -6,11 +6,11 @@
#define DYNA_RAYCAST_WALLS 2
#define DYNA_RAYCAST_CEILINGS 4
static u32 sWallFlags[32] = {
u32 sWallFlags[32] = {
0, 1, 3, 5, 8, 16, 32, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
static u16 sSurfaceTypeSfx[] = {
u16 sSurfaceTypeSfx[] = {
/* 0x00 */ NA_SE_PL_WALK_GROUND - SFX_FLAG,
/* 0x01 */ NA_SE_PL_WALK_SAND - SFX_FLAG,
/* 0x02 */ NA_SE_PL_WALK_CONCRETE - SFX_FLAG,
@@ -28,7 +28,7 @@ static u16 sSurfaceTypeSfx[] = {
/* 0x0E */ NA_SE_PL_WALK_SNOW - SFX_FLAG
};
static u8 D_801B46C0[] = {
u8 D_801B46C0[] = {
/* 0x00 */ 1,
/* 0x01 */ 1,
/* 0x02 */ 0,
@@ -46,7 +46,7 @@ static u8 D_801B46C0[] = {
/* 0x0E */ 1
};
static s16 sSmallMemScenes[] = {
s16 sSmallMemScenes[] = {
SCENE_F01,
};
@@ -55,7 +55,7 @@ typedef struct {
u32 memSize;
} BgCheckSceneMemEntry;
static BgCheckSceneMemEntry sSceneMemList[] = {
BgCheckSceneMemEntry sSceneMemList[] = {
{ SCENE_00KEIKOKU, 0xC800 },
};
+7 -5
View File
@@ -3,8 +3,9 @@
SaveContext gSaveContext;
void SaveContext_Init(void) {
bzero(&gSaveContext, sizeof(gSaveContext));
gSaveContext.playerForm = 0;
bzero(&gSaveContext, sizeof(SaveContext));
gSaveContext.save.playerForm = 0;
gSaveContext.seqIndex = (u8)NA_BGM_DISABLED;
gSaveContext.nightSeqIndex = 0xFF;
gSaveContext.unk_3F46 = NA_BGM_GENERAL_SFX;
@@ -16,7 +17,8 @@ void SaveContext_Init(void) {
gSaveContext.dogIsLost = true;
gSaveContext.nextTransition = 0xFF;
gSaveContext.unk_3F26 = 50;
gSaveContext.language = 1;
gSaveContext.audioSetting = 0;
gSaveContext.zTargetSetting = 0;
gSaveContext.options.language = 1;
gSaveContext.options.audioSetting = 0;
gSaveContext.options.zTargetSetting = 0;
}
+39 -38
View File
@@ -68,7 +68,7 @@ CutsceneStateHandler sCsStateHandlers1[] = {
};
void Cutscene_Update1(GlobalContext* globalCtx, CutsceneContext* csCtx) {
if (gSaveContext.cutscene < 0xFFF0) {
if (gSaveContext.save.cutscene < 0xFFF0) {
sCsStateHandlers1[csCtx->state](globalCtx, csCtx);
}
}
@@ -87,11 +87,11 @@ void Cutscene_Update2(GlobalContext* globalCtx, CutsceneContext* csCtx) {
}
if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_0)) {
gSaveContext.cutscene = 0xFFFD;
gSaveContext.save.cutscene = 0xFFFD;
gSaveContext.cutsceneTrigger = 1;
}
if (gSaveContext.cutscene >= 0xFFF0) {
if (gSaveContext.save.cutscene >= 0xFFF0) {
func_800EDA84(globalCtx, csCtx);
sCsStateHandlers2[csCtx->state](globalCtx, csCtx);
}
@@ -250,12 +250,12 @@ void Cutscene_Command_Misc(GlobalContext* globalCtx2, CutsceneContext* csCtx, Cs
gSaveContext.sunsSongState = SUNSSONG_START;
break;
case 0x12:
if (!gSaveContext.isNight) {
time = gSaveContext.time;
gSaveContext.time = time - (u16)REG(15);
if (!gSaveContext.save.isNight) {
time = gSaveContext.save.time;
gSaveContext.save.time = time - (u16)REG(15);
} else {
time = gSaveContext.time;
gSaveContext.time = time - (u16)(2 * REG(15));
time = gSaveContext.save.time;
gSaveContext.save.time = time - (u16)(2 * REG(15));
}
break;
case 0x13:
@@ -270,7 +270,7 @@ void Cutscene_Command_Misc(GlobalContext* globalCtx2, CutsceneContext* csCtx, Cs
EnvFlags_Set(globalCtx, 4);
break;
case 0x16:
gSaveContext.playerForm = PLAYER_FORM_DEKU;
gSaveContext.save.playerForm = PLAYER_FORM_DEKU;
break;
case 0x17:
player->stateFlags2 |= 0x4000000;
@@ -279,9 +279,9 @@ void Cutscene_Command_Misc(GlobalContext* globalCtx2, CutsceneContext* csCtx, Cs
player->stateFlags2 &= ~0x4000000;
break;
case 0x19:
sCutsceneStoredPlayerForm = gSaveContext.playerForm;
gSaveContext.playerForm = PLAYER_FORM_HUMAN;
gSaveContext.equippedMask = PLAYER_MASK_NONE;
sCutsceneStoredPlayerForm = gSaveContext.save.playerForm;
gSaveContext.save.playerForm = PLAYER_FORM_HUMAN;
gSaveContext.save.equippedMask = PLAYER_MASK_NONE;
break;
case 0x1A:
func_8019F128(NA_SE_EV_EARTHQUAKE_LAST2 - SFX_FLAG);
@@ -306,7 +306,7 @@ void Cutscene_Command_Misc(GlobalContext* globalCtx2, CutsceneContext* csCtx, Cs
}
break;
case 0x1D:
gSaveContext.playerForm = sCutsceneStoredPlayerForm;
gSaveContext.save.playerForm = sCutsceneStoredPlayerForm;
break;
case 0x1E:
D_801F4DE0 = true;
@@ -316,7 +316,7 @@ void Cutscene_Command_Misc(GlobalContext* globalCtx2, CutsceneContext* csCtx, Cs
break;
case 0x21:
if (isStartFrame) {
func_80146EE8(globalCtx);
Sram_SaveSpecialEnterClockTown(globalCtx);
}
break;
case 0x22:
@@ -329,10 +329,10 @@ void Cutscene_Command_Misc(GlobalContext* globalCtx2, CutsceneContext* csCtx, Cs
D_801BB15C = csCtx->frames;
if (REG(15) != 0) {
time = gSaveContext.time;
gSaveContext.time = (u16)REG(15) + time;
time = gSaveContext.time;
gSaveContext.time = (u16)gSaveContext.unk_14 + time;
time = gSaveContext.save.time;
gSaveContext.save.time = (u16)REG(15) + time;
time = gSaveContext.save.time;
gSaveContext.save.time = (u16)gSaveContext.save.daySpeed + time;
}
}
break;
@@ -349,7 +349,7 @@ void Cutscene_Command_Misc(GlobalContext* globalCtx2, CutsceneContext* csCtx, Cs
case 0x26:
// Seems to be used to trigger "Dawn of A New Day"
gSaveContext.day = 9;
gSaveContext.save.day = 9;
{
GameState* gameState = &globalCtx->state;
@@ -357,11 +357,11 @@ void Cutscene_Command_Misc(GlobalContext* globalCtx2, CutsceneContext* csCtx, Cs
}
SET_NEXT_GAMESTATE(&globalCtx->state, Daytelop_Init, DaytelopContext);
func_80146F5C(globalCtx);
Sram_SaveSpecialNewDay(globalCtx);
break;
case 0x27:
gSaveContext.playerForm = PLAYER_FORM_ZORA;
gSaveContext.save.playerForm = PLAYER_FORM_ZORA;
break;
case 0x28:
@@ -442,7 +442,7 @@ void func_800EADB0(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
u8 dayMinusOne;
if (csCtx->frames == cmd->startFrame) {
dayMinusOne = (gSaveContext.day - 1);
dayMinusOne = (gSaveContext.save.day - 1);
if (dayMinusOne >= 3) {
dayMinusOne = 0;
}
@@ -557,7 +557,7 @@ void Cutscene_Command_SetTime(GlobalContext* globalCtx, CutsceneContext* csCtx,
minutes = CLOCK_TIME_ALT_F(0, cmd->minute + 1);
nextTime = hourAsMinutes + minutes;
gSaveContext.time = nextTime;
gSaveContext.save.time = nextTime;
gSaveContext.environmentTime = nextTime;
}
}
@@ -572,7 +572,7 @@ void Cutscene_TerminatorImpl(GlobalContext* globalCtx, CutsceneContext* csCtx, C
gSaveContext.unk_3F1E = 1;
}
gSaveContext.cutscene = 0;
gSaveContext.save.cutscene = 0;
if (cmd->base == 1) {
globalCtx->nextEntranceIndex = globalCtx->csCtx.sceneCsList[globalCtx->csCtx.currentCsIndex].nextEntranceIndex;
gSaveContext.nextCutsceneIndex = 0;
@@ -607,7 +607,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
switch (D_801F4DE2) {
case 0x1F:
if (gSaveContext.weekEventReg[0x14] & 2) {
if (gSaveContext.save.weekEventReg[20] & 2) {
globalCtx->nextEntranceIndex = 0x3010;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->unk_1887F = 3;
@@ -620,7 +620,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
break;
case 0x44:
if (gSaveContext.weekEventReg[0x21] & 0x80) {
if (gSaveContext.save.weekEventReg[33] & 0x80) {
globalCtx->nextEntranceIndex = 0xAE70;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->unk_1887F = 3;
@@ -633,7 +633,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
break;
case 0x5F:
gSaveContext.weekEventReg[0x37] |= 0x80;
gSaveContext.save.weekEventReg[55] |= 0x80;
globalCtx->nextEntranceIndex = 0x6A80;
gSaveContext.nextCutsceneIndex = 0xFFF0;
globalCtx->sceneLoadFlag = 0x14;
@@ -641,7 +641,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
break;
case 0x36:
gSaveContext.weekEventReg[0x34] |= 0x20;
gSaveContext.save.weekEventReg[52] |= 0x20;
globalCtx->nextEntranceIndex = 0x2000;
gSaveContext.nextCutsceneIndex = 0xFFF1;
globalCtx->sceneLoadFlag = 0x14;
@@ -813,7 +813,7 @@ void Cutscene_Command_GiveTatlToPlayer(GlobalContext* globalCtx, CutsceneContext
if (csCtx->frames == cmd->startFrame) {
if (cmd->base == 1) {
gSaveContext.hasTatl = true;
gSaveContext.save.hasTatl = true;
if (player->tatlActor != NULL) {
return;
}
@@ -1093,7 +1093,7 @@ void Cutscene_Command_Textbox(GlobalContext* globalCtx, CutsceneContext* csCtx,
}
}
if (dialogState == 5 && Message_ShouldAdvance(globalCtx) != 0) {
if (dialogState == 5 && Message_ShouldAdvance(globalCtx)) {
func_80152434(globalCtx, cmd->base);
}
}
@@ -1424,7 +1424,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
/* End of command handling section */
void func_800ED980(GlobalContext* globalCtx, CutsceneContext* csCtx) {
if (gSaveContext.cutscene >= 0xFFF0) {
if (gSaveContext.save.cutscene >= 0xFFF0) {
csCtx->frames++;
Cutscene_ProcessCommands(globalCtx, csCtx, (u8*)globalCtx->csCtx.csData);
}
@@ -1448,7 +1448,7 @@ void func_800EDA04(GlobalContext* globalCtx, CutsceneContext* csCtx) {
csCtx->actorActions[i] = NULL;
}
gSaveContext.cutscene = 0;
gSaveContext.save.cutscene = 0;
gSaveContext.gameMode = 0;
ActorCutscene_Stop(0x7F);
Audio_SetCutsceneFlag(false);
@@ -1458,10 +1458,10 @@ void func_800EDA04(GlobalContext* globalCtx, CutsceneContext* csCtx) {
void func_800EDA84(GlobalContext* globalCtx, CutsceneContext* csCtx) {
if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_0) && !Player_InCsMode(&globalCtx->state)) {
gSaveContext.cutscene = 0xFFFD;
gSaveContext.save.cutscene = 0xFFFD;
}
if ((gSaveContext.cutscene >= 0xFFF0) && (csCtx->state == CS_STATE_0)) {
if ((gSaveContext.save.cutscene >= 0xFFF0) && (csCtx->state == CS_STATE_0)) {
s16 i;
D_801BB124 = 0;
@@ -1515,8 +1515,9 @@ void func_800EDBE0(GlobalContext* globalCtx) {
ActorCutscene_Start(sp2A, NULL);
gSaveContext.showTitleCard = false;
} else if (!((1 << (temp_a3[temp_v0_3].unk7 % 8)) &
gSaveContext.weekEventReg[temp_a3[temp_v0_3].unk7 / 8])) {
gSaveContext.weekEventReg[(temp_a3[temp_v0_3].unk7 / 8)] |= 1 << (temp_a3[temp_v0_3].unk7 % 8);
gSaveContext.save.weekEventReg[temp_a3[temp_v0_3].unk7 / 8])) {
gSaveContext.save.weekEventReg[(temp_a3[temp_v0_3].unk7 / 8)] |=
1 << (temp_a3[temp_v0_3].unk7 % 8);
ActorCutscene_Start(sp2A, NULL);
gSaveContext.showTitleCard = false;
}
@@ -1530,8 +1531,8 @@ void func_800EDBE0(GlobalContext* globalCtx) {
if ((gSaveContext.respawnFlag == 0) || (gSaveContext.respawnFlag == -2)) {
sp24 = globalCtx->loadedScene;
if ((sp24->titleTextId != 0) && gSaveContext.showTitleCard) {
if ((Entrance_GetTransitionFlags(gSaveContext.sceneSetupIndex + gSaveContext.entranceIndex) & 0x4000) !=
0) {
if ((Entrance_GetTransitionFlags(gSaveContext.sceneSetupIndex + gSaveContext.save.entranceIndex) &
0x4000) != 0) {
func_80151A68(globalCtx, sp24->titleTextId);
}
}
+13 -13
View File
@@ -7,17 +7,17 @@ u16 ElfMessage_GetFirstCycleHint(GlobalContext* globalCtx) {
if (CURRENT_DAY <= 0) {
return 0;
}
if (gSaveContext.weekEventReg[88] & 0x20) {
if (gSaveContext.save.weekEventReg[88] & 0x20) {
return 0;
}
if (gSaveContext.weekEventReg[79] & 0x10) {
if (gSaveContext.weekEventReg[8] & 0x40) {
if (gSaveContext.save.weekEventReg[79] & 0x10) {
if (gSaveContext.save.weekEventReg[8] & 0x40) {
return 0;
}
return 0x224;
}
if (!(gSaveContext.weekEventReg[8] & 0x80)) {
if (gSaveContext.weekEventReg[9] & 1) {
if (!(gSaveContext.save.weekEventReg[8] & 0x80)) {
if (gSaveContext.save.weekEventReg[9] & 1) {
return 0x21E;
}
if (globalCtx->sceneNum == SCENE_YOUSEI_IZUMI) {
@@ -25,7 +25,7 @@ u16 ElfMessage_GetFirstCycleHint(GlobalContext* globalCtx) {
}
return 0x21D;
}
if (gSaveContext.magicAcquired != true) {
if (gSaveContext.save.playerData.magicAcquired != true) {
return 0x21F;
}
if (INV_CONTENT(ITEM_DEED_LAND) == ITEM_DEED_LAND) {
@@ -35,27 +35,27 @@ u16 ElfMessage_GetFirstCycleHint(GlobalContext* globalCtx) {
return 0;
}
if (INV_CONTENT(ITEM_MOON_TEAR) == ITEM_MOON_TEAR) {
if (gSaveContext.weekEventReg[86] & 4) {
if (gSaveContext.save.weekEventReg[86] & 4) {
return 0x242;
}
return 0x243;
}
if (gSaveContext.weekEventReg[74] & 0x20) {
if (gSaveContext.save.weekEventReg[74] & 0x20) {
return 0x223;
}
if (gSaveContext.weekEventReg[73] & 0x80) {
if (gSaveContext.save.weekEventReg[73] & 0x80) {
return 0x222;
}
if (gSaveContext.weekEventReg[73] & 0x20) {
if (gSaveContext.save.weekEventReg[73] & 0x20) {
return 0x221;
}
if (gSaveContext.weekEventReg[77] & 2) {
if (gSaveContext.weekEventReg[73] & 0x10) {
if (gSaveContext.save.weekEventReg[77] & 2) {
if (gSaveContext.save.weekEventReg[73] & 0x10) {
return 0x240;
}
return 0x241;
}
if ((gSaveContext.weekEventReg[86] & 2) || (gSaveContext.weekEventReg[73] & 0x40)) {
if ((gSaveContext.save.weekEventReg[86] & 2) || (gSaveContext.save.weekEventReg[73] & 0x40)) {
return 0x23F;
}
return 0x220;
+12 -10
View File
@@ -822,13 +822,14 @@ s16 func_800A7650(s16 dropId) {
(((dropId == ITEM00_ARROWS_10) || (dropId == ITEM00_ARROWS_30) || (dropId == ITEM00_ARROWS_40) ||
(dropId == ITEM00_ARROWS_50)) &&
(INV_CONTENT(ITEM_BOW) == ITEM_NONE)) ||
(((dropId == ITEM00_MAGIC_LARGE) || (dropId == ITEM00_MAGIC_SMALL)) && (gSaveContext.magicLevel == 0))) {
(((dropId == ITEM00_MAGIC_LARGE) || (dropId == ITEM00_MAGIC_SMALL)) &&
(gSaveContext.save.playerData.magicLevel == 0))) {
return ITEM00_NO_DROP;
}
if (dropId == ITEM00_HEART) {
healthCapacity = gSaveContext.healthCapacity;
if (healthCapacity == gSaveContext.health) {
healthCapacity = gSaveContext.save.playerData.healthCapacity;
if (healthCapacity == gSaveContext.save.playerData.health) {
return ITEM00_RUPEE_GREEN;
}
}
@@ -1049,7 +1050,7 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
dropQuantity = sDropTableAmounts[params + dropTableIndex];
if (dropId == ITEM00_MASK) {
switch (gSaveContext.playerForm) {
switch (gSaveContext.save.playerForm) {
case PLAYER_FORM_HUMAN:
dropId = ITEM00_ARROWS_10;
break;
@@ -1085,26 +1086,27 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
}
if (dropId == ITEM00_FLEXIBLE) {
if (gSaveContext.health <= 0x10) {
if (gSaveContext.save.playerData.health <= 0x10) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f,
spawnPos->z, 0, 0, 0, 2);
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, spawnPos, 40, NA_SE_EV_BUTTERFRY_TO_FAIRY);
return;
}
if (gSaveContext.health <= 0x30) {
if (gSaveContext.save.playerData.health <= 0x30) {
params = 0x10;
dropId = ITEM00_HEART;
dropQuantity = 3;
} else if (gSaveContext.health <= 0x50) {
} else if (gSaveContext.save.playerData.health <= 0x50) {
params = 0x10;
dropId = ITEM00_HEART;
dropQuantity = 1;
} else if ((gSaveContext.magicLevel != 0) && (gSaveContext.magic == 0)) {
} else if ((gSaveContext.save.playerData.magicLevel != 0) && (gSaveContext.save.playerData.magic == 0)) {
params = 0xD0;
dropId = ITEM00_MAGIC_LARGE;
dropQuantity = 1;
} else if ((gSaveContext.magicLevel != 0) && ((gSaveContext.magicLevel >> 1) >= gSaveContext.magic)) {
} else if ((gSaveContext.save.playerData.magicLevel != 0) &&
((gSaveContext.save.playerData.magicLevel >> 1) >= gSaveContext.save.playerData.magic)) {
params = 0xD0;
dropId = ITEM00_MAGIC_LARGE;
dropQuantity = 1;
@@ -1116,7 +1118,7 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
params = 0xB0;
dropId = ITEM00_BOMBS_A;
dropQuantity = 1;
} else if (gSaveContext.rupees < 11) {
} else if (gSaveContext.save.playerData.rupees < 11) {
params = 0xA0;
dropId = ITEM00_RUPEE_RED;
dropQuantity = 1;
+4 -4
View File
@@ -44,7 +44,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
}
gSaveContext.unk_3DC0 = 2000;
gSaveContext.tatlTimer = 0;
gSaveContext.save.playerData.tatlTimer = 0;
gSaveContext.seqIndex = (u8)NA_BGM_DISABLED;
gSaveContext.nightSeqIndex = 0xFF;
gSaveContext.eventInf[0] = 0;
@@ -72,11 +72,11 @@ void GameOver_Update(GlobalContext* globalCtx) {
gSaveContext.respawnFlag = -6;
}
gSaveContext.nextTransition = 2;
gSaveContext.health = 48;
gSaveContext.save.playerData.health = 48;
gameOverCtx->state++;
if (INV_CONTENT(ITEM_MASK_DEKU) == ITEM_MASK_DEKU) {
gSaveContext.playerForm = PLAYER_FORM_HUMAN;
gSaveContext.equippedMask = PLAYER_MASK_NONE;
gSaveContext.save.playerForm = PLAYER_FORM_HUMAN;
gSaveContext.save.equippedMask = PLAYER_MASK_NONE;
}
func_8013EE24();
}
+14 -14
View File
@@ -38,7 +38,7 @@ void LifeMeter_Init(GlobalContext* globalCtx) {
interfaceCtx->unkTimer = 320;
interfaceCtx->health = gSaveContext.health;
interfaceCtx->health = gSaveContext.save.playerData.health;
interfaceCtx->lifeColorChange = 0;
interfaceCtx->lifeColorChangeDirection = 0;
@@ -168,7 +168,7 @@ void LifeMeter_UpdateColors(GlobalContext* globalCtx) {
}
s32 LifeMeter_SaveInterfaceHealth(GlobalContext* globalCtx) {
gSaveContext.health = globalCtx->interfaceCtx.health;
gSaveContext.save.playerData.health = globalCtx->interfaceCtx.health;
return 1;
}
@@ -178,8 +178,8 @@ s32 LifeMeter_IncreaseInterfaceHealth(GlobalContext* globalCtx) {
interfaceCtx->unkTimer = 320;
interfaceCtx->health += 0x10;
if (globalCtx->interfaceCtx.health >= gSaveContext.health) {
globalCtx->interfaceCtx.health = gSaveContext.health;
if (globalCtx->interfaceCtx.health >= gSaveContext.save.playerData.health) {
globalCtx->interfaceCtx.health = gSaveContext.save.playerData.health;
return 1;
}
return 0;
@@ -195,7 +195,7 @@ s32 LifeMeter_DecreaseInterfaceHealth(GlobalContext* globalCtx) {
interfaceCtx->health -= 0x10;
if (interfaceCtx->health <= 0) {
interfaceCtx->health = 0;
globalCtx->damagePlayer(globalCtx, -(((void)0, gSaveContext.health) + 1));
globalCtx->damagePlayer(globalCtx, -(((void)0, gSaveContext.save.playerData.health) + 1));
return 1;
}
}
@@ -216,18 +216,18 @@ void LifeMeter_Draw(GlobalContext* globalCtx) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
Vtx* beatingHeartVtx = interfaceCtx->beatingHeartVtx;
s32 fractionHeartCount = gSaveContext.health % 0x10;
s16 healthCapacity = gSaveContext.healthCapacity / 0x10;
s16 fullHeartCount = gSaveContext.health / 0x10;
s32 fractionHeartCount = gSaveContext.save.playerData.health % 0x10;
s16 healthCapacity = gSaveContext.save.playerData.healthCapacity / 0x10;
s16 fullHeartCount = gSaveContext.save.playerData.health / 0x10;
s32 pad2;
f32 lifesize = interfaceCtx->lifeSizeChange * 0.1f;
u32 curCombineModeSet = 0;
TexturePtr temp = NULL;
s32 ddCount = gSaveContext.inventory.dungeonKeys[9] - 1;
s32 ddCount = gSaveContext.save.inventory.dungeonKeys[9] - 1;
OPEN_DISPS(gfxCtx);
if ((gSaveContext.health % 0x10) == 0) {
if ((gSaveContext.save.playerData.health % 0x10) == 0) {
fullHeartCount--;
}
offsetY = 0.0f;
@@ -417,19 +417,19 @@ void LifeMeter_UpdateSizeAndBeep(GlobalContext* globalCtx) {
u32 LifeMeter_IsCritical(void) {
s16 criticalThreshold;
if (gSaveContext.healthCapacity <= 80) { // healthCapacity <= 5 hearts?
if (gSaveContext.save.playerData.healthCapacity <= 80) { // healthCapacity <= 5 hearts?
criticalThreshold = 16;
} else if (gSaveContext.healthCapacity <= 160) { // healthCapacity <= 10 hearts?
} else if (gSaveContext.save.playerData.healthCapacity <= 160) { // healthCapacity <= 10 hearts?
criticalThreshold = 24;
} else if (gSaveContext.healthCapacity <= 240) { // healthCapacity <= 15 hearts?
} else if (gSaveContext.save.playerData.healthCapacity <= 240) { // healthCapacity <= 15 hearts?
criticalThreshold = 32;
} else {
criticalThreshold = 44;
}
if ((criticalThreshold >= gSaveContext.health) && (gSaveContext.health > 0)) {
if ((criticalThreshold >= gSaveContext.save.playerData.health) && (gSaveContext.save.playerData.health > 0)) {
return true;
}
return false;
+6 -6
View File
@@ -391,12 +391,12 @@ void func_80151BB4(GlobalContext* globalCtx, u8 arg1) {
u8 temp = arg1;
if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) {
if ((gSaveContext.weekEventReg[D_801C6B28[arg1] >> 8] & (u8)D_801C6B28[arg1]) == 0) {
if ((gSaveContext.save.weekEventReg[D_801C6B28[arg1] >> 8] & (u8)D_801C6B28[arg1]) == 0) {
msgCtx->unk120B2[msgCtx->unk120B1] = temp;
msgCtx->unk120B1++;
}
} else if (arg1 >= 20) {
if ((gSaveContext.weekEventReg[D_801C6B28[arg1] >> 8] & (u8)D_801C6B28[arg1]) == 0) {
if ((gSaveContext.save.weekEventReg[D_801C6B28[arg1] >> 8] & (u8)D_801C6B28[arg1]) == 0) {
msgCtx->unk120B2[msgCtx->unk120B1] = temp;
msgCtx->unk120B1++;
}
@@ -413,10 +413,10 @@ u32 func_80151C9C(GlobalContext* globalCtx) {
}
msgCtx->unk120B1--;
if ((gSaveContext.weekEventReg[D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]] >> 8] &
if ((gSaveContext.save.weekEventReg[D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]] >> 8] &
(u8)D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]]) == 0) {
flag = gSaveContext.weekEventReg[D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]] >> 8];
gSaveContext.weekEventReg[D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]] >> 8] =
flag = gSaveContext.save.weekEventReg[D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]] >> 8];
gSaveContext.save.weekEventReg[D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]] >> 8] =
flag | (u8)D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]];
if ((D_801C6AB8[msgCtx->unk120B2[msgCtx->unk120B1]] != 0) && CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) {
func_80151938(globalCtx, D_801C6AB8[msgCtx->unk120B2[msgCtx->unk120B1]]);
@@ -474,7 +474,7 @@ void func_80152EC0(GlobalContext* globalCtx) {
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/func_80153750.s")
void func_80153E7C(GlobalContext* globalCtx, void* arg1) {
if ((gSaveContext.language == 0) && (globalCtx->msgCtx.unk12090 == 0)) {
if ((gSaveContext.options.language == 0) && (globalCtx->msgCtx.unk12090 == 0)) {
func_8014ADBC(globalCtx, arg1);
return;
}
+7 -7
View File
@@ -131,15 +131,15 @@ void Message_LoadLocalizedRupeesNES(GlobalContext* globalCtx, s16* decodedBufPos
msgCtx->decodedBuffer.schar[p] = ' ';
p++;
for (j = 0; j < D_801D0710[gSaveContext.language - 1]; j++) {
Font_LoadCharNES(globalCtx, D_801D06F0[gSaveContext.language - 1][j], o);
msgCtx->decodedBuffer.schar[p] = D_801D06F0[gSaveContext.language - 1][j];
for (j = 0; j < D_801D0710[gSaveContext.options.language - 1]; j++) {
Font_LoadCharNES(globalCtx, D_801D06F0[gSaveContext.options.language - 1][j], o);
msgCtx->decodedBuffer.schar[p] = D_801D06F0[gSaveContext.options.language - 1][j];
o += FONT_CHAR_TEX_SIZE;
p++;
}
p--;
f += 16.0f * msgCtx->unk12098 * (D_801D0710[gSaveContext.language - 1] + 1);
f += 16.0f * msgCtx->unk12098 * (D_801D0710[gSaveContext.options.language - 1] + 1);
*decodedBufPos = p;
*offset = o;
*arg3 = f;
@@ -200,10 +200,10 @@ void Message_LoadTimeNES(GlobalContext* globalCtx, u8 arg1, s32* offset, f32* ar
s16 i;
if (arg1 == 0xCF) {
day = gSaveContext.day;
dayTime = 0x40000 - ((day % 5) << 16) - (u16)(-0x4000 + gSaveContext.time);
day = gSaveContext.save.day;
dayTime = 0x40000 - ((day % 5) << 16) - (u16)(-0x4000 + gSaveContext.save.time);
} else {
dayTime = 0x10000 - (u16)(-0x4000 + gSaveContext.time);
dayTime = 0x10000 - (u16)(-0x4000 + gSaveContext.save.time);
}
timeInMinutes = TIME_TO_MINUTES_F(dayTime);
+9 -9
View File
@@ -158,8 +158,8 @@ void Play_SaveCycleSceneFlags(GameState* gameState) {
cycleSceneFlags = &gSaveContext.cycleSceneFlags[Play_GetOriginalSceneNumber(globalCtx->sceneNum)];
cycleSceneFlags->chest = globalCtx->actorCtx.flags.chest;
cycleSceneFlags->swch0 = globalCtx->actorCtx.flags.switches[0];
cycleSceneFlags->swch1 = globalCtx->actorCtx.flags.switches[1];
cycleSceneFlags->switch0 = globalCtx->actorCtx.flags.switches[0];
cycleSceneFlags->switch1 = globalCtx->actorCtx.flags.switches[1];
if (globalCtx->sceneNum == SCENE_INISIE_R) { // Inverted Stone Tower Temple
cycleSceneFlags = &gSaveContext.cycleSceneFlags[globalCtx->sceneNum];
@@ -178,7 +178,7 @@ void Play_SetRespawnData(GameState* gameState, s32 respawnMode, u16 entranceInde
gSaveContext.respawn[respawnMode].pos = *pos;
gSaveContext.respawn[respawnMode].yaw = yaw;
gSaveContext.respawn[respawnMode].playerParams = playerParams;
gSaveContext.respawn[respawnMode].tempSwchFlags = globalCtx->actorCtx.flags.switches[2];
gSaveContext.respawn[respawnMode].tempSwitchFlags = globalCtx->actorCtx.flags.switches[2];
gSaveContext.respawn[respawnMode].unk_18 = globalCtx->actorCtx.flags.collectible[1];
gSaveContext.respawn[respawnMode].tempCollectFlags = globalCtx->actorCtx.flags.collectible[2];
}
@@ -188,7 +188,7 @@ void Play_SetupRespawnPoint(GameState* gameState, s32 respawnMode, s32 playerPar
Player* player = GET_PLAYER(globalCtx);
if (globalCtx->sceneNum != SCENE_KAKUSIANA) { // Grottos
Play_SetRespawnData(&globalCtx->state, respawnMode, (u16)((void)0, gSaveContext.entranceIndex),
Play_SetRespawnData(&globalCtx->state, respawnMode, (u16)((void)0, gSaveContext.save.entranceIndex),
globalCtx->roomCtx.currRoom.num, playerParams, &player->actor.world.pos,
player->actor.shape.rot.y);
}
@@ -207,10 +207,10 @@ void func_80169ECC(GlobalContext* globalCtx) {
void func_80169EFC(GameState* gameState) {
GlobalContext* globalCtx = (GlobalContext*)gameState;
gSaveContext.respawn[0].tempSwchFlags = globalCtx->actorCtx.flags.switches[2];
gSaveContext.respawn[0].unk_18 = globalCtx->actorCtx.flags.collectible[1];
gSaveContext.respawn[0].tempCollectFlags = globalCtx->actorCtx.flags.collectible[2];
globalCtx->nextEntranceIndex = gSaveContext.respawn[0].entranceIndex;
gSaveContext.respawn[RESTART_MODE_DOWN].tempSwitchFlags = globalCtx->actorCtx.flags.switches[2];
gSaveContext.respawn[RESTART_MODE_DOWN].unk_18 = globalCtx->actorCtx.flags.collectible[1];
gSaveContext.respawn[RESTART_MODE_DOWN].tempCollectFlags = globalCtx->actorCtx.flags.collectible[2];
globalCtx->nextEntranceIndex = gSaveContext.respawn[RESTART_MODE_DOWN].entranceIndex;
gSaveContext.respawnFlag = 1;
func_80169ECC(globalCtx);
globalCtx->sceneLoadFlag = 0x14;
@@ -222,7 +222,7 @@ void func_80169EFC(GameState* gameState) {
void func_80169F78(GameState* gameState) {
GlobalContext* globalCtx = (GlobalContext*)gameState;
globalCtx->nextEntranceIndex = gSaveContext.respawn[2].entranceIndex;
globalCtx->nextEntranceIndex = gSaveContext.respawn[RESTART_MODE_TOP].entranceIndex;
gSaveContext.respawnFlag = -1;
func_80169ECC(globalCtx);
globalCtx->sceneLoadFlag = 0x14;
+11 -11
View File
@@ -151,7 +151,7 @@ void Scene_HeaderCmdSpawnList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->linkActorEntry = (ActorEntry*)Lib_SegmentedToVirtual(cmd->spawnList.segment) +
globalCtx->setupEntranceList[globalCtx->curSpawn].spawn;
if ((globalCtx->linkActorEntry->params & 0x0F00) >> 8 == 0x0C ||
(gSaveContext.respawnFlag == 0x02 && gSaveContext.respawn[1].playerParams == 0x0CFF)) {
(gSaveContext.respawnFlag == 0x02 && gSaveContext.respawn[RESTART_MODE_RETURN].playerParams == 0x0CFF)) {
// Skull Kid Object
Object_Spawn(&globalCtx->objectCtx, OBJECT_STK);
return;
@@ -161,7 +161,7 @@ void Scene_HeaderCmdSpawnList(GlobalContext* globalCtx, SceneCmd* cmd) {
nextObject = globalCtx2->objectCtx.status[globalCtx2->objectCtx.num].segment;
globalCtx->objectCtx.num = loadedCount;
globalCtx->objectCtx.spawnedObjectCount = loadedCount;
playerForm = gSaveContext.playerForm;
playerForm = gSaveContext.save.playerForm;
playerObjectId = gLinkFormObjectIndexes[playerForm];
gActorOverlayTable[0].initInfo->objectId = playerObjectId;
Object_Spawn(&globalCtx->objectCtx, playerObjectId);
@@ -383,7 +383,7 @@ void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
u32 dayTime;
if (cmd->timeSettings.hour != 0xFF && cmd->timeSettings.min != 0xFF) {
gSaveContext.environmentTime = gSaveContext.time =
gSaveContext.environmentTime = gSaveContext.save.time =
(u16)(((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / 0.021972656f);
}
@@ -393,7 +393,7 @@ void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->envCtx.timeIncrement = 0;
}
if ((gSaveContext.inventory.items[SLOT_OCARINA] == ITEM_NONE) && (globalCtx->envCtx.timeIncrement != 0)) {
if ((gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) && (globalCtx->envCtx.timeIncrement != 0)) {
globalCtx->envCtx.timeIncrement = 5;
}
@@ -401,15 +401,15 @@ void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
REG(15) = globalCtx->envCtx.timeIncrement;
}
dayTime = gSaveContext.time;
dayTime = gSaveContext.save.time;
globalCtx->envCtx.unk_4 = -(Math_SinS(dayTime - 0x8000) * 120.0f) * 25.0f;
dayTime = gSaveContext.time;
dayTime = gSaveContext.save.time;
globalCtx->envCtx.unk_8 = (Math_CosS(dayTime - 0x8000) * 120.0f) * 25.0f;
dayTime = gSaveContext.time;
dayTime = gSaveContext.save.time;
globalCtx->envCtx.unk_C = (Math_CosS(dayTime - 0x8000) * 20.0f) * 25.0f;
if (globalCtx->envCtx.timeIncrement == 0 && gSaveContext.cutscene < 0xFFF0) {
gSaveContext.environmentTime = gSaveContext.time;
if (globalCtx->envCtx.timeIncrement == 0 && gSaveContext.save.cutscene < 0xFFF0) {
gSaveContext.environmentTime = gSaveContext.save.time;
if (gSaveContext.environmentTime >= CLOCK_TIME(4, 0) && gSaveContext.environmentTime < CLOCK_TIME(6, 30)) {
gSaveContext.environmentTime = CLOCK_TIME(5, 0);
@@ -527,7 +527,7 @@ void Scene_HeaderCmdSetAreaVisitedFlag(GlobalContext* globalCtx, SceneCmd* cmd)
}
if (i < ARRAY_COUNT(gScenesPerRegion)) {
gSaveContext.mapsVisited = (gBitFlags[i] | gSaveContext.mapsVisited) | gSaveContext.mapsVisited;
gSaveContext.save.mapsVisited = (gBitFlags[i] | gSaveContext.save.mapsVisited) | gSaveContext.save.mapsVisited;
}
}
@@ -610,5 +610,5 @@ u16 Entrance_CreateIndex(s32 sceneIndex, s32 spawnIndex, s32 sceneSetup) {
* Creates an entrance index from the current entrance index with the given spawn index.
*/
u16 Entrance_CreateIndexFromSpawn(s32 spawnIndex) {
return Entrance_CreateIndex(gSaveContext.entranceIndex >> 9, spawnIndex, 0);
return Entrance_CreateIndex(gSaveContext.save.entranceIndex >> 9, spawnIndex, 0);
}
+9 -9
View File
@@ -12,8 +12,8 @@ s32 func_8013A240(GlobalContext* globalCtx) {
s32 seen;
s32 count = 0;
gSaveContext.pictoFlags0 = 0;
gSaveContext.pictoFlags1 = 0;
gSaveContext.save.pictoFlags0 = 0;
gSaveContext.save.pictoFlags1 = 0;
if (globalCtx->sceneNum == SCENE_20SICHITAI) {
func_8013A41C(1);
@@ -76,19 +76,19 @@ s32 func_8013A240(GlobalContext* globalCtx) {
void func_8013A41C(s32 flag) {
if (flag < 0x20) {
gSaveContext.pictoFlags0 |= (1 << flag);
gSaveContext.save.pictoFlags0 |= (1 << flag);
} else {
flag &= 0x1F;
gSaveContext.pictoFlags1 |= (1 << flag);
gSaveContext.save.pictoFlags1 |= (1 << flag);
}
}
void func_8013A46C(s32 flag) {
if (flag < 0x20) {
gSaveContext.pictoFlags0 &= ~(1 << flag);
gSaveContext.save.pictoFlags0 &= ~(1 << flag);
} else {
flag &= 0x1F;
gSaveContext.pictoFlags1 &= ~(1 << flag);
gSaveContext.save.pictoFlags1 &= ~(1 << flag);
}
}
@@ -96,10 +96,10 @@ u32 func_8013A4C4(s32 flag) {
SaveContext* saveCtx = &gSaveContext;
if (flag < 0x20) {
return saveCtx->pictoFlags0 & (1 << flag);
return saveCtx->save.pictoFlags0 & (1 << flag);
} else {
flag &= 0x1F;
return saveCtx->pictoFlags1 & (1 << flag);
return saveCtx->save.pictoFlags1 & (1 << flag);
}
}
@@ -135,7 +135,7 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos,
Actor_GetProjectedPos(globalCtx, pos, &screenSpace, &distance);
x = (s16)(screenSpace.x * distance * 160.0f + 160.0f) - 85;
y = (s16)(screenSpace.y * distance * -120.0f + 120.0f) - 67;
if ((x < 0) || (0x96 < x) || (y < 0) || (0x69 < y)) {
if ((x < 0) || (150 < x) || (y < 0) || (105 < y)) {
func_8013A41C(0x3D);
ret |= 0x3D;
}
+1640 -31
View File
File diff suppressed because it is too large Load Diff
@@ -84,7 +84,7 @@ void BgIknvObj_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit);
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE;
gSaveContext.weekEventReg[51] &= (u8)~0x10;
gSaveContext.save.weekEventReg[51] &= (u8)~0x10;
Actor_SetFocus(&this->dyna.actor, IREG(88));
break;
default:
@@ -98,7 +98,7 @@ void BgIknvObj_Destroy(Actor* thisx, GlobalContext* globalCtx) {
if (IKNV_OBJ_TYPE(this) != IKNV_OBJ_RAISED_DOOR) {
if (IKNV_OBJ_TYPE(this) == IKNV_OBJ_SAKON_DOOR) {
Collider_DestroyCylinder(globalCtx, &this->collider);
gSaveContext.weekEventReg[51] &= (u8)~0x10;
gSaveContext.save.weekEventReg[51] &= (u8)~0x10;
} else {
return;
}
@@ -125,7 +125,7 @@ s32 func_80BD7CEC(BgIknvObj* this) {
}
void BgIknvObj_UpdateWaterwheel(BgIknvObj* this, GlobalContext* globalCtx) {
if (gSaveContext.weekEventReg[14] & 4) {
if (gSaveContext.save.weekEventReg[14] & 4) {
this->dyna.actor.shape.rot.z -= 0x64;
func_800B9098(&this->dyna.actor);
func_800B9010(&this->dyna.actor, NA_SE_EV_WOOD_WATER_WHEEL - SFX_FLAG);
@@ -156,16 +156,16 @@ s32 func_80BD7E0C(BgIknvObj* this, s16 targetRotation, GlobalContext* globalCtx)
void func_80BD7ED8(BgIknvObj* this, GlobalContext* globalCtx) {
if (func_80BD7E0C(this, this->dyna.actor.home.rot.y, globalCtx)) {
this->actionFunc = BgIknvObj_UpdateSakonDoor;
gSaveContext.weekEventReg[51] &= (u8)~0x10;
gSaveContext.save.weekEventReg[51] &= (u8)~0x10;
}
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
void func_80BD7F4C(BgIknvObj* this, GlobalContext* globalCtx) {
if (gSaveContext.time > CLOCK_TIME(19, 30)) {
if (gSaveContext.save.time > CLOCK_TIME(19, 30)) {
this->actionFunc = func_80BD7ED8;
}
if ((this->dyna.actor.home.rot.x == 1) && !(gSaveContext.weekEventReg[58] & 0x80)) {
if ((this->dyna.actor.home.rot.x == 1) && !(gSaveContext.save.weekEventReg[58] & 0x80)) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
this->dyna.actor.home.rot.x = 0;
}
@@ -175,7 +175,7 @@ void func_80BD7F4C(BgIknvObj* this, GlobalContext* globalCtx) {
void func_80BD7FDC(BgIknvObj* this, GlobalContext* globalCtx) {
if (func_80BD7E0C(this, this->dyna.actor.home.rot.y + 0x4000, globalCtx)) {
this->actionFunc = func_80BD7F4C;
gSaveContext.weekEventReg[51] |= 0x10;
gSaveContext.save.weekEventReg[51] |= 0x10;
this->dyna.actor.home.rot.x = 1;
}
}
@@ -188,9 +188,9 @@ void func_80BD8040(BgIknvObj* this, GlobalContext* globalCtx) {
}
void BgIknvObj_UpdateSakonDoor(BgIknvObj* this, GlobalContext* globalCtx) {
if (gSaveContext.weekEventReg[58] & 0x80) {
if (gSaveContext.save.weekEventReg[58] & 0x80) {
this->actionFunc = func_80BD8040;
gSaveContext.weekEventReg[89] |= 0x80;
gSaveContext.save.weekEventReg[89] |= 0x80;
}
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
@@ -194,7 +194,7 @@ void func_80953F9C(BgIngate* this, GlobalContext* globalCtx) {
this->dyna.actor.textId = 0x9E4;
Message_StartTextbox(globalCtx, this->dyna.actor.textId, NULL);
this->unk16C += 1;
gSaveContext.weekEventReg[90] |= 0x40;
gSaveContext.save.weekEventReg[90] |= 0x40;
this->actionFunc = func_809543D4;
} else {
@@ -253,7 +253,7 @@ void func_809542A0(BgIngate* this, GlobalContext* globalCtx) {
globalCtx->unk_1887F = 3;
gSaveContext.nextTransition = 3;
this->actionFunc = func_80953F8C;
gSaveContext.weekEventReg[90] &= (u8)~0x40;
gSaveContext.save.weekEventReg[90] &= (u8)~0x40;
func_800FE498();
}
@@ -289,7 +289,7 @@ void func_809543D4(BgIngate* this, GlobalContext* globalCtx) {
this->unk164 = &globalCtx->setupPathList[this->unk164->unk1];
}
func_80953F14(this, globalCtx);
gSaveContext.weekEventReg[90] &= (u8)~0x40;
gSaveContext.save.weekEventReg[90] &= (u8)~0x40;
func_8019F230();
}
func_801477B4(globalCtx);
@@ -297,7 +297,7 @@ void func_809543D4(BgIngate* this, GlobalContext* globalCtx) {
case 0x9E6:
if (globalCtx->msgCtx.choiceIndex == 0) {
func_80953EA4(this, globalCtx);
gSaveContext.weekEventReg[90] &= (u8)~0x40;
gSaveContext.save.weekEventReg[90] &= (u8)~0x40;
func_8019F208();
} else {
this = this;
@@ -330,10 +330,10 @@ void BgIngate_Init(Actor* thisx, GlobalContext* globalCtx2) {
Actor_SetScale(&this->dyna.actor, 1.0f);
this->unk164 = func_8013BB34(globalCtx, BGINGATE_GET_FF(&this->dyna.actor), 0);
this->dyna.actor.room = -1;
if (gSaveContext.weekEventReg[20] & 2) {
gSaveContext.weekEventReg[90] &= (u8)~0x40;
if (gSaveContext.save.weekEventReg[20] & 2) {
gSaveContext.save.weekEventReg[90] &= (u8)~0x40;
}
if (!(gSaveContext.eventInf[3] & 0x20) && (gSaveContext.weekEventReg[90] & 0x40)) {
if (!(gSaveContext.eventInf[3] & 0x20) && (gSaveContext.save.weekEventReg[90] & 0x40)) {
phi_a2 = 1;
this->unk16C = 1;
this->actionFunc = func_809541B8;
@@ -194,7 +194,7 @@ void BgKin2Fence_HandleMaskCode(BgKin2Fence* this, GlobalContext* globalCtx) {
if (this->collider.base.acFlags & AC_HIT) {
hitMask = BgKin2Fence_CheckHitMask(this);
if (hitMask >= 0) {
nextMask = (s8)gSaveContext.spiderHouseMaskOrder[this->masksHit];
nextMask = (s8)gSaveContext.save.spiderHouseMaskOrder[this->masksHit];
if (hitMask == nextMask) {
play_sound(NA_SE_SY_TRE_BOX_APPEAR);
this->masksHit += 1;
@@ -97,7 +97,7 @@ void BgLotus_Wait(BgLotus* this, GlobalContext* globalCtx) {
EffectSsGRipple_Spawn(globalCtx, &this->dyna.actor.world.pos, 1000, 1400, 8);
this->timer = 40;
}
if (gSaveContext.playerForm != PLAYER_FORM_DEKU) {
if (gSaveContext.save.playerForm != PLAYER_FORM_DEKU) {
this->timer = 40;
this->dyna.actor.flags |= ACTOR_FLAG_10;
this->actionFunc = BgLotus_Sink;
@@ -161,7 +161,7 @@ void BgNumaHana_Init(Actor* thisx, GlobalContext* globalCtx) {
return;
}
if (gSaveContext.weekEventReg[12] & 1) {
if (gSaveContext.save.weekEventReg[12] & 1) {
func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
this->petalZRotation = 0x2000;
@@ -219,7 +219,7 @@ void BgNumaHana_ClosedIdle(BgNumaHana* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_FLAME_IGNITION);
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
gSaveContext.weekEventReg[12] |= 1;
gSaveContext.save.weekEventReg[12] |= 1;
Flags_SetSwitch(globalCtx, BG_NUMA_HANA_SWITCH_FLAG(&this->dyna.actor));
BgNumaHana_SetupUnfoldInnerPetals(this);
} else {
@@ -38,13 +38,13 @@ void BgTobira01_Open(BgTobira01* this, GlobalContext* globalCtx) {
ActorCutscene_Stop(0x7C);
} else if (ActorCutscene_GetCanPlayNext(cutsceneId)) {
ActorCutscene_StartAndSetUnkLinkFields(cutsceneId, &this->dyna.actor);
gSaveContext.weekEventReg[88] |= 0x40;
gSaveContext.save.weekEventReg[88] |= 0x40;
this->playCutscene = false;
} else {
ActorCutscene_SetIntentToPlay(cutsceneId);
}
} else if (!(gSaveContext.weekEventReg[88] & 0x40) && (this->timer == 0) && (globalCtx->actorCtx.unk1F5 != 0) &&
(globalCtx->actorCtx.unk1F4 == 0) &&
} else if (!(gSaveContext.save.weekEventReg[88] & 0x40) && (this->timer == 0) &&
(globalCtx->actorCtx.unk1F5 != 0) && (globalCtx->actorCtx.unk1F4 == 0) &&
(SurfaceType_GetSceneExitIndex(&globalCtx->colCtx, player->actor.floorPoly, player->actor.floorBgId) ==
6)) {
this->playCutscene = true;
@@ -53,7 +53,7 @@ void BgTobira01_Open(BgTobira01* this, GlobalContext* globalCtx) {
prevTimer = this->timer;
if (gSaveContext.weekEventReg[88] & 0x40) {
if (gSaveContext.save.weekEventReg[88] & 0x40) {
this->timer++;
} else {
this->timer--;
@@ -68,8 +68,8 @@ void BgTobira01_Open(BgTobira01* this, GlobalContext* globalCtx) {
this->timer2 = 180;
}
if (!(player->stateFlags1 & 0x40) && (gSaveContext.weekEventReg[88] & 0x40) && (DECR(this->timer2) == 0)) {
gSaveContext.weekEventReg[88] &= (u8)~0x40;
if (!(player->stateFlags1 & 0x40) && (gSaveContext.save.weekEventReg[88] & 0x40) && (DECR(this->timer2) == 0)) {
gSaveContext.save.weekEventReg[88] &= (u8)~0x40;
}
}
@@ -79,9 +79,9 @@ void BgTobira01_Init(Actor* thisx, GlobalContext* globalCtx) {
DynaPolyActor_Init(&this->dyna, 1);
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_spot11_obj_Colheader_0011C0);
gSaveContext.weekEventReg[88] &= (u8)~0x40;
gSaveContext.save.weekEventReg[88] &= (u8)~0x40;
Actor_SetScale(&this->dyna.actor, 1.0f);
this->timer2 = gSaveContext.isNight;
this->timer2 = gSaveContext.save.isNight;
this->timer = 0;
this->actionFunc = BgTobira01_Open;
}
+2 -2
View File
@@ -549,7 +549,7 @@ void Boss02_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 i;
s32 pad[2];
if ((gSaveContext.weekEventReg[52] & 0x20) && (this->actor.params == 0)) {
if ((gSaveContext.save.weekEventReg[52] & 0x20) && (this->actor.params == 0)) {
D_809E0434 = (DoorWarp1*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1,
0.0f, 60.0f, 0.0f, 0, 0, 0, 1);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_B_HEART, 0.0f, 30.0f, -150.0f, 0, 1, 0, 0);
@@ -2057,7 +2057,7 @@ void func_809DEAC4(Boss02* this, GlobalContext* globalCtx) {
break;
case 1:
if ((gSaveContext.weekEventReg[52] & 0x20) || ((u32)(KREG(13) + 15) >= this->unk_1D1C)) {
if ((gSaveContext.save.weekEventReg[52] & 0x20) || ((u32)(KREG(13) + 15) >= this->unk_1D1C)) {
break;
}
Cutscene_Start(globalCtx, &globalCtx->csCtx);
+1 -1
View File
@@ -519,7 +519,7 @@ void Boss06_Draw(Actor* thisx, GlobalContext* globalCtx2) {
func_8012C2DC(globalCtx->state.gfxCtx);
func_8012C28C(globalCtx->state.gfxCtx);
temp_v0 = gSaveContext.time;
temp_v0 = gSaveContext.save.time;
if (temp_v0 > CLOCK_TIME(12, 0)) {
temp_v0 = 0xFFFF - temp_v0;
}
@@ -66,7 +66,7 @@ void DmChar01_Init(Actor* thisx, GlobalContext* globalCtx) {
switch (DMCHAR01_GET(&this->dyna.actor)) {
case DMCHAR01_0:
if (gSaveContext.weekEventReg[20] & 2) {
if (gSaveContext.save.weekEventReg[20] & 2) {
this->unk_34C = 2;
this->actionFunc = func_80AA8F1C;
break;
@@ -96,7 +96,7 @@ void DmChar01_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
case DMCHAR01_1:
if ((gSaveContext.weekEventReg[20] & 2) || (gSaveContext.sceneSetupIndex == 1)) {
if ((gSaveContext.save.weekEventReg[20] & 2) || (gSaveContext.sceneSetupIndex == 1)) {
this->unk_34C = 1;
this->actionFunc = func_80AA8F1C;
} else {
@@ -106,7 +106,7 @@ void DmChar01_Init(Actor* thisx, GlobalContext* globalCtx) {
case DMCHAR01_2:
this->unk_34C = 0;
if (!(gSaveContext.weekEventReg[20] & 1)) {
if (!(gSaveContext.save.weekEventReg[20] & 1)) {
this->unk_34C = 1;
this->dyna.actor.world.pos.y -= 400.0f;
}
@@ -122,7 +122,7 @@ void DmChar01_Init(Actor* thisx, GlobalContext* globalCtx) {
case DMCHAR01_3:
this->dyna.actor.world.rot.y += 0x8000;
this->dyna.actor.shape.rot.y += 0x8000;
if (!(gSaveContext.weekEventReg[20] & 1)) {
if (!(gSaveContext.save.weekEventReg[20] & 1)) {
Actor_MarkForDeath(&this->dyna.actor);
return;
}
@@ -132,7 +132,7 @@ void DmChar01_Init(Actor* thisx, GlobalContext* globalCtx) {
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_mtoride_Colheader_00FE5C);
this->unk_34D = true;
if (!(gSaveContext.weekEventReg[20] & 2)) {
if (!(gSaveContext.save.weekEventReg[20] & 2)) {
this->actionFunc = func_80AA9020;
this->dyna.actor.world.pos.y -= 120.0f;
} else {
@@ -158,7 +158,7 @@ void func_80AA8698(DmChar01* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
Player* player2 = GET_PLAYER(globalCtx);
if (gSaveContext.weekEventReg[20] & 1) {
if (gSaveContext.save.weekEventReg[20] & 1) {
return;
}
@@ -178,7 +178,7 @@ void func_80AA8698(DmChar01* this, GlobalContext* globalCtx) {
if ((player2->actor.world.pos.x > -40.0f) && (player2->actor.world.pos.x < 40.0f) &&
(player2->actor.world.pos.z > 1000.0f) && (player2->actor.world.pos.z < 1078.0f)) {
gSaveContext.weekEventReg[20] |= 1;
gSaveContext.save.weekEventReg[20] |= 1;
this->actionFunc = func_80AA884C;
}
}
@@ -344,7 +344,7 @@ void func_80AA9020(DmChar01* this, GlobalContext* globalCtx) {
CsCmdActorAction* temp_v1 = globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 135)];
if ((temp_v1->startFrame == globalCtx->csCtx.frames) && (temp_v1->action == 2)) {
gSaveContext.weekEventReg[20] |= 2;
gSaveContext.save.weekEventReg[20] |= 2;
this->actionFunc = func_80AA90AC;
}
}
@@ -30,7 +30,7 @@ const ActorInit Dm_Ravine_InitVars = {
void DmRavine_Init(Actor* thisx, GlobalContext* globalCtx) {
DmRavine* this = THIS;
u8 flag = gSaveContext.weekEventReg[0];
u8 flag = gSaveContext.save.weekEventReg[0];
if (((flag & 0x10) | cREG(0)) != 0) {
Actor_MarkForDeath(&this->actor);
return;
+15 -15
View File
@@ -841,7 +841,7 @@ void DmStk_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitCylinder(globalCtx, &this->collider);
if (gSaveContext.entranceIndex == 0x2C00) {
if (gSaveContext.save.entranceIndex == 0x2C00) {
if (gSaveContext.sceneSetupIndex == 0) {
if (gSaveContext.unk_3DD0[3] == 0) {
func_8010E9F0(3, 300);
@@ -849,7 +849,7 @@ void DmStk_Init(Actor* thisx, GlobalContext* globalCtx) {
XREG(81) = 115;
}
if (gSaveContext.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
sCylinderInit.base.colType = COLTYPE_WOOD;
this->actionFunc = func_80AA18D8;
} else {
@@ -938,7 +938,7 @@ void func_80AA1704(DmStk* this, GlobalContext* globalCtx) {
void func_80AA1714(DmStk* this, GlobalContext* globalCtx) {
Vec3f sp1C;
if (!(gSaveContext.weekEventReg[74] & 0x20)) {
if (!(gSaveContext.save.weekEventReg[74] & 0x20)) {
func_80169474(globalCtx, &this->actor.world.pos, &sp1C);
if (globalCtx->view.fovy < 25.0f) {
if ((sp1C.x >= 70.0f) && (sp1C.x < 250.0f) && (sp1C.y >= 30.0f) && (sp1C.y < 210.0f)) {
@@ -955,10 +955,10 @@ void func_80AA17F8(DmStk* this, GlobalContext* globalCtx) {
s16 sp18 = ActorCutscene_GetAdditionalCutscene(sp1C);
s16 cutscene;
if (gSaveContext.day < 3) {
if (gSaveContext.save.day < 3) {
cutscene = sp1E;
} else if ((gSaveContext.weekEventReg[8] & 0x40) ||
((CURRENT_DAY == 3) && (gSaveContext.time < CLOCK_TIME(6, 0)))) {
} else if ((gSaveContext.save.weekEventReg[8] & 0x40) ||
((CURRENT_DAY == 3) && (gSaveContext.save.time < CLOCK_TIME(6, 0)))) {
cutscene = sp18;
} else {
cutscene = sp1C;
@@ -1171,7 +1171,7 @@ void func_80AA1D1C(DmStk* this, GlobalContext* globalCtx) {
case 22:
this->unk_2E0 = 29;
if (gSaveContext.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
this->unk_32D = 3;
}
break;
@@ -1183,7 +1183,7 @@ void func_80AA1D1C(DmStk* this, GlobalContext* globalCtx) {
case 24:
this->unk_2E0 = 32;
if (gSaveContext.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
this->unk_32D = 3;
}
break;
@@ -1194,14 +1194,14 @@ void func_80AA1D1C(DmStk* this, GlobalContext* globalCtx) {
case 26:
this->unk_2E0 = 34;
if (gSaveContext.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
this->unk_32D = 3;
}
break;
case 27:
this->unk_2E0 = 36;
if (gSaveContext.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
this->unk_32D = 3;
}
break;
@@ -1399,7 +1399,7 @@ void func_80AA1D1C(DmStk* this, GlobalContext* globalCtx) {
if (this->unk_2E4 < 0) {
this->unk_2E4 = 0;
this->unk_32F = 0;
gSaveContext.weekEventReg[12] |= 4;
gSaveContext.save.weekEventReg[12] |= 4;
if (!(globalCtx->actorCtx.unk5 & 2)) {
Actor_MarkForDeath(&this->actor);
} else {
@@ -1569,11 +1569,11 @@ void DmStk_Update(Actor* thisx, GlobalContext* globalCtx) {
(globalCtx->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(&globalCtx->state) &&
(globalCtx->sceneLoadFlag == 0) && (ActorCutscene_GetCurrentIndex() == -1) &&
(globalCtx->csCtx.state == 0)) {
time = gSaveContext.time;
gSaveContext.time = (u16)REG(15) + time;
time = gSaveContext.save.time;
gSaveContext.save.time = (u16)REG(15) + time;
if (REG(15) != 0) {
time = gSaveContext.time;
gSaveContext.time = (u16)gSaveContext.unk_14 + time;
time = gSaveContext.save.time;
gSaveContext.save.time = (u16)gSaveContext.save.daySpeed + time;
}
}
}
@@ -139,13 +139,13 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
} else {
s32 destinationIdx = DOORANA_GET_ENTRANCE(&this->actor);
Play_SetupRespawnPoint(&globalCtx->state, 3, 0x4FF);
Play_SetupRespawnPoint(&globalCtx->state, RESPAWN_MODE_UNK_3, 0x4FF);
gSaveContext.respawn[3].pos.y = this->actor.world.pos.y;
gSaveContext.respawn[3].yaw = this->actor.home.rot.y;
gSaveContext.respawn[RESPAWN_MODE_UNK_3].pos.y = this->actor.world.pos.y;
gSaveContext.respawn[RESPAWN_MODE_UNK_3].yaw = this->actor.home.rot.y;
// Stores item and chest flag that ACTOR_EN_TORCH uses for spawning the grotto chest
gSaveContext.respawn[3].data = DOORANA_GET_ITEMFLAGS(&this->actor);
gSaveContext.respawn[RESPAWN_MODE_UNK_3].data = DOORANA_GET_ITEMFLAGS(&this->actor);
if (destinationIdx < 0) {
destinationIdx = DOORANA_GET_EX_ENTRANCE(&this->actor);
@@ -344,7 +344,7 @@ void func_808A1090(DoorShutter* this, GlobalContext* globalCtx) {
if (this->unk_166 != 0) {
Flags_SetSwitch(globalCtx, DOORSHUTTER_GET_7F(&this->actor));
if (this->doorType != 5) {
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--;
gSaveContext.save.inventory.dungeonKeys[gSaveContext.mapIndex]--;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
} else {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK_B);
@@ -367,7 +367,7 @@ void func_808A1090(DoorShutter* this, GlobalContext* globalCtx) {
}
if (this->doorType == 6) {
if (gSaveContext.healthCapacity < (DOORSHUTTER_GET_1F(&this->actor) * 0x10)) {
if (gSaveContext.save.playerData.healthCapacity < (DOORSHUTTER_GET_1F(&this->actor) * 0x10)) {
player->doorType = -1;
this->actor.textId = 0x14FC;
}
@@ -570,7 +570,7 @@ void func_808A1884(DoorShutter* this, GlobalContext* globalCtx) {
if (DoorShutter_SetupDoor(this, globalCtx) && !(player->stateFlags1 & 0x800)) {
DoorShutter_SetupAction(this, func_808A1C50);
if (ActorCutscene_GetCurrentIndex() == 0x7D) {
s8 data = gSaveContext.respawn[0].data;
s8 data = gSaveContext.respawn[RESTART_MODE_DOWN].data;
func_801226E0(globalCtx, data);
player->unk_A86 = -1;
@@ -270,7 +270,7 @@ void func_808B8E78(DoorWarp1* this, GlobalContext* globalCtx) {
this->unk_1A4 = 700.0f;
if (globalCtx->sceneNum == SCENE_INISIE_N) {
DoorWarp1_SetupAction(this, func_808B96A0);
} else if (gSaveContext.weekEventReg[86] & 0x80) {
} else if (gSaveContext.save.weekEventReg[86] & 0x80) {
this->unk_1D4 = 0;
DoorWarp1_SetupAction(this, func_808B921C);
} else {
@@ -553,27 +553,28 @@ void func_808B9CE8(DoorWarp1* this, GlobalContext* globalCtx) {
switch (globalCtx->sceneNum) {
case SCENE_MITURIN_BS:
gSaveContext.unk_ECC[0] =
(((void)0, gSaveContext.unk_ECC[0]) & 0xFFFFFF00) | (((u8)gSaveContext.unk_ECC[1]) & 0xFF);
gSaveContext.save.unk_ECC[0] =
(((void)0, gSaveContext.save.unk_ECC[0]) & 0xFFFFFF00) | (((u8)gSaveContext.save.unk_ECC[1]) & 0xFF);
break;
case SCENE_HAKUGIN_BS:
gSaveContext.unk_ECC[0] =
(((void)0, gSaveContext.unk_ECC[0]) & 0xFFFF00FF) | ((((u8)gSaveContext.unk_ECC[1]) & 0xFF) << 8);
gSaveContext.save.unk_ECC[0] = (((void)0, gSaveContext.save.unk_ECC[0]) & 0xFFFF00FF) |
((((u8)gSaveContext.save.unk_ECC[1]) & 0xFF) << 8);
break;
case SCENE_INISIE_BS:
gSaveContext.unk_ECC[0] =
(((void)0, gSaveContext.unk_ECC[0]) & 0xFF00FFFF) | ((((u8)gSaveContext.unk_ECC[1]) & 0xFF) << 0x10);
gSaveContext.save.unk_ECC[0] = (((void)0, gSaveContext.save.unk_ECC[0]) & 0xFF00FFFF) |
((((u8)gSaveContext.save.unk_ECC[1]) & 0xFF) << 0x10);
break;
case SCENE_SEA_BS:
gSaveContext.unk_ECC[0] =
(((void)0, gSaveContext.unk_ECC[0]) & 0x00FFFFFF) | ((((u8)gSaveContext.unk_ECC[1]) & 0xFF) << 0x18);
gSaveContext.save.unk_ECC[0] = (((void)0, gSaveContext.save.unk_ECC[0]) & 0x00FFFFFF) |
((((u8)gSaveContext.save.unk_ECC[1]) & 0xFF) << 0x18);
break;
}
gSaveContext.unk_ECC[1] = (gSaveContext.unk_ECC[1] & 0xFFFFFF00) | ((((u8)gSaveContext.unk_ECC[1]) + 1) & 0xFF);
gSaveContext.save.unk_ECC[1] =
(gSaveContext.save.unk_ECC[1] & 0xFFFFFF00) | ((((u8)gSaveContext.save.unk_ECC[1]) + 1) & 0xFF);
Item_Give(globalCtx, func_808B849C(this, globalCtx) + (ITEM_REMAINS_ODOLWA - 1));
DoorWarp1_SetupAction(this, func_808B9E94);
}
@@ -651,24 +652,24 @@ void func_808BA10C(DoorWarp1* this, GlobalContext* globalCtx) {
if (this->unk_202 != 0) {
if (phi_v0_2 > 0) {
gSaveContext.weekEventReg[7] |= 0x80;
gSaveContext.save.weekEventReg[7] |= 0x80;
}
switch (phi_v0_2) {
case 0:
phi_a0 = gSaveContext.unk_ECC[0] & 0xFF;
phi_a0 = gSaveContext.save.unk_ECC[0] & 0xFF;
break;
case 1:
phi_a0 = (gSaveContext.unk_ECC[0] & 0xFF00) >> 8;
phi_a0 = (gSaveContext.save.unk_ECC[0] & 0xFF00) >> 8;
break;
case 2:
phi_a0 = (gSaveContext.unk_ECC[0] & 0xFF0000) >> 0x10;
phi_a0 = (gSaveContext.save.unk_ECC[0] & 0xFF0000) >> 0x10;
break;
case 3:
phi_a0 = (gSaveContext.unk_ECC[0] & 0xFF000000) >> 0x18;
phi_a0 = (gSaveContext.save.unk_ECC[0] & 0xFF000000) >> 0x18;
break;
default:
@@ -709,8 +710,8 @@ void func_808BA10C(DoorWarp1* this, GlobalContext* globalCtx) {
} else {
switch (phi_v0_2) {
case 0:
if (gSaveContext.weekEventReg[20] & 2) {
gSaveContext.weekEventReg[7] |= 0x80;
if (gSaveContext.save.weekEventReg[20] & 2) {
gSaveContext.save.weekEventReg[7] |= 0x80;
globalCtx->nextEntranceIndex = 0x3010;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->unk_1887F = 3;
@@ -725,7 +726,7 @@ void func_808BA10C(DoorWarp1* this, GlobalContext* globalCtx) {
break;
case 1:
gSaveContext.weekEventReg[33] |= 0x80;
gSaveContext.save.weekEventReg[33] |= 0x80;
globalCtx->nextEntranceIndex = 0xAE70;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->unk_1887F = 3;
@@ -733,14 +734,14 @@ void func_808BA10C(DoorWarp1* this, GlobalContext* globalCtx) {
break;
case 3:
if (gSaveContext.weekEventReg[55] & 0x80) {
if (gSaveContext.save.weekEventReg[55] & 0x80) {
globalCtx->nextEntranceIndex = 0x6A90;
gSaveContext.nextCutsceneIndex = 0xFFF0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->unk_1887F = 3;
gSaveContext.nextTransition = 3;
} else {
gSaveContext.weekEventReg[55] |= 0x80;
gSaveContext.save.weekEventReg[55] |= 0x80;
globalCtx->nextEntranceIndex = 0x6A80;
gSaveContext.nextCutsceneIndex = 0xFFF0;
globalCtx->sceneLoadFlag = 0x14;
@@ -750,7 +751,7 @@ void func_808BA10C(DoorWarp1* this, GlobalContext* globalCtx) {
break;
case 2:
gSaveContext.weekEventReg[52] |= 0x20;
gSaveContext.save.weekEventReg[52] |= 0x20;
globalCtx->nextEntranceIndex = 0x20F0;
gSaveContext.nextCutsceneIndex = 0xFFF2;
globalCtx->sceneLoadFlag = 0x14;
@@ -885,14 +886,14 @@ void func_808BAAF4(DoorWarp1* this, GlobalContext* globalCtx) {
phi_f2 = 85.0f;
}
if (!(gSaveContext.weekEventReg[86] & 0x80) && (fabsf(this->dyna.actor.xzDistToPlayer) < phi_f2) &&
if (!(gSaveContext.save.weekEventReg[86] & 0x80) && (fabsf(this->dyna.actor.xzDistToPlayer) < phi_f2) &&
((player->actor.world.pos.y - 20.0f) < this->dyna.actor.world.pos.y) &&
(this->dyna.actor.world.pos.y < (player->actor.world.pos.y + 20.0f))) {
cutscene = this->dyna.actor.cutscene;
if (ActorCutscene_GetCanPlayNext(cutscene)) {
ActorCutscene_Start(cutscene, &this->dyna.actor);
gSaveContext.weekEventReg[86] |= 0x80;
gSaveContext.save.weekEventReg[86] |= 0x80;
DoorWarp1_SetupAction(this, func_808BABF4);
} else {
ActorCutscene_SetIntentToPlay(cutscene);
+1 -1
View File
@@ -338,7 +338,7 @@ s32* func_80BD3294(EnAh* this, GlobalContext* globalCtx) {
switch (this->unk_1DC) {
case 1:
if (gSaveContext.day == 2) {
if (gSaveContext.save.day == 2) {
return D_80BD3DF0;
}
return D_80BD3DE8;
@@ -257,17 +257,17 @@ void func_80BED090(GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (player->transformation == PLAYER_FORM_DEKU) {
gSaveContext.weekEventReg[63] |= 8;
gSaveContext.weekEventReg[63] &= (u8)~0x10;
gSaveContext.save.weekEventReg[63] |= 8;
gSaveContext.save.weekEventReg[63] &= (u8)~0x10;
} else if (player->transformation == PLAYER_FORM_ZORA) {
gSaveContext.weekEventReg[63] &= (u8)~8;
gSaveContext.weekEventReg[63] |= 0x10;
gSaveContext.save.weekEventReg[63] &= (u8)~8;
gSaveContext.save.weekEventReg[63] |= 0x10;
} else if (player->transformation == PLAYER_FORM_GORON) {
gSaveContext.weekEventReg[63] |= 8;
gSaveContext.weekEventReg[63] |= 0x10;
gSaveContext.save.weekEventReg[63] |= 8;
gSaveContext.save.weekEventReg[63] |= 0x10;
} else if (player->transformation == PLAYER_FORM_HUMAN) {
gSaveContext.weekEventReg[63] &= (u8)~8;
gSaveContext.weekEventReg[63] &= (u8)~0x10;
gSaveContext.save.weekEventReg[63] &= (u8)~8;
gSaveContext.save.weekEventReg[63] &= (u8)~0x10;
}
}
@@ -275,19 +275,19 @@ s32 func_80BED140(GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (player->transformation == PLAYER_FORM_DEKU) {
if ((gSaveContext.weekEventReg[63] & 8) && !(gSaveContext.weekEventReg[63] & 0x10)) {
if ((gSaveContext.save.weekEventReg[63] & 8) && !(gSaveContext.save.weekEventReg[63] & 0x10)) {
return true;
}
} else if (player->transformation == PLAYER_FORM_ZORA) {
if (!(gSaveContext.weekEventReg[63] & 8) && (gSaveContext.weekEventReg[63] & 0x10)) {
if (!(gSaveContext.save.weekEventReg[63] & 8) && (gSaveContext.save.weekEventReg[63] & 0x10)) {
return true;
}
} else if (player->transformation == PLAYER_FORM_GORON) {
if ((gSaveContext.weekEventReg[63] & 8) && (gSaveContext.weekEventReg[63] & 0x10)) {
if ((gSaveContext.save.weekEventReg[63] & 8) && (gSaveContext.save.weekEventReg[63] & 0x10)) {
return true;
}
} else if (player->transformation == PLAYER_FORM_HUMAN) {
if (!(gSaveContext.weekEventReg[63] & 8) && !(gSaveContext.weekEventReg[63] & 0x10)) {
if (!(gSaveContext.save.weekEventReg[63] & 8) && !(gSaveContext.save.weekEventReg[63] & 0x10)) {
return true;
}
}
@@ -300,7 +300,7 @@ s32 func_80BED208(EnAkindonuts* this) {
return 0;
}
if (gSaveContext.rupees < 10) {
if (gSaveContext.save.playerData.rupees < 10) {
return 1;
}
@@ -314,15 +314,15 @@ s32 func_80BED208(EnAkindonuts* this) {
}
s32 func_80BED27C(EnAkindonuts* this) {
if (CUR_UPG_VALUE_VOID(UPG_BOMB_BAG) == 3) {
if (GET_CUR_UPG_VALUE(UPG_BOMB_BAG) == 3) {
return 2;
}
if (CUR_UPG_VALUE_VOID(UPG_BOMB_BAG) < 2) {
if (GET_CUR_UPG_VALUE(UPG_BOMB_BAG) < 2) {
return 0;
}
if (gSaveContext.rupees < 200) {
if (gSaveContext.save.playerData.rupees < 200) {
return 1;
}
@@ -336,7 +336,7 @@ s32 func_80BED2FC(EnAkindonuts* this) {
return 2;
}
if (gSaveContext.rupees < 40) {
if (gSaveContext.save.playerData.rupees < 40) {
return 1;
}
@@ -350,7 +350,7 @@ s32 func_80BED35C(EnAkindonuts* this) {
return 2;
}
if (gSaveContext.rupees < 100) {
if (gSaveContext.save.playerData.rupees < 100) {
return 1;
}
@@ -384,8 +384,8 @@ void func_80BED3BC(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
case 0x15E7:
if (!(gSaveContext.weekEventReg[61] & 0x20)) {
gSaveContext.weekEventReg[61] |= 0x20;
if (!(gSaveContext.save.weekEventReg[61] & 0x20)) {
gSaveContext.save.weekEventReg[61] |= 0x20;
this->unk_33C = 0x15E8;
break;
}
@@ -446,7 +446,7 @@ void func_80BED3BC(EnAkindonuts* this, GlobalContext* globalCtx) {
case 0x15E5:
this->unk_33C = 0x15E6;
func_80BED090(globalCtx);
gSaveContext.weekEventReg[61] |= 0x10;
gSaveContext.save.weekEventReg[61] |= 0x10;
this->unk_32C |= 0x20;
break;
@@ -461,8 +461,8 @@ void func_80BED3BC(EnAkindonuts* this, GlobalContext* globalCtx) {
void func_80BED680(EnAkindonuts* this, GlobalContext* globalCtx) {
switch (this->unk_33C) {
case 0:
if (func_80BED140(globalCtx) && !(gSaveContext.weekEventReg[61] & 0x40)) {
gSaveContext.weekEventReg[61] |= 0x40;
if (func_80BED140(globalCtx) && !(gSaveContext.save.weekEventReg[61] & 0x40)) {
gSaveContext.save.weekEventReg[61] |= 0x40;
this->unk_33C = 0x15F0;
break;
}
@@ -562,8 +562,8 @@ void func_80BED8A4(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
case 0x15FE:
if (!(gSaveContext.weekEventReg[62] & 1)) {
gSaveContext.weekEventReg[62] |= 1;
if (!(gSaveContext.save.weekEventReg[62] & 1)) {
gSaveContext.save.weekEventReg[62] |= 1;
this->unk_33C = 0x15FF;
break;
}
@@ -623,7 +623,7 @@ void func_80BED8A4(EnAkindonuts* this, GlobalContext* globalCtx) {
case 0x15FA:
this->unk_33C = 0x15FB;
gSaveContext.weekEventReg[61] |= 0x80;
gSaveContext.save.weekEventReg[61] |= 0x80;
this->unk_32C |= 0x20;
break;
@@ -640,8 +640,8 @@ void func_80BEDB88(EnAkindonuts* this, GlobalContext* globalCtx) {
switch (this->unk_33C) {
case 0:
if ((player->transformation == PLAYER_FORM_DEKU) && !(gSaveContext.weekEventReg[62] & 2)) {
gSaveContext.weekEventReg[62] |= 2;
if ((player->transformation == PLAYER_FORM_DEKU) && !(gSaveContext.save.weekEventReg[62] & 2)) {
gSaveContext.save.weekEventReg[62] |= 2;
this->unk_33C = 0x15F0;
break;
}
@@ -740,8 +740,8 @@ void func_80BEDDAC(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
case 0x1610:
if (!(gSaveContext.weekEventReg[62] & 8)) {
gSaveContext.weekEventReg[62] |= 8;
if (!(gSaveContext.save.weekEventReg[62] & 8)) {
gSaveContext.save.weekEventReg[62] |= 8;
this->unk_33C = 0x1611;
break;
}
@@ -796,7 +796,7 @@ void func_80BEDDAC(EnAkindonuts* this, GlobalContext* globalCtx) {
case 0x15FA:
this->unk_33C = 0x160D;
gSaveContext.weekEventReg[62] |= 4;
gSaveContext.save.weekEventReg[62] |= 4;
this->unk_32C |= 0x20;
break;
@@ -813,8 +813,8 @@ void func_80BEE070(EnAkindonuts* this, GlobalContext* globalCtx) {
switch (this->unk_33C) {
case 0:
if ((player->transformation == PLAYER_FORM_GORON) && !(gSaveContext.weekEventReg[62] & 0x10)) {
gSaveContext.weekEventReg[62] |= 0x10;
if ((player->transformation == PLAYER_FORM_GORON) && !(gSaveContext.save.weekEventReg[62] & 0x10)) {
gSaveContext.save.weekEventReg[62] |= 0x10;
this->unk_33C = 0x1614;
break;
}
@@ -900,8 +900,8 @@ void func_80BEE274(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
case 0x1624:
if (!(gSaveContext.weekEventReg[62] & 0x40)) {
gSaveContext.weekEventReg[62] |= 0x40;
if (!(gSaveContext.save.weekEventReg[62] & 0x40)) {
gSaveContext.save.weekEventReg[62] |= 0x40;
this->unk_33C = 0x1625;
break;
}
@@ -957,7 +957,7 @@ void func_80BEE274(EnAkindonuts* this, GlobalContext* globalCtx) {
case 0x1622:
this->unk_33C = 0x1623;
gSaveContext.weekEventReg[62] |= 0x20;
gSaveContext.save.weekEventReg[62] |= 0x20;
this->unk_32C |= 0x20;
break;
@@ -974,8 +974,8 @@ void func_80BEE530(EnAkindonuts* this, GlobalContext* globalCtx) {
switch (this->unk_33C) {
case 0:
if ((player->transformation == PLAYER_FORM_ZORA) && !(gSaveContext.weekEventReg[62] & 0x80)) {
gSaveContext.weekEventReg[62] |= 0x80;
if ((player->transformation == PLAYER_FORM_ZORA) && !(gSaveContext.save.weekEventReg[62] & 0x80)) {
gSaveContext.save.weekEventReg[62] |= 0x80;
this->unk_33C = 0x162A;
break;
}
@@ -1095,7 +1095,7 @@ void func_80BEE73C(EnAkindonuts* this, GlobalContext* globalCtx) {
void func_80BEE938(EnAkindonuts* this, GlobalContext* globalCtx) {
switch (ENAKINDONUTS_GET_3(&this->actor)) {
case 0:
if (gSaveContext.weekEventReg[61] & 0x10) {
if (gSaveContext.save.weekEventReg[61] & 0x10) {
if (ENAKINDONUTS_GET_4(&this->actor)) {
this->unk_2DC = func_80BED680;
} else {
@@ -1109,7 +1109,7 @@ void func_80BEE938(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
case 1:
if (gSaveContext.weekEventReg[61] & 0x80) {
if (gSaveContext.save.weekEventReg[61] & 0x80) {
if (ENAKINDONUTS_GET_4(&this->actor)) {
this->unk_2DC = func_80BEDB88;
} else {
@@ -1123,7 +1123,7 @@ void func_80BEE938(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
case 2:
if (gSaveContext.weekEventReg[62] & 4) {
if (gSaveContext.save.weekEventReg[62] & 4) {
if (ENAKINDONUTS_GET_4(&this->actor)) {
this->unk_2DC = func_80BEE070;
} else {
@@ -1137,7 +1137,7 @@ void func_80BEE938(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
case 3:
if (gSaveContext.weekEventReg[62] & 0x20) {
if (gSaveContext.save.weekEventReg[62] & 0x20) {
if (ENAKINDONUTS_GET_4(&this->actor)) {
this->unk_2DC = func_80BEE530;
} else {
+7 -7
View File
@@ -187,7 +187,7 @@ Actor* func_80BDE384(EnAl* this, GlobalContext* globalCtx) {
switch (this->unk_35C) {
case 2:
if (!(gSaveContext.weekEventReg[89] & 8) && (gSaveContext.weekEventReg[85] & 0x80)) {
if (!(gSaveContext.save.weekEventReg[89] & 8) && (gSaveContext.save.weekEventReg[85] & 0x80)) {
actor = func_80BDE1A0(this, globalCtx, ACTORCAT_NPC, ACTOR_EN_PM);
} else {
actor = &GET_PLAYER(globalCtx)->actor;
@@ -398,7 +398,7 @@ s32 func_80BDEA14(EnAl* this, GlobalContext* globalCtx) {
switch (this->unk_4E6) {
case 0:
case 1:
if ((gSaveContext.weekEventReg[75] & 2)) {
if ((gSaveContext.save.weekEventReg[75] & 2)) {
sp18 = true;
} else if (func_80BDE4E0(this, &this->unk_4E6, 0)) {
sp18 = true;
@@ -439,7 +439,7 @@ s32* func_80BDEABC(EnAl* this, GlobalContext* globalCtx) {
return D_80BDFE84;
case 2:
if (!(gSaveContext.weekEventReg[89] & 8) && (gSaveContext.weekEventReg[85] & 0x80)) {
if (!(gSaveContext.save.weekEventReg[89] & 8) && (gSaveContext.save.weekEventReg[85] & 0x80)) {
this->unk_4EC = func_80BDE7FC;
return D_80BDFCBC;
}
@@ -687,15 +687,15 @@ void func_80BDF414(EnAl* this, GlobalContext* globalCtx) {
switch (this->unk_4EA) {
case 0:
case 1:
if (!(gSaveContext.weekEventReg[89] & 8)) {
if (gSaveContext.weekEventReg[85] & 0x80) {
if (!(gSaveContext.save.weekEventReg[89] & 8)) {
if (gSaveContext.save.weekEventReg[85] & 0x80) {
func_80BDE4E0(this, &this->unk_4EA, 0);
}
}
break;
case 2:
if (gSaveContext.weekEventReg[89] & 8) {
if (gSaveContext.save.weekEventReg[89] & 8) {
this->unk_4EA++;
}
break;
@@ -734,7 +734,7 @@ void func_80BDF578(EnAl* this, GlobalContext* globalCtx) {
}
void func_80BDF5E8(EnAl* this, GlobalContext* globalCtx) {
u32* unk14 = &gSaveContext.unk_14;
u32* unk14 = &gSaveContext.save.daySpeed;
struct_80133038_arg2 sp20;
this->unk_4E0 = REG(15) + *unk14;
+40 -40
View File
@@ -101,11 +101,11 @@ void func_809C10B0(EnAob01* this, s32 arg1) {
}
void func_809C1124(void) {
u16 time = gSaveContext.time;
u16 time = gSaveContext.save.time;
gSaveContext.time = (u16)REG(15) + time;
time = gSaveContext.time;
gSaveContext.time = (u16)gSaveContext.unk_14 + time;
gSaveContext.save.time = (u16)REG(15) + time;
time = gSaveContext.save.time;
gSaveContext.save.time = (u16)gSaveContext.save.daySpeed + time;
}
void func_809C1158(EnAob01* this, GlobalContext* globalCtx) {
@@ -219,18 +219,18 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) {
case 0x3548:
case 0x3549:
case 0x354A:
switch (gSaveContext.day) {
switch (gSaveContext.save.day) {
case 1:
if (!gSaveContext.isNight) {
if (!(gSaveContext.weekEventReg[64] & 0x80)) {
gSaveContext.weekEventReg[64] |= 0x80;
if (!gSaveContext.save.isNight) {
if (!(gSaveContext.save.weekEventReg[64] & 0x80)) {
gSaveContext.save.weekEventReg[64] |= 0x80;
this->unk_210 = 0x3520;
} else {
this->unk_210 = 0x352F;
}
} else {
if (!(gSaveContext.weekEventReg[65] & 1)) {
gSaveContext.weekEventReg[65] |= 1;
if (!(gSaveContext.save.weekEventReg[65] & 1)) {
gSaveContext.save.weekEventReg[65] |= 1;
this->unk_210 = 0x3530;
} else {
this->unk_210 = 0x352F;
@@ -239,16 +239,16 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) {
break;
case 2:
if (!gSaveContext.isNight) {
if (!(gSaveContext.weekEventReg[65] & 2)) {
gSaveContext.weekEventReg[65] |= 2;
if (!gSaveContext.save.isNight) {
if (!(gSaveContext.save.weekEventReg[65] & 2)) {
gSaveContext.save.weekEventReg[65] |= 2;
this->unk_210 = 0x3531;
} else {
this->unk_210 = 0x352F;
}
} else {
if (!(gSaveContext.weekEventReg[65] & 4)) {
gSaveContext.weekEventReg[65] |= 4;
if (!(gSaveContext.save.weekEventReg[65] & 4)) {
gSaveContext.save.weekEventReg[65] |= 4;
this->unk_210 = 0x3532;
} else {
this->unk_210 = 0x352F;
@@ -257,16 +257,16 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) {
break;
case 3:
if (!gSaveContext.isNight) {
if (!(gSaveContext.weekEventReg[65] & 8)) {
gSaveContext.weekEventReg[65] |= 8;
if (!gSaveContext.save.isNight) {
if (!(gSaveContext.save.weekEventReg[65] & 8)) {
gSaveContext.save.weekEventReg[65] |= 8;
this->unk_210 = 0x3533;
} else {
this->unk_210 = 0x352F;
}
} else {
if (!(gSaveContext.weekEventReg[65] & 0x10)) {
gSaveContext.weekEventReg[65] |= 0x10;
if (!(gSaveContext.save.weekEventReg[65] & 0x10)) {
gSaveContext.save.weekEventReg[65] |= 0x10;
this->unk_210 = 0x3534;
} else {
this->unk_210 = 0x352F;
@@ -307,7 +307,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) {
break;
case PLAYER_FORM_HUMAN:
if (gSaveContext.rupees < 10) {
if (gSaveContext.save.playerData.rupees < 10) {
this->unk_210 = 0x3524;
this->unk_2D2 |= 0x10;
} else {
@@ -371,7 +371,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) {
break;
case 0x3528:
if (gSaveContext.rupees < this->unk_434) {
if (gSaveContext.save.playerData.rupees < this->unk_434) {
this->unk_210 = 0x3536;
this->unk_2D2 |= 0x40;
this->unk_43C = 1;
@@ -416,8 +416,8 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) {
void func_809C1C9C(EnAob01* this, GlobalContext* globalCtx) {
if (gSaveContext.rupeeAccumulator == 0) {
gSaveContext.weekEventReg[63] |= 1;
gSaveContext.weekEventReg[63] &= (u8)~2;
gSaveContext.save.weekEventReg[63] |= 1;
gSaveContext.save.weekEventReg[63] &= (u8)~2;
this->unk_2D2 |= 0x20;
func_800FD750(0x40);
globalCtx->nextEntranceIndex = 0x7C10;
@@ -436,7 +436,7 @@ void func_809C1D64(EnAob01* this, GlobalContext* globalCtx) {
if (Message_ShouldAdvance(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) {
case 0:
if (gSaveContext.rupees < 10) {
if (gSaveContext.save.playerData.rupees < 10) {
play_sound(NA_SE_SY_ERROR);
this->unk_210 = 0x3524;
Message_StartTextbox(globalCtx, this->unk_210, &this->actor);
@@ -761,13 +761,13 @@ void func_809C2A64(EnAob01* this, GlobalContext* globalCtx) {
this->unk_2E0 = this->unk_2F2;
this->actor.parent = NULL;
this->actor.shape.rot.y = this->actor.world.rot.y;
if (gSaveContext.weekEventReg[8] & 0x20) {
if (gSaveContext.save.weekEventReg[8] & 0x20) {
this->actionFunc = func_809C2BE4;
} else {
gSaveContext.weekEventReg[8] |= 0x20;
gSaveContext.save.weekEventReg[8] |= 0x20;
this->actionFunc = func_809C2BE4;
}
} else if (gSaveContext.weekEventReg[8] & 0x20) {
} else if (gSaveContext.save.weekEventReg[8] & 0x20) {
Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_RED, 300.0f, 300.0f);
} else {
Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 300.0f, 300.0f);
@@ -779,12 +779,12 @@ void func_809C2BE4(EnAob01* this, GlobalContext* globalCtx) {
u8 temp_v0 = Message_GetState(&globalCtx->msgCtx);
if (((temp_v0 == 5) || (temp_v0 == 6)) && Message_ShouldAdvance(globalCtx)) {
if (gSaveContext.weekEventReg[63] & 2) {
gSaveContext.weekEventReg[63] &= (u8)~2;
if (gSaveContext.save.weekEventReg[63] & 2) {
gSaveContext.save.weekEventReg[63] &= (u8)~2;
}
if (gSaveContext.weekEventReg[63] & 1) {
gSaveContext.weekEventReg[63] &= (u8)~1;
if (gSaveContext.save.weekEventReg[63] & 1) {
gSaveContext.save.weekEventReg[63] &= (u8)~1;
}
this->unk_210 = 0;
@@ -833,12 +833,12 @@ void func_809C2D0C(EnAob01* this, GlobalContext* globalCtx) {
this->unk_434 = 0;
this->actor.shape.rot.y = this->actor.world.rot.y;
if (gSaveContext.weekEventReg[63] & 2) {
gSaveContext.weekEventReg[63] &= (u8)~2;
if (gSaveContext.save.weekEventReg[63] & 2) {
gSaveContext.save.weekEventReg[63] &= (u8)~2;
}
if (gSaveContext.weekEventReg[63] & 1) {
gSaveContext.weekEventReg[63] &= (u8)~1;
if (gSaveContext.save.weekEventReg[63] & 1) {
gSaveContext.save.weekEventReg[63] &= (u8)~1;
}
this->unk_210 = 0x354C;
@@ -902,7 +902,7 @@ void func_809C2FA0(void) {
}
for (i = 0; i < ARRAY_COUNT(sp44); i++) {
gSaveContext.weekEventReg[42 + i] = 0;
gSaveContext.save.weekEventReg[42 + i] = 0;
sp44[i] = 0;
}
@@ -912,8 +912,8 @@ void func_809C2FA0(void) {
if (i % 2) {
sp44[idx2] |= orig2 << 0x4;
idx = gSaveContext.weekEventReg[42 + idx2];
gSaveContext.weekEventReg[42 + idx2] = idx | sp44[idx2];
idx = gSaveContext.save.weekEventReg[42 + idx2];
gSaveContext.save.weekEventReg[42 + idx2] = idx | sp44[idx2];
} else {
sp44[idx2] |= orig2;
}
@@ -967,7 +967,7 @@ void EnAob01_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnAob01* this = THIS;
if (!(this->unk_2D2 & 0x20)) {
gSaveContext.weekEventReg[63] &= (u8)~1;
gSaveContext.save.weekEventReg[63] &= (u8)~1;
}
Collider_DestroyCylinder(globalCtx, &this->collider);
}
+22 -22
View File
@@ -130,12 +130,12 @@ void func_80BA886C(EnBaba* this, GlobalContext* globalCtx) {
switch (this->unk_1E0) {
case 0:
if (this->unk_40A & 8) {
if (gSaveContext.weekEventReg[33] & 8) {
if (gSaveContext.save.weekEventReg[33] & 8) {
this->unk_1E0 = 0x2A34;
break;
}
if (gSaveContext.weekEventReg[79] & 0x40) {
if (gSaveContext.save.weekEventReg[79] & 0x40) {
this->unk_40A |= 1;
this->unk_1E0 = 0x2A33;
break;
@@ -145,8 +145,8 @@ void func_80BA886C(EnBaba* this, GlobalContext* globalCtx) {
this->unk_1E0 = 0x2A32;
break;
} else if (player->transformation == PLAYER_FORM_DEKU) {
if (!(gSaveContext.weekEventReg[79] & 0x20)) {
gSaveContext.weekEventReg[79] |= 0x20;
if (!(gSaveContext.save.weekEventReg[79] & 0x20)) {
gSaveContext.save.weekEventReg[79] |= 0x20;
this->unk_40A |= 1;
this->unk_1E0 = 0x2A37;
break;
@@ -155,15 +155,15 @@ void func_80BA886C(EnBaba* this, GlobalContext* globalCtx) {
this->unk_1E0 = 0x2A38;
}
break;
} else if (!(gSaveContext.weekEventReg[33] & 8)) {
if (!(gSaveContext.weekEventReg[73] & 1)) {
} else if (!(gSaveContext.save.weekEventReg[33] & 8)) {
if (!(gSaveContext.save.weekEventReg[73] & 1)) {
this->unk_1E0 = 0x660;
break;
}
this->unk_1E0 = 0x662;
break;
} else {
if (!(gSaveContext.weekEventReg[73] & 2)) {
if (!(gSaveContext.save.weekEventReg[73] & 2)) {
this->unk_1E0 = 0x65A;
break;
}
@@ -185,7 +185,7 @@ void func_80BA886C(EnBaba* this, GlobalContext* globalCtx) {
case 0x662:
Actor_ChangeFocus(&this->actor, globalCtx, &this->unk_144->actor);
this->unk_1E0 = 0x663;
gSaveContext.weekEventReg[73] |= 1;
gSaveContext.save.weekEventReg[73] |= 1;
this->unk_40A |= 1;
break;
@@ -202,7 +202,7 @@ void func_80BA886C(EnBaba* this, GlobalContext* globalCtx) {
case 0x65C:
Actor_ChangeFocus(&this->actor, globalCtx, &this->unk_144->actor);
this->unk_1E0 = 0x65D;
gSaveContext.weekEventReg[73] |= 2;
gSaveContext.save.weekEventReg[73] |= 2;
this->unk_40A |= 1;
break;
@@ -306,7 +306,7 @@ void func_80BA8DF4(EnBaba* this, GlobalContext* globalCtx) {
}
s32 func_80BA8F88(EnBaba* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
u16 sp26 = (u16)(gSaveContext.time - 0x3FFC);
u16 sp26 = (u16)(gSaveContext.save.time - 0x3FFC);
u16 temp;
u8 sp23 = ENBABA_GET_3F00(&this->actor);
@@ -413,7 +413,7 @@ s32 func_80BA9160(EnBaba* this, GlobalContext* globalCtx) {
void func_80BA93AC(EnBaba* this, GlobalContext* globalCtx) {
if (this->unk_434 != 1) {
if (this->unk_434 == 2) {
gSaveContext.weekEventReg[58] |= 0x40;
gSaveContext.save.weekEventReg[58] |= 0x40;
this->unk_40A |= 2;
func_80BA9160(this, globalCtx);
}
@@ -443,10 +443,10 @@ void func_80BA9480(EnBaba* this, GlobalContext* globalCtx) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
this->actionFunc = func_80BA9758;
} else if (globalCtx->sceneNum == SCENE_BACKTOWN) {
if ((ENBABA_GET_C000(&this->actor) == ENBABA_C000_0) && (gSaveContext.entranceIndex != 0xD670) &&
if ((ENBABA_GET_C000(&this->actor) == ENBABA_C000_0) && (gSaveContext.save.entranceIndex != 0xD670) &&
((ENBABA_GET_3F00(&this->actor)) != ENBABA_3F00_3F)) {
if ((gSaveContext.weekEventReg[58] & 0x40) ||
(!(gSaveContext.time < CLOCK_TIME(0, 20)) && (gSaveContext.time < CLOCK_TIME(6, 0)))) {
if ((gSaveContext.save.weekEventReg[58] & 0x40) ||
(!(gSaveContext.save.time < CLOCK_TIME(0, 20)) && (gSaveContext.save.time < CLOCK_TIME(6, 0)))) {
Actor_MarkForDeath(&this->actor);
return;
}
@@ -455,14 +455,14 @@ void func_80BA9480(EnBaba* this, GlobalContext* globalCtx) {
this->unk_40C = 2;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
this->actionFunc = func_80BA9B80;
} else if ((ENBABA_GET_C000(&this->actor) == ENBABA_C000_1) && (gSaveContext.entranceIndex == 0xD670)) {
if (gSaveContext.weekEventReg[81] & 2) {
} else if ((ENBABA_GET_C000(&this->actor) == ENBABA_C000_1) && (gSaveContext.save.entranceIndex == 0xD670)) {
if (gSaveContext.save.weekEventReg[81] & 2) {
Actor_MarkForDeath(&this->actor);
return;
}
this->unk_40A |= 2;
if (gSaveContext.weekEventReg[33] & 8) {
if (gSaveContext.save.weekEventReg[33] & 8) {
this->unk_40C = 0;
} else {
this->unk_40C = 1;
@@ -534,12 +534,12 @@ void func_80BA98EC(EnBaba* this, GlobalContext* globalCtx) {
if (this->unk_40A & 8) {
if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) {
if (globalCtx->msgCtx.unk120B1 == 0) {
gSaveContext.weekEventReg[81] |= 2;
gSaveContext.save.weekEventReg[81] |= 2;
func_80BA8C4C(globalCtx, 0xD670);
return;
}
} else {
gSaveContext.weekEventReg[81] |= 2;
gSaveContext.save.weekEventReg[81] |= 2;
func_80BA8C4C(globalCtx, 0xD670);
}
} else {
@@ -557,7 +557,7 @@ void func_80BA98EC(EnBaba* this, GlobalContext* globalCtx) {
}
} else if (temp_v0 == 6) {
if (Message_ShouldAdvance(globalCtx) && (globalCtx->msgCtx.unk120B1 == 0)) {
gSaveContext.weekEventReg[81] |= 2;
gSaveContext.save.weekEventReg[81] |= 2;
func_80BA8C4C(globalCtx, 0xD670);
}
}
@@ -583,7 +583,7 @@ void func_80BA9B24(EnBaba* this, GlobalContext* globalCtx) {
}
void func_80BA9B80(EnBaba* this, GlobalContext* globalCtx) {
u32* unk14 = &gSaveContext.unk_14;
u32* unk14 = &gSaveContext.save.daySpeed;
struct_80133038_arg2 sp20;
this->unk_436 = REG(15) + *unk14;
@@ -629,7 +629,7 @@ void func_80BA9CD4(EnBaba* this, GlobalContext* globalCtx) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
}
} else {
if ((gSaveContext.weekEventReg[79] & 0x40) && (DECR(this->unk_404) == 0)) {
if ((gSaveContext.save.weekEventReg[79] & 0x40) && (DECR(this->unk_404) == 0)) {
Audio_QueueSeqCmd(0x101400FF);
func_80BA8C4C(globalCtx, 0xD670);
} else {
@@ -71,14 +71,16 @@ void EnBaisen_Init(Actor* thisx, GlobalContext* globalCtx) {
this->paramCopy = this->actor.params;
if (this->actor.params == 0) {
this->unk290 = true;
if (!(gSaveContext.weekEventReg[63] & 0x80) && ((gSaveContext.day != 3) || !gSaveContext.isNight)) {
if (!(gSaveContext.save.weekEventReg[63] & 0x80) &&
((gSaveContext.save.day != 3) || !gSaveContext.save.isNight)) {
Actor_MarkForDeath(&this->actor);
}
} else {
this->collider.dim.radius = 30;
this->collider.dim.height = 60;
this->collider.dim.yShift = 0;
if ((gSaveContext.weekEventReg[63] & 0x80) || ((gSaveContext.day == 3) && (gSaveContext.isNight))) {
if ((gSaveContext.save.weekEventReg[63] & 0x80) ||
((gSaveContext.save.day == 3) && (gSaveContext.save.isNight))) {
Actor_MarkForDeath(&this->actor);
}
}
@@ -153,7 +155,7 @@ void func_80BE887C(EnBaisen* this, GlobalContext* globalCtx) {
} else {
if (this->paramCopy != 0) {
this->textIdIndex = 0;
if (gSaveContext.weekEventReg[60] & 8) {
if (gSaveContext.save.weekEventReg[60] & 8) {
this->textIdIndex = 1;
}
if (Player_GetMask(globalCtx) == PLAYER_MASK_COUPLE) {
@@ -246,7 +248,7 @@ void EnBaisen_Update(Actor* thisx, GlobalContext* globalCtx) {
this->unusedCounter--;
}
this->actor.shape.rot.y = this->actor.world.rot.y;
if ((this->paramCopy != 0) && (gSaveContext.day == 3) && gSaveContext.isNight) {
if ((this->paramCopy != 0) && (gSaveContext.save.day == 3) && gSaveContext.save.isNight) {
Actor_MarkForDeath(&this->actor);
return;
}
@@ -105,7 +105,7 @@ void EnBigokuta_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
this->cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene);
if (gSaveContext.weekEventReg[20] & 2 ||
if (gSaveContext.save.weekEventReg[20] & 2 ||
((this->actor.params != 0xFF) && Flags_GetSwitch(globalCtx, this->actor.params))) {
Actor_MarkForDeath(&this->actor);
} else {
@@ -309,7 +309,7 @@ static InitChainEntry sInitChain[] = {
};
void EnBigslime_Init(Actor* thisx, GlobalContext* globalCtx2) {
// gSaveContext.weekEventReg[KEY] = VALUE
// gSaveContext.save.weekEventReg[KEY] = VALUE
// KEY | VALUE
static s32 isFrogReturnedFlags[] = {
(32 << 8) | 0x40, // Woodfall Temple Frog Returned
@@ -340,7 +340,7 @@ void EnBigslime_Init(Actor* thisx, GlobalContext* globalCtx2) {
if (Flags_GetClear(globalCtx, globalCtx->roomCtx.currRoom.num)) {
Actor_MarkForDeath(&this->actor);
if (!(gSaveContext.weekEventReg[isFrogReturnedFlags[this->actor.params - 1] >> 8] &
if (!(gSaveContext.save.weekEventReg[isFrogReturnedFlags[this->actor.params - 1] >> 8] &
(u8)isFrogReturnedFlags[this->actor.params - 1])) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_MINIFROG, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0,
@@ -1614,7 +1614,7 @@ void EnBigslime_AttackPlayerInBigslime(EnBigslime* this, GlobalContext* globalCt
if (this->numGekkoMeleeAttacks == 0) {
this->numGekkoPosGrabPlayer--;
if ((gSaveContext.health < 5) || (this->numGekkoPosGrabPlayer == 0)) {
if ((gSaveContext.save.playerData.health < 5) || (this->numGekkoPosGrabPlayer == 0)) {
this->numGekkoPosGrabPlayer = 0;
this->gekkoRot.y = this->actor.world.rot.y;
this->gekkoPosOffset.x = Math_SinS(this->gekkoRot.y) * -50.0f;
+15 -15
View File
@@ -122,44 +122,44 @@ void func_809CD028(EnBji01* this, GlobalContext* globalCtx) {
switch (this->actor.params) {
case ENBJI01_PARAMS_DEFAULT:
case ENBJI01_PARAMS_FINISHED_CONVERSATION:
switch (gSaveContext.playerForm) {
switch (gSaveContext.save.playerForm) {
case PLAYER_FORM_DEKU:
if (gSaveContext.weekEventReg[17] & 0x10) {
if (gSaveContext.weekEventReg[74] & 0x80) {
if (gSaveContext.save.weekEventReg[17] & 0x10) {
if (gSaveContext.save.weekEventReg[74] & 0x80) {
this->textId = 0x5F4;
} else {
this->textId = 0x5E2;
}
} else {
this->textId = 0x5EC;
gSaveContext.weekEventReg[17] |= 0x10;
gSaveContext.save.weekEventReg[17] |= 0x10;
}
break;
case PLAYER_FORM_HUMAN:
if (Player_GetMask(globalCtx) == PLAYER_MASK_KAFEIS_MASK) {
this->textId = 0x236A;
} else if (gSaveContext.weekEventReg[74] & 0x10) {
} else if (gSaveContext.save.weekEventReg[74] & 0x10) {
this->textId = 0x5F6;
} else {
this->textId = 0x5F5;
gSaveContext.weekEventReg[74] |= 0x10;
gSaveContext.save.weekEventReg[74] |= 0x10;
}
break;
case PLAYER_FORM_GORON:
case PLAYER_FORM_ZORA:
if (gSaveContext.weekEventReg[75] & 8) {
if (gSaveContext.save.weekEventReg[75] & 8) {
this->textId = 0x5E4;
} else {
this->textId = 0x5DC;
gSaveContext.weekEventReg[75] |= 8;
gSaveContext.save.weekEventReg[75] |= 8;
}
break;
}
break;
case ENBJI01_PARAMS_LOOKED_THROUGH_TELESCOPE:
switch (gSaveContext.playerForm) {
switch (gSaveContext.save.playerForm) {
case PLAYER_FORM_DEKU:
if (gSaveContext.weekEventReg[74] & 0x80) {
if (gSaveContext.save.weekEventReg[74] & 0x80) {
this->textId = 0x5F2;
} else {
this->textId = 0x5F1;
@@ -180,9 +180,9 @@ void func_809CD028(EnBji01* this, GlobalContext* globalCtx) {
this->textId = 0x5EA;
break;
case 3:
tempDay = gSaveContext.day;
tempDay = gSaveContext.save.day;
tempTimeBeforeMoonCrash =
((-(tempDay % 5 << 0x10) - ((u16)(gSaveContext.time - 0x4000))) + 0x40000);
((-(tempDay % 5 << 0x10) - ((u16)(gSaveContext.save.time - 0x4000))) + 0x40000);
if (tempTimeBeforeMoonCrash < CLOCK_TIME_F(1, 0)) { /* 1 hr */
this->textId = 0x5E8;
} else {
@@ -218,7 +218,7 @@ void EnBji01_DialogueHandler(EnBji01* this, GlobalContext* globalCtx) {
break;
case 1:
func_8019F230();
switch (gSaveContext.playerForm) {
switch (gSaveContext.save.playerForm) {
case PLAYER_FORM_DEKU:
func_80151938(globalCtx, 0x5F0);
break;
@@ -298,7 +298,7 @@ void func_809CD634(EnBji01* this, GlobalContext* globalCtx) {
func_801A5BD0(0x6F);
Audio_QueueSeqCmd(0xE0000101);
globalCtx->nextEntranceIndex = 0x54A0; /* Termina Field from telescope */
gSaveContext.respawn[0].entranceIndex = globalCtx->nextEntranceIndex;
gSaveContext.respawn[RESTART_MODE_DOWN].entranceIndex = globalCtx->nextEntranceIndex;
func_80169EFC(&globalCtx->state); /* Load new entrance? */
gSaveContext.respawnFlag = -2;
this->actionFunc = EnBji01_DoNothing;
@@ -344,7 +344,7 @@ void EnBji01_Init(Actor* thisx, GlobalContext* globalCtx) {
SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
this->moonsTear = (ObjMoonStone*)SubS_FindActor(globalCtx, NULL, ACTORCAT_PROP, ACTOR_OBJ_MOON_STONE);
switch (gSaveContext.entranceIndex) {
switch (gSaveContext.save.entranceIndex) {
case 0x4C00: /* Observatory from ECT */
case 0x4C10: /* Observatory from Termina Field door */
this->actor.params = ENBJI01_PARAMS_DEFAULT;
@@ -97,7 +97,7 @@ void EnBomBowlMan_Init(Actor* thisx, GlobalContext* globalCtx) {
this->path = func_8013D648(globalCtx, this->unk_29A, 0x3F);
this->unk_2C8 = 80.0f;
if ((gSaveContext.entranceIndex == 0xD220) && (gSaveContext.weekEventReg[73] & 0x80) &&
if ((gSaveContext.save.entranceIndex == 0xD220) && (gSaveContext.save.weekEventReg[73] & 0x80) &&
!CHECK_QUEST_ITEM(ITEM_BOTTLE)) {
this->unk_2D6 = this->actor.cutscene;
if (this->unk_2D6 == 0) {
@@ -173,9 +173,9 @@ void func_809C4BC4(EnBomBowlMan* this, GlobalContext* globalCtx) {
func_809C4B50(this);
func_809C493C(this, 0, 1.0f);
for (i = 0; i < ARRAY_COUNT(gSaveContext.bomberCode); i++) {
for (i = 0; i < ARRAY_COUNT(gSaveContext.save.bomberCode); i++) {
Math_Vec3f_Copy(&sp7C, &this->actor.home.pos);
code = gSaveContext.bomberCode[i];
code = gSaveContext.save.bomberCode[i];
if (code == 1) {
Math_Vec3f_Copy(&this->actor.world.pos, &D_809C61A0[i]);
this->unk_2D8[code] = this;
@@ -203,8 +203,8 @@ void func_809C4BC4(EnBomBowlMan* this, GlobalContext* globalCtx) {
func_809C493C(this, 3, 1.0f);
this->unk_2D4 = this->actor.yawTowardsPlayer;
this->unk_290 = this->actor.yawTowardsPlayer;
gSaveContext.weekEventReg[73] &= (u8)~0x10;
gSaveContext.weekEventReg[85] &= (u8)~2;
gSaveContext.save.weekEventReg[73] &= (u8)~0x10;
gSaveContext.save.weekEventReg[85] &= (u8)~2;
this->unk_29C = 0;
this->actionFunc = func_809C4DA4;
}
@@ -338,13 +338,13 @@ void func_809C51B4(EnBomBowlMan* this, GlobalContext* globalCtx) {
globalCtx->sceneLoadFlag = 0x14;
globalCtx->unk_1887F = 0x56;
gSaveContext.nextTransition = 3;
gSaveContext.weekEventReg[75] &= (u8)~0x40;
gSaveContext.save.weekEventReg[75] &= (u8)~0x40;
if (player->transformation == PLAYER_FORM_HUMAN) {
gSaveContext.weekEventReg[84] |= 0x80;
gSaveContext.weekEventReg[77] &= (u8)~2;
gSaveContext.save.weekEventReg[84] |= 0x80;
gSaveContext.save.weekEventReg[77] &= (u8)~2;
} else {
gSaveContext.weekEventReg[73] |= 0x20;
gSaveContext.weekEventReg[85] &= (u8)~1;
gSaveContext.save.weekEventReg[73] |= 0x20;
gSaveContext.save.weekEventReg[85] &= (u8)~1;
}
}
}
@@ -402,7 +402,7 @@ void func_809C5408(EnBomBowlMan* this, GlobalContext* globalCtx) {
void func_809C5524(EnBomBowlMan* this, GlobalContext* globalCtx) {
this->actor.textId = 0x730;
if (!(gSaveContext.weekEventReg[85] & 2)) {
if (!(gSaveContext.save.weekEventReg[85] & 2)) {
this->actor.textId = 0x72F;
}
func_809C493C(this, 3, 1.0f);
@@ -484,8 +484,8 @@ void func_809C5738(EnBomBowlMan* this, GlobalContext* globalCtx) {
(this->path != NULL)) {
this->unk_298++;
if (this->unk_298 >= this->path->count) {
gSaveContext.weekEventReg[84] |= 0x80;
gSaveContext.weekEventReg[83] &= (u8)~4;
gSaveContext.save.weekEventReg[84] |= 0x80;
gSaveContext.save.weekEventReg[83] &= (u8)~4;
ActorCutscene_Stop(this->unk_2D6);
Actor_MarkForDeath(&this->actor);
} else {
@@ -104,19 +104,19 @@ void EnBombers_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_2BE = ENBOMBERS_GET_F(&this->actor);
if (this->unk_2BC == ENBOMBERS_F0_0) {
if ((gSaveContext.weekEventReg[73] & 0x10) || (gSaveContext.weekEventReg[85] & 2)) {
if ((gSaveContext.save.weekEventReg[73] & 0x10) || (gSaveContext.save.weekEventReg[85] & 2)) {
Actor_MarkForDeath(&this->actor);
} else {
this->unk_2BE++;
func_80C03ACC(this);
}
} else if (((gSaveContext.weekEventReg[73] & 0x10) || (gSaveContext.weekEventReg[85] & 2)) &&
(((this->unk_2BE == ENBOMBERS_F_0) && (gSaveContext.weekEventReg[76] & 1)) ||
((this->unk_2BE == ENBOMBERS_F_1) && (gSaveContext.weekEventReg[76] & 2)) ||
((this->unk_2BE == ENBOMBERS_F_2) && (gSaveContext.weekEventReg[76] & 4)) ||
((this->unk_2BE == ENBOMBERS_F_3) && (gSaveContext.weekEventReg[76] & 8)) ||
((this->unk_2BE == ENBOMBERS_F_4) && (gSaveContext.weekEventReg[76] & 0x10)))) {
if (gSaveContext.weekEventReg[75] & 0x40) {
} else if (((gSaveContext.save.weekEventReg[73] & 0x10) || (gSaveContext.save.weekEventReg[85] & 2)) &&
(((this->unk_2BE == ENBOMBERS_F_0) && (gSaveContext.save.weekEventReg[76] & 1)) ||
((this->unk_2BE == ENBOMBERS_F_1) && (gSaveContext.save.weekEventReg[76] & 2)) ||
((this->unk_2BE == ENBOMBERS_F_2) && (gSaveContext.save.weekEventReg[76] & 4)) ||
((this->unk_2BE == ENBOMBERS_F_3) && (gSaveContext.save.weekEventReg[76] & 8)) ||
((this->unk_2BE == ENBOMBERS_F_4) && (gSaveContext.save.weekEventReg[76] & 0x10)))) {
if (gSaveContext.save.weekEventReg[75] & 0x40) {
if (this->unk_2BE == ENBOMBERS_F_0) {
EnBomBowlMan* bomBowlMan = (EnBomBowlMan*)Actor_Spawn(
&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM_BOWL_MAN, this->actor.world.pos.x,
@@ -130,11 +130,11 @@ void EnBombers_Init(Actor* thisx, GlobalContext* globalCtx) {
while (cs != -1) { bomBowlMan->unk_2CC[i] = cs; cs = ActorCutscene_GetAdditionalCutscene(cs); i++; }
// clang-format on
gSaveContext.weekEventReg[76] &= (u8)~1;
gSaveContext.weekEventReg[76] &= (u8)~2;
gSaveContext.weekEventReg[76] &= (u8)~4;
gSaveContext.weekEventReg[76] &= (u8)~8;
gSaveContext.weekEventReg[76] &= (u8)~0x10;
gSaveContext.save.weekEventReg[76] &= (u8)~1;
gSaveContext.save.weekEventReg[76] &= (u8)~2;
gSaveContext.save.weekEventReg[76] &= (u8)~4;
gSaveContext.save.weekEventReg[76] &= (u8)~8;
gSaveContext.save.weekEventReg[76] &= (u8)~0x10;
}
}
Actor_MarkForDeath(&this->actor);
@@ -180,7 +180,7 @@ void func_80C039A8(EnBombers* this, GlobalContext* globalCtx) {
switch (player->transformation) {
case PLAYER_FORM_HUMAN:
this->actor.textId = 0x73D;
if (gSaveContext.weekEventReg[84] & 0x80) {
if (gSaveContext.save.weekEventReg[84] & 0x80) {
this->actor.textId = 0x74B;
}
break;
@@ -194,14 +194,14 @@ void func_80C039A8(EnBombers* this, GlobalContext* globalCtx) {
break;
case PLAYER_FORM_DEKU:
if (gSaveContext.weekEventReg[73] & 0x20) {
if (gSaveContext.save.weekEventReg[73] & 0x20) {
this->actor.textId = 0x75A;
} else if (gSaveContext.weekEventReg[73] & 0x40) {
} else if (gSaveContext.save.weekEventReg[73] & 0x40) {
this->actor.textId = 0x749;
if (((this->unk_2BE == ENBOMBERS_F_1) && (gSaveContext.weekEventReg[74] & 1)) ||
((this->unk_2BE == ENBOMBERS_F_2) && (gSaveContext.weekEventReg[74] & 2)) ||
((this->unk_2BE == ENBOMBERS_F_3) && (gSaveContext.weekEventReg[74] & 4)) ||
((this->unk_2BE == ENBOMBERS_F_4) && (gSaveContext.weekEventReg[74] & 8))) {
if (((this->unk_2BE == ENBOMBERS_F_1) && (gSaveContext.save.weekEventReg[74] & 1)) ||
((this->unk_2BE == ENBOMBERS_F_2) && (gSaveContext.save.weekEventReg[74] & 2)) ||
((this->unk_2BE == ENBOMBERS_F_3) && (gSaveContext.save.weekEventReg[74] & 4)) ||
((this->unk_2BE == ENBOMBERS_F_4) && (gSaveContext.save.weekEventReg[74] & 8))) {
this->actor.textId = 0x74A;
}
} else {
@@ -375,7 +375,7 @@ void func_80C03FAC(EnBombers* this, GlobalContext* globalCtx) {
sp2A = 1;
}
} else if (this->actor.textId == 0x744) {
s32 day = gSaveContext.day - 1;
s32 day = gSaveContext.save.day - 1;
if (day == 2) {
this->actor.textId = 0x746;
@@ -393,22 +393,22 @@ void func_80C03FAC(EnBombers* this, GlobalContext* globalCtx) {
} else if (this->actor.textId == 0x748) {
switch (this->unk_2BE) {
case ENBOMBERS_F_1:
gSaveContext.weekEventReg[74] |= 1;
gSaveContext.save.weekEventReg[74] |= 1;
break;
case ENBOMBERS_F_2:
gSaveContext.weekEventReg[74] |= 2;
gSaveContext.save.weekEventReg[74] |= 2;
break;
case ENBOMBERS_F_3:
gSaveContext.weekEventReg[74] |= 4;
gSaveContext.save.weekEventReg[74] |= 4;
break;
case ENBOMBERS_F_4:
gSaveContext.weekEventReg[74] |= 8;
gSaveContext.save.weekEventReg[74] |= 8;
break;
}
gSaveContext.weekEventReg[73] |= 0x40;
gSaveContext.save.weekEventReg[73] |= 0x40;
}
switch (sp2A) {
@@ -94,7 +94,7 @@ void EnBombers2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->jointTable, OBJECT_CS_LIMB_MAX);
this->actor.targetMode = 6;
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
if ((gSaveContext.weekEventReg[0x49] & 0x80) || (gSaveContext.entranceIndex == 0xD220)) {
if ((gSaveContext.save.weekEventReg[73] & 0x80) || (gSaveContext.save.entranceIndex == 0xD220)) {
this->actor.world.pos.x += Math_SinS(this->actor.home.rot.y + 0xC100) * 50.0f;
cos = Math_CosS(this->actor.home.rot.y + 0xC100) * 50.0f;
this->unk_2AC = 1;
@@ -165,7 +165,7 @@ void func_80C04BA0(EnBombers2* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->unk_2B6 = this->actor.world.rot.y;
gSaveContext.weekEventReg[0x56] |= 2;
gSaveContext.save.weekEventReg[86] |= 2;
func_80C04D00(this);
return;
}
@@ -219,7 +219,8 @@ void func_80C04D8C(EnBombers2* this, GlobalContext* globalCtx) {
s32 correctDigits;
for (i = 0; i < ARRAY_COUNT(this->correctDigitSlots); i++) {
if (!(this->correctDigitSlots[i]) && (globalCtx->msgCtx.unk12054[i] == gSaveContext.bomberCode[i])) {
if (!(this->correctDigitSlots[i]) &&
(globalCtx->msgCtx.unk12054[i] == gSaveContext.save.bomberCode[i])) {
this->correctDigitSlots[i] = true;
}
}
@@ -329,7 +330,7 @@ void func_80C0520C(EnBombers2* this, GlobalContext* globalCtx) {
EnBombers2_ChangeAnim(this, 6, 1.0f);
this->unk_2A8 = 0;
this->unk_2C0 = 1;
gSaveContext.weekEventReg[0x49] |= 0x80;
gSaveContext.save.weekEventReg[73] |= 0x80;
ActorCutscene_Stop(this->cutscene);
this->unk_2AC = 1;
this->actor.textId = sTextIds[this->textIdIndex];
@@ -117,7 +117,7 @@ void EnBomjima_Init(Actor* thisx, GlobalContext* globalCtx) {
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_cs_Skel_00F82C, &gBomberIdleAnim, this->jointTable,
this->morphTable, OBJECT_CS_LIMB_MAX);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
gSaveContext.weekEventReg[83] &= (u8)~4;
gSaveContext.save.weekEventReg[83] &= (u8)~4;
this->actor.targetMode = 0;
this->unk_2E6 = ENBOMJIMA_GET_F0(&this->actor);
this->unk_2E4 = ENBOMJIMA_GET_F(&this->actor);
@@ -139,8 +139,8 @@ void EnBomjima_Init(Actor* thisx, GlobalContext* globalCtx) {
func_80BFFCFC(this);
}
if ((gSaveContext.weekEventReg[75] & 0x40) || (gSaveContext.weekEventReg[73] & 0x10) ||
(gSaveContext.weekEventReg[85] & 2)) {
if ((gSaveContext.save.weekEventReg[75] & 0x40) || (gSaveContext.save.weekEventReg[73] & 0x10) ||
(gSaveContext.save.weekEventReg[85] & 2)) {
Actor_MarkForDeath(&this->actor);
}
}
@@ -166,12 +166,12 @@ void func_80BFE32C(EnBomjima* this, GlobalContext* globalCtx, s32 arg2) {
case 0:
if (player->transformation == PLAYER_FORM_DEKU) {
this->actor.textId = 0x759;
if (!(gSaveContext.weekEventReg[73] & 0x20)) {
if (!(gSaveContext.save.weekEventReg[73] & 0x20)) {
this->actor.textId = 0x708;
}
} else if (player->transformation == PLAYER_FORM_HUMAN) {
this->actor.textId = 0x75A;
if (!(gSaveContext.weekEventReg[84] & 0x80)) {
if (!(gSaveContext.save.weekEventReg[84] & 0x80)) {
this->actor.textId = 0x719;
}
} else if ((this->unk_2C8 == 1) || (this->unk_2C8 == 2)) {
@@ -350,18 +350,18 @@ void func_80BFEB64(EnBomjima* this, GlobalContext* globalCtx) {
func_80BFE32C(this, globalCtx, 0);
if (player->transformation == PLAYER_FORM_DEKU) {
if (gSaveContext.weekEventReg[73] & 0x20) {
if (gSaveContext.save.weekEventReg[73] & 0x20) {
this->unk_2C8 = 3;
func_80BFE32C(this, globalCtx, 3);
} else if (gSaveContext.weekEventReg[77] & 2) {
} else if (gSaveContext.save.weekEventReg[77] & 2) {
this->unk_2C8 = 11;
func_80BFE32C(this, globalCtx, 2);
}
} else if (player->transformation == PLAYER_FORM_HUMAN) {
if (gSaveContext.weekEventReg[84] & 0x80) {
if (gSaveContext.save.weekEventReg[84] & 0x80) {
this->unk_2C8 = 0;
func_80BFE32C(this, globalCtx, 3);
} else if (gSaveContext.weekEventReg[85] & 1) {
} else if (gSaveContext.save.weekEventReg[85] & 1) {
this->unk_2C8 = 11;
func_80BFE32C(this, globalCtx, 2);
}
@@ -460,7 +460,7 @@ void func_80BFF03C(EnBomjima* this, GlobalContext* globalCtx) {
ActorCutscene_SetIntentToPlay(this->unk_2D4[0]);
} else {
player->stateFlags1 &= ~0x20;
gSaveContext.weekEventReg[83] &= (u8)~4;
gSaveContext.save.weekEventReg[83] &= (u8)~4;
this->actor.world.rot.y = Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx));
this->unk_2DC = Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx));
ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D4[0], &this->actor);
@@ -506,11 +506,11 @@ void func_80BFF174(EnBomjima* this, GlobalContext* globalCtx) {
}
if (player->transformation == PLAYER_FORM_DEKU) {
if (gSaveContext.weekEventReg[73] & 0x20) {
if (gSaveContext.save.weekEventReg[73] & 0x20) {
this->unk_2C8 = 3;
func_80BFE32C(this, globalCtx, 3);
} else {
if (!(gSaveContext.weekEventReg[77] & 2)) {
if (!(gSaveContext.save.weekEventReg[77] & 2)) {
if (this->unk_2E8 == 0) {
this->unk_2C8 = 4;
} else {
@@ -522,11 +522,11 @@ void func_80BFF174(EnBomjima* this, GlobalContext* globalCtx) {
func_80BFE32C(this, globalCtx, 2);
}
} else if (player->transformation == PLAYER_FORM_HUMAN) {
if (gSaveContext.weekEventReg[84] & 0x80) {
if (gSaveContext.save.weekEventReg[84] & 0x80) {
this->unk_2C8 = 0;
func_80BFE32C(this, globalCtx, 3);
} else {
if (!(gSaveContext.weekEventReg[85] & 1)) {
if (!(gSaveContext.save.weekEventReg[85] & 1)) {
if (this->unk_2EA == 0) {
this->unk_2C8 = 4;
} else {
@@ -566,7 +566,7 @@ void func_80BFF430(EnBomjima* this, GlobalContext* globalCtx) {
bombal->unk_150 = 0.0f;
bombal->unk_14C = this->unk_2F4;
Actor_ChangeFocus(&this->actor, globalCtx, &bombal->actor);
gSaveContext.weekEventReg[83] &= (u8)~4;
gSaveContext.save.weekEventReg[83] &= (u8)~4;
func_80BFE65C(this);
func_801477B4(globalCtx);
this->actionFunc = func_80BFEA94;
@@ -689,31 +689,31 @@ void func_80BFF9B0(EnBomjima* this, GlobalContext* globalCtx) {
D_80C009F0 = 0;
this->unk_2C8 = 9;
if (player->transformation == PLAYER_FORM_DEKU) {
gSaveContext.weekEventReg[73] |= 0x10;
gSaveContext.weekEventReg[77] |= 2;
gSaveContext.save.weekEventReg[73] |= 0x10;
gSaveContext.save.weekEventReg[77] |= 2;
} else {
gSaveContext.weekEventReg[85] |= 2;
gSaveContext.weekEventReg[85] |= 1;
gSaveContext.save.weekEventReg[85] |= 2;
gSaveContext.save.weekEventReg[85] |= 1;
}
gSaveContext.weekEventReg[11] &= (u8)~1;
gSaveContext.weekEventReg[11] &= (u8)~2;
gSaveContext.weekEventReg[11] &= (u8)~4;
gSaveContext.weekEventReg[11] &= (u8)~8;
gSaveContext.weekEventReg[11] &= (u8)~0x10;
gSaveContext.save.weekEventReg[11] &= (u8)~1;
gSaveContext.save.weekEventReg[11] &= (u8)~2;
gSaveContext.save.weekEventReg[11] &= (u8)~4;
gSaveContext.save.weekEventReg[11] &= (u8)~8;
gSaveContext.save.weekEventReg[11] &= (u8)~0x10;
gSaveContext.weekEventReg[76] &= (u8)~1;
gSaveContext.weekEventReg[76] &= (u8)~2;
gSaveContext.weekEventReg[76] &= (u8)~4;
gSaveContext.weekEventReg[76] &= (u8)~8;
gSaveContext.weekEventReg[76] &= (u8)~0x10;
gSaveContext.save.weekEventReg[76] &= (u8)~1;
gSaveContext.save.weekEventReg[76] &= (u8)~2;
gSaveContext.save.weekEventReg[76] &= (u8)~4;
gSaveContext.save.weekEventReg[76] &= (u8)~8;
gSaveContext.save.weekEventReg[76] &= (u8)~0x10;
gSaveContext.unk_FE6 = 0;
gSaveContext.unk_FE7[0] = 0;
gSaveContext.unk_FE7[1] = 0;
gSaveContext.unk_FE7[2] = 0;
gSaveContext.unk_FE7[3] = 0;
gSaveContext.unk_FE7[4] = 0;
gSaveContext.save.bombersCaughtNum = 0;
gSaveContext.save.bombersCaughtOrder[0] = 0;
gSaveContext.save.bombersCaughtOrder[1] = 0;
gSaveContext.save.bombersCaughtOrder[2] = 0;
gSaveContext.save.bombersCaughtOrder[3] = 0;
gSaveContext.save.bombersCaughtOrder[4] = 0;
func_80BFE494(this, 3, 1.0f);
this->unk_2C8 = 9;
@@ -99,38 +99,38 @@ void EnBomjimb_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_2C6 = ENBOMJIMB_F0_0;
}
if ((gSaveContext.weekEventReg[73] & 0x10) || (gSaveContext.weekEventReg[85] & 2)) {
if ((gSaveContext.save.weekEventReg[73] & 0x10) || (gSaveContext.save.weekEventReg[85] & 2)) {
switch (this->unk_2C8) {
case ENBOMJIMB_F_0:
if (gSaveContext.weekEventReg[11] & 1) {
if (gSaveContext.save.weekEventReg[11] & 1) {
Actor_MarkForDeath(&this->actor);
return;
}
break;
case ENBOMJIMB_F_1:
if (gSaveContext.weekEventReg[11] & 2) {
if (gSaveContext.save.weekEventReg[11] & 2) {
Actor_MarkForDeath(&this->actor);
return;
}
break;
case ENBOMJIMB_F_2:
if (gSaveContext.weekEventReg[11] & 4) {
if (gSaveContext.save.weekEventReg[11] & 4) {
Actor_MarkForDeath(&this->actor);
return;
}
break;
case ENBOMJIMB_F_3:
if (gSaveContext.weekEventReg[11] & 8) {
if (gSaveContext.save.weekEventReg[11] & 8) {
Actor_MarkForDeath(&this->actor);
return;
}
break;
case ENBOMJIMB_F_4:
if (gSaveContext.weekEventReg[11] & 0x10) {
if (gSaveContext.save.weekEventReg[11] & 0x10) {
Actor_MarkForDeath(&this->actor);
return;
}
@@ -138,8 +138,8 @@ void EnBomjimb_Init(Actor* thisx, GlobalContext* globalCtx) {
}
}
if ((!(gSaveContext.weekEventReg[73] & 0x10) && !(gSaveContext.weekEventReg[85] & 2)) ||
(gSaveContext.weekEventReg[75] & 0x40)) {
if ((!(gSaveContext.save.weekEventReg[73] & 0x10) && !(gSaveContext.save.weekEventReg[85] & 2)) ||
(gSaveContext.save.weekEventReg[75] & 0x40)) {
Actor_MarkForDeath(&this->actor);
return;
}
@@ -671,8 +671,8 @@ void func_80C02740(EnBomjimb* this, GlobalContext* globalCtx) {
return;
}
if (((player->transformation == PLAYER_FORM_DEKU) && !(gSaveContext.weekEventReg[73] & 0x10)) ||
((player->transformation == PLAYER_FORM_HUMAN) && !(gSaveContext.weekEventReg[85] & 2))) {
if (((player->transformation == PLAYER_FORM_DEKU) && !(gSaveContext.save.weekEventReg[73] & 0x10)) ||
((player->transformation == PLAYER_FORM_HUMAN) && !(gSaveContext.save.weekEventReg[85] & 2))) {
func_80C0113C(this, 17, 1.0f);
Message_StartTextbox(globalCtx, 0x72E, &this->actor);
player->stateFlags1 |= 0x10000000;
@@ -683,13 +683,13 @@ void func_80C02740(EnBomjimb* this, GlobalContext* globalCtx) {
return;
}
idx = gSaveContext.unk_FE6;
idx = gSaveContext.save.bombersCaughtNum;
Message_StartTextbox(globalCtx, D_80C03230[idx], &this->actor);
idx = gSaveContext.unk_FE6;
gSaveContext.unk_FE7[idx] = this->unk_2C8 + 1;
gSaveContext.unk_FE6++;
idx = gSaveContext.save.bombersCaughtNum;
gSaveContext.save.bombersCaughtOrder[idx] = this->unk_2C8 + 1;
gSaveContext.save.bombersCaughtNum++;
if (gSaveContext.unk_FE6 > 4) {
if (gSaveContext.save.bombersCaughtNum > 4) {
func_801A3098(0x922);
} else {
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_PIECE_OF_HEART);
@@ -697,28 +697,28 @@ void func_80C02740(EnBomjimb* this, GlobalContext* globalCtx) {
switch (this->unk_2C8) {
case ENBOMJIMB_F_0:
gSaveContext.weekEventReg[76] |= 1;
gSaveContext.weekEventReg[11] |= 1;
gSaveContext.save.weekEventReg[76] |= 1;
gSaveContext.save.weekEventReg[11] |= 1;
break;
case ENBOMJIMB_F_1:
gSaveContext.weekEventReg[76] |= 2;
gSaveContext.weekEventReg[11] |= 2;
gSaveContext.save.weekEventReg[76] |= 2;
gSaveContext.save.weekEventReg[11] |= 2;
break;
case ENBOMJIMB_F_2:
gSaveContext.weekEventReg[76] |= 4;
gSaveContext.weekEventReg[11] |= 4;
gSaveContext.save.weekEventReg[76] |= 4;
gSaveContext.save.weekEventReg[11] |= 4;
break;
case ENBOMJIMB_F_3:
gSaveContext.weekEventReg[76] |= 8;
gSaveContext.weekEventReg[11] |= 8;
gSaveContext.save.weekEventReg[76] |= 8;
gSaveContext.save.weekEventReg[11] |= 8;
break;
case ENBOMJIMB_F_4:
gSaveContext.weekEventReg[76] |= 0x10;
gSaveContext.weekEventReg[11] |= 0x10;
gSaveContext.save.weekEventReg[76] |= 0x10;
gSaveContext.save.weekEventReg[11] |= 0x10;
break;
}
@@ -760,7 +760,7 @@ void func_80C02A14(EnBomjimb* this, GlobalContext* globalCtx) {
if ((Message_GetState(&globalCtx->msgCtx) == 5) && Message_ShouldAdvance(globalCtx)) {
func_801477B4(globalCtx);
if ((this->unk_2CA == 8) && (gSaveContext.unk_FE6 >= 5)) {
if ((this->unk_2CA == 8) && (gSaveContext.save.bombersCaughtNum >= 5)) {
func_80C02CA4(this, globalCtx);
} else {
if (this->unk_2CA == 8) {
@@ -800,8 +800,8 @@ void func_80C02CA4(EnBomjimb* this, GlobalContext* globalCtx) {
globalCtx->unk_1887F = 0x56;
gSaveContext.nextTransition = 3;
}
gSaveContext.weekEventReg[75] |= 0x40;
gSaveContext.weekEventReg[83] |= 4;
gSaveContext.save.weekEventReg[75] |= 0x40;
gSaveContext.save.weekEventReg[83] |= 4;
this->actionFunc = func_80C02DAC;
}
+5 -5
View File
@@ -61,7 +61,7 @@ void EnCha_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.home.rot.z = 0;
this->actionFunc = EnCha_Idle;
this->actor.home.rot.x = this->actor.home.rot.z;
gSaveContext.weekEventReg[60] &= (u8)~4;
gSaveContext.save.weekEventReg[60] &= (u8)~4;
}
void EnCha_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@@ -83,16 +83,16 @@ void EnCha_Ring(EnCha* this, GlobalContext* globalCtx) {
}
void EnCha_Idle(EnCha* this, GlobalContext* globalCtx) {
if (gSaveContext.weekEventReg[60] & 4) {
if (gSaveContext.save.weekEventReg[60] & 4) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DOOR_BELL);
gSaveContext.weekEventReg[60] &= (u8)~4;
gSaveContext.save.weekEventReg[60] &= (u8)~4;
this->actor.home.rot.z = 0x7D0;
}
if (this->collider.base.acFlags & AC_HIT) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DOOR_BELL);
this->actor.home.rot.z = 0x7D0;
if (!(gSaveContext.weekEventReg[51] & 4)) {
gSaveContext.weekEventReg[51] |= 4;
if (!(gSaveContext.save.weekEventReg[51] & 4)) {
gSaveContext.save.weekEventReg[51] |= 4;
this->actionFunc = EnCha_Ring;
}
}
@@ -94,7 +94,7 @@ void EnColMan_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void func_80AFDD60(EnColMan* this) {
if (!(gSaveContext.weekEventReg[56] & 2)) {
if (!(gSaveContext.save.weekEventReg[56] & 2)) {
this->actor.draw = func_80AFE414;
this->actor.shape.yOffset = 700.0f;
if (this->actor.params == EN_COL_MAN_HEART_PIECE) {
@@ -123,14 +123,14 @@ void func_80AFDE00(EnColMan* this, GlobalContext* globalCtx) {
this->actor.speedXZ = 0.0f;
}
}
if (!(gSaveContext.weekEventReg[56] & 2)) {
if (!(gSaveContext.save.weekEventReg[56] & 2)) {
this->actor.shape.rot.y += 0x3E8;
}
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
this->actor.draw = NULL;
this->actionFunc = EnColMan_SetHeartPieceCollectedAndKill;
} else if (!(gSaveContext.weekEventReg[56] & 2)) {
} else if (!(gSaveContext.save.weekEventReg[56] & 2)) {
Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 40.0f, 40.0f);
} else {
Actor_PickUp(&this->actor, globalCtx, GI_RECOVERY_HEART, 40.0f, 40.0f);
@@ -139,7 +139,7 @@ void func_80AFDE00(EnColMan* this, GlobalContext* globalCtx) {
void EnColMan_SetHeartPieceCollectedAndKill(EnColMan* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == 6 && Message_ShouldAdvance(globalCtx)) {
gSaveContext.weekEventReg[56] |= 2;
gSaveContext.save.weekEventReg[56] |= 2;
Actor_MarkForDeath(&this->actor);
}
}
+5 -5
View File
@@ -116,7 +116,7 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc = EnCow_Idle;
if (!(gSaveContext.weekEventReg[22] & 1) && (CURRENT_DAY != 1) &&
if (!(gSaveContext.save.weekEventReg[22] & 1) && (CURRENT_DAY != 1) &&
(EN_COW_TYPE(thisx) == EN_COW_TYPE_ABDUCTED)) {
Actor_MarkForDeath(&this->actor);
return;
@@ -153,7 +153,7 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 0.01f);
this->flags = 0;
gSaveContext.weekEventReg[87] &= (u8)~1;
gSaveContext.save.weekEventReg[87] &= (u8)~1;
}
void EnCow_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@@ -289,8 +289,8 @@ void EnCow_Idle(EnCow* this, GlobalContext* globalCtx) {
if (this->actor.xzDistToPlayer < 150.0f &&
ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 25000) {
if (func_801A5100() == 4) {
if (!(gSaveContext.weekEventReg[87] & 1)) {
gSaveContext.weekEventReg[87] |= 1;
if (!(gSaveContext.save.weekEventReg[87] & 1)) {
gSaveContext.save.weekEventReg[87] |= 1;
if (Interface_HasEmptyBottle()) {
this->actor.textId = 0x32C9; // Text to give milk.
} else {
@@ -301,7 +301,7 @@ void EnCow_Idle(EnCow* this, GlobalContext* globalCtx) {
this->actionFunc = EnCow_Talk;
}
} else {
gSaveContext.weekEventReg[87] &= (u8)~1;
gSaveContext.save.weekEventReg[87] &= (u8)~1;
}
}
+4 -4
View File
@@ -179,7 +179,7 @@ s32 func_80B3E69C(EnDai* this, GlobalContext* globalCtx) {
s32 ret = false;
if ((globalCtx->csCtx.state != 0) && (globalCtx->sceneNum == SCENE_12HAKUGINMAE) &&
(globalCtx->csCtx.currentCsIndex == 0) && !(gSaveContext.weekEventReg[30] & 1)) {
(globalCtx->csCtx.currentCsIndex == 0) && !(gSaveContext.save.weekEventReg[30] & 1)) {
if (!(this->unk_1CE & 0x10)) {
Flags_SetSwitch(globalCtx, 20);
this->unk_1CE |= (0x80 | 0x10);
@@ -194,7 +194,7 @@ s32 func_80B3E69C(EnDai* this, GlobalContext* globalCtx) {
} else if (this->unk_1CE & 0x10) {
this->unk_1CE &= ~0x10;
this->unk_1CE |= 0x200;
gSaveContext.weekEventReg[30] |= 1;
gSaveContext.save.weekEventReg[30] |= 1;
this->actionFunc = func_80B3F00C;
}
@@ -525,7 +525,7 @@ void EnDai_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_1CE = 0;
this->unk_1D6 = 0;
if (gSaveContext.weekEventReg[33] & 0x80) {
if (gSaveContext.save.weekEventReg[33] & 0x80) {
SubS_UpdateFlags(&this->unk_1CE, 3, 7);
this->unk_1CE |= 0x80;
this->unk_1CD = 0xFF;
@@ -533,7 +533,7 @@ void EnDai_Init(Actor* thisx, GlobalContext* globalCtx) {
return;
}
if (gSaveContext.weekEventReg[30] & 1) {
if (gSaveContext.save.weekEventReg[30] & 1) {
Actor_MarkForDeath(&this->actor);
return;
}
@@ -77,10 +77,11 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) {
this->collider.dim.height = 60;
this->collider.dim.yShift = 0;
this->actor.flags |= ACTOR_FLAG_8000000;
if ((gSaveContext.weekEventReg[63] & 0x80) || ((gSaveContext.day == 3) && gSaveContext.isNight)) {
if ((gSaveContext.save.weekEventReg[63] & 0x80) ||
((gSaveContext.save.day == 3) && gSaveContext.save.isNight)) {
Actor_MarkForDeath(&this->actor);
}
} else if ((gSaveContext.day == 3) && gSaveContext.isNight) {
} else if ((gSaveContext.save.day == 3) && gSaveContext.save.isNight) {
Actor_MarkForDeath(&this->actor);
}
@@ -140,7 +141,7 @@ void func_809437C8(EnDaiku* this) {
}
void func_80943820(EnDaiku* this) {
s32 day = gSaveContext.day - 1;
s32 day = gSaveContext.save.day - 1;
switch (this->unk_278) {
case 0:
@@ -167,7 +168,7 @@ void func_80943820(EnDaiku* this) {
void func_809438F8(EnDaiku* this, GlobalContext* globalCtx) {
f32 currentFrame = this->skelAnime.curFrame;
s32 pad;
s32 day = gSaveContext.day - 1;
s32 day = gSaveContext.save.day - 1;
s32 pad2;
if (Player_GetMask(globalCtx) == PLAYER_MASK_KAFEIS_MASK) {
@@ -255,7 +256,7 @@ void EnDaiku_Update(Actor* thisx, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
}
if ((this->unk_278 == ENDAIKU_PARAMS_FF_0) && (gSaveContext.day == 3) && (gSaveContext.isNight)) {
if ((this->unk_278 == ENDAIKU_PARAMS_FF_0) && (gSaveContext.save.day == 3) && (gSaveContext.save.isNight)) {
Actor_MarkForDeath(&this->actor);
return;
}
@@ -78,7 +78,7 @@ void func_80BE61D0(EnDaiku2* this) {
void EnDaiku2_Init(Actor* thisx, GlobalContext* globalCtx) {
EnDaiku2* this = THIS;
s32 day = gSaveContext.day;
s32 day = gSaveContext.save.day;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f);
@@ -163,10 +163,10 @@ s32 func_80BE64C0(EnDaiku2* this, GlobalContext* globalCtx) {
}
void func_80BE65B4(EnDaiku2* this, GlobalContext* globalCtx) {
switch (gSaveContext.day - 1) {
switch (gSaveContext.save.day - 1) {
case 0:
this->unk_28A = 0;
if (gSaveContext.weekEventReg[64] & 2) {
if (gSaveContext.save.weekEventReg[64] & 2) {
this->unk_28A = 6;
}
func_80BE6408(this, 8);
@@ -174,7 +174,7 @@ void func_80BE65B4(EnDaiku2* this, GlobalContext* globalCtx) {
case 1:
this->unk_28A = 2;
if (gSaveContext.weekEventReg[64] & 4) {
if (gSaveContext.save.weekEventReg[64] & 4) {
this->unk_28A = 7;
}
func_80BE6408(this, 8);
@@ -201,7 +201,7 @@ void func_80BE65B4(EnDaiku2* this, GlobalContext* globalCtx) {
void func_80BE66E4(EnDaiku2* this, GlobalContext* globalCtx) {
f32 sp9C = this->skelAnime.curFrame;
s32 sp98 = gSaveContext.day - 1;
s32 sp98 = gSaveContext.save.day - 1;
s32 i;
Vec3f sp88;
Vec3f sp7C;
@@ -279,7 +279,7 @@ void func_80BE66E4(EnDaiku2* this, GlobalContext* globalCtx) {
}
void func_80BE6B40(EnDaiku2* this, GlobalContext* globalCtx) {
s32 day = gSaveContext.day;
s32 day = gSaveContext.save.day;
this->unk_288 = 1;
if ((day != 3) && Flags_GetSwitch(globalCtx, this->unk_278)) {
@@ -293,7 +293,7 @@ void func_80BE6B40(EnDaiku2* this, GlobalContext* globalCtx) {
void func_80BE6BC0(EnDaiku2* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 0x0);
if ((Message_GetState(&globalCtx->msgCtx) == 5) && Message_ShouldAdvance(globalCtx)) {
s32 day = gSaveContext.day - 1;
s32 day = gSaveContext.save.day - 1;
func_801477B4(globalCtx);
@@ -307,11 +307,11 @@ void func_80BE6BC0(EnDaiku2* this, GlobalContext* globalCtx) {
} else {
switch (day) {
case 0:
gSaveContext.weekEventReg[64] |= 2;
gSaveContext.save.weekEventReg[64] |= 2;
break;
case 1:
gSaveContext.weekEventReg[64] |= 4;
gSaveContext.save.weekEventReg[64] |= 4;
break;
}
func_80BE65B4(this, globalCtx);
+3 -2
View File
@@ -348,10 +348,11 @@ void func_80989BF8(EnDg* this) {
if (this->unk_286 < 14) {
if (this->unk_286 % 2) {
D_8098C2A8[this->unk_286].unk_04 =
0x3538 + ((gSaveContext.weekEventReg[42 + (this->unk_286 / 2)] & (0x10 | 0x20 | 0x40 | 0x80)) >> 4);
0x3538 +
((gSaveContext.save.weekEventReg[42 + (this->unk_286 / 2)] & (0x10 | 0x20 | 0x40 | 0x80)) >> 4);
} else {
D_8098C2A8[this->unk_286].unk_04 =
0x3538 + (gSaveContext.weekEventReg[42 + (this->unk_286 / 2)] & (1 | 2 | 4 | 8));
0x3538 + (gSaveContext.save.weekEventReg[42 + (this->unk_286 / 2)] & (1 | 2 | 4 | 8));
}
} else {
Actor_MarkForDeath(&this->actor);
@@ -450,7 +450,7 @@ s32 func_8089AE00(EnDinofos* this, GlobalContext* globalCtx) {
return true;
}
if ((gSaveContext.playerForm == PLAYER_FORM_GORON) && (player->actor.velocity.y < -5.0f) &&
if ((gSaveContext.save.playerForm == PLAYER_FORM_GORON) && (player->actor.velocity.y < -5.0f) &&
(player->unk_AE7 == 1) && (this->unk_28B == 0)) {
this->unk_28B = 1;
for (i = 0; i < ARRAY_COUNT(this->colliderJntSphElement) - 3; i++) {
+8 -8
View File
@@ -211,7 +211,7 @@ void EnDno_Init(Actor* thisx, GlobalContext* globalCtx) {
switch (ENDNO_GET_C000(thisx)) {
case ENDNO_GET_C000_0:
func_80A71788(this, globalCtx);
if (!(gSaveContext.weekEventReg[23] & 0x20) || (gSaveContext.weekEventReg[93] & 2)) {
if (!(gSaveContext.save.weekEventReg[23] & 0x20) || (gSaveContext.save.weekEventReg[93] & 2)) {
Actor_MarkForDeath(thisx);
} else {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 14, &this->unk_32C);
@@ -225,7 +225,7 @@ void EnDno_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
case ENDNO_GET_C000_1:
if (gSaveContext.weekEventReg[23] & 0x20) {
if (gSaveContext.save.weekEventReg[23] & 0x20) {
Actor_MarkForDeath(thisx);
} else {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C);
@@ -267,7 +267,7 @@ void func_80A71B68(EnDno* this, GlobalContext* globalCtx) {
this->unk_452 = 0;
this->actor.textId = 0;
if (CHECK_QUEST_ITEM(QUEST_SONG_SONATA)) {
if (gSaveContext.weekEventReg[27] & 1) {
if (gSaveContext.save.weekEventReg[27] & 1) {
if (!(this->unk_3B0 & 0x20)) {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 6, &this->unk_32C);
this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->unk_460);
@@ -331,17 +331,17 @@ void func_80A71C3C(EnDno* this, GlobalContext* globalCtx) {
void func_80A71E54(EnDno* this, GlobalContext* globalCtx) {
if (CHECK_QUEST_ITEM(QUEST_SONG_SONATA)) {
if (gSaveContext.weekEventReg[27] & 1) {
if (gSaveContext.save.weekEventReg[27] & 1) {
this->textId = 0x811;
} else {
this->textId = 0x80F;
gSaveContext.weekEventReg[27] |= 1;
gSaveContext.save.weekEventReg[27] |= 1;
}
} else if (gSaveContext.weekEventReg[26] & 0x80) {
} else if (gSaveContext.save.weekEventReg[26] & 0x80) {
this->textId = 0x80B;
} else {
this->textId = 0x80C;
gSaveContext.weekEventReg[26] |= 0x80;
gSaveContext.save.weekEventReg[26] |= 0x80;
}
if (this->textId != 0x811) {
@@ -558,7 +558,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) {
case 2:
if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x2D8)) {
gSaveContext.weekEventReg[93] |= 2;
gSaveContext.save.weekEventReg[93] |= 2;
Message_StartTextbox(globalCtx, 0x802, &this->actor);
}
break;
+8 -8
View File
@@ -206,7 +206,7 @@ s32 func_80B3CF60(EnDnp* this, GlobalContext* globalCtx) {
this->unk_322 |= 8;
this->actionFunc = func_80B3D3F8;
ret = true;
} else if (!(gSaveContext.weekEventReg[23] & 0x20) && Actor_HasParent(&this->actor, globalCtx)) {
} else if (!(gSaveContext.save.weekEventReg[23] & 0x20) && Actor_HasParent(&this->actor, globalCtx)) {
SubS_UpdateFlags(&this->unk_322, 0, 7);
this->unk_322 &= ~0x500;
this->actor.parent = NULL;
@@ -247,10 +247,10 @@ void func_80B3D11C(EnDnp* this, GlobalContext* globalCtx) {
s32 temp_v0;
s32 val;
if (!(gSaveContext.weekEventReg[29] & 0x40) && (globalCtx->sceneNum == SCENE_MITURIN) &&
if (!(gSaveContext.save.weekEventReg[29] & 0x40) && (globalCtx->sceneNum == SCENE_MITURIN) &&
(globalCtx->csCtx.currentCsIndex == 0)) {
this->unk_322 |= 0x20;
gSaveContext.weekEventReg[29] |= 0x40;
gSaveContext.save.weekEventReg[29] |= 0x40;
}
if (Cutscene_CheckActorAction(globalCtx, 101)) {
@@ -337,7 +337,7 @@ void func_80B3D47C(EnDnp* this, GlobalContext* globalCtx) {
void func_80B3D558(EnDnp* this, GlobalContext* globalCtx) {
if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor);
gSaveContext.weekEventReg[23] |= 0x20;
gSaveContext.save.weekEventReg[23] |= 0x20;
} else {
ActorCutscene_SetIntentToPlay(this->actor.cutscene);
}
@@ -366,12 +366,12 @@ void EnDnp_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.cutscene = 0x10;
this->actionFunc = func_80B3D47C;
} else if (((ENDNP_GET_7(&this->actor) == ENDNP_GET_7_0) && !Interface_HasItemInBottle(ITEM_DEKU_PRINCESS) &&
!(gSaveContext.weekEventReg[23] & 0x20)) ||
((ENDNP_GET_7(&this->actor) == ENDNP_GET_7_2) && (gSaveContext.weekEventReg[23] & 0x20))) {
!(gSaveContext.save.weekEventReg[23] & 0x20)) ||
((ENDNP_GET_7(&this->actor) == ENDNP_GET_7_2) && (gSaveContext.save.weekEventReg[23] & 0x20))) {
Actor_SetScale(&this->actor, 0.0085f);
SubS_UpdateFlags(&this->unk_322, 3, 7);
this->unk_322 |= 0x400;
if ((globalCtx->sceneNum == SCENE_MITURIN) && (gSaveContext.weekEventReg[29] & 0x40)) {
if ((globalCtx->sceneNum == SCENE_MITURIN) && (gSaveContext.save.weekEventReg[29] & 0x40)) {
this->unk_322 |= 0x20;
func_80B3CC38(this, 1);
}
@@ -407,7 +407,7 @@ void EnDnp_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4);
sp2C = this->collider.dim.radius + 50;
sp28 = this->collider.dim.height + 30;
if ((this->unk_322 & 0x400) && !(gSaveContext.weekEventReg[23] & 0x20)) {
if ((this->unk_322 & 0x400) && !(gSaveContext.save.weekEventReg[23] & 0x20)) {
Actor_PickUp(&this->actor, globalCtx, GI_MAX, sp2C, sp28);
}
func_8013C964(&this->actor, globalCtx, sp2C, sp28, 0, this->unk_322 & 7);
+5 -5
View File
@@ -306,7 +306,7 @@ void func_80A52C6C(EnDnq* this, GlobalContext* globalCtx) {
}
s32* func_80A52CF8(EnDnq* this, GlobalContext* globalCtx) {
if (gSaveContext.weekEventReg[23] & 0x20) {
if (gSaveContext.save.weekEventReg[23] & 0x20) {
return &D_80A53400[14];
}
@@ -340,11 +340,11 @@ void func_80A52DC8(EnDnq* this, GlobalContext* globalCtx) {
SubS_UpdateFlags(&this->unk_37C, 0, 7);
}
if (!(gSaveContext.weekEventReg[23] & 0x20)) {
if (!(gSaveContext.save.weekEventReg[23] & 0x20)) {
this->unk_390 = 70.0f;
if (Interface_HasItemInBottle(ITEM_DEKU_PRINCESS) && !func_801690CC(globalCtx) &&
(Message_GetState(&globalCtx->msgCtx) == 0) && (ActorCutscene_GetCurrentIndex() == -1)) {
if ((DECR(this->unk_384) == 0) && (gSaveContext.weekEventReg[29] & 0x40)) {
if ((DECR(this->unk_384) == 0) && (gSaveContext.save.weekEventReg[29] & 0x40)) {
Message_StartTextbox(globalCtx, 0x969, NULL);
this->unk_384 = 200;
}
@@ -358,7 +358,7 @@ void func_80A52DC8(EnDnq* this, GlobalContext* globalCtx) {
this->actor.xzDistToPlayer = this->unk_394;
if (gSaveContext.weekEventReg[83] & 8) {
if (gSaveContext.save.weekEventReg[83] & 8) {
func_80A52A78(this, globalCtx);
} else if (this->unk_3A4 == 0) {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 3, 0x2AA8);
@@ -427,7 +427,7 @@ void EnDnq_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_386 = 0;
this->unk_37C = 0;
SubS_UpdateFlags(&this->unk_37C, 3, 7);
if (gSaveContext.weekEventReg[9] & 0x80) {
if (gSaveContext.save.weekEventReg[9] & 0x80) {
this->unk_3A4 = 1;
} else {
this->unk_3A4 = 0;
+7 -6
View File
@@ -182,7 +182,7 @@ void func_8092C934(EnDns* this) {
s32* func_8092C9BC(EnDns* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (!(gSaveContext.weekEventReg[23] & 0x20)) {
if (!(gSaveContext.save.weekEventReg[23] & 0x20)) {
if (player->transformation != PLAYER_FORM_DEKU) {
return &D_8092DCB0[16];
} else if (this->unk_2FC != 0) {
@@ -361,14 +361,14 @@ s32 func_8092D068(EnDns* this) {
s32 ret = false;
if (ENDNS_GET_8000(&this->actor)) {
if (gSaveContext.weekEventReg[23] & 0x20) {
if (gSaveContext.save.weekEventReg[23] & 0x20) {
ret = true;
}
} else if (ENDNS_GET_4000(&this->actor)) {
if ((gSaveContext.weekEventReg[9] & 0x80) && !(gSaveContext.weekEventReg[23] & 0x20)) {
if ((gSaveContext.save.weekEventReg[9] & 0x80) && !(gSaveContext.save.weekEventReg[23] & 0x20)) {
ret = true;
}
} else if (!(gSaveContext.weekEventReg[9] & 0x80) && !(gSaveContext.weekEventReg[23] & 0x20)) {
} else if (!(gSaveContext.save.weekEventReg[9] & 0x80) && !(gSaveContext.save.weekEventReg[23] & 0x20)) {
ret = true;
}
@@ -399,7 +399,8 @@ void func_8092D1B8(EnDns* this, GlobalContext* globalCtx) {
}
if (!ENDNS_GET_4000(&this->actor) || (this->unk_2D2 != 0)) {
if (!(gSaveContext.weekEventReg[23] & 0x20) && !(gSaveContext.eventInf[1] & 0x20) && func_8092CC68(globalCtx)) {
if (!(gSaveContext.save.weekEventReg[23] & 0x20) && !(gSaveContext.eventInf[1] & 0x20) &&
func_8092CC68(globalCtx)) {
player->stateFlags1 |= 0x20;
this->unk_2C6 |= 0x100;
SubS_UpdateFlags(&this->unk_2C6, 4, 7);
@@ -524,7 +525,7 @@ void EnDns_Init(Actor* thisx, GlobalContext* globalCtx) {
SubS_UpdateFlags(&this->unk_2C6, 3, 7);
this->unk_2C6 |= (0x40 | 0x10);
this->unk_2C6 |= 0x200;
if (gSaveContext.weekEventReg[9] & 0x80) {
if (gSaveContext.save.weekEventReg[9] & 0x80) {
this->unk_2FC = 1;
} else {
this->unk_2FC = 0;
+2 -2
View File
@@ -346,7 +346,7 @@ void func_80866B20(EnDoor* this, GlobalContext* globalCtx) {
Animation_PlayOnceSetSpeed(&this->skelAnime, sAnimations[this->animIndex],
(player->stateFlags1 & 0x8000000) ? 0.75f : 1.5f);
if (this->unk_1A6 != 0) {
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--;
gSaveContext.save.inventory.dungeonKeys[gSaveContext.mapIndex]--;
Flags_SetSwitch(globalCtx, this->switchFlag);
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
}
@@ -366,7 +366,7 @@ void func_80866B20(EnDoor* this, GlobalContext* globalCtx) {
player->doorDirection = playerPosRelToDoor.z >= 0.0f ? 1.0f : -1.0f;
player->doorActor = &this->dyna.actor;
if (this->unk_1A6 != 0) {
if (gSaveContext.inventory.dungeonKeys[((void)0, gSaveContext.mapIndex)] <= 0) {
if (gSaveContext.save.inventory.dungeonKeys[((void)0, gSaveContext.mapIndex)] <= 0) {
player->doorType = -1;
this->dyna.actor.textId = 0x1802;
} else {
+1 -1
View File
@@ -108,7 +108,7 @@ void EnDrs_PostLimbDraw(GlobalContext* globalCtx2, s32 limbIndex, Gfx** dList, V
// Anju removes the Moon Mask at the start of the Couple's Mask cutscene
// after that it will no longer be rendered.
if (!(gSaveContext.weekEventReg[87] & 2) && (limbIndex == WEDDING_DRESS_MANNEQUIN_LIMB_MASK)) {
if (!(gSaveContext.save.weekEventReg[87] & 2) && (limbIndex == WEDDING_DRESS_MANNEQUIN_LIMB_MASK)) {
OPEN_DISPS(globalCtx->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[temp].segment);
gSPDisplayList(POLY_OPA_DISP++, &gMoonMaskDL);
+13 -12
View File
@@ -355,8 +355,8 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx2) {
this->elfMsg = NULL;
this->unk_234 = NULL;
this->unk_269 = 20;
if ((gSaveContext.tatlTimer >= 25800) || (gSaveContext.tatlTimer < 3000)) {
gSaveContext.tatlTimer = 0;
if ((gSaveContext.save.playerData.tatlTimer >= 25800) || (gSaveContext.save.playerData.tatlTimer < 3000)) {
gSaveContext.save.playerData.tatlTimer = 0;
}
this->unk_266 = ElfMessage_GetFirstCycleHint(globalCtx);
break;
@@ -675,7 +675,8 @@ void func_8088DD34(EnElf* this, GlobalContext* globalCtx) {
!func_8088C804(&this->actor.world.pos, &refActor->actor.world.pos, 10.0f)) {
func_80115908(globalCtx, 0x80);
if (this->fairyFlags & 0x200) {
Parameter_AddMagic(globalCtx, ((void)0, gSaveContext.unk_3F30) + (gSaveContext.doubleMagic * 0x30) + 0x30);
Parameter_AddMagic(globalCtx, ((void)0, gSaveContext.unk_3F30) +
(gSaveContext.save.playerData.doubleMagic * 0x30) + 0x30);
}
gSaveContext.jinxTimer = 0;
this->unk_254 = 50.0f;
@@ -1414,10 +1415,10 @@ void func_8088FE64(Actor* thisx, GlobalContext* globalCtx2) {
break;
case 3:
if (!gSaveContext.isNight) {
if (!gSaveContext.save.isNight) {
func_80151938(globalCtx, 0x248);
} else if ((gSaveContext.time < CLOCK_TIME(6, 0)) &&
(gSaveContext.weekEventReg[74] & 0x20)) {
} else if ((gSaveContext.save.time < CLOCK_TIME(6, 0)) &&
(gSaveContext.save.weekEventReg[74] & 0x20)) {
func_80151938(globalCtx, 0x225);
} else {
func_80151938(globalCtx, 0x249);
@@ -1454,11 +1455,11 @@ void func_8089010C(Actor* thisx, GlobalContext* globalCtx) {
if (temp_v0 != this->unk_266) {
this->unk_266 = temp_v0;
gSaveContext.tatlTimer = 0;
gSaveContext.save.playerData.tatlTimer = 0;
}
if ((player->tatlTextId == 0) && (player->unk_730 == NULL)) {
if ((gSaveContext.tatlTimer >= 600) && (gSaveContext.tatlTimer <= 3000)) {
if ((gSaveContext.save.playerData.tatlTimer >= 600) && (gSaveContext.save.playerData.tatlTimer <= 3000)) {
player->tatlTextId = ElfMessage_GetFirstCycleHint(globalCtx);
}
}
@@ -1473,7 +1474,7 @@ void func_8089010C(Actor* thisx, GlobalContext* globalCtx) {
if (thisx->textId == ElfMessage_GetFirstCycleHint(globalCtx)) {
this->fairyFlags |= 0x80;
gSaveContext.tatlTimer = 3001;
gSaveContext.save.playerData.tatlTimer = 3001;
}
this->fairyFlags |= 0x10;
@@ -1504,10 +1505,10 @@ void func_8089010C(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
if (!func_801690CC(globalCtx)) {
if (gSaveContext.tatlTimer < 25800) {
gSaveContext.tatlTimer++;
if (gSaveContext.save.playerData.tatlTimer < 25800) {
gSaveContext.save.playerData.tatlTimer++;
} else if (!(this->fairyFlags & 0x80)) {
gSaveContext.tatlTimer = 0;
gSaveContext.save.playerData.tatlTimer = 0;
}
}
}
+21 -20
View File
@@ -91,7 +91,7 @@ void EnElfgrp_Init(Actor* thisx, GlobalContext* globalCtx) {
switch (this->unk_147) {
case ENELFGRP_1:
if (gSaveContext.weekEventReg[23] & 2) {
if (gSaveContext.save.weekEventReg[23] & 2) {
func_80A396B0(this, 1);
} else {
this->unk_14A |= 4;
@@ -99,13 +99,13 @@ void EnElfgrp_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
case ENELFGRP_2:
if (gSaveContext.doubleMagic == true) {
if (gSaveContext.save.playerData.doubleMagic == true) {
func_80A396B0(this, 1);
}
break;
case ENELFGRP_3:
if (gSaveContext.doubleDefense) {
if (gSaveContext.save.playerData.doubleDefense) {
func_80A396B0(this, 1);
}
break;
@@ -123,7 +123,7 @@ void EnElfgrp_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.textId = (this->unk_147 * 3) + 0x581;
} else {
this->actionFunc = func_80A3A8F8;
if ((gSaveContext.weekEventReg[9] & this->unk_146)) {
if ((gSaveContext.save.weekEventReg[9] & this->unk_146)) {
this->actor.textId = (this->unk_147 * 3) + 0x580;
} else {
this->actor.textId = (this->unk_147 * 3) + 0x57F;
@@ -146,7 +146,7 @@ void EnElfgrp_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_14A |= 2;
func_80A396B0(this, 6);
}
} else if ((gSaveContext.weekEventReg[8] & 0x80)) {
} else if ((gSaveContext.save.weekEventReg[8] & 0x80)) {
func_80A39DC8(this, globalCtx, 24, 0);
this->actionFunc = func_80A3A398;
if (INV_CONTENT(ITEM_MASK_DEKU) == ITEM_MASK_DEKU) {
@@ -156,13 +156,13 @@ void EnElfgrp_Init(Actor* thisx, GlobalContext* globalCtx) {
func_80A396B0(this, 3);
this->unk_14A |= 2;
}
} else if (gSaveContext.magicAcquired == true) {
} else if (gSaveContext.save.playerData.magicAcquired == true) {
func_80A396B0(this, 1);
}
} else {
func_80A39DC8(this, globalCtx, 24, 0);
this->actionFunc = func_80A3A8F8;
if ((gSaveContext.weekEventReg[9] & this->unk_146)) {
if ((gSaveContext.save.weekEventReg[9] & this->unk_146)) {
this->actor.textId = 0x580;
} else {
this->actor.textId = 0x578;
@@ -183,7 +183,7 @@ s32 func_80A39BD0(GlobalContext* globalCtx, s32 arg2) {
return 0;
}
sp1F = gSaveContext.inventory.strayFairies[arg2 - 1];
sp1F = gSaveContext.save.inventory.strayFairies[arg2 - 1];
return (sp1F - func_80A39C1C(globalCtx, arg2)) + 10;
}
@@ -208,13 +208,13 @@ s32 func_80A39C1C(GlobalContext* globalCtx, s32 arg1) {
}
if (arg1 == 0) {
if (gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 1) {
if (gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 1) {
return 25;
}
return 24;
}
temp_v1 = (gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 >> (((arg1 - 1) * 5) + 1)) & 0x1F;
temp_v1 = (gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 >> (((arg1 - 1) * 5) + 1)) & 0x1F;
if (temp_v1 < 10) {
temp_v1 = 10;
} else if (temp_v1 > 25) {
@@ -230,13 +230,13 @@ void func_80A39CD4(GlobalContext* globalCtx, s32 arg1, s32 arg2) {
if (arg1 == 0) {
if (arg2 == 25) {
gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 |= 1;
gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 |= 1;
} else {
gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 &= ~1;
gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 &= ~1;
}
} else {
gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 &= ~(0x1F << ((arg1 * 5) - 4));
gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 |= arg2 << ((arg1 * 5) - 4);
gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 &= ~(0x1F << ((arg1 * 5) - 4));
gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 |= arg2 << ((arg1 * 5) - 4);
}
}
@@ -425,7 +425,7 @@ void func_80A3A398(EnElfgrp* this, GlobalContext* globalCtx) {
}
if ((this->unk_14A & 4) != 0) {
gSaveContext.weekEventReg[23] |= 2;
gSaveContext.save.weekEventReg[23] |= 2;
}
if (this->unk_14A & 0x10) {
@@ -481,7 +481,8 @@ void func_80A3A610(EnElfgrp* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (this->unk_144 == 60) {
Parameter_AddMagic(globalCtx, ((void)0, gSaveContext.unk_3F30) + (gSaveContext.doubleMagic * 0x30) + 0x30);
Parameter_AddMagic(globalCtx,
((void)0, gSaveContext.unk_3F30) + (gSaveContext.save.playerData.doubleMagic * 0x30) + 0x30);
gSaveContext.healthAccumulator = 320;
}
@@ -526,7 +527,7 @@ void func_80A3A7FC(EnElfgrp* this, GlobalContext* globalCtx) {
s32 temp_s0;
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
gSaveContext.weekEventReg[9] |= this->unk_146;
gSaveContext.save.weekEventReg[9] |= this->unk_146;
this->actionFunc = func_80A3A6F4;
temp_s0 = func_80A39BD0(globalCtx, this->unk_147);
func_80A39DC8(this, globalCtx, temp_s0, 1);
@@ -546,7 +547,7 @@ void func_80A3A8F8(EnElfgrp* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
gSaveContext.weekEventReg[9] |= this->unk_146;
gSaveContext.save.weekEventReg[9] |= this->unk_146;
this->actionFunc = func_80A3A6F4;
return;
}
@@ -559,13 +560,13 @@ void func_80A3A8F8(EnElfgrp* this, GlobalContext* globalCtx) {
}
if (this->actor.xzDistToPlayer < 30.0f) {
if (gSaveContext.playerForm == PLAYER_FORM_DEKU) {
if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
this->actor.flags &= ~ACTOR_FLAG_10000;
player->actor.freezeTimer = 100;
player->stateFlags1 |= 0x20000000;
Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
this->actionFunc = func_80A3A77C;
gSaveContext.weekEventReg[9] |= this->unk_146;
gSaveContext.save.weekEventReg[9] |= this->unk_146;
} else {
this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 100.0f);
@@ -81,7 +81,7 @@ void EnElforg_Init(Actor* thisx, GlobalContext* globalCtx) {
switch (STRAY_FAIRY_TYPE(&this->actor)) {
case STRAY_FAIRY_TYPE_CLOCK_TOWN:
if (gSaveContext.weekEventReg[8] & 0x80) {
if (gSaveContext.save.weekEventReg[8] & 0x80) {
Actor_MarkForDeath(&this->actor);
return;
}
@@ -364,7 +364,7 @@ void EnElforg_CirclePlayer(EnElforg* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
f32 distanceFromPlayer;
if (gSaveContext.playerForm == PLAYER_FORM_GORON) {
if (gSaveContext.save.playerForm == PLAYER_FORM_GORON) {
distanceFromPlayer = 40.0f;
} else {
distanceFromPlayer = 20.0f;
@@ -407,7 +407,7 @@ void EnElforg_ClockTownFairyCollected(EnElforg* this, GlobalContext* globalCtx)
player->actor.freezeTimer = 0;
player->stateFlags1 &= ~0x20000000;
Actor_MarkForDeath(&this->actor);
gSaveContext.weekEventReg[8] |= 0x80;
gSaveContext.save.weekEventReg[8] |= 0x80;
ActorCutscene_Stop(0x7C);
} else {
func_800B9010(&this->actor, NA_SE_PL_CHIBI_FAIRY_HEAL - SFX_FLAG);
@@ -463,9 +463,9 @@ void EnElforg_FreeFloating(EnElforg* this, GlobalContext* globalCtx) {
}
if (func_8010A074(globalCtx)) {
gSaveContext.inventory.strayFairies[gSaveContext.unk_48C8]++;
gSaveContext.save.inventory.strayFairies[gSaveContext.unk_48C8]++;
Message_StartTextbox(globalCtx, 0x11, NULL);
if (gSaveContext.inventory.strayFairies[(void)0, gSaveContext.unk_48C8] >= 15) {
if (gSaveContext.save.inventory.strayFairies[(void)0, gSaveContext.unk_48C8] >= 15) {
func_801A3098(NA_BGM_GET_ITEM | 0x900);
}
}
+8 -8
View File
@@ -77,7 +77,7 @@ const ActorInit En_Fall_InitVars = {
* it also moves the moon closer to the ground depending on the current time.
*/
void EnFall_Moon_AdjustScaleAndPosition(EnFall* this, GlobalContext* globalCtx) {
u16 currentTime = gSaveContext.time;
u16 currentTime = gSaveContext.save.time;
u16 dayStartTime = this->dayStartTime;
f32 finalDayRelativeHeight;
@@ -218,7 +218,7 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) {
this->actor.draw = EnFall_Moon_Draw;
this->actionFunc = EnFall_StoppedClosedMouthMoon_PerformCutsceneActions;
Actor_SetScale(&this->actor, this->scale * 3.0f);
if (!(gSaveContext.weekEventReg[25] & 2)) {
if (!(gSaveContext.save.weekEventReg[25] & 2)) {
Actor_MarkForDeath(&this->actor);
}
break;
@@ -227,7 +227,7 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) {
this->actionFunc = EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions;
Actor_SetScale(&this->actor, this->scale * 3.0f);
this->actor.draw = EnFall_Moon_Draw;
if (gSaveContext.weekEventReg[25] & 2) {
if (gSaveContext.save.weekEventReg[25] & 2) {
Actor_MarkForDeath(&this->actor);
}
break;
@@ -325,7 +325,7 @@ void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, GlobalContext* globa
case 2:
if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT) &&
CHECK_QUEST_ITEM(QUEST_REMAINS_GYORG) && CHECK_QUEST_ITEM(QUEST_REMAINS_TWINMOLD)) {
if (gSaveContext.weekEventReg[93] & 4) {
if (gSaveContext.save.weekEventReg[93] & 4) {
if (ActorCutscene_GetCanPlayNext(0xC)) {
ActorCutscene_Start(0xC, &this->actor);
sGiantsCutsceneState++;
@@ -334,7 +334,7 @@ void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, GlobalContext* globa
}
} else if (ActorCutscene_GetCanPlayNext(0xB)) {
ActorCutscene_Start(0xB, &this->actor);
gSaveContext.weekEventReg[93] |= 4;
gSaveContext.save.weekEventReg[93] |= 4;
sGiantsCutsceneState++;
} else {
ActorCutscene_SetIntentToPlay(0xB);
@@ -481,7 +481,7 @@ void EnFall_Moon_PerformDefaultActions(EnFall* this, GlobalContext* globalCtx) {
currentDay = CURRENT_DAY;
if ((u16)this->currentDay != (u32)currentDay) {
this->currentDay = currentDay;
this->dayStartTime = gSaveContext.time;
this->dayStartTime = gSaveContext.save.time;
}
EnFall_Moon_AdjustScaleAndPosition(this, globalCtx);
}
@@ -518,8 +518,8 @@ void EnFall_MoonsTear_Fall(EnFall* this, GlobalContext* globalCtx) {
if (this->actor.draw != NULL) {
if (Math_Vec3f_StepTo(&this->actor.world.pos, &this->actor.home.pos, this->actor.speedXZ) <= 0.0f) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_GORON_BOUND_1);
gSaveContext.weekEventReg[74] |= 0x80;
gSaveContext.weekEventReg[74] |= 0x20;
gSaveContext.save.weekEventReg[74] |= 0x80;
gSaveContext.save.weekEventReg[74] |= 0x20;
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_TEST, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, -2);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x,
+18 -18
View File
@@ -161,27 +161,27 @@ void EnFish2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->jointTable, this->morphTable, 24);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
if (this->unk_344 == 0) {
if (gSaveContext.weekEventReg[81] & 0x10) {
if (gSaveContext.save.weekEventReg[81] & 0x10) {
this->unk_2C0 = 1;
}
if (gSaveContext.weekEventReg[81] & 0x20) {
if (gSaveContext.save.weekEventReg[81] & 0x20) {
this->unk_2C0 = 2;
}
if (gSaveContext.weekEventReg[81] & 0x40) {
if (gSaveContext.save.weekEventReg[81] & 0x40) {
this->unk_2C0 = 3;
}
} else {
if (gSaveContext.weekEventReg[81] & 0x80) {
if (gSaveContext.save.weekEventReg[81] & 0x80) {
this->unk_2C0 = 1;
}
if (gSaveContext.weekEventReg[82] & 1) {
if (gSaveContext.save.weekEventReg[82] & 1) {
this->unk_2C0 = 2;
}
if (gSaveContext.weekEventReg[82] & 2) {
if (gSaveContext.save.weekEventReg[82] & 2) {
this->unk_2C0 = 3;
}
}
@@ -619,18 +619,18 @@ void func_80B297FC(EnFish2* this, GlobalContext* globalCtx) {
this->unk_2C0++;
if (this->unk_344 == 0) {
if (this->unk_2C0 == 1) {
gSaveContext.weekEventReg[81] |= 0x10;
gSaveContext.save.weekEventReg[81] |= 0x10;
} else if (this->unk_2C0 == 2) {
gSaveContext.weekEventReg[81] |= 0x20;
gSaveContext.save.weekEventReg[81] |= 0x20;
} else if (this->unk_2C0 == 3) {
gSaveContext.weekEventReg[81] |= 0x40;
gSaveContext.save.weekEventReg[81] |= 0x40;
}
} else if (this->unk_2C0 == 1) {
gSaveContext.weekEventReg[81] |= 0x80;
gSaveContext.save.weekEventReg[81] |= 0x80;
} else if (this->unk_2C0 == 2) {
gSaveContext.weekEventReg[82] |= 1;
gSaveContext.save.weekEventReg[82] |= 1;
} else if (this->unk_2C0 == 3) {
gSaveContext.weekEventReg[82] |= 2;
gSaveContext.save.weekEventReg[82] |= 2;
}
if (this->unk_2B0 != 0) {
@@ -890,12 +890,12 @@ void func_80B2A498(EnFish2* this, GlobalContext* globalCtx) {
temp_v0->speedXZ = 4.0f;
temp_v0->velocity.y = 15.0f;
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_PIECE_OF_HEART);
gSaveContext.weekEventReg[81] &= (u8)~0x10;
gSaveContext.weekEventReg[81] &= (u8)~0x20;
gSaveContext.weekEventReg[81] &= (u8)~0x40;
gSaveContext.weekEventReg[81] &= (u8)~0x80;
gSaveContext.weekEventReg[82] &= (u8)~1;
gSaveContext.weekEventReg[82] &= (u8)~2;
gSaveContext.save.weekEventReg[81] &= (u8)~0x10;
gSaveContext.save.weekEventReg[81] &= (u8)~0x20;
gSaveContext.save.weekEventReg[81] &= (u8)~0x40;
gSaveContext.save.weekEventReg[81] &= (u8)~0x80;
gSaveContext.save.weekEventReg[82] &= (u8)~1;
gSaveContext.save.weekEventReg[82] &= (u8)~2;
}
}
+169 -170
View File
@@ -119,86 +119,86 @@ typedef struct {
#define LINE_SEG_COUNT 200
#define SINKING_LURE_SEG_COUNT 20
static f32 D_809101B0;
static f32 D_809101B4;
static s16 D_809101B8;
static f32 D_809101BC;
static f32 D_809101C0;
static f32 D_809101C4;
static f32 D_809101C8;
static s16 D_809101CC;
static f32 D_809101D0;
static Vec3f sRodTipPos;
static Vec3f sReelLinePos[LINE_SEG_COUNT];
static Vec3f sReelLineRot[LINE_SEG_COUNT];
static Vec3f sReelLineUnk[LINE_SEG_COUNT];
static Vec3f sLureHookRefPos[2];
static f32 sLureHookRotY[2];
static u8 D_80911E28;
static Vec3f sSinkingLurePos[SINKING_LURE_SEG_COUNT];
static s16 D_80911F20;
static f32 sProjectedW;
static Vec3f sCameraEye;
static Vec3f sCameraAt;
static s16 sCameraId;
static f32 D_80911F48;
static f32 D_80911F4C;
static f32 D_80911F50;
static Vec3f sSinkingLureBasePos;
static f32 D_80911F64;
static s32 sRandSeed0;
static s32 sRandSeed1;
static s32 sRandSeed2;
static FishingProp sPondProps[POND_PROP_COUNT];
static FishingGroupFish sGroupFishes[GROUP_FISH_COUNT];
static f32 sFishGroupAngle1;
static f32 sFishGroupAngle2;
static f32 sFishGroupAngle3;
static FishingEffect sFishingEffects[EFFECT_COUNT];
static Vec3f sStreamSoundProjectedPos;
static EnFishing* sFishingMain;
static u8 D_809171C8;
static u8 sLinkAge;
static u8 D_809171CA;
static u8 D_809171CB;
static f32 D_809171CC;
static u8 D_809171D0;
static u8 D_809171D1;
static u8 D_809171D2;
static s16 D_809171D4;
static u8 D_809171D6;
static u16 D_809171D8;
static u16 D_809171DA;
static s8 D_809171DC;
static Vec3f sOwnerHeadPos;
static Vec3s sEffOwnerHatRot;
static u8 D_809171F2;
static s16 D_809171F4;
static s16 D_809171F6;
static EnFishing* sFishingHookedFish;
static s16 D_809171FC;
static s16 D_809171FE;
static s16 D_80917200;
static s16 D_80917202;
static s16 D_80917204;
static u8 D_80917206;
static Vec3f sLurePos;
static Vec3f D_80917218;
static Vec3f sLureRot;
static Vec3f D_80917238;
static Vec3f D_80917248;
static f32 D_80917254;
static f32 D_80917258;
static f32 D_8091725C;
static f32 D_80917260;
static s8 D_80917264;
static s16 D_80917266;
static u8 D_80917268;
static f32 D_8091726C;
static u8 D_80917270;
static s16 D_80917272;
static u8 D_80917274;
static Vec3f D_80917278;
f32 D_809101B0;
f32 D_809101B4;
s16 D_809101B8;
f32 D_809101BC;
f32 D_809101C0;
f32 D_809101C4;
f32 D_809101C8;
s16 D_809101CC;
f32 D_809101D0;
Vec3f sRodTipPos;
Vec3f sReelLinePos[LINE_SEG_COUNT];
Vec3f sReelLineRot[LINE_SEG_COUNT];
Vec3f sReelLineUnk[LINE_SEG_COUNT];
Vec3f sLureHookRefPos[2];
f32 sLureHookRotY[2];
u8 D_80911E28;
Vec3f sSinkingLurePos[SINKING_LURE_SEG_COUNT];
s16 D_80911F20;
f32 sProjectedW;
Vec3f sCameraEye;
Vec3f sCameraAt;
s16 sCameraId;
f32 D_80911F48;
f32 D_80911F4C;
f32 D_80911F50;
Vec3f sSinkingLureBasePos;
f32 D_80911F64;
s32 sRandSeed0;
s32 sRandSeed1;
s32 sRandSeed2;
FishingProp sPondProps[POND_PROP_COUNT];
FishingGroupFish sGroupFishes[GROUP_FISH_COUNT];
f32 sFishGroupAngle1;
f32 sFishGroupAngle2;
f32 sFishGroupAngle3;
FishingEffect sFishingEffects[EFFECT_COUNT];
Vec3f sStreamSoundProjectedPos;
EnFishing* sFishingMain;
u8 D_809171C8;
u8 sLinkAge;
u8 D_809171CA;
u8 D_809171CB;
f32 D_809171CC;
u8 D_809171D0;
u8 D_809171D1;
u8 D_809171D2;
s16 D_809171D4;
u8 D_809171D6;
u16 D_809171D8;
u16 D_809171DA;
s8 D_809171DC;
Vec3f sOwnerHeadPos;
Vec3s sEffOwnerHatRot;
u8 D_809171F2;
s16 D_809171F4;
s16 D_809171F6;
EnFishing* sFishingHookedFish;
s16 D_809171FC;
s16 D_809171FE;
s16 D_80917200;
s16 D_80917202;
s16 D_80917204;
u8 D_80917206;
Vec3f sLurePos;
Vec3f D_80917218;
Vec3f sLureRot;
Vec3f D_80917238;
Vec3f D_80917248;
f32 D_80917254;
f32 D_80917258;
f32 D_8091725C;
f32 D_80917260;
s8 D_80917264;
s16 D_80917266;
u8 D_80917268;
f32 D_8091726C;
u8 D_80917270;
s16 D_80917272;
u8 D_80917274;
Vec3f D_80917278;
const ActorInit En_Fishing_InitVars = {
ACTOR_EN_FISHING,
@@ -212,38 +212,38 @@ const ActorInit En_Fishing_InitVars = {
(ActorFunc)EnFishing_DrawFish,
};
static f32 D_8090CCD0 = 0.0f;
static u8 D_8090CCD4 = 0;
static f32 D_8090CCD8 = 0.0f;
static Vec3f D_8090CCDC = { 0.0f, 0.0f, 0.0f };
static f32 D_8090CCE8 = 0.0f;
static u8 sSinkingLureLocation = 0;
static f32 D_8090CCF0 = 0.0f;
static u8 D_8090CCF4 = true;
static u16 D_8090CCF8 = 0;
static u8 D_8090CCFC = 0;
static s32 D_8090CD00 = 0;
static s16 D_8090CD04 = 0;
static u8 D_8090CD08 = 0;
static u8 D_8090CD0C = 0;
static u8 D_8090CD10 = 0;
static s16 D_8090CD14 = 0;
static Vec3f sFishMouthOffset = { 500.0f, 500.0f, 0.0f };
static u8 D_8090CD24 = 0;
static f32 D_8090CD28 = 0;
static f32 D_8090CD2C = 0;
static f32 D_8090CD30 = 0.0f;
static f32 D_8090CD34 = 0.0f;
static f32 D_8090CD38 = 0.0f;
static f32 D_8090CD3C = 0.0f;
static f32 D_8090CD40 = 0.0f;
static s16 D_8090CD44 = 0;
static s16 D_8090CD48 = 0;
static u8 D_8090CD4C = 0;
static u8 D_8090CD50 = 0;
static u8 D_8090CD54 = 0;
f32 D_8090CCD0 = 0.0f;
u8 D_8090CCD4 = 0;
f32 D_8090CCD8 = 0.0f;
Vec3f D_8090CCDC = { 0.0f, 0.0f, 0.0f };
f32 D_8090CCE8 = 0.0f;
u8 sSinkingLureLocation = 0;
f32 D_8090CCF0 = 0.0f;
u8 D_8090CCF4 = true;
u16 D_8090CCF8 = 0;
u8 D_8090CCFC = 0;
s32 D_8090CD00 = 0;
s16 D_8090CD04 = 0;
u8 D_8090CD08 = 0;
u8 D_8090CD0C = 0;
u8 D_8090CD10 = 0;
s16 D_8090CD14 = 0;
Vec3f sFishMouthOffset = { 500.0f, 500.0f, 0.0f };
u8 D_8090CD24 = 0;
f32 D_8090CD28 = 0;
f32 D_8090CD2C = 0;
f32 D_8090CD30 = 0.0f;
f32 D_8090CD34 = 0.0f;
f32 D_8090CD38 = 0.0f;
f32 D_8090CD3C = 0.0f;
f32 D_8090CD40 = 0.0f;
s16 D_8090CD44 = 0;
s16 D_8090CD48 = 0;
u8 D_8090CD4C = 0;
u8 D_8090CD50 = 0;
u8 D_8090CD54 = 0;
static ColliderJntSphElementInit sJntSphElementsInit[12] = {
static ColliderJntSphElementInit sJntSphElementsInit[] = {
{
{
ELEMTYPE_UNK0,
@@ -387,13 +387,13 @@ static ColliderJntSphInit sJntSphInit = {
OC2_TYPE_1,
COLSHAPE_JNTSPH,
},
12,
ARRAY_COUNT(sJntSphElementsInit),
sJntSphElementsInit,
};
static u8 D_8090CF18 = 0;
u8 D_8090CF18 = 0;
static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f };
static Vec3f D_8090CF28 = { 0.0f, 0.0f, 2000.0f }; // Unused
Vec3f D_8090CF28 = { 0.0f, 0.0f, 2000.0f }; // Unused
void EnFishing_SetColliderElement(s32 index, ColliderJntSph* collider, Vec3f* pos, f32 scale) {
collider->elements[index].dim.worldSphere.center.x = pos->x;
@@ -580,7 +580,7 @@ void EnFishing_SpawnRainDrop(FishingEffect* effect, Vec3f* pos, Vec3f* rot) {
}
}
static FishingPropInit sPondPropInits[POND_PROP_COUNT + 1] = {
FishingPropInit sPondPropInits[POND_PROP_COUNT + 1] = {
{ FS_PROP_ROCK, { 529, -53, -498 } },
{ FS_PROP_ROCK, { 461, -66, -480 } },
{ FS_PROP_ROCK, { 398, -73, -474 } },
@@ -780,7 +780,7 @@ void EnFishing_InitPondProps(EnFishing* this, GlobalContext* globalCtx) {
}
}
static FishingFishInit sFishInits[] = {
FishingFishInit sFishInits[] = {
{ 0, { 666, -45, 354 }, 38, 0.1f }, { 0, { 681, -45, 240 }, 36, 0.1f }, { 0, { 670, -45, 90 }, 41, 0.05f },
{ 0, { 615, -45, -450 }, 35, 0.2f }, { 0, { 500, -45, -420 }, 39, 0.1f }, { 0, { 420, -45, -550 }, 44, 0.05f },
{ 0, { -264, -45, -640 }, 40, 0.1f }, { 0, { -470, -45, -540 }, 34, 0.2f }, { 0, { -557, -45, -430 }, 54, 0.01f },
@@ -802,7 +802,7 @@ void EnFishing_Init(Actor* thisx, GlobalContext* globalCtx2) {
Actor_ProcessInitChain(thisx, sInitChain);
ActorShape_Init(&thisx->shape, 0.0f, NULL, 0.0f);
sLinkAge = gSaveContext.linkAge;
sLinkAge = gSaveContext.save.linkAge;
if (thisx->params < 100) {
s16 i;
@@ -834,7 +834,7 @@ void EnFishing_Init(Actor* thisx, GlobalContext* globalCtx2) {
if (sLinkAge != 1) {
// HIGH_SCORE(HS_FISHING) from OoT
if (gSaveContext.unk_EE4 & 0x1000) {
if (gSaveContext.save.unk_EE4 & 0x1000) {
D_8090CD08 = 0;
} else {
D_8090CD08 = 1;
@@ -852,18 +852,18 @@ void EnFishing_Init(Actor* thisx, GlobalContext* globalCtx2) {
Audio_QueueSeqCmd(0x100100FF);
if (sLinkAge == 1) {
if (gSaveContext.unk_EE4 & 0x7F) {
D_809171CC = gSaveContext.unk_EE4 & 0x7F;
if (gSaveContext.save.unk_EE4 & 0x7F) {
D_809171CC = gSaveContext.save.unk_EE4 & 0x7F;
} else {
D_809171CC = 40.0f;
}
} else if (gSaveContext.unk_EE4 & 0x7F000000) {
D_809171CC = (gSaveContext.unk_EE4 & 0x7F000000) >> 0x18;
} else if (gSaveContext.save.unk_EE4 & 0x7F000000) {
D_809171CC = (gSaveContext.save.unk_EE4 & 0x7F000000) >> 0x18;
} else {
D_809171CC = 45.0f;
}
D_809171D1 = (gSaveContext.unk_EE4 & 0xFF0000) >> 0x10;
D_809171D1 = (gSaveContext.save.unk_EE4 & 0xFF0000) >> 0x10;
if ((D_809171D1 & 7) == 7) {
globalCtx->roomCtx.unk7A[0] = 90;
D_809171CA = 1;
@@ -1700,7 +1700,7 @@ void EnFishing_UpdateSinkingLure(GlobalContext* globalCtx) {
}
}
static f32 sSinkingLureSizes[] = {
f32 sSinkingLureSizes[] = {
1.0f, 1.5f, 1.8f, 2.0f, 1.8f, 1.6f, 1.4f, 1.2f, 1.0f, 1.0f,
0.9f, 0.85f, 0.8f, 0.7f, 0.8f, 1.0f, 1.2f, 1.1f, 1.0f, 0.8f,
};
@@ -1905,18 +1905,18 @@ void EnFishing_DrawLureAndLine(GlobalContext* globalCtx, Vec3f* linePos, Vec3f*
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
static f32 sRodScales[22] = {
f32 sRodScales[22] = {
1.0f, 1.0f, 1.0f, 0.9625f, 0.925f, 0.8875f, 0.85f, 0.8125f,
0.775f, 0.73749995f, 0.7f, 0.6625f, 0.625f, 0.5875f, 0.54999995f, 0.5125f,
0.47499996f, 0.4375f, 0.39999998f, 0.36249995f, 0.325f, 0.28749996f,
};
static f32 sRodBendRatios[22] = {
f32 sRodBendRatios[22] = {
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.06f, 0.12f, 0.18f, 0.24f, 0.30f, 0.36f,
0.42f, 0.48f, 0.54f, 0.60f, 0.60f, 0.5142f, 0.4285f, 0.3428f, 0.2571f, 0.1714f, 0.0857f,
};
static Vec3f sRodTipOffset = { 0.0f, 0.0f, 0.0f };
Vec3f sRodTipOffset = { 0.0f, 0.0f, 0.0f };
void EnFishing_DrawRod(GlobalContext* globalCtx) {
s16 i;
@@ -2057,7 +2057,7 @@ void EnFishing_DrawRod(GlobalContext* globalCtx) {
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
static Vec3f D_8090D614 = { 0.0f, 0.0f, 0.0f };
Vec3f D_8090D614 = { 0.0f, 0.0f, 0.0f };
void EnFishing_UpdateLure(EnFishing* this, GlobalContext* globalCtx) {
f32 spE4;
@@ -2801,8 +2801,8 @@ void func_80903C60(EnFishing* this, u8 arg1) {
void EnFishing_HandleAquariumDialog(EnFishing* this, GlobalContext* globalCtx) {
if (sLinkAge == 1) {
if (gSaveContext.unk_EE4 & 0x7F) {
if (gSaveContext.unk_EE4 & 0x80) {
if (gSaveContext.save.unk_EE4 & 0x7F) {
if (gSaveContext.save.unk_EE4 & 0x80) {
this->actor.textId = 0x40B1;
} else {
this->actor.textId = 0x4089;
@@ -2810,8 +2810,8 @@ void EnFishing_HandleAquariumDialog(EnFishing* this, GlobalContext* globalCtx) {
} else {
this->actor.textId = 0x40AE;
}
} else if (gSaveContext.unk_EE4 & 0x7F000000) {
if (gSaveContext.unk_EE4 & 0x80000000) {
} else if (gSaveContext.save.unk_EE4 & 0x7F000000) {
if (gSaveContext.save.unk_EE4 & 0x80000000) {
this->actor.textId = 0x40B1;
} else {
this->actor.textId = 0x4089;
@@ -3065,11 +3065,11 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
}
if (Message_GetState(&globalCtx->msgCtx) == 0) {
if ((gSaveContext.time >= 0xC000) && (gSaveContext.time <= 0xC01B)) {
if ((gSaveContext.save.time >= CLOCK_TIME(18, 0)) && (gSaveContext.save.time <= 0xC01B)) {
this->unk_150 = 7;
this->unk_172[3] = Rand_ZeroFloat(150.0f) + 200.0f;
}
if ((gSaveContext.time >= 0x3AAA) && (gSaveContext.time <= 0x3AC5)) {
if ((gSaveContext.save.time >= CLOCK_TIME(5, 30)) && (gSaveContext.save.time <= 0x3AC5)) {
this->unk_150 = 7;
this->unk_172[3] = Rand_ZeroFloat(150.0f) + 200.0f;
}
@@ -3313,9 +3313,9 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
multiplier = 1.0f;
}
if ((gSaveContext.time >= 0xB555) && (gSaveContext.time <= 0xCAAA)) {
if ((gSaveContext.save.time >= 0xB555) && (gSaveContext.save.time <= 0xCAAA)) {
multiplier *= 1.75f;
} else if ((gSaveContext.time >= 0x3555) && (gSaveContext.time <= 0x4AAA)) {
} else if ((gSaveContext.save.time >= 0x3555) && (gSaveContext.save.time <= 0x4AAA)) {
multiplier *= 1.5f;
} else if (D_809171CA != 0) {
multiplier *= 1.5f;
@@ -3752,8 +3752,8 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
if ((D_80917272 == 0) && (D_80917274 == 0)) {
// Assignment of OoT's D_80B7E086 here removed in MM
if (((sLinkAge == 1) && (gSaveContext.unk_EE4 & 0x400)) ||
((sLinkAge != 1) && (gSaveContext.unk_EE4 & 0x800))) {
if (((sLinkAge == 1) && (gSaveContext.save.unk_EE4 & 0x400)) ||
((sLinkAge != 1) && (gSaveContext.save.unk_EE4 & 0x800))) {
// Assignment of OoT's D_80B7A67C here removed in MM, this is now an empty branch
}
} else {
@@ -4685,14 +4685,14 @@ void EnFishing_DrawGroupFishes(GlobalContext* globalCtx) {
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
static u16 D_8090D638[] = { 0x4096, 0x408D, 0x408E, 0x408F, 0x4094, 0x4095 };
u16 D_8090D638[] = { 0x4096, 0x408D, 0x408E, 0x408F, 0x4094, 0x4095 };
void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
switch (this->unk_154) {
case 0:
if (D_809171FC == 0) {
if (sLinkAge != 1) {
if ((gSaveContext.unk_EE4 & 0x100) && !(gSaveContext.unk_EE4 & 0x200)) {
if ((gSaveContext.save.unk_EE4 & 0x100) && !(gSaveContext.save.unk_EE4 & 0x200)) {
this->actor.textId = 0x4093;
} else {
this->actor.textId = 0x407B;
@@ -4710,9 +4710,9 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
if (D_809171FC == 0) {
this->unk_154 = 1;
if (sLinkAge != 1) {
gSaveContext.unk_EE4 |= 0x200;
gSaveContext.save.unk_EE4 |= 0x200;
} else {
gSaveContext.unk_EE4 |= 0x100;
gSaveContext.save.unk_EE4 |= 0x100;
}
} else {
this->unk_154 = 10;
@@ -4728,7 +4728,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
switch (globalCtx->msgCtx.choiceIndex) {
case 0:
if (gSaveContext.rupees >= 20) {
if (gSaveContext.save.playerData.rupees >= 20) {
func_801159EC(-20);
if (func_8013EE04() == 0) {
this->actor.textId = 0x407C;
@@ -4795,8 +4795,8 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
D_8090CD04 = 20;
this->unk_154 = 0;
if ((gSaveContext.unk_EE4 & 0xFF0000) < 0xFF0000) {
gSaveContext.unk_EE4 += 0x10000;
if ((gSaveContext.save.unk_EE4 & 0xFF0000) < 0xFF0000) {
gSaveContext.save.unk_EE4 += 0x10000;
}
}
break;
@@ -4904,30 +4904,29 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
if (sLinkAge == 1) {
f32 temp;
gSaveContext.unk_EE4 &= 0xFFFFFF00;
gSaveContext.unk_EE4 |= ((s16)D_809171CC & 0x7F);
temp = (gSaveContext.unk_EE4 & 0x7F000000) >> 0x18;
gSaveContext.save.unk_EE4 &= 0xFFFFFF00;
gSaveContext.save.unk_EE4 |= ((s16)D_809171CC & 0x7F);
temp = (gSaveContext.save.unk_EE4 & 0x7F000000) >> 0x18;
if (temp < D_809171CC) {
gSaveContext.unk_EE4 &= 0xFFFFFF;
gSaveContext.unk_EE4 |= ((s16)D_809171CC & 0x7F) << 0x18;
gSaveContext.save.unk_EE4 &= 0xFFFFFF;
gSaveContext.save.unk_EE4 |= ((s16)D_809171CC & 0x7F) << 0x18;
if (D_809171D2 == 2) {
gSaveContext.unk_EE4 |= 0x80000000;
gSaveContext.save.unk_EE4 |= 0x80000000;
}
}
if (D_809171D2 == 2) {
gSaveContext.unk_EE4 |= 0x80;
gSaveContext.save.unk_EE4 |= 0x80;
this->unk_154 = 0;
break;
}
} else {
gSaveContext.unk_EE4 &= 0xFFFFFF;
gSaveContext.unk_EE4 |= ((s16)D_809171CC & 0x7F) << 0x18;
gSaveContext.save.unk_EE4 &= 0xFFFFFF;
gSaveContext.save.unk_EE4 |= ((s16)D_809171CC & 0x7F) << 0x18;
if (D_809171D2 == 2) {
gSaveContext.unk_EE4 |= 0x80000000;
gSaveContext.save.unk_EE4 |= 0x80000000;
this->unk_154 = 0;
break;
}
@@ -4944,14 +4943,14 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
}
if (sLinkAge == 1) {
if ((D_809171CC >= 50.0f) && !(gSaveContext.unk_EE4 & 0x400)) {
gSaveContext.unk_EE4 |= 0x400;
if ((D_809171CC >= 50.0f) && !(gSaveContext.save.unk_EE4 & 0x400)) {
gSaveContext.save.unk_EE4 |= 0x400;
getItemId = GI_HEART_PIECE;
sSinkingLureLocation = Rand_ZeroFloat(3.999f) + 1.0f;
}
} else {
if ((D_809171CC >= 60.0f) && !(gSaveContext.unk_EE4 & 0x800)) {
gSaveContext.unk_EE4 |= 0x800;
if ((D_809171CC >= 60.0f) && !(gSaveContext.save.unk_EE4 & 0x800)) {
gSaveContext.save.unk_EE4 |= 0x800;
getItemId = GI_SCALE_GOLD;
sSinkingLureLocation = Rand_ZeroFloat(3.999f) + 1.0f;
}
@@ -5029,11 +5028,11 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
}
}
static s16 D_8090D644[] = { 0, 1, 2, 2, 1 };
s16 D_8090D644[] = { 0, 1, 2, 2, 1 };
static Vec3f sStreamSoundPos = { 670.0f, 0.0f, -600.0f };
Vec3f sStreamSoundPos = { 670.0f, 0.0f, -600.0f };
static Vec3s sSinkingLureLocationPos[] = {
Vec3s sSinkingLureLocationPos[] = {
{ -364, -30, -269 },
{ 1129, 3, -855 },
{ -480, 0, -1055 },
@@ -5114,9 +5113,9 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
}
if (D_8090CD08 == 0) {
gSaveContext.unk_EE4 |= 0x1000;
gSaveContext.save.unk_EE4 |= 0x1000;
} else if (D_8090CD08 == 1) {
gSaveContext.unk_EE4 &= ~0x1000;
gSaveContext.save.unk_EE4 &= ~0x1000;
}
if (D_8090CCFC != 0) {
@@ -5579,7 +5578,7 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
Audio_PlaySfxAtPos(&sStreamSoundProjectedPos, NA_SE_EV_WATER_WALL - SFX_FLAG);
if (gSaveContext.language == 0) { // Added in MM
if (gSaveContext.options.language == 0) { // Added in MM
gSaveContext.minigameScore = D_8090CCF8;
} else {
gSaveContext.minigameScore = (SQ((f32)D_8090CCF8) * 0.0036f) + 0.5f;
@@ -5613,10 +5612,10 @@ void EnFishing_OwnerPostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx**
}
}
static UNK_TYPE sFishingOwnerEyeTexs[] = {
&gFishingOwnerEyeOpenTex,
&gFishingOwnerEyeHalfTex,
&gFishingOwnerEyeClosedTex,
TexturePtr sFishingOwnerEyeTexs[] = {
gFishingOwnerEyeOpenTex,
gFishingOwnerEyeHalfTex,
gFishingOwnerEyeClosedTex,
};
void EnFishing_DrawOwner(Actor* thisx, GlobalContext* globalCtx) {
@@ -721,7 +721,7 @@ void func_808D217C(EnFloormas* this, Player* player) {
this->actor.speedXZ = 0.0f;
this->actor.velocity.y = 0.0f;
func_808D08D0(this);
playerForm = gSaveContext.playerForm;
playerForm = gSaveContext.save.playerForm;
ptr = &D_808D3900[playerForm];
this->actor.home.pos.x = ptr->z * Math_SinS(this->actor.shape.rot.y);
this->actor.home.pos.y = CLAMP(-this->actor.playerHeightRel, ptr->x, ptr->y);
+25 -23
View File
@@ -153,7 +153,7 @@ u16 EnFsn_GetWelcome(GlobalContext* globalCtx) {
void EnFsn_HandleConversationBackroom(EnFsn* this, GlobalContext* globalCtx) {
switch (this->textId) {
case 0:
if (!(gSaveContext.weekEventReg[80] & 0x10)) {
if (!(gSaveContext.save.weekEventReg[80] & 0x10)) {
this->textId = 0x29E0;
break;
} else {
@@ -166,7 +166,7 @@ void EnFsn_HandleConversationBackroom(EnFsn* this, GlobalContext* globalCtx) {
this->flags |= ENFSN_GIVE_ITEM;
this->flags |= ENFSN_GAVE_LETTER_TO_MAMA;
this->getItemId = GI_LETTER_TO_MAMA;
gSaveContext.weekEventReg[80] |= 0x10;
gSaveContext.save.weekEventReg[80] |= 0x10;
this->textId = 0x29F1;
break;
} else {
@@ -186,7 +186,7 @@ void EnFsn_HandleConversationBackroom(EnFsn* this, GlobalContext* globalCtx) {
this->flags |= ENFSN_GIVE_ITEM;
this->flags |= ENFSN_GAVE_LETTER_TO_MAMA;
this->getItemId = GI_LETTER_TO_MAMA;
gSaveContext.weekEventReg[80] |= 0x10;
gSaveContext.save.weekEventReg[80] |= 0x10;
this->textId = 0x29F1;
break;
case 0x29F1:
@@ -301,8 +301,8 @@ void EnFsn_CursorLeftRight(EnFsn* this) {
}
s16 EnFsn_GetThirdDayItemId(void) {
if (!(gSaveContext.weekEventReg[33] & 4) && CURRENT_DAY == 3) {
if (!(gSaveContext.weekEventReg[33] & 8) && !(gSaveContext.weekEventReg[79] & 0x40)) {
if (!(gSaveContext.save.weekEventReg[33] & 4) && CURRENT_DAY == 3) {
if (!(gSaveContext.save.weekEventReg[33] & 8) && !(gSaveContext.save.weekEventReg[79] & 0x40)) {
return SI_BOMB_BAG_30_1;
}
return SI_MASK_ALL_NIGHT;
@@ -328,22 +328,23 @@ s16 EnFsn_GetStolenItemId(u32 stolenItem) {
s32 EnFsn_HasItemsToSell(void) {
if (CURRENT_DAY != 3) {
if (((gSaveContext.stolenItems & 0xFF000000) >> 0x18) || ((gSaveContext.stolenItems & 0xFF0000) >> 0x10)) {
return true;
}
return false;
} else {
if (((gSaveContext.stolenItems & 0xFF000000) >> 0x18) || ((gSaveContext.stolenItems & 0xFF0000) >> 0x10) ||
!(gSaveContext.weekEventReg[33] & 4)) {
if ((STOLEN_ITEM_1 != STOLEN_ITEM_NONE) || (STOLEN_ITEM_2 != STOLEN_ITEM_NONE)) {
return true;
}
return false;
}
if ((STOLEN_ITEM_1 != STOLEN_ITEM_NONE) || (STOLEN_ITEM_2 != STOLEN_ITEM_NONE) ||
!(gSaveContext.save.weekEventReg[33] & 4)) {
return true;
}
return false;
}
void EnFsn_GetShopItemIds(EnFsn* this) {
u32 stolenItem1 = (gSaveContext.stolenItems & 0xFF000000) >> 0x18;
u32 stolenItem2 = (gSaveContext.stolenItems & 0xFF0000) >> 0x10;
u32 stolenItem1 = STOLEN_ITEM_1;
u32 stolenItem2 = STOLEN_ITEM_2;
s16 itemId;
this->stolenItem1 = this->stolenItem2 = 0;
@@ -440,9 +441,9 @@ s32 EnFsn_FacingShopkeeperDialogResult(EnFsn* this, GlobalContext* globalCtx) {
func_8019F208();
if (CURRENT_DAY != 3) {
this->actor.textId = 0x29FB;
} else if (gSaveContext.weekEventReg[33] & 4) {
} else if (gSaveContext.save.weekEventReg[33] & 4) {
this->actor.textId = 0x29FF;
} else if (!(gSaveContext.weekEventReg[33] & 8) && !(gSaveContext.weekEventReg[79] & 0x40)) {
} else if (!(gSaveContext.save.weekEventReg[33] & 8) && !(gSaveContext.save.weekEventReg[79] & 0x40)) {
this->actor.textId = 0x29D7;
} else {
this->actor.textId = 0x29D8;
@@ -860,9 +861,10 @@ void EnFsn_AskBuyOrSell(EnFsn* this, GlobalContext* globalCtx) {
Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
break;
case 0x29D2:
if (gSaveContext.weekEventReg[33] & 4) {
if (gSaveContext.save.weekEventReg[33] & 4) {
this->actor.textId = 0x2A01;
} else if (!(gSaveContext.weekEventReg[33] & 8) && !(gSaveContext.weekEventReg[79] & 0x40)) {
} else if (!(gSaveContext.save.weekEventReg[33] & 8) &&
!(gSaveContext.save.weekEventReg[79] & 0x40)) {
this->actor.textId = 0x29D3;
} else {
this->actor.textId = 0x29D4;
@@ -923,7 +925,7 @@ void EnFsn_DeterminePrice(EnFsn* this, GlobalContext* globalCtx) {
if (player->heldItemButton == 0) {
buttonItem = CUR_FORM_EQUIP(player->heldItemButton);
} else {
buttonItem = gSaveContext.equips.buttonItems[0][player->heldItemButton];
buttonItem = gSaveContext.save.equips.buttonItems[0][player->heldItemButton];
}
this->price = (buttonItem < ITEM_MOON_TEAR) ? gItemPrices[buttonItem] : 0;
if (this->price > 0) {
@@ -1147,7 +1149,7 @@ void EnFsn_HandleCanPlayerBuyItem(EnFsn* this, GlobalContext* globalCtx) {
switch (item->canBuyFunc(globalCtx, item)) {
case CANBUY_RESULT_SUCCESS_2:
func_8019F208();
gSaveContext.weekEventReg[33] |= 4;
gSaveContext.save.weekEventReg[33] |= 4;
case CANBUY_RESULT_SUCCESS_1:
if (this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) {
ActorCutscene_Stop(this->cutscene);
@@ -1165,9 +1167,9 @@ void EnFsn_HandleCanPlayerBuyItem(EnFsn* this, GlobalContext* globalCtx) {
item = this->items[this->cursorIdx];
item->boughtFunc(globalCtx, item);
if (this->stolenItem1 == this->cursorIdx) {
gSaveContext.stolenItems &= ~0xFF000000;
SET_STOLEN_ITEM_1(STOLEN_ITEM_NONE);
} else if (this->stolenItem2 == this->cursorIdx) {
gSaveContext.stolenItems &= ~0xFF0000;
SET_STOLEN_ITEM_2(STOLEN_ITEM_NONE);
}
this->numSellingItems--;
this->itemIds[this->cursorIdx] = -1;
@@ -1416,7 +1418,7 @@ void EnFsn_Init(Actor* thisx, GlobalContext* globalCtx) {
EnFsn_GetCutscenes(this);
EnFsn_InitShop(this, globalCtx);
} else {
if ((gSaveContext.weekEventReg[33] & 8) || (gSaveContext.weekEventReg[79] & 0x40)) {
if ((gSaveContext.save.weekEventReg[33] & 8) || (gSaveContext.save.weekEventReg[79] & 0x40)) {
Actor_MarkForDeath(&this->actor);
return;
}
+41 -41
View File
@@ -112,7 +112,7 @@ void func_809616E0(EnFu* this, GlobalContext* globalCtx) {
s16 spA0 = false;
Vec3f sp94;
if ((gSaveContext.playerForm == PLAYER_FORM_DEKU) && (CURRENT_DAY == 3)) {
if ((gSaveContext.save.playerForm == PLAYER_FORM_DEKU) && (CURRENT_DAY == 3)) {
spA0 = true;
}
this->unk_54C = 0;
@@ -230,8 +230,8 @@ void EnFu_Init(Actor* thisx, GlobalContext* globalCtx) {
void EnFu_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnFu* this = THIS;
gSaveContext.weekEventReg[63] &= (u8)~1;
gSaveContext.weekEventReg[8] &= (u8)~1;
gSaveContext.save.weekEventReg[63] &= (u8)~1;
gSaveContext.save.weekEventReg[8] &= (u8)~1;
Collider_DestroyCylinder(globalCtx, &this->collider);
}
@@ -386,12 +386,12 @@ void func_80962340(EnFu* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
if (this->unk_54A == 2) {
if (this->unk_552 == 0x287D) {
if (gSaveContext.playerForm == PLAYER_FORM_DEKU) {
if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
Message_StartTextbox(globalCtx, 0x287E, &this->actor);
this->unk_552 = 0x287E;
} else if ((CURRENT_DAY == 3) && (gSaveContext.weekEventReg[22] & 0x10) &&
(gSaveContext.weekEventReg[22] & 0x20)) {
if ((gSaveContext.weekEventReg[22] & 0x40)) {
} else if ((CURRENT_DAY == 3) && (gSaveContext.save.weekEventReg[22] & 0x10) &&
(gSaveContext.save.weekEventReg[22] & 0x20)) {
if ((gSaveContext.save.weekEventReg[22] & 0x40)) {
Message_StartTextbox(globalCtx, 0x2883, &this->actor);
this->unk_552 = 0x2883;
} else {
@@ -429,7 +429,7 @@ void func_80962588(EnFu* this, GlobalContext* globalCtx) {
if (Message_ShouldAdvance(globalCtx) && (this->unk_552 == 0x2871)) {
if (1) {}
if (globalCtx->msgCtx.choiceIndex == 0) {
if (gSaveContext.rupees >= 10) {
if (gSaveContext.save.playerData.rupees >= 10) {
func_8019F208();
func_801159EC(-10);
func_80963DE4(this, globalCtx);
@@ -532,8 +532,8 @@ void func_80962660(EnFu* this, GlobalContext* globalCtx) {
break;
case 0x287D:
gSaveContext.weekEventReg[63] |= 1;
gSaveContext.weekEventReg[63] &= (u8)~2;
gSaveContext.save.weekEventReg[63] |= 1;
gSaveContext.save.weekEventReg[63] &= (u8)~2;
func_801477B4(globalCtx);
player->stateFlags1 |= 0x20;
this->unk_53C = 0;
@@ -605,8 +605,8 @@ void func_809628D0(EnFu* this, GlobalContext* globalCtx) {
case 0x2884:
case 0x2887:
case 0x288A:
gSaveContext.weekEventReg[63] &= (u8)~1;
gSaveContext.weekEventReg[63] &= (u8)~2;
gSaveContext.save.weekEventReg[63] &= (u8)~1;
gSaveContext.save.weekEventReg[63] &= (u8)~2;
func_809622FC(this);
break;
@@ -652,10 +652,10 @@ void func_80962A10(EnFu* this, GlobalContext* globalCtx) {
this->unk_546 = 1;
}
if ((gSaveContext.playerForm == PLAYER_FORM_DEKU) && gSaveContext.magicAcquired) {
if ((gSaveContext.save.playerForm == PLAYER_FORM_DEKU) && gSaveContext.save.playerData.magicAcquired) {
s16 temp = gSaveContext.unk_3F30;
Parameter_AddMagic(globalCtx, temp + (gSaveContext.doubleMagic * 48) + 48);
Parameter_AddMagic(globalCtx, temp + (gSaveContext.save.playerData.doubleMagic * 48) + 48);
}
func_80962F10(this);
@@ -739,7 +739,7 @@ void func_80962EBC(EnFu* this, GlobalContext* globalCtx) {
void func_80962F10(EnFu* this) {
this->unk_548 = 0;
this->actor.flags &= ~ACTOR_FLAG_1;
gSaveContext.weekEventReg[8] |= 1;
gSaveContext.save.weekEventReg[8] |= 1;
this->actionFunc = func_80962F4C;
}
@@ -749,7 +749,7 @@ void func_80962F4C(EnFu* this, GlobalContext* globalCtx) {
switch (this->unk_542) {
case 0:
if (gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
if (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) {
player->stateFlags3 |= 0x400;
}
break;
@@ -822,11 +822,11 @@ void func_8096326C(EnFu* this, GlobalContext* globalCtx) {
}
void func_809632D0(EnFu* this) {
if (gSaveContext.playerForm == PLAYER_FORM_DEKU) {
if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
Interface_ChangeAlpha(50);
}
gSaveContext.weekEventReg[8] &= (u8)~1;
gSaveContext.save.weekEventReg[8] &= (u8)~1;
if (this->unk_2D4 != NULL) {
BgFuMizu* mizu = this->unk_2D4;
@@ -879,7 +879,7 @@ void func_80963560(EnFu* this, GlobalContext* globalCtx) {
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
func_80963610(this);
} else if ((this->unk_552 == 0x2880) && !(gSaveContext.weekEventReg[22] & 0x80)) {
} else if ((this->unk_552 == 0x2880) && !(gSaveContext.save.weekEventReg[22] & 0x80)) {
Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 500.0f, 100.0f);
} else {
Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_PURPLE, 500.0f, 100.0f);
@@ -896,13 +896,13 @@ void func_80963630(EnFu* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
if ((gSaveContext.weekEventReg[22] & 0x10) && (gSaveContext.weekEventReg[22] & 0x20) && (CURRENT_DAY == 3) &&
(gSaveContext.playerForm == PLAYER_FORM_HUMAN)) {
if (gSaveContext.weekEventReg[22] & 0x40) {
if ((gSaveContext.save.weekEventReg[22] & 0x10) && (gSaveContext.save.weekEventReg[22] & 0x20) &&
(CURRENT_DAY == 3) && (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN)) {
if (gSaveContext.save.weekEventReg[22] & 0x40) {
Message_StartTextbox(globalCtx, 0x2884, &this->actor);
this->unk_552 = 0x2884;
} else if (!(gSaveContext.weekEventReg[22] & 0x80)) {
gSaveContext.weekEventReg[22] |= 0x80;
} else if (!(gSaveContext.save.weekEventReg[22] & 0x80)) {
gSaveContext.save.weekEventReg[22] |= 0x80;
Message_StartTextbox(globalCtx, 0x2882, &this->actor);
this->unk_552 = 0x2882;
} else {
@@ -918,18 +918,18 @@ void func_80963630(EnFu* this, GlobalContext* globalCtx) {
this->actor.child->freezeTimer = 0;
func_809628BC(this);
if (gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
if (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) {
switch (CURRENT_DAY) {
case 1:
gSaveContext.weekEventReg[22] |= 0x10;
gSaveContext.save.weekEventReg[22] |= 0x10;
break;
case 2:
gSaveContext.weekEventReg[22] |= 0x20;
gSaveContext.save.weekEventReg[22] |= 0x20;
break;
case 3:
gSaveContext.weekEventReg[22] |= 0x40;
gSaveContext.save.weekEventReg[22] |= 0x40;
break;
}
}
@@ -1016,11 +1016,11 @@ s32 func_809638F8(GlobalContext* globalCtx) {
void func_809639D0(EnFu* this, GlobalContext* globalCtx) {
switch (CURRENT_DAY) {
case 1:
if (gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
if (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) {
if (CUR_UPG_VALUE(UPG_BOMB_BAG) == 0) {
Message_StartTextbox(globalCtx, 0x2853, &this->actor);
this->unk_552 = 0x2853;
} else if (gSaveContext.weekEventReg[22] & 0x10) {
} else if (gSaveContext.save.weekEventReg[22] & 0x10) {
Message_StartTextbox(globalCtx, 0x284D, &this->actor);
this->unk_552 = 0x284D;
} else if (this->unk_53E == 1) {
@@ -1038,13 +1038,13 @@ void func_809639D0(EnFu* this, GlobalContext* globalCtx) {
break;
case 2:
if (gSaveContext.playerForm != PLAYER_FORM_HUMAN) {
if (gSaveContext.save.playerForm != PLAYER_FORM_HUMAN) {
Message_StartTextbox(globalCtx, 0x286F, &this->actor);
this->unk_552 = 0x286F;
} else if (CUR_UPG_VALUE(UPG_BOMB_BAG) == 0) {
Message_StartTextbox(globalCtx, 0x2853, &this->actor);
this->unk_552 = 0x2853;
} else if (!(gSaveContext.weekEventReg[22] & 0x10)) {
} else if (!(gSaveContext.save.weekEventReg[22] & 0x10)) {
if (this->unk_53E == 1) {
Message_StartTextbox(globalCtx, 0x285B, &this->actor);
this->unk_552 = 0x285B;
@@ -1053,7 +1053,7 @@ void func_809639D0(EnFu* this, GlobalContext* globalCtx) {
Message_StartTextbox(globalCtx, 0x285D, &this->actor);
this->unk_552 = 0x285D;
}
} else if (gSaveContext.weekEventReg[22] & 0x20) {
} else if (gSaveContext.save.weekEventReg[22] & 0x20) {
Message_StartTextbox(globalCtx, 0x2855, &this->actor);
this->unk_552 = 0x2855;
} else if (this->unk_53E == 1) {
@@ -1067,8 +1067,8 @@ void func_809639D0(EnFu* this, GlobalContext* globalCtx) {
break;
case 3:
if (gSaveContext.playerForm != PLAYER_FORM_HUMAN) {
if (gSaveContext.playerForm == PLAYER_FORM_DEKU) {
if (gSaveContext.save.playerForm != PLAYER_FORM_HUMAN) {
if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
func_80963EAC(this, globalCtx);
} else {
Message_StartTextbox(globalCtx, 0x2841, &this->actor);
@@ -1077,15 +1077,15 @@ void func_809639D0(EnFu* this, GlobalContext* globalCtx) {
} else if (CUR_UPG_VALUE(UPG_QUIVER) == 0) {
Message_StartTextbox(globalCtx, 0x284B, &this->actor);
this->unk_552 = 0x284B;
} else if (gSaveContext.weekEventReg[22] & 0x40) {
if ((gSaveContext.weekEventReg[22] & 0x10) && (gSaveContext.weekEventReg[22] & 0x20)) {
} else if (gSaveContext.save.weekEventReg[22] & 0x40) {
if ((gSaveContext.save.weekEventReg[22] & 0x10) && (gSaveContext.save.weekEventReg[22] & 0x20)) {
Message_StartTextbox(globalCtx, 0x285F, &this->actor);
this->unk_552 = 0x285F;
} else {
Message_StartTextbox(globalCtx, 0x2861, &this->actor);
this->unk_552 = 0x2861;
}
} else if ((gSaveContext.weekEventReg[22] & 0x10) && (gSaveContext.weekEventReg[22] & 0x20)) {
} else if ((gSaveContext.save.weekEventReg[22] & 0x10) && (gSaveContext.save.weekEventReg[22] & 0x20)) {
if (this->unk_53E == 1) {
Message_StartTextbox(globalCtx, 0x2863, &this->actor);
this->unk_552 = 0x2863;
@@ -1094,7 +1094,7 @@ void func_809639D0(EnFu* this, GlobalContext* globalCtx) {
Message_StartTextbox(globalCtx, 0x2865, &this->actor);
this->unk_552 = 0x2865;
}
} else if ((gSaveContext.weekEventReg[22] & 0x10) || (gSaveContext.weekEventReg[22] & 0x20)) {
} else if ((gSaveContext.save.weekEventReg[22] & 0x10) || (gSaveContext.save.weekEventReg[22] & 0x20)) {
if (this->unk_53E == 1) {
Message_StartTextbox(globalCtx, 0x2867, &this->actor);
this->unk_552 = 0x2867;
@@ -1118,7 +1118,7 @@ void func_809639D0(EnFu* this, GlobalContext* globalCtx) {
void func_80963DE4(EnFu* this, GlobalContext* globalCtx) {
switch (this->unk_542) {
case 0:
if (gSaveContext.playerForm != PLAYER_FORM_HUMAN) {
if (gSaveContext.save.playerForm != PLAYER_FORM_HUMAN) {
Message_StartTextbox(globalCtx, 0x2875, &this->actor);
this->unk_552 = 0x2875;
} else {
@@ -1140,7 +1140,7 @@ void func_80963DE4(EnFu* this, GlobalContext* globalCtx) {
}
void func_80963EAC(EnFu* this, GlobalContext* globalCtx) {
if (gSaveContext.magicAcquired) {
if (gSaveContext.save.playerData.magicAcquired) {
if (this->unk_540 == 1) {
Message_StartTextbox(globalCtx, 0x2847, &this->actor);
this->unk_552 = 0x2847;
@@ -207,7 +207,7 @@ void EnGakufu_GiveReward(EnGakufu* this, GlobalContext* globalCtx) {
play_sound(NA_SE_SY_CORRECT_CHIME);
hour = gSaveContext.time * (24.0f / 0x10000);
hour = gSaveContext.save.time * (24.0f / 0x10000);
for (i = 0; i < 3; i++) {
Item_DropCollectible(globalCtx, &sRewardDropsSpawnTerminaFieldPos, sRewardDrops[i + sRewardDropsIndex[hour]]);
}
+20 -20
View File
@@ -120,8 +120,8 @@ s32 func_80B0F660(EnGb2* this, GlobalContext* globalCtx) {
}
void func_80B0F6DC(EnGb2* this) {
if (!(gSaveContext.weekEventReg[54] & 0x20)) {
gSaveContext.weekEventReg[54] |= 0x20;
if (!(gSaveContext.save.weekEventReg[54] & 0x20)) {
gSaveContext.save.weekEventReg[54] |= 0x20;
this->unk_26E = 0x14D0;
} else {
this->unk_26E = 0x14D1;
@@ -163,7 +163,7 @@ u16 func_80B0F7FC(EnGb2* this) {
return 0x14E4;
}
if (gSaveContext.health > 48) {
if (gSaveContext.save.playerData.health > 48) {
return 0x14D2;
}
@@ -171,7 +171,7 @@ u16 func_80B0F7FC(EnGb2* this) {
return 0x14D3;
case 0x14E4:
if (gSaveContext.health > 48) {
if (gSaveContext.save.playerData.health > 48) {
return 0x14D2;
}
@@ -208,7 +208,7 @@ u16 func_80B0F8F8(EnGb2* this) {
case 0x14DE:
this->unk_26C |= 2;
gSaveContext.weekEventReg[54] |= 0x80;
gSaveContext.save.weekEventReg[54] |= 0x80;
return 0x14DF;
case 0x14E1:
@@ -226,7 +226,7 @@ u16 func_80B0F97C(EnGb2* this) {
return 0x14F7;
case 0x14F7:
gSaveContext.weekEventReg[76] |= 0x80;
gSaveContext.save.weekEventReg[76] |= 0x80;
this->unk_26C |= 2;
return 0x14F8;
@@ -259,7 +259,7 @@ s32 func_80B0FA48(EnGb2* this, GlobalContext* globalCtx) {
return false;
case PLAYER_MASK_CAPTAIN:
if (!(gSaveContext.weekEventReg[80] & 0x40)) {
if (!(gSaveContext.save.weekEventReg[80] & 0x40)) {
this->unk_26E = 0x14EB;
return false;
}
@@ -267,7 +267,7 @@ s32 func_80B0FA48(EnGb2* this, GlobalContext* globalCtx) {
return true;
}
if (!(gSaveContext.weekEventReg[80] & 0x20)) {
if (!(gSaveContext.save.weekEventReg[80] & 0x20)) {
this->unk_26E = 0x14EF;
return false;
} else {
@@ -407,7 +407,7 @@ void func_80B0FFA8(EnGb2* this, GlobalContext* globalCtx) {
if (this->unk_26E == 0x14D5) {
switch (globalCtx->msgCtx.choiceIndex) {
case 0:
if (gSaveContext.rupees < this->unk_288) {
if (gSaveContext.save.playerData.rupees < this->unk_288) {
play_sound(NA_SE_SY_ERROR);
this->unk_26E = 0x14D7;
this->unk_26C |= 2;
@@ -505,7 +505,7 @@ void func_80B10344(EnGb2* this, GlobalContext* globalCtx) {
}
}
if (gSaveContext.health < 49) {
if (gSaveContext.save.playerData.health < 49) {
gSaveContext.unk_3DD0[1] = 5;
gSaveContext.eventInf[4] |= 0x40;
gSaveContext.eventInf[4] |= 0x20;
@@ -575,7 +575,7 @@ void func_80B10634(EnGb2* this, GlobalContext* globalCtx) {
} else if ((temp_v0 == 4) && Message_ShouldAdvance(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) {
case 0:
if (gSaveContext.rupees < this->unk_288) {
if (gSaveContext.save.playerData.rupees < this->unk_288) {
play_sound(NA_SE_SY_ERROR);
this->unk_26E = 0x14D7;
this->unk_26C |= 2;
@@ -617,7 +617,7 @@ void func_80B10868(EnGb2* this, GlobalContext* globalCtx) {
void func_80B10924(EnGb2* this, GlobalContext* globalCtx) {
s32 sp24;
if (gSaveContext.weekEventReg[54] & 0x40) {
if (gSaveContext.save.weekEventReg[54] & 0x40) {
sp24 = 5;
} else {
sp24 = 12;
@@ -626,7 +626,7 @@ void func_80B10924(EnGb2* this, GlobalContext* globalCtx) {
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
if (sp24 == 12) {
gSaveContext.weekEventReg[54] |= 0x40;
gSaveContext.save.weekEventReg[54] |= 0x40;
} else {
func_801159EC(50);
}
@@ -706,9 +706,9 @@ void func_80B10B5C(EnGb2* this, GlobalContext* globalCtx) {
this->actor.flags &= ~ACTOR_FLAG_10000;
Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
if (this->unk_26E == 0x14EB) {
gSaveContext.weekEventReg[80] |= 0x40;
gSaveContext.save.weekEventReg[80] |= 0x40;
} else if (this->unk_26E == 0x14EF) {
gSaveContext.weekEventReg[80] |= 0x20;
gSaveContext.save.weekEventReg[80] |= 0x20;
}
this->unk_26C &= ~0x20;
this->unk_290 = 0;
@@ -885,13 +885,13 @@ void EnGb2_Init(Actor* thisx, GlobalContext* globalCtx) {
switch (ENGB2_GET_7(&this->actor)) {
case ENGB2_7_0:
if (gSaveContext.weekEventReg[54] & 0x80) {
if (gSaveContext.save.weekEventReg[54] & 0x80) {
Actor_MarkForDeath(&this->actor);
} else if (gSaveContext.weekEventReg[52] & 0x20) {
} else if (gSaveContext.save.weekEventReg[52] & 0x20) {
Actor_MarkForDeath(&this->actor);
}
if (gSaveContext.entranceIndex == 0x9C10) {
if (gSaveContext.save.entranceIndex == 0x9C10) {
func_800FE484();
this->actionFunc = func_80B10240;
break;
@@ -910,7 +910,7 @@ void EnGb2_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
case ENGB2_7_1:
if ((globalCtx->curSpawn == 1) || (gSaveContext.weekEventReg[80] & 0x80)) {
if ((globalCtx->curSpawn == 1) || (gSaveContext.save.weekEventReg[80] & 0x80)) {
Actor_MarkForDeath(&this->actor);
return;
}
@@ -940,7 +940,7 @@ void EnGb2_Init(Actor* thisx, GlobalContext* globalCtx) {
return;
}
if (gSaveContext.weekEventReg[76] & 0x80) {
if (gSaveContext.save.weekEventReg[76] & 0x80) {
this->actor.draw = NULL;
this->unk_26C |= 0x100;
this->actor.flags &= ~ACTOR_FLAG_1;
+5 -5
View File
@@ -452,7 +452,7 @@ void func_80BB221C(EnGeg* this, GlobalContext* globalCtx) {
}
} else {
this->unk_230 &= ~4;
if (gSaveContext.weekEventReg[35] & 0x40) {
if (gSaveContext.save.weekEventReg[35] & 0x40) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) && (this->unk_230 & 8)) {
this->unk_496 = 0xD62;
Message_StartTextbox(globalCtx, this->unk_496, &this->actor);
@@ -463,7 +463,7 @@ void func_80BB221C(EnGeg* this, GlobalContext* globalCtx) {
this->unk_230 |= 8;
}
} else if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) && (this->unk_230 & 8)) {
gSaveContext.weekEventReg[35] |= 0x40;
gSaveContext.save.weekEventReg[35] |= 0x40;
this->unk_496 = 0xD5E;
this->unk_49A = this->unk_49C[0];
Message_StartTextbox(globalCtx, this->unk_496, &this->actor);
@@ -655,7 +655,7 @@ void func_80BB2B1C(EnGeg* this, GlobalContext* globalCtx) {
if (ActorCutscene_GetCurrentIndex() != this->unk_49C[4]) {
if (ActorCutscene_GetCanPlayNext(this->unk_498)) {
gSaveContext.weekEventReg[37] |= 8;
gSaveContext.save.weekEventReg[37] |= 8;
if (this->actor.child != NULL) {
Actor_MarkForDeath(this->actor.child);
}
@@ -797,7 +797,7 @@ void func_80BB31B8(EnGeg* this, GlobalContext* globalCtx) {
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
gSaveContext.weekEventReg[61] |= 1;
gSaveContext.save.weekEventReg[61] |= 1;
if (getItemId == GI_MASK_DON_GERO) {
this->unk_230 |= 0x40;
}
@@ -860,7 +860,7 @@ void EnGeg_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad2;
s32 sp34[] = { 0x3E, 0xF64 };
if (gSaveContext.weekEventReg[61] & 1) {
if (gSaveContext.save.weekEventReg[61] & 1) {
Actor_MarkForDeath(&this->actor);
return;
}
+14 -14
View File
@@ -129,7 +129,7 @@ s32 func_80B34FB4(EnGg* this, GlobalContext* globalCtx) {
pitch = Math_Vec3f_Pitch(&sp34, &sp40);
if ((this->actor.xzDistToPlayer < 250.0f) && (this->actor.xzDistToPlayer > 50.0f) &&
(CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80) || (gSaveContext.weekEventReg[19] & 0x80))) {
(CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80) || (gSaveContext.save.weekEventReg[19] & 0x80))) {
Math_SmoothStepToS(&this->unk_2E8, pitch, 4, 0x2AA8, 1);
} else {
Math_SmoothStepToS(&this->unk_2E8, 0, 4, 0x2AA8, 1);
@@ -212,7 +212,7 @@ void func_80B352A4(EnGg* this, GlobalContext* globalCtx) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
break;
}
gSaveContext.weekEventReg[19] |= 0x80;
gSaveContext.save.weekEventReg[19] |= 0x80;
this->actionFunc = func_80B3556C;
} else if ((this->unk_2E6 == 0) && ((this->actor.textId == 0xCED) || (this->actor.textId == 0xCEE))) {
if (sp26 < (lastFrame - 1)) {
@@ -225,7 +225,7 @@ void func_80B352A4(EnGg* this, GlobalContext* globalCtx) {
}
void func_80B35450(EnGg* this, GlobalContext* globalCtx) {
if ((gSaveContext.weekEventReg[91] & 0x10) && (globalCtx->csCtx.state == 0)) {
if ((gSaveContext.save.weekEventReg[91] & 0x10) && (globalCtx->csCtx.state == 0)) {
func_80B359DC(this, globalCtx);
}
@@ -236,7 +236,7 @@ void func_80B35450(EnGg* this, GlobalContext* globalCtx) {
this->unk_308 = 1;
this->actionFunc = func_80B352A4;
} else if ((this->actor.xzDistToPlayer < 200.0f) && (this->actor.xzDistToPlayer > 50.0f)) {
if (gSaveContext.weekEventReg[19] & 0x80) {
if (gSaveContext.save.weekEventReg[19] & 0x80) {
func_800B863C(&this->actor, globalCtx);
this->actor.textId = 0xCEE;
} else if CHECK_FLAG_ALL (this->actor.flags, ACTOR_FLAG_80) {
@@ -400,8 +400,8 @@ void func_80B359DC(EnGg* this, GlobalContext* globalCtx) {
if ((player->transformation == PLAYER_FORM_HUMAN) && (globalCtx->msgCtx.ocarinaMode == 3) &&
(globalCtx->msgCtx.unk1202E == 7)) {
if (!(gSaveContext.weekEventReg[19] & 0x80)) {
gSaveContext.weekEventReg[19] |= 0x80;
if (!(gSaveContext.save.weekEventReg[19] & 0x80)) {
gSaveContext.save.weekEventReg[19] |= 0x80;
}
this->unk_307 = true;
}
@@ -661,9 +661,9 @@ void EnGg_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
gSaveContext.weekEventReg[20] &= (u8)~4;
gSaveContext.weekEventReg[20] &= (u8)~8;
gSaveContext.weekEventReg[20] &= (u8)~0x10;
gSaveContext.save.weekEventReg[20] &= (u8)~4;
gSaveContext.save.weekEventReg[20] &= (u8)~8;
gSaveContext.save.weekEventReg[20] &= (u8)~0x10;
this->actor.flags &= ~ACTOR_FLAG_80;
this->unk_310 = this->actor.home.pos.y;
this->unk_2DC = this->actor.cutscene;
@@ -691,7 +691,7 @@ void EnGg_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actor.flags &= ~ACTOR_FLAG_1;
}
if (gSaveContext.weekEventReg[19] & 0x80) {
if (gSaveContext.save.weekEventReg[19] & 0x80) {
if (globalCtx->csCtx.state == 0) {
this->actor.flags |= ACTOR_FLAG_1;
} else {
@@ -709,10 +709,10 @@ void EnGg_Update(Actor* thisx, GlobalContext* globalCtx) {
func_80B35968(this, globalCtx);
}
if (!(gSaveContext.weekEventReg[91] & 0x10) &&
((gSaveContext.weekEventReg[19] & 0x80) || CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80) ||
if (!(gSaveContext.save.weekEventReg[91] & 0x10) &&
((gSaveContext.save.weekEventReg[19] & 0x80) || CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80) ||
(this->unk_308 == 1))) {
gSaveContext.weekEventReg[91] |= 0x10;
gSaveContext.save.weekEventReg[91] |= 0x10;
}
this->actionFunc(this, globalCtx);
@@ -790,7 +790,7 @@ void EnGg_Draw(Actor* thisx, GlobalContext* globalCtx) {
this->unk_344.unk_38(&this->unk_344, globalCtx);
}
if (gSaveContext.weekEventReg[19] & 0x80) {
if (gSaveContext.save.weekEventReg[19] & 0x80) {
func_8012C28C(globalCtx->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B36DFC[this->unk_2E2]));
+31 -31
View File
@@ -214,17 +214,17 @@ void func_80B3B294(EnGg2* this, GlobalContext* globalCtx) {
if (this->unk_2F1 == 0) {
if (globalCtx->sceneNum == SCENE_11GORONNOSATO) {
gSaveContext.weekEventReg[20] |= 4;
gSaveContext.weekEventReg[20] &= (u8)~8;
gSaveContext.weekEventReg[20] &= (u8)~0x10;
gSaveContext.save.weekEventReg[20] |= 4;
gSaveContext.save.weekEventReg[20] &= (u8)~8;
gSaveContext.save.weekEventReg[20] &= (u8)~0x10;
} else if (globalCtx->sceneNum == SCENE_17SETUGEN) {
gSaveContext.weekEventReg[20] &= (u8)~4;
gSaveContext.weekEventReg[20] |= 8;
gSaveContext.weekEventReg[20] &= (u8)~0x10;
gSaveContext.save.weekEventReg[20] &= (u8)~4;
gSaveContext.save.weekEventReg[20] |= 8;
gSaveContext.save.weekEventReg[20] &= (u8)~0x10;
} else if (globalCtx->sceneNum == SCENE_10YUKIYAMANOMURA) {
gSaveContext.weekEventReg[20] &= (u8)~4;
gSaveContext.weekEventReg[20] &= (u8)~8;
gSaveContext.weekEventReg[20] |= 0x10;
gSaveContext.save.weekEventReg[20] &= (u8)~4;
gSaveContext.save.weekEventReg[20] &= (u8)~8;
gSaveContext.save.weekEventReg[20] |= 0x10;
}
if (this->unk_1D8 != NULL) {
@@ -240,17 +240,17 @@ void func_80B3B294(EnGg2* this, GlobalContext* globalCtx) {
} else {
this->unk_2F1 = 1;
if (globalCtx->sceneNum == SCENE_11GORONNOSATO) {
gSaveContext.weekEventReg[20] |= 4;
gSaveContext.weekEventReg[20] &= (u8)~8;
gSaveContext.weekEventReg[20] &= (u8)~0x10;
gSaveContext.save.weekEventReg[20] |= 4;
gSaveContext.save.weekEventReg[20] &= (u8)~8;
gSaveContext.save.weekEventReg[20] &= (u8)~0x10;
} else if (globalCtx->sceneNum == SCENE_17SETUGEN) {
gSaveContext.weekEventReg[20] &= (u8)~4;
gSaveContext.weekEventReg[20] |= 8;
gSaveContext.weekEventReg[20] &= (u8)~0x10;
gSaveContext.save.weekEventReg[20] &= (u8)~4;
gSaveContext.save.weekEventReg[20] |= 8;
gSaveContext.save.weekEventReg[20] &= (u8)~0x10;
} else if (globalCtx->sceneNum == SCENE_10YUKIYAMANOMURA) {
gSaveContext.weekEventReg[20] &= (u8)~4;
gSaveContext.weekEventReg[20] &= (u8)~8;
gSaveContext.weekEventReg[20] |= 0x10;
gSaveContext.save.weekEventReg[20] &= (u8)~4;
gSaveContext.save.weekEventReg[20] &= (u8)~8;
gSaveContext.save.weekEventReg[20] |= 0x10;
}
}
}
@@ -360,7 +360,7 @@ void EnGg2_Init(Actor* thisx, GlobalContext* globalCtx2) {
return;
}
if (gSaveContext.weekEventReg[91] & 0x10) {
if (gSaveContext.save.weekEventReg[91] & 0x10) {
Actor_MarkForDeath(&this->actor);
return;
}
@@ -381,16 +381,16 @@ void EnGg2_Init(Actor* thisx, GlobalContext* globalCtx2) {
this->unk_2EA = 0;
if (globalCtx->sceneNum == SCENE_11GORONNOSATO) {
gSaveContext.weekEventReg[20] &= (u8)~4;
gSaveContext.weekEventReg[20] &= (u8)~8;
gSaveContext.weekEventReg[20] &= (u8)~0x10;
gSaveContext.save.weekEventReg[20] &= (u8)~4;
gSaveContext.save.weekEventReg[20] &= (u8)~8;
gSaveContext.save.weekEventReg[20] &= (u8)~0x10;
this->unk_2EE = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_80B3BF00, 0);
this->actionFunc = func_80B3AFB0;
} else if (globalCtx->sceneNum == SCENE_17SETUGEN) {
if ((gSaveContext.weekEventReg[20] & 4) && !(gSaveContext.weekEventReg[20] & 8) &&
!(gSaveContext.weekEventReg[20] & 0x10)) {
gSaveContext.weekEventReg[20] &= (u8)~4;
if ((gSaveContext.save.weekEventReg[20] & 4) && !(gSaveContext.save.weekEventReg[20] & 8) &&
!(gSaveContext.save.weekEventReg[20] & 0x10)) {
gSaveContext.save.weekEventReg[20] &= (u8)~4;
this->unk_2EE = 8;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_80B3BF00, 0);
this->actionFunc = func_80B3B05C;
@@ -398,9 +398,9 @@ void EnGg2_Init(Actor* thisx, GlobalContext* globalCtx2) {
Actor_MarkForDeath(&this->actor);
}
} else if (globalCtx->sceneNum == SCENE_10YUKIYAMANOMURA) {
if (!(gSaveContext.weekEventReg[20] & 4) && (gSaveContext.weekEventReg[20] & 8) &&
!(gSaveContext.weekEventReg[20] & 0x10)) {
gSaveContext.weekEventReg[20] &= (u8)~8;
if (!(gSaveContext.save.weekEventReg[20] & 4) && (gSaveContext.save.weekEventReg[20] & 8) &&
!(gSaveContext.save.weekEventReg[20] & 0x10)) {
gSaveContext.save.weekEventReg[20] &= (u8)~8;
this->unk_2EE = 8;
Actor_ChangeAnimationByInfo(&this->skelAnime, D_80B3BF00, 0);
this->actionFunc = func_80B3B05C;
@@ -408,9 +408,9 @@ void EnGg2_Init(Actor* thisx, GlobalContext* globalCtx2) {
Actor_MarkForDeath(&this->actor);
}
} else {
gSaveContext.weekEventReg[20] &= (u8)~4;
gSaveContext.weekEventReg[20] &= (u8)~8;
gSaveContext.weekEventReg[20] &= (u8)~0x10;
gSaveContext.save.weekEventReg[20] &= (u8)~4;
gSaveContext.save.weekEventReg[20] &= (u8)~8;
gSaveContext.save.weekEventReg[20] &= (u8)~0x10;
Actor_MarkForDeath(&this->actor);
}
}
@@ -183,10 +183,11 @@ void EnGiant_Init(Actor* thisx, GlobalContext* globalCtx) {
}
if (GIANT_TYPE_IS_CLOCK_TOWER_SUCCESS(type)) {
if (!(gSaveContext.weekEventReg[25] & 2)) {
if (!(gSaveContext.save.weekEventReg[25] & 2)) {
Actor_MarkForDeath(&this->actor);
return;
}
this->actorActionCommand = 0x1C5;
Actor_SetScale(&this->actor, 0.32f);
this->actionFunc = EnGiant_PerformClockTowerSuccessActions;
@@ -81,13 +81,13 @@ void EnGinkoMan_Idle(EnGinkoMan* this, GlobalContext* globalCtx) {
EnGinkoMan_SwitchAnimation(this, globalCtx);
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
if ((gSaveContext.bankRupees & 0xFFFF) == 0) {
if ((gSaveContext.save.bankRupees & 0xFFFF) == 0) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
Message_StartTextbox(globalCtx, 0x44C, &this->actor);
this->curTextId = 0x44C; // would you like to make an account
} else {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) {
if ((CURRENT_DAY == 3) && (gSaveContext.save.isNight == true)) {
Message_StartTextbox(globalCtx, 0x467, &this->actor);
this->curTextId = 0x467; // "What's this? You need somethin' on a day like this?
} else {
@@ -110,7 +110,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
switch (this->curTextId) {
case 0x44C: // "Hey there, little guy! Won't you deposit some Rupees? (first dialogue)
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
if (gSaveContext.weekEventReg[10] & 8) {
if (gSaveContext.save.weekEventReg[10] & 8) {
Message_StartTextbox(globalCtx, 0x44E, &this->actor);
this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees"
} else {
@@ -145,7 +145,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
}
globalCtx->msgCtx.bankRupees = gSaveContext.bankRupees & 0xFFFF;
globalCtx->msgCtx.bankRupees = gSaveContext.save.bankRupees & 0xFFFF;
Message_StartTextbox(globalCtx, 0x45A, &this->actor);
this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!"
}
@@ -156,22 +156,22 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees"
break;
case 0x45A: // "All right, little guy, now I've got a total of [rupees] from you!"
if (((gSaveContext.bankRupees & 0xFFFF) >= 200) && (this->previousBankValue < 200) &&
!(gSaveContext.weekEventReg[59] & 0x40)) {
gSaveContext.weekEventReg[59] |= 0x40;
if (((gSaveContext.save.bankRupees & 0xFFFF) >= 200) && (this->previousBankValue < 200) &&
!(gSaveContext.save.weekEventReg[59] & 0x40)) {
gSaveContext.save.weekEventReg[59] |= 0x40;
Message_StartTextbox(globalCtx, 0x45B, &this->actor);
this->curTextId = 0x45B; // "What's this? You've already saved up 200 Rupees!?!
} else if (((gSaveContext.bankRupees & 0xFFFF) >= 1000) && ((this->previousBankValue) < 1000) &&
!(gSaveContext.weekEventReg[59] & 0x80)) {
gSaveContext.weekEventReg[59] |= 0x80;
} else if (((gSaveContext.save.bankRupees & 0xFFFF) >= 1000) && ((this->previousBankValue) < 1000) &&
!(gSaveContext.save.weekEventReg[59] & 0x80)) {
gSaveContext.save.weekEventReg[59] |= 0x80;
Message_StartTextbox(globalCtx, 0x45C, &this->actor);
this->curTextId = 0x45C; // "What's this? You've already saved up 1000 Rupees!?!
} else if ((gSaveContext.bankRupees & 0xFFFF) >= 5000) {
if ((this->previousBankValue < 5000) && !(gSaveContext.weekEventReg[60] & 1)) {
gSaveContext.weekEventReg[60] |= 1;
} else if ((gSaveContext.save.bankRupees & 0xFFFF) >= 5000) {
if ((this->previousBankValue < 5000) && !(gSaveContext.save.weekEventReg[60] & 1)) {
gSaveContext.save.weekEventReg[60] |= 1;
Message_StartTextbox(globalCtx, 0x45D, &this->actor);
this->curTextId = 0x45D; // "What's this? You've already saved up 5000 Rupees?!
} else if (this->previousBankValue < (s16)(gSaveContext.bankRupees & 0xFFFF)) {
} else if (this->previousBankValue < (s16)(gSaveContext.save.bankRupees & 0xFFFF)) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Message_StartTextbox(globalCtx, 0x45E, &this->actor);
this->curTextId =
@@ -213,7 +213,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
break;
case 0x465: // "There! Now I'll know you when I see you!"
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
globalCtx->msgCtx.bankRupees = gSaveContext.bankRupees & 0xFFFF;
globalCtx->msgCtx.bankRupees = gSaveContext.save.bankRupees & 0xFFFF;
Message_StartTextbox(globalCtx, 0x45A, &this->actor);
this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!"
break;
@@ -229,10 +229,10 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
case 0x46C: // "Ah, yes...[Link], right? If I remember, you're the little guy who deposited [rupees]."
case 0x47E: // "Your deposits total [rupees]."
if (this->choiceDepositWithdrawl == GINKOMAN_CHOICE_DEPOSIT) {
if ((u32)(gSaveContext.bankRupees & 0xFFFF) >= 5000) {
if ((u32)(gSaveContext.save.bankRupees & 0xFFFF) >= 5000) {
Message_StartTextbox(globalCtx, 0x45F, &this->actor);
this->curTextId = 0x45F; // "Excuuuse me! But I can't take anymore deposits!
} else if (gSaveContext.rupees == 0) {
} else if (gSaveContext.save.playerData.rupees == 0) {
Message_StartTextbox(globalCtx, 0x458, &this->actor);
this->curTextId =
0x458; // "Hmm...You play mean jokes, little guy! You haven't even got a single Rupee!
@@ -240,7 +240,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
Message_StartTextbox(globalCtx, 0x479, &this->actor);
this->curTextId = 0x479; // "Well, are you gonna make a deposit?"
}
} else if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) {
} else if ((CURRENT_DAY == 3) && (gSaveContext.save.isNight == true)) {
Message_StartTextbox(globalCtx, 0x46D, &this->actor);
// "Look, little guy, if it's 'cause of the bad rumors going around, forget it! They're just rumors!"
this->curTextId = 0x46D;
@@ -280,12 +280,12 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
case 0x473: // Use it wisely...
case 0x474: // "Aw, you're taking out all that? If you spend it like that, it'll all be gone before you know
// it!"
if ((gSaveContext.bankRupees & 0xFFFF) == 0) {
if ((gSaveContext.save.bankRupees & 0xFFFF) == 0) {
Message_StartTextbox(globalCtx, 0x478, &this->actor);
// "Look, little guy, all the Rupees you deposited are gone, so you can't use that stamp anymore."
this->curTextId = 0x478;
} else {
globalCtx->msgCtx.bankRupees = gSaveContext.bankRupees & 0xFFFF;
globalCtx->msgCtx.bankRupees = gSaveContext.save.bankRupees & 0xFFFF;
Message_StartTextbox(globalCtx, 0x45A, &this->actor);
this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!"
}
@@ -311,12 +311,12 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
switch (this->curTextId) {
case 0x44E: // "...So, what'll it be?
if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) {
if ((gSaveContext.bankRupees & 0xFFFF) >= 5000) {
if ((gSaveContext.save.bankRupees & 0xFFFF) >= 5000) {
play_sound(NA_SE_SY_ERROR);
Message_StartTextbox(globalCtx, 0x45F, &this->actor);
this->curTextId = 0x45F; // bank full, cannot accept more
} else {
if (gSaveContext.rupees > 0) {
if (gSaveContext.save.playerData.rupees > 0) {
func_8019F208();
Message_StartTextbox(globalCtx, 0x44F, &this->actor);
this->curTextId = 0x44F; // "All right! so..."
@@ -334,7 +334,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
break;
case 0x452: // Really? are you really depositing rupees?
if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) {
if (gSaveContext.rupees < globalCtx->msgCtx.bankRupeesSelected) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.bankRupeesSelected) {
play_sound(NA_SE_SY_ERROR);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
Message_StartTextbox(globalCtx, 0x459, &this->actor);
@@ -353,20 +353,20 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
this->curTextId = 0x453; // That's it? That aint nothing at all
}
if ((gSaveContext.bankRupees & 0xFFFF) == 0) {
if ((gSaveContext.save.bankRupees & 0xFFFF) == 0) {
this->isNewAccount = true;
}
func_801159EC((s16)-globalCtx->msgCtx.bankRupeesSelected);
this->previousBankValue = gSaveContext.bankRupees & 0xFFFF;
gSaveContext.bankRupees =
((gSaveContext.bankRupees & 0xFFFF) + globalCtx->msgCtx.bankRupeesSelected) |
(gSaveContext.bankRupees & 0xFFFF0000);
this->previousBankValue = gSaveContext.save.bankRupees & 0xFFFF;
gSaveContext.save.bankRupees =
((gSaveContext.save.bankRupees & 0xFFFF) + globalCtx->msgCtx.bankRupeesSelected) |
(gSaveContext.save.bankRupees & 0xFFFF0000);
}
} else { // GINKOMAN_CHOICE_NO
func_8019F230();
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
if ((gSaveContext.bankRupees & 0xFFFF) == 0) {
if ((gSaveContext.save.bankRupees & 0xFFFF) == 0) {
Message_StartTextbox(globalCtx, 0x456, &this->actor);
this->curTextId = 0x456; // Is that so? think about it
} else {
@@ -395,13 +395,14 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
break;
case 0x471: // Are you really withdrawling [selected rupees]?
if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) {
if ((s32)((gSaveContext.bankRupees & 0xFFFF)) <
if ((s32)((gSaveContext.save.bankRupees & 0xFFFF)) <
((s32)(globalCtx->msgCtx.bankRupeesSelected + this->serviceFee))) {
play_sound(NA_SE_SY_ERROR);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
Message_StartTextbox(globalCtx, 0x476, &this->actor);
this->curTextId = 0x476; // you dont have enough deposited to withdrawl
} else if (CUR_CAPACITY(UPG_WALLET) < (globalCtx->msgCtx.bankRupeesSelected + gSaveContext.rupees)) {
} else if (CUR_CAPACITY(UPG_WALLET) <
(globalCtx->msgCtx.bankRupeesSelected + gSaveContext.save.playerData.rupees)) {
// check if wallet is big enough
play_sound(NA_SE_SY_ERROR);
Message_StartTextbox(globalCtx, 0x475, &this->actor);
@@ -419,11 +420,11 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
this->curTextId = 0x472; // It's a waste to take out such a tiny bit
}
this->previousBankValue = (s16)(gSaveContext.bankRupees & 0xFFFF);
gSaveContext.bankRupees =
(((gSaveContext.bankRupees & 0xFFFF) - globalCtx->msgCtx.bankRupeesSelected) -
this->previousBankValue = (s16)(gSaveContext.save.bankRupees & 0xFFFF);
gSaveContext.save.bankRupees =
(((gSaveContext.save.bankRupees & 0xFFFF) - globalCtx->msgCtx.bankRupeesSelected) -
this->serviceFee) |
(gSaveContext.bankRupees & 0xFFFF0000);
(gSaveContext.save.bankRupees & 0xFFFF0000);
func_801159EC(globalCtx->msgCtx.bankRupeesSelected);
}
} else {
@@ -452,7 +453,7 @@ void EnGinkoMan_WaitForRupeeCount(EnGinkoMan* this, GlobalContext* globalCtx) {
if (globalCtx->msgCtx.bankRupeesSelected == 0) {
Message_StartTextbox(globalCtx, 0x46F, &this->actor);
this->curTextId = 0x46F; // "Zero Rupees?!? That's a cruel joke!"
} else if (gSaveContext.isNight == 1) {
} else if (gSaveContext.save.isNight == true) {
Message_StartTextbox(globalCtx, 0x477, &this->actor);
this->curTextId = 0x477; // "...You know, at this time of day there's a 4 Rupee service charge...
} else {
@@ -510,14 +511,14 @@ void EnGinkoMan_BankAward(EnGinkoMan* this, GlobalContext* globalCtx) {
this->actor.parent = NULL;
EnGinkoMan_SetupBankAward2(this);
} else if (this->curTextId == 0x45B) { // "Whats this, you already saved up 200?"
if (!(gSaveContext.weekEventReg[10] & 8)) {
if (!(gSaveContext.save.weekEventReg[10] & 8)) {
Actor_PickUp(&this->actor, globalCtx, GI_WALLET_ADULT + CUR_UPG_VALUE(UPG_WALLET), 500.0f, 100.0f);
} else {
Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_BLUE, 500.0f, 100.0f);
}
} else if (this->curTextId == 0x45C) { // "Whats this, you already saved up 5000?"
Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_BLUE, 500.0f, 100.0f);
} else if (!(gSaveContext.weekEventReg[59] & 8)) {
} else if (!(gSaveContext.save.weekEventReg[59] & 8)) {
Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 500.0f, 100.0f);
} else {
Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_BLUE, 500.0f, 100.0f);
@@ -532,10 +533,10 @@ void EnGinkoMan_SetupBankAward2(EnGinkoMan* this) {
// separate function to handle bank rewards... called while the player is receiving the award
void EnGinkoMan_BankAward2(EnGinkoMan* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
if (!(gSaveContext.weekEventReg[10] & 8) && (this->curTextId == 0x45B)) {
if (!(gSaveContext.save.weekEventReg[10] & 8) && (this->curTextId == 0x45B)) {
// "What's this? You've already saved up 200 Rupees!?! Well, little guy, here's your special gift. Take
// it!"
gSaveContext.weekEventReg[10] |= 8;
gSaveContext.save.weekEventReg[10] |= 8;
Message_StartTextbox(globalCtx, 0x47A, &this->actor);
this->curTextId = 0x47A; // Message after receiving reward for depositing 200 rupees.
} else {
@@ -547,8 +548,8 @@ void EnGinkoMan_BankAward2(EnGinkoMan* this, GlobalContext* globalCtx) {
EnGinkoMan_SetupDialogue(this);
} else if (this->curTextId == 0x45D) { // saved up 5000 rupees for HP
if ((Message_GetState(&globalCtx->msgCtx) == 6) && Message_ShouldAdvance(globalCtx)) {
if (!(gSaveContext.weekEventReg[59] & 8)) {
gSaveContext.weekEventReg[59] |= 8;
if (!(gSaveContext.save.weekEventReg[59] & 8)) {
gSaveContext.save.weekEventReg[59] |= 8;
}
EnGinkoMan_SetupIdle(this);
}
@@ -577,8 +578,8 @@ void EnGinkoMan_Stamp(EnGinkoMan* this, GlobalContext* globalCtx) {
break;
case 0x469: // "Excuse me, but let me take a look at you..."
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
globalCtx->msgCtx.bankRupees = (gSaveContext.bankRupees & 0xFFFF);
if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) {
globalCtx->msgCtx.bankRupees = (gSaveContext.save.bankRupees & 0xFFFF);
if ((CURRENT_DAY == 3) && (gSaveContext.save.isNight == true)) {
Message_StartTextbox(globalCtx, 0x46C, &this->actor);
this->curTextId = 0x46C; // "Ah, yes...[Link], right?
} else {
+30 -30
View File
@@ -188,7 +188,7 @@ s32 EnGirlA_CanBuyPotionRed(GlobalContext* globalCtx, EnGirlA* this) {
if (!Interface_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_EMPTY_BOTTLE;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS_2;
@@ -198,46 +198,46 @@ s32 EnGirlA_CanBuyPotionGreen(GlobalContext* globalCtx, EnGirlA* this) {
if (!Interface_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_EMPTY_BOTTLE;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS_2;
}
s32 EnGirlA_CanBuyPotionBlue(GlobalContext* globalCtx, EnGirlA* this) {
if (!(gSaveContext.weekEventReg[53] & 8)) {
if (!(gSaveContext.save.weekEventReg[53] & 8)) {
return CANBUY_RESULT_CANNOT_GET_NOW;
}
if (!Interface_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_EMPTY_BOTTLE;
}
if (!(gSaveContext.weekEventReg[53] & 0x10)) {
if (!(gSaveContext.save.weekEventReg[53] & 0x10)) {
return CANBUY_RESULT_SUCCESS_2;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS_2;
}
s32 EnGirlA_CanBuyArrows(GlobalContext* globalCtx, EnGirlA* this) {
if (CUR_UPG_VALUE_VOID(UPG_QUIVER) == 0) {
if (GET_CUR_UPG_VALUE(UPG_QUIVER) == 0) {
return CANBUY_RESULT_CANNOT_GET_NOW_2;
}
if (AMMO(ITEM_BOW) >= CUR_CAPACITY(UPG_QUIVER)) {
return CANBUY_RESULT_NO_ROOM_2;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS_2;
}
s32 EnGirlA_CanBuyNuts(GlobalContext* globalCtx, EnGirlA* this) {
if (CUR_CAPACITY(UPG_NUTS) != 0 && AMMO(ITEM_NUT) >= CUR_CAPACITY(UPG_NUTS)) {
if (CUR_CAPACITY(UPG_NUTS) != 0 && CUR_CAPACITY(UPG_NUTS) <= AMMO(ITEM_NUT)) {
return CANBUY_RESULT_NO_ROOM;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (func_80114978(ITEM_NUT) == ITEM_NONE) {
@@ -247,10 +247,10 @@ s32 EnGirlA_CanBuyNuts(GlobalContext* globalCtx, EnGirlA* this) {
}
s32 EnGirlA_CanBuyShieldHero(GlobalContext* globalCtx, EnGirlA* this) {
if (CUR_EQUIP_VALUE_VOID(EQUIP_SHIELD) != 0) {
if (GET_CUR_EQUIP_VALUE(EQUIP_SHIELD) != 0) {
return CANBUY_RESULT_NO_ROOM;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS_1;
@@ -260,7 +260,7 @@ s32 EnGirlA_CanBuyStick(GlobalContext* globalCtx, EnGirlA* this) {
if (CUR_CAPACITY(UPG_STICKS) != 0 && AMMO(ITEM_STICK) >= CUR_CAPACITY(UPG_STICKS)) {
return CANBUY_RESULT_NO_ROOM;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (func_80114978(ITEM_STICK) == ITEM_NONE) {
@@ -270,56 +270,56 @@ s32 EnGirlA_CanBuyStick(GlobalContext* globalCtx, EnGirlA* this) {
}
s32 EnGirlA_CanBuyMaskAllNight(GlobalContext* globalCtx, EnGirlA* this) {
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS_2;
}
s32 EnGirlA_CanBuyBombBagCuriosityShop(GlobalContext* globalCtx, EnGirlA* this) {
if (CUR_UPG_VALUE_VOID(UPG_BOMB_BAG) >= 2) {
if (GET_CUR_UPG_VALUE(UPG_BOMB_BAG) >= 2) {
return CANBUY_RESULT_CANNOT_GET_NOW;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS_2;
}
s32 EnGirlA_CanBuyBombBag20BombShop(GlobalContext* globalCtx, EnGirlA* this) {
if (CUR_UPG_VALUE_VOID(UPG_BOMB_BAG) == 1) {
if (GET_CUR_UPG_VALUE(UPG_BOMB_BAG) == 1) {
return CANBUY_RESULT_ALREADY_HAVE;
}
if (CUR_UPG_VALUE_VOID(UPG_BOMB_BAG) >= 2) {
if (GET_CUR_UPG_VALUE(UPG_BOMB_BAG) >= 2) {
return CANBUY_RESULT_HAVE_BETTER;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS_1;
}
s32 EnGirlA_CanBuyBombBag30BombShop(GlobalContext* globalCtx, EnGirlA* this) {
if (CUR_UPG_VALUE_VOID(UPG_BOMB_BAG) == 2) {
if (GET_CUR_UPG_VALUE(UPG_BOMB_BAG) == 2) {
return CANBUY_RESULT_ALREADY_HAVE;
}
if (CUR_UPG_VALUE_VOID(UPG_BOMB_BAG) == 3) {
if (GET_CUR_UPG_VALUE(UPG_BOMB_BAG) == 3) {
return CANBUY_RESULT_HAVE_BETTER;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS_1;
}
s32 EnGirlA_CanBuyBombchus(GlobalContext* globalCtx, EnGirlA* this) {
if (CUR_UPG_VALUE_VOID(UPG_BOMB_BAG) == 0) {
if (GET_CUR_UPG_VALUE(UPG_BOMB_BAG) == 0) {
return CANBUY_RESULT_CANNOT_GET_NOW;
}
if (AMMO(ITEM_BOMBCHU) >= CUR_CAPACITY(UPG_BOMB_BAG)) {
return CANBUY_RESULT_NO_ROOM;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
if (func_80114978(ITEM_BOMBCHU) == ITEM_NONE) {
@@ -329,37 +329,37 @@ s32 EnGirlA_CanBuyBombchus(GlobalContext* globalCtx, EnGirlA* this) {
}
s32 EnGirlA_CanBuyBombs(GlobalContext* globalCtx, EnGirlA* this) {
if (CUR_UPG_VALUE_VOID(UPG_BOMB_BAG) == 0) {
if (GET_CUR_UPG_VALUE(UPG_BOMB_BAG) == 0) {
return CANBUY_RESULT_CANNOT_GET_NOW;
}
if (AMMO(ITEM_BOMB) >= CUR_CAPACITY(UPG_BOMB_BAG)) {
return CANBUY_RESULT_NO_ROOM;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS_2;
}
s32 EnGirlA_CanBuyBottle(GlobalContext* globalCtx, EnGirlA* this) {
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS_1;
}
s32 EnGirlA_CanBuySword(GlobalContext* globalCtx, EnGirlA* this) {
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS_1;
}
s32 EnGirlA_CanBuyShieldMirror(GlobalContext* globalCtx, EnGirlA* this) {
if (CUR_EQUIP_VALUE_VOID(EQUIP_SHIELD) != 0) {
if (GET_CUR_EQUIP_VALUE(EQUIP_SHIELD) != 0) {
return CANBUY_RESULT_NO_ROOM;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS_1;
@@ -369,7 +369,7 @@ s32 EnGirlA_CanBuyFairy(GlobalContext* globalCtx, EnGirlA* this) {
if (!Interface_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_EMPTY_BOTTLE;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
return CANBUY_RESULT_SUCCESS_2;
+30 -30
View File
@@ -120,7 +120,7 @@ u16 func_80B50410(EnGk* this, GlobalContext* globalCtx) {
if (globalCtx->sceneNum == SCENE_17SETUGEN2) {
if (player->transformation == PLAYER_FORM_GORON) {
if (!(gSaveContext.weekEventReg[40] & 0x80)) {
if (!(gSaveContext.save.weekEventReg[40] & 0x80)) {
switch (this->unk_31C) {
case 0xE7A:
return 0xE7B;
@@ -133,7 +133,7 @@ u16 func_80B50410(EnGk* this, GlobalContext* globalCtx) {
case 0xE7E:
return 0xE7F;
case 0xE7F:
gSaveContext.weekEventReg[40] |= 0x80;
gSaveContext.save.weekEventReg[40] |= 0x80;
this->unk_1E4 |= 1;
return 0xE80;
default:
@@ -143,7 +143,7 @@ u16 func_80B50410(EnGk* this, GlobalContext* globalCtx) {
this->unk_1E4 |= 1;
return 0xE81;
}
} else if (!(gSaveContext.weekEventReg[41] & 1)) {
} else if (!(gSaveContext.save.weekEventReg[41] & 1)) {
switch (this->unk_31C) {
case 0xE82:
return 0xE83;
@@ -154,7 +154,7 @@ u16 func_80B50410(EnGk* this, GlobalContext* globalCtx) {
case 0xE7E:
return 0xE7F;
case 0xE7F:
gSaveContext.weekEventReg[41] |= 1;
gSaveContext.save.weekEventReg[41] |= 1;
this->unk_1E4 |= 1;
return 0xE80;
default:
@@ -166,12 +166,12 @@ u16 func_80B50410(EnGk* this, GlobalContext* globalCtx) {
}
} else if (globalCtx->sceneNum == SCENE_GORONRACE) {
if (player->transformation == PLAYER_FORM_GORON) {
if (!(gSaveContext.weekEventReg[41] & 4)) {
if (!(gSaveContext.save.weekEventReg[41] & 4)) {
if (this->unk_31C == 0xE88) {
if (!(gSaveContext.weekEventReg[41] & 8) || Interface_HasEmptyBottle()) {
if (!(gSaveContext.save.weekEventReg[41] & 8) || Interface_HasEmptyBottle()) {
return 0xE89;
}
gSaveContext.weekEventReg[41] |= 4;
gSaveContext.save.weekEventReg[41] |= 4;
this->unk_1E4 |= 1;
return 0xE94;
}
@@ -179,10 +179,10 @@ u16 func_80B50410(EnGk* this, GlobalContext* globalCtx) {
}
if ((this->unk_31C == 0xE8D) || (this->unk_31C == 0xE98)) {
if (!(gSaveContext.weekEventReg[41] & 8) || Interface_HasEmptyBottle()) {
if (!(gSaveContext.save.weekEventReg[41] & 8) || Interface_HasEmptyBottle()) {
return 0xE89;
}
gSaveContext.weekEventReg[41] |= 4;
gSaveContext.save.weekEventReg[41] |= 4;
this->unk_1E4 |= 1;
return 0xE94;
}
@@ -193,12 +193,12 @@ u16 func_80B50410(EnGk* this, GlobalContext* globalCtx) {
return 0xE98;
}
if (!(gSaveContext.weekEventReg[41] & 2)) {
if (!(gSaveContext.save.weekEventReg[41] & 2)) {
switch (this->unk_31C) {
case 0xE85:
return 0xE86;
case 0xE86:
gSaveContext.weekEventReg[41] |= 2;
gSaveContext.save.weekEventReg[41] |= 2;
this->unk_1E4 |= 1;
return 0xE87;
default:
@@ -216,7 +216,7 @@ u16 func_80B50410(EnGk* this, GlobalContext* globalCtx) {
u16 func_80B50710(EnGk* this) {
switch (this->unk_31C) {
case 0xE8E:
gSaveContext.weekEventReg[41] |= 4;
gSaveContext.save.weekEventReg[41] |= 4;
this->unk_1E4 &= ~0x10;
this->unk_1E4 |= 1;
return 0xE8F;
@@ -225,7 +225,7 @@ u16 func_80B50710(EnGk* this) {
return 0xE8B;
case 0xE8B:
gSaveContext.weekEventReg[41] |= 4;
gSaveContext.save.weekEventReg[41] |= 4;
this->unk_1E4 |= 0x10;
this->unk_1E4 |= 1;
return 0xE8C;
@@ -633,7 +633,7 @@ void func_80B51760(EnGk* this, GlobalContext* globalCtx) {
}
} else {
if (Flags_GetSwitch(globalCtx, ENGK_GET_3F00(&this->actor))) {
gSaveContext.weekEventReg[40] |= 0x40;
gSaveContext.save.weekEventReg[40] |= 0x40;
this->actionFunc = func_80B51D9C;
return;
}
@@ -648,7 +648,7 @@ void func_80B51760(EnGk* this, GlobalContext* globalCtx) {
this->unk_1E4 |= 2;
}
} else if (((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) &&
(gSaveContext.entranceIndex != 0xD010)) {
(gSaveContext.save.entranceIndex != 0xD010)) {
func_800B863C(&this->actor, globalCtx);
}
@@ -727,8 +727,8 @@ void func_80B51B40(EnGk* this, GlobalContext* globalCtx) {
globalCtx->sceneLoadFlag = 0x14;
globalCtx->unk_1887F = 3;
gSaveContext.nextTransition = 3;
Parameter_AddMagic(globalCtx,
((void)0, gSaveContext.unk_3F30) + (gSaveContext.doubleMagic * 0x30) + 0x30);
Parameter_AddMagic(globalCtx, ((void)0, gSaveContext.unk_3F30) +
(gSaveContext.save.playerData.doubleMagic * 0x30) + 0x30);
} else {
this->actionFunc = func_80B51760;
}
@@ -833,7 +833,7 @@ void func_80B51EA4(EnGk* this, GlobalContext* globalCtx) {
}
void func_80B51FD0(EnGk* this, GlobalContext* globalCtx) {
if (!(gSaveContext.weekEventReg[22] & 4)) {
if (!(gSaveContext.save.weekEventReg[22] & 4)) {
if (this->unk_1E4 & 2) {
func_801A4748(&this->actor.projectedPos, NA_SE_EN_GOLON_KID_CRY - SFX_FLAG);
} else {
@@ -851,7 +851,7 @@ void func_80B5202C(EnGk* this, GlobalContext* globalCtx) {
if (!func_80B50854(this, globalCtx)) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
gSaveContext.weekEventReg[24] |= 0x80;
gSaveContext.save.weekEventReg[24] |= 0x80;
this->actionFunc = func_80B51698;
} else if ((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) {
func_800B863C(&this->actor, globalCtx);
@@ -900,7 +900,7 @@ void func_80B5227C(EnGk* this, GlobalContext* globalCtx) {
func_800B14D4(globalCtx, 20.0f, &this->actor.home.pos);
this->unk_350 = 60;
if (!(this->unk_1E4 & 0x80)) {
gSaveContext.weekEventReg[22] |= 4;
gSaveContext.save.weekEventReg[22] |= 4;
}
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SIT_IMT);
this->unk_350 = 0x4000;
@@ -960,7 +960,7 @@ void func_80B52430(EnGk* this, GlobalContext* globalCtx) {
void func_80B5253C(EnGk* this, GlobalContext* globalCtx) {
s32 sp24;
if (gSaveContext.weekEventReg[41] & 8) {
if (gSaveContext.save.weekEventReg[41] & 8) {
sp24 = 0x93;
} else {
sp24 = 0x6A;
@@ -969,7 +969,7 @@ void func_80B5253C(EnGk* this, GlobalContext* globalCtx) {
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
if (sp24 == 0x6A) {
gSaveContext.weekEventReg[41] |= 8;
gSaveContext.save.weekEventReg[41] |= 8;
}
this->actionFunc = func_80B525E0;
} else {
@@ -990,7 +990,7 @@ void func_80B525E0(EnGk* this, GlobalContext* globalCtx) {
void func_80B52654(EnGk* this, GlobalContext* globalCtx) {
this->unk_350 += 0x400;
if ((this->unk_1E4 & 0x80) && (globalCtx->csCtx.frames == 250)) {
gSaveContext.weekEventReg[22] |= 4;
gSaveContext.save.weekEventReg[22] |= 4;
}
this->unk_354 = Math_SinS(this->unk_350) * 0.006f * 0.06f;
@@ -1032,10 +1032,10 @@ void EnGk_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc = func_80B51760;
}
} else if (globalCtx->sceneNum == SCENE_GORONRACE) {
if (gSaveContext.weekEventReg[33] & 0x80) {
if (gSaveContext.entranceIndex == 0xD010) {
if (gSaveContext.save.weekEventReg[33] & 0x80) {
if (gSaveContext.save.entranceIndex == 0xD010) {
this->actionFunc = func_80B51760;
} else if (gSaveContext.entranceIndex == 0xD020) {
} else if (gSaveContext.save.entranceIndex == 0xD020) {
this->actionFunc = func_80B52340;
} else {
this->actionFunc = func_80B51760;
@@ -1047,7 +1047,7 @@ void EnGk_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_MarkForDeath(&this->actor);
}
} else if (ENGK_GET_F(&this->actor) == ENGK_F_2) {
if (!(gSaveContext.weekEventReg[22] & 4)) {
if (!(gSaveContext.save.weekEventReg[22] & 4)) {
this->actionFunc = func_80B51FD0;
this->actor.draw = NULL;
this->actor.flags |= ACTOR_FLAG_10;
@@ -1055,7 +1055,7 @@ void EnGk_Init(Actor* thisx, GlobalContext* globalCtx) {
} else {
Actor_MarkForDeath(&this->actor);
}
} else if (!(gSaveContext.weekEventReg[22] & 4)) {
} else if (!(gSaveContext.save.weekEventReg[22] & 4)) {
this->unk_2E4 = 0;
this->unk_318 = this->actor.cutscene;
this->actor.flags |= ACTOR_FLAG_10;
@@ -1079,7 +1079,7 @@ void EnGk_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
if ((ENGK_GET_F(&this->actor) == ENGK_F_1) ||
((ENGK_GET_F(&this->actor) == ENGK_F_0) && !(gSaveContext.weekEventReg[22] & 4))) {
((ENGK_GET_F(&this->actor) == ENGK_F_0) && !(gSaveContext.save.weekEventReg[22] & 4))) {
func_80B507A0(this, globalCtx);
SkelAnime_Update(&this->skelAnime);
func_800E9250(globalCtx, &this->actor, &this->unk_1D8, &this->unk_1DE, this->actor.focus.pos);
@@ -1238,7 +1238,7 @@ void EnGk_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
if ((ENGK_GET_F(&this->actor) == ENGK_F_0) && (gSaveContext.weekEventReg[22] & 4)) {
if ((ENGK_GET_F(&this->actor) == ENGK_F_0) && (gSaveContext.save.weekEventReg[22] & 4)) {
Matrix_InsertXRotation_s(-0x4000, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+11 -11
View File
@@ -382,7 +382,7 @@ s32 func_8094E52C(EnGm* this, GlobalContext* globalCtx) {
}
case 2:
if (!(gSaveContext.weekEventReg[86] & 0x40) && (this->unk_3E0 == 2)) {
if (!(gSaveContext.save.weekEventReg[86] & 0x40) && (this->unk_3E0 == 2)) {
ActorCutscene_Stop(sp2A);
} else {
Camera_SetTargetActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)), &this->actor);
@@ -552,8 +552,8 @@ s32 func_8094EB1C(EnGm* this, GlobalContext* globalCtx) {
switch (this->unk_3E0) {
case 0:
if ((gSaveContext.weekEventReg[50] & 1) || (gSaveContext.weekEventReg[51] & 0x80) ||
(gSaveContext.weekEventReg[75] & 2)) {
if ((gSaveContext.save.weekEventReg[50] & 1) || (gSaveContext.save.weekEventReg[51] & 0x80) ||
(gSaveContext.save.weekEventReg[75] & 2)) {
ret = true;
break;
}
@@ -659,14 +659,14 @@ s32 func_8094EE84(EnGm* this, GlobalContext* globalCtx) {
this->actor.child = this->unk_268;
this->unk_264 = func_8094EDBC(this, globalCtx);
if ((this->unk_258 == 5) && !(gSaveContext.weekEventReg[50] & 1) &&
!(gSaveContext.weekEventReg[51] & 0x80) && !(gSaveContext.weekEventReg[75] & 2)) {
if ((this->unk_258 == 5) && !(gSaveContext.save.weekEventReg[50] & 1) &&
!(gSaveContext.save.weekEventReg[51] & 0x80) && !(gSaveContext.save.weekEventReg[75] & 2)) {
this->unk_3A4 |= 0x20;
} else if ((this->unk_258 != 1) && (this->unk_258 != 5) && (this->unk_258 != 7)) {
this->unk_3A4 |= 0x20;
}
if ((this->unk_258 == 3) && (gSaveContext.weekEventReg[75] & 1)) {
if ((this->unk_258 == 3) && (gSaveContext.save.weekEventReg[75] & 1)) {
this->unk_3A4 &= ~0x20;
}
@@ -920,7 +920,7 @@ s32 func_8094F7D0(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
}
s32 func_8094F904(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
u16 sp56 = gSaveContext.time - 0x3FFC;
u16 sp56 = gSaveContext.save.time - 0x3FFC;
u8 sp55 = ENGM_GET_FF(&this->actor);
EnDoor* door;
Vec3s* sp4C;
@@ -966,7 +966,7 @@ s32 func_8094F904(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
}
s32 func_8094FAC4(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
u16 sp2E = gSaveContext.time - 0x3FFC;
u16 sp2E = gSaveContext.save.time - 0x3FFC;
u16 phi_v1;
u8 sp2B = ENGM_GET_FF(&this->actor);
s32 pad;
@@ -1052,7 +1052,7 @@ s32 func_8094FE10(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
func_8094E054(this, globalCtx, 11);
SubS_UpdateFlags(&this->unk_3A4, 3, 7);
this->unk_268 = al;
if (!(gSaveContext.weekEventReg[86] & 0x20)) {
if (!(gSaveContext.save.weekEventReg[86] & 0x20)) {
this->unk_3C8 = 2;
this->unk_3CA = 2;
this->unk_3CC = 8;
@@ -1267,7 +1267,7 @@ s32 func_80950490(EnGm* this, GlobalContext* globalCtx) {
};
s32 pad;
if ((gSaveContext.weekEventReg[50] & 1) || (gSaveContext.weekEventReg[51] & 0x80)) {
if ((gSaveContext.save.weekEventReg[50] & 1) || (gSaveContext.save.weekEventReg[51] & 0x80)) {
if (this->unk_400 == 0) {
this->unk_3C8 = 1;
this->unk_3CA = 1;
@@ -1493,7 +1493,7 @@ void func_80950C24(EnGm* this, GlobalContext* globalCtx) {
}
void func_80950CDC(EnGm* this, GlobalContext* globalCtx) {
u32* unk_14 = &gSaveContext.unk_14;
u32* unk_14 = &gSaveContext.save.daySpeed;
struct_80133038_arg2 sp20;
this->unk_3C4 = REG(15) + *unk_14;
+18 -18
View File
@@ -536,7 +536,7 @@ s32 func_80A1222C(EnGo* this, GlobalContext* globalCtx) {
if (((player->transformation == PLAYER_FORM_GORON) && (globalCtx->msgCtx.ocarinaMode == 3) &&
(globalCtx->msgCtx.unk1202E == 1) && (this->unk_3EC == 0) && (this->actor.xzDistToPlayer < 400.0f)) ||
(!(gSaveContext.weekEventReg[22] & 4) && (globalCtx->sceneNum == SCENE_16GORON_HOUSE) &&
(!(gSaveContext.save.weekEventReg[22] & 4) && (globalCtx->sceneNum == SCENE_16GORON_HOUSE) &&
(gSaveContext.sceneSetupIndex == 0) && (this->unk_3EC == 0) && (globalCtx->csCtx.currentCsIndex == 1))) {
ret = true;
}
@@ -943,7 +943,7 @@ void func_80A132C8(EnGo* this, GlobalContext* globalCtx) {
if ((fabsf(this->actor.playerHeightRel) > 20.0f) || (this->actor.xzDistToPlayer > 300.0f)) {
SubS_UpdateFlags(&this->unk_390, 3, 7);
} else if ((player->transformation != PLAYER_FORM_GORON) || (ABS_ALT(temp_v1) >= 0x1C70) ||
(gSaveContext.weekEventReg[21] & 4) || (gSaveContext.weekEventReg[21] & 8)) {
(gSaveContext.save.weekEventReg[21] & 4) || (gSaveContext.save.weekEventReg[21] & 8)) {
SubS_UpdateFlags(&this->unk_390, 3, 7);
} else {
SubS_UpdateFlags(&this->unk_390, 4, 7);
@@ -951,7 +951,7 @@ void func_80A132C8(EnGo* this, GlobalContext* globalCtx) {
}
void func_80A133A8(EnGo* this, GlobalContext* globalCtx) {
if (gSaveContext.weekEventReg[21] & 8) {
if (gSaveContext.save.weekEventReg[21] & 8) {
SubS_UpdateFlags(&this->unk_390, 3, 7);
} else {
SubS_UpdateFlags(&this->unk_390, 4, 7);
@@ -986,7 +986,7 @@ Actor* func_80A13400(EnGo* this, GlobalContext* globalCtx) {
}
void func_80A134B0(EnGo* this, GlobalContext* globalCtx, s32 arg2) {
if ((gSaveContext.weekEventReg[18] & 0x80) || (globalCtx->actorCtx.unk5 & 1) || arg2) {
if ((gSaveContext.save.weekEventReg[18] & 0x80) || (globalCtx->actorCtx.unk5 & 1) || arg2) {
this->colliderSphere.dim.modelSphere.radius = 300;
} else {
this->colliderSphere.dim.modelSphere.radius = 380;
@@ -1177,7 +1177,7 @@ s32 func_80A13B1C(EnGo* this, GlobalContext* globalCtx) {
func_80A13728(this, globalCtx);
this->unk_3C4++;
this->unk_3C2 = 0;
gSaveContext.weekEventReg[88] |= 0x40;
gSaveContext.save.weekEventReg[88] |= 0x40;
}
break;
@@ -1197,19 +1197,19 @@ s32 func_80A13B1C(EnGo* this, GlobalContext* globalCtx) {
if (this->unk_3C0 >= 65) {
switch (player->transformation) {
case 4:
gSaveContext.weekEventReg[88] |= 0x80;
gSaveContext.save.weekEventReg[88] |= 0x80;
break;
case 1:
gSaveContext.weekEventReg[89] |= 4;
gSaveContext.save.weekEventReg[89] |= 4;
break;
case 2:
gSaveContext.weekEventReg[89] |= 2;
gSaveContext.save.weekEventReg[89] |= 2;
break;
case 3:
gSaveContext.weekEventReg[89] |= 1;
gSaveContext.save.weekEventReg[89] |= 1;
break;
}
ret = true;
@@ -1373,8 +1373,8 @@ void func_80A143A8(EnGo* this, GlobalContext* globalCtx) {
}
void func_80A14430(EnGo* this, GlobalContext* globalCtx) {
if (((gSaveContext.entranceIndex == 0xD000) || (gSaveContext.entranceIndex == 0xD020)) &&
(gSaveContext.weekEventReg[33] & 0x80)) {
if (((gSaveContext.save.entranceIndex == 0xD000) || (gSaveContext.save.entranceIndex == 0xD020)) &&
(gSaveContext.save.weekEventReg[33] & 0x80)) {
func_80A14018(this, globalCtx);
this->actionFunc = func_80A149B0;
} else {
@@ -1383,7 +1383,7 @@ void func_80A14430(EnGo* this, GlobalContext* globalCtx) {
}
void func_80A1449C(EnGo* this, GlobalContext* globalCtx) {
if ((gSaveContext.entranceIndex == 0xD010) || (gSaveContext.entranceIndex == 0x1C00)) {
if ((gSaveContext.save.entranceIndex == 0xD010) || (gSaveContext.save.entranceIndex == 0x1C00)) {
func_80A14104(this, globalCtx);
this->actionFunc = func_80A149B0;
} else {
@@ -1392,7 +1392,7 @@ void func_80A1449C(EnGo* this, GlobalContext* globalCtx) {
}
void func_80A144F4(EnGo* this, GlobalContext* globalCtx) {
if (gSaveContext.day >= 2) {
if (gSaveContext.save.day >= 2) {
this->unk_284 = func_8013BEDC(globalCtx, ENGO_GET_7F80(&this->actor), 0xFF, &this->unk_3E4);
if (this->unk_284 != NULL) {
this->unk_3E4 = 1;
@@ -1411,7 +1411,7 @@ void func_80A145AC(EnGo* this, GlobalContext* globalCtx) {
if ((ENGO_GET_70(&this->actor) == ENGO_70_1) &&
(((globalCtx->sceneNum == SCENE_10YUKIYAMANOMURA2) && (gSaveContext.sceneSetupIndex == 1) &&
(globalCtx->csCtx.currentCsIndex == 0)) ||
!(gSaveContext.weekEventReg[21] & 8))) {
!(gSaveContext.save.weekEventReg[21] & 8))) {
this->actor.child = func_80A13400(this, globalCtx);
this->actor.child->child = &this->actor;
func_80A141D4(this, globalCtx);
@@ -1423,7 +1423,7 @@ void func_80A145AC(EnGo* this, GlobalContext* globalCtx) {
}
void func_80A14668(EnGo* this, GlobalContext* globalCtx) {
if (!(gSaveContext.weekEventReg[22] & 4)) {
if (!(gSaveContext.save.weekEventReg[22] & 4)) {
func_80A14324(this, globalCtx);
this->actionFunc = func_80A149B0;
} else {
@@ -1511,7 +1511,7 @@ void func_80A14798(EnGo* this, GlobalContext* globalCtx) {
void func_80A149B0(EnGo* this, GlobalContext* globalCtx) {
s16 sp26 = this->actor.world.rot.y;
if ((ENGO_GET_F(&this->actor) == ENGO_F_2) && (gSaveContext.entranceIndex == 0xD010)) {
if ((ENGO_GET_F(&this->actor) == ENGO_F_2) && (gSaveContext.save.entranceIndex == 0xD010)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_GORON_CHEER - SFX_FLAG);
} else if (ENGO_GET_F(&this->actor) != ENGO_F_8) {
if (func_80A1222C(this, globalCtx)) {
@@ -1568,7 +1568,7 @@ void func_80A14B30(EnGo* this, GlobalContext* globalCtx) {
this->unk_390 &= ~0x200;
this->unk_390 |= 0x8000;
this->actor.shape.yOffset = 0.0f;
} else if ((this->unk_3EC != 0) && (gSaveContext.weekEventReg[22] & 4)) {
} else if ((this->unk_3EC != 0) && (gSaveContext.save.weekEventReg[22] & 4)) {
this->actor.scale.x = this->unk_3A4 - (Math_SinS(this->unk_3AE) * 0.001f);
this->actor.scale.y = (Math_SinS(this->unk_3AE) * 0.001f) + this->unk_3A4;
this->actor.scale.z = (Math_SinS(this->unk_3AE) * 0.001f) + this->unk_3A4;
@@ -1771,7 +1771,7 @@ void func_80A153FC(EnGo* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_COLD);
if (gSaveContext.day == 3) {
if (gSaveContext.save.day == 3) {
func_80A141D4(this, globalCtx);
this->actionFunc = func_80A14E14;
} else {
+15 -15
View File
@@ -112,7 +112,7 @@ s8 func_80997A90(s16 arg0, s16 arg1) {
if ((arg0 == 0) || ((arg0 != 1) && (arg0 != 2) && (arg0 == 3))) {
phi_v1 = 0;
} else {
phi_v1 = (gSaveContext.unk_EC4 >> (arg1 * 3)) & 7;
phi_v1 = (gSaveContext.save.unk_EC4 >> (arg1 * 3)) & 7;
}
return phi_v1;
}
@@ -296,7 +296,7 @@ void func_8099807C(EnGs* this, GlobalContext* globalCtx) {
break;
case 0:
if ((this->actor.params == ENGS_1) && (gSaveContext.playerForm == PLAYER_FORM_DEKU)) {
if ((this->actor.params == ENGS_1) && (gSaveContext.save.playerForm == PLAYER_FORM_DEKU)) {
this->unk_194 = 1;
this->unk_19C = 5;
this->unk_19A |= 1;
@@ -306,7 +306,7 @@ void func_8099807C(EnGs* this, GlobalContext* globalCtx) {
break;
case 2:
if ((this->actor.params == ENGS_1) && (gSaveContext.playerForm == PLAYER_FORM_ZORA)) {
if ((this->actor.params == ENGS_1) && (gSaveContext.save.playerForm == PLAYER_FORM_ZORA)) {
this->unk_194 = 3;
this->unk_19C = 5;
this->unk_19A |= 1;
@@ -316,7 +316,7 @@ void func_8099807C(EnGs* this, GlobalContext* globalCtx) {
break;
case 1:
if ((this->actor.params == ENGS_1) && (gSaveContext.playerForm == PLAYER_FORM_GORON)) {
if ((this->actor.params == ENGS_1) && (gSaveContext.save.playerForm == PLAYER_FORM_GORON)) {
this->unk_194 = 2;
this->unk_19C = 5;
this->unk_19A |= 1;
@@ -388,8 +388,8 @@ void func_809985B8(EnGs* this, GlobalContext* globalCtx) {
Math_Vec3f_Sum(&player->actor.world.pos, &sp38, &player->actor.world.pos);
Math_Vec3f_Copy(&player->actor.prevPos, &player->actor.world.pos);
this->unk_200 = 0.0f;
gSaveContext.unk_EC4 =
((u32)gSaveContext.unk_EC4 & ~(7 << (this->unk_198 * 3))) | ((this->unk_194 & 7) << (this->unk_198 * 3));
gSaveContext.save.unk_EC4 = ((u32)gSaveContext.save.unk_EC4 & ~(7 << (this->unk_198 * 3))) |
((this->unk_194 & 7) << (this->unk_198 * 3));
gossipStone = NULL;
do {
@@ -450,7 +450,7 @@ void func_8099874C(EnGs* this, GlobalContext* globalCtx) {
phi_v0 = 1;
for (i = 0; i < 4; i++) {
if (((gSaveContext.unk_EC4 >> (i * 3)) & 7) != (u32)this->unk_194) {
if (((gSaveContext.save.unk_EC4 >> (i * 3)) & 7) != (u32)this->unk_194) {
phi_v0 = 0;
}
}
@@ -459,29 +459,29 @@ void func_8099874C(EnGs* this, GlobalContext* globalCtx) {
this->unk_20C = -1;
switch (this->unk_194) {
case 1:
if (!(gSaveContext.weekEventReg[77] & 8)) {
if (!(gSaveContext.save.weekEventReg[77] & 8)) {
this->unk_20C = 6;
gSaveContext.weekEventReg[77] |= 8;
gSaveContext.save.weekEventReg[77] |= 8;
}
break;
case 3:
if (!(gSaveContext.weekEventReg[77] & 0x10)) {
if (!(gSaveContext.save.weekEventReg[77] & 0x10)) {
this->unk_20C = 6;
gSaveContext.weekEventReg[77] |= 0x10;
gSaveContext.save.weekEventReg[77] |= 0x10;
}
break;
case 2:
if (!(gSaveContext.weekEventReg[77] & 0x20)) {
if (!(gSaveContext.save.weekEventReg[77] & 0x20)) {
this->unk_20C = 6;
gSaveContext.weekEventReg[77] |= 0x20;
gSaveContext.save.weekEventReg[77] |= 0x20;
}
break;
}
if (!(gSaveContext.weekEventReg[90] & 0x10)) {
gSaveContext.weekEventReg[90] |= 0x10;
if (!(gSaveContext.save.weekEventReg[90] & 0x10)) {
gSaveContext.save.weekEventReg[90] |= 0x10;
this->unk_20C = 12;
}
@@ -108,7 +108,7 @@ void EnGuardNuts_Init(Actor* thisx, GlobalContext* globalCtx) {
sGuardCount++;
// If you have returned deku princess guards will init burrowed.
if (!(gSaveContext.weekEventReg[23] & 0x20)) {
if (!(gSaveContext.save.weekEventReg[23] & 0x20)) {
EnGuardNuts_SetupWait(this);
} else {
EnGuardNuts_Burrow(this, globalCtx);
@@ -157,10 +157,10 @@ void EnGuardNuts_Wait(EnGuardNuts* this, GlobalContext* globalCtx) {
if (player->transformation == PLAYER_FORM_DEKU) {
// this is the palace of...
this->guardTextIndex = 0;
if ((gSaveContext.weekEventReg[17] & 4) && (!this->hasCompletedConversation)) {
if ((gSaveContext.save.weekEventReg[17] & 4) && (!this->hasCompletedConversation)) {
// I told you not to enter!!
this->guardTextIndex = 7;
} else if (gSaveContext.weekEventReg[12] & 0x40) {
} else if (gSaveContext.save.weekEventReg[12] & 0x40) {
// come to see the monkey again?
this->guardTextIndex = 4;
}
@@ -233,7 +233,7 @@ void func_80ABB590(EnGuardNuts* this, GlobalContext* globalCtx) {
if (D_80ABBE38[this->guardTextIndex] == 2) {
func_801477B4(globalCtx);
D_80ABBE20 = 2;
gSaveContext.weekEventReg[12] |= 0x40;
gSaveContext.save.weekEventReg[12] |= 0x40;
EnGuardNuts_Burrow(this, globalCtx);
} else {
this->guardTextIndex++;
@@ -299,7 +299,7 @@ void EnGuardNuts_Unburrow(EnGuardNuts* this, GlobalContext* globalCtx) {
Vec3f digPos;
// If you have returned Deku Princess, guards will not unburrow
if (!(gSaveContext.weekEventReg[23] & 0x20)) {
if (!(gSaveContext.save.weekEventReg[23] & 0x20)) {
yawDiff = ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.home.rot.y));
if ((yawDiff < 0x4000) && ((D_80ABBE20 == 0) || (this->actor.xzDistToPlayer > 150.0f))) {
Math_Vec3f_Copy(&digPos, &this->actor.world.pos);
@@ -79,7 +79,7 @@ void EnGuruguru_Init(Actor* thisx, GlobalContext* globalCtx) {
if (this->actor.params != 2) {
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
}
if (!gSaveContext.isNight) {
if (!gSaveContext.save.isNight) {
if (this->actor.params == 0) {
func_80BC6E10(this);
} else if (this->actor.params == 2) {
@@ -119,10 +119,10 @@ void func_80BC6E10(EnGuruguru* this) {
this->textIdIndex = 0;
this->unk270 = 0;
if (this->actor.params == 0) {
if (gSaveContext.weekEventReg[38] & 0x10) {
if (gSaveContext.save.weekEventReg[38] & 0x10) {
this->textIdIndex = 1;
}
} else if (gSaveContext.weekEventReg[38] & 0x40) {
} else if (gSaveContext.save.weekEventReg[38] & 0x40) {
this->textIdIndex = 2;
} else {
this->textIdIndex = 3;
@@ -131,8 +131,8 @@ void func_80BC6E10(EnGuruguru* this) {
this->headZRotTarget = 0;
this->unk268 = 1;
this->actor.textId = textIDs[this->textIdIndex];
if ((this->textIdIndex == 0 || this->textIdIndex == 1) && (gSaveContext.weekEventReg[77] & 4)) {
if (!(gSaveContext.weekEventReg[88] & 4)) {
if ((this->textIdIndex == 0 || this->textIdIndex == 1) && (gSaveContext.save.weekEventReg[77] & 4)) {
if (!(gSaveContext.save.weekEventReg[88] & 4)) {
this->actor.textId = 0x295F;
} else {
this->actor.textId = 0x2960;
@@ -153,7 +153,7 @@ void func_80BC6F14(EnGuruguru* this, GlobalContext* globalCtx) {
this->textIdIndex = 3;
if (player->transformation == PLAYER_FORM_DEKU) {
this->textIdIndex = 13;
if (gSaveContext.weekEventReg[79] & 4) {
if (gSaveContext.save.weekEventReg[79] & 4) {
this->textIdIndex = 14;
}
}
@@ -212,16 +212,16 @@ void func_80BC7068(EnGuruguru* this, GlobalContext* globalCtx) {
this->headZRotTarget = 0;
if ((this->textIdIndex == 13) || (this->textIdIndex == 14)) {
func_80151BB4(globalCtx, 0x13);
gSaveContext.weekEventReg[79] |= 4;
gSaveContext.save.weekEventReg[79] |= 4;
func_80BC6E10(this);
return;
}
if (this->actor.params == 0) {
if (this->actor.textId == 0x295F) {
gSaveContext.weekEventReg[88] |= 4;
gSaveContext.save.weekEventReg[88] |= 4;
}
if (this->actor.textId == 0x292A) {
gSaveContext.weekEventReg[38] |= 0x10;
gSaveContext.save.weekEventReg[38] |= 0x10;
}
func_80151BB4(globalCtx, 0x13);
func_80BC6E10(this);
@@ -232,7 +232,7 @@ void func_80BC7068(EnGuruguru* this, GlobalContext* globalCtx) {
return;
}
if (this->textIdIndex == 12) {
gSaveContext.weekEventReg[38] |= 0x40;
gSaveContext.save.weekEventReg[38] |= 0x40;
func_801A3B48(0);
func_80151BB4(globalCtx, 0x36);
func_80151BB4(globalCtx, 0x13);
@@ -297,7 +297,7 @@ void func_80BC7440(EnGuruguru* this, GlobalContext* globalCtx) {
func_801A3B48(1);
func_800B8500(&this->actor, globalCtx, 400.0f, 400.0f, EXCH_ITEM_MINUS1);
this->unk268 = 0;
gSaveContext.weekEventReg[38] |= 0x40;
gSaveContext.save.weekEventReg[38] |= 0x40;
this->actionFunc = func_80BC7520;
} else {
Actor_PickUp(&this->actor, globalCtx, GI_MASK_BREMEN, 300.0f, 300.0f);
@@ -319,7 +319,7 @@ void EnGuruguru_Update(Actor* thisx, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s16 yawTemp;
if (!gSaveContext.isNight) {
if (!gSaveContext.save.isNight) {
if (this->actor.params == 1) {
Actor_MarkForDeath(&this->actor);
return;
@@ -324,7 +324,7 @@ void func_80B23910(EnHanabi* this, GlobalContext* globalCtx) {
}
void func_80B23934(EnHanabi* this, GlobalContext* globalCtx) {
if ((gSaveContext.entranceIndex == 0x5410) && (gSaveContext.sceneSetupIndex == 7)) {
if ((gSaveContext.save.entranceIndex == 0x5410) && (gSaveContext.sceneSetupIndex == 7)) {
if (globalCtx->csCtx.frames > 1650) {
func_80B236C8(this, globalCtx);
func_800B8FE8(&this->actor, NA_SE_EV_FIREWORKS_LAUNCH - SFX_FLAG);
@@ -73,14 +73,16 @@ void EnHeishi_Init(Actor* thisx, GlobalContext* globalCtx) {
if (this->paramsCopy == 0) {
this->shouldSetHeadRotation = 1;
if (!(gSaveContext.weekEventReg[63] & 0x80) && !((gSaveContext.day == 3) && gSaveContext.isNight)) {
if (!(gSaveContext.save.weekEventReg[63] & 0x80) &&
!((gSaveContext.save.day == 3) && gSaveContext.save.isNight)) {
Actor_MarkForDeath(&this->actor);
}
} else {
this->colliderCylinder.dim.radius = 30;
this->colliderCylinder.dim.height = 60;
this->colliderCylinder.dim.yShift = 0;
if ((gSaveContext.weekEventReg[63] & 0x80) || ((gSaveContext.day == 3) && gSaveContext.isNight)) {
if ((gSaveContext.save.weekEventReg[63] & 0x80) ||
((gSaveContext.save.day == 3) && gSaveContext.save.isNight)) {
Actor_MarkForDeath(&this->actor);
}
}
@@ -150,7 +152,7 @@ void EnHeishi_Update(Actor* thisx, GlobalContext* globalCtx) {
}
this->actor.shape.rot.y = this->actor.world.rot.y;
if ((this->paramsCopy != 0) && (gSaveContext.day == 3) && gSaveContext.isNight) {
if ((this->paramsCopy != 0) && (gSaveContext.save.day == 3) && gSaveContext.save.isNight) {
Actor_MarkForDeath(&this->actor);
} else {
this->actionFunc(this, globalCtx);
+5 -5
View File
@@ -126,7 +126,7 @@ void EnHg_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2);
if ((gSaveContext.weekEventReg[75] & 0x20) || (gSaveContext.weekEventReg[52] & 0x20)) {
if ((gSaveContext.save.weekEventReg[75] & 0x20) || (gSaveContext.save.weekEventReg[52] & 0x20)) {
Actor_MarkForDeath(&this->actor);
}
this->actor.targetMode = 1;
@@ -304,7 +304,7 @@ void func_80BCF95C(EnHg* this, GlobalContext* globalCtx) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
break;
case 6:
gSaveContext.weekEventReg[75] |= 0x20;
gSaveContext.save.weekEventReg[75] |= 0x20;
Actor_MarkForDeath(&this->actor);
break;
}
@@ -358,7 +358,7 @@ void func_80BCFC0C(EnHg* this, GlobalContext* globalCtx) {
D_80BD00C8 = false;
}
if (globalCtx->msgCtx.ocarinaMode == 3) {
if (globalCtx->msgCtx.unk1202E == 7 && gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
if (globalCtx->msgCtx.unk1202E == 7 && gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) {
if (INV_CONTENT(ITEM_MASK_GIBDO) == ITEM_MASK_GIBDO) {
this->unk218 = 3;
} else {
@@ -369,8 +369,8 @@ void func_80BCFC0C(EnHg* this, GlobalContext* globalCtx) {
} else {
if (this->actor.xzDistToPlayer < 60.0f && fabsf(this->actor.playerHeightRel) < 40.0f) {
if ((this->actionFunc != func_80BCF8A0) && (this->actionFunc != func_80BCF95C)) {
if (!(gSaveContext.weekEventReg[61] & 2)) {
gSaveContext.weekEventReg[61] |= 2;
if (!(gSaveContext.save.weekEventReg[61] & 2)) {
gSaveContext.save.weekEventReg[61] |= 2;
this->unk218 = 0;
} else {
this->unk218 = 2;
+4 -4
View File
@@ -94,7 +94,7 @@ void EnHgo_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_314 = 0;
this->unk_310 = 0;
this->unk_312 = 0;
if ((gSaveContext.weekEventReg[75] & 0x20) || (gSaveContext.weekEventReg[52] & 0x20)) {
if ((gSaveContext.save.weekEventReg[75] & 0x20) || (gSaveContext.save.weekEventReg[52] & 0x20)) {
func_80BD049C(this);
} else {
thisx->draw = NULL;
@@ -144,7 +144,7 @@ void func_80BD04E0(EnHgo* this, GlobalContext* globalCtx) {
Message_StartTextbox(globalCtx, 0x15A7, &this->actor);
this->unk_314 = 0x15A7; // can I research that mask
}
} else if (gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
} else if (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) {
if (!(this->unk_310 & 1)) {
this->unk_310 |= 1;
Message_StartTextbox(globalCtx, 0x158F, &this->actor);
@@ -201,7 +201,7 @@ void func_80BD06FC(EnHgo* this, GlobalContext* globalCtx) {
this->unk_314 = 0x1590;
break;
case 0x1590:
if (gSaveContext.weekEventReg[14] & 4) {
if (gSaveContext.save.weekEventReg[14] & 4) {
Message_StartTextbox(globalCtx, 0x1591, &this->actor);
this->unk_314 = 0x1591;
break;
@@ -303,7 +303,7 @@ s32 func_80BD0898(EnHgo* this, GlobalContext* globalCtx) {
Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
return true;
}
if ((globalCtx->csCtx.state == 0) && (((gSaveContext.weekEventReg[75]) & 0x20)) &&
if ((globalCtx->csCtx.state == 0) && (((gSaveContext.save.weekEventReg[75]) & 0x20)) &&
(this->actionFunc == func_80BD0410)) {
this->actor.shape.rot.y = this->actor.world.rot.y;
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ELF_MSG2, this->actor.focus.pos.x, this->actor.focus.pos.y,
@@ -32,13 +32,14 @@ enum {
#define RACE_FLAG_4 4
#define RACE_FLAGS 7
#define GET_RACE_FLAGS (gSaveContext.weekEventReg[92] & RACE_FLAGS)
#define GET_RACE_FLAGS (gSaveContext.save.weekEventReg[92] & RACE_FLAGS)
#define SET_RACE_FLAGS(flag) { \
gSaveContext.weekEventReg[92] &= (u8) ~RACE_FLAGS; \
gSaveContext.weekEventReg[92] = \
gSaveContext.weekEventReg[92] | (u8)((gSaveContext.weekEventReg[92] & ~RACE_FLAGS) | (flag)); \
}
#define SET_RACE_FLAGS(flag) \
{ \
gSaveContext.save.weekEventReg[92] &= (u8)~RACE_FLAGS; \
gSaveContext.save.weekEventReg[92] = \
gSaveContext.save.weekEventReg[92] | (u8)((gSaveContext.save.weekEventReg[92] & ~RACE_FLAGS) | (flag)); \
}
typedef struct EnHorseGameCheck {
/* 0x000 */ DynaPolyActor dyna;
+4 -4
View File
@@ -341,7 +341,7 @@ s32 func_80BF17BC(EnIg* this, GlobalContext* globalCtx) {
case 1:
case 3:
if (!(gSaveContext.weekEventReg[75] & 0x10) && (this->unk_3F6 == 3)) {
if (!(gSaveContext.save.weekEventReg[75] & 0x10) && (this->unk_3F6 == 3)) {
ActorCutscene_Stop(sp2A);
this->unk_3F6 = 5;
} else {
@@ -509,7 +509,7 @@ s32 func_80BF1D78(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
}
s32 func_80BF1DF4(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
u16 sp56 = gSaveContext.time - 0x3FFC;
u16 sp56 = gSaveContext.save.time - 0x3FFC;
u8 sp55 = ENIG_GET_FF(&this->actor);
EnDoor* door;
Vec3s* sp4C;
@@ -554,7 +554,7 @@ s32 func_80BF1DF4(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
}
s32 func_80BF1FA8(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
u16 sp2E = gSaveContext.time - 0x3FFC;
u16 sp2E = gSaveContext.save.time - 0x3FFC;
u16 phi_v1;
u8 sp2B = ENIG_GET_FF(&this->actor);
s32 temp_t8;
@@ -840,7 +840,7 @@ void func_80BF2A50(EnIg* this, GlobalContext* globalCtx) {
}
void func_80BF2AF8(EnIg* this, GlobalContext* globalCtx) {
u32* unk_14 = &gSaveContext.unk_14;
u32* unk_14 = &gSaveContext.save.daySpeed;
struct_80133038_arg2 sp20;
this->unk_3EC = REG(15) + *unk_14;
+71 -70
View File
@@ -218,12 +218,11 @@ s32 func_808F3334(EnIn* this, GlobalContext* globalCtx) {
}
s32 func_808F33B8(void) {
s32 ret;
s32 ret = (((gSaveContext.save.day == 1) &&
((gSaveContext.save.time >= CLOCK_TIME(5, 30)) && (gSaveContext.save.time <= CLOCK_TIME(6, 0)))) ||
(gSaveContext.save.day >= 2)) &&
!(gSaveContext.save.weekEventReg[22] & 1);
if (((ret = gSaveContext.day == 1) && (ret = gSaveContext.time >= 0x3AAA) && (ret = gSaveContext.time <= 0x4000)) ||
(ret = gSaveContext.day >= 2)) {
ret = (gSaveContext.weekEventReg[22] & 1) == 0;
}
return ret;
}
@@ -347,7 +346,7 @@ void func_808F395C(EnIn* this, GlobalContext* globalCtx) {
void func_808F39DC(EnIn* this, GlobalContext* globalCtx) {
u16 textId = 0;
if (gSaveContext.day != 3) {
if (gSaveContext.save.day != 3) {
switch (GET_RACE_FLAGS) {
case RACE_FLAG_2:
textId = 0x347A;
@@ -395,7 +394,7 @@ void func_808F3B40(EnIn* this, GlobalContext* globalCtx) {
this->actor.parent = NULL;
this->actor.flags |= ACTOR_FLAG_10000;
this->actionFunc = func_808F3AD4;
textId = gSaveContext.day != 3 ? 0x3481 : 0x34A4;
textId = gSaveContext.save.day != 3 ? 0x3481 : 0x34A4;
this->actor.textId = textId;
} else {
Actor_PickUp(&this->actor, globalCtx, GI_MILK, 500.0f, 100.0f);
@@ -419,7 +418,7 @@ void func_808F3C40(EnIn* this, GlobalContext* globalCtx) {
this->actor.parent = NULL;
this->actor.flags |= ACTOR_FLAG_10000;
this->actionFunc = func_808F3BD4;
textId = gSaveContext.day != 3 ? 0x346A : 0x3492;
textId = gSaveContext.save.day != 3 ? 0x346A : 0x3492;
this->actor.textId = textId;
} else {
Actor_PickUp(&this->actor, globalCtx, GI_MILK, 500.0f, 100.0f);
@@ -442,7 +441,7 @@ void func_808F3D40(EnIn* this, GlobalContext* globalCtx) {
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
this->actionFunc = func_808F3CD4;
textId = gSaveContext.day != 3 ? 0x347D : 0x34A0;
textId = gSaveContext.save.day != 3 ? 0x347D : 0x34A0;
this->actor.textId = textId;
this->actor.flags |= ACTOR_FLAG_10000;
} else {
@@ -456,7 +455,7 @@ u16 func_808F3DD4(GlobalContext* globalCtx, EnIn* this, u32 arg2) {
if (Player_GetMask(globalCtx) == PLAYER_MASK_CIRCUS_LEADER) {
s32 requiredScopeTemp;
if (!(gSaveContext.weekEventReg[63] & 0x40)) {
if (!(gSaveContext.save.weekEventReg[63] & 0x40)) {
return 0x34A9;
} else if (this->unk4AC & 8) {
return 0x34B1;
@@ -466,41 +465,43 @@ u16 func_808F3DD4(GlobalContext* globalCtx, EnIn* this, u32 arg2) {
} else {
switch (arg2) {
case 0:
if ((gSaveContext.playerForm == PLAYER_FORM_ZORA) || (gSaveContext.playerForm == PLAYER_FORM_GORON)) {
if ((gSaveContext.save.playerForm == PLAYER_FORM_ZORA) ||
(gSaveContext.save.playerForm == PLAYER_FORM_GORON)) {
textId = 0x345C;
} else if (gSaveContext.playerForm == PLAYER_FORM_DEKU) {
} else if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
textId = 0x3460;
} else if (!(gSaveContext.weekEventReg[15] & 8)) {
} else if (!(gSaveContext.save.weekEventReg[15] & 8)) {
textId = 0x3458;
} else {
textId = 0x345B;
}
break;
case 1:
if (!(gSaveContext.weekEventReg[15] & 0x10)) {
if (!(gSaveContext.save.weekEventReg[15] & 0x10)) {
textId = 0x3463;
} else {
textId = 0x346B;
}
break;
case 3:
if (gSaveContext.playerForm == PLAYER_FORM_DEKU) {
if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
textId = 0x3485;
} else if (gSaveContext.playerForm == PLAYER_FORM_ZORA ||
gSaveContext.playerForm == PLAYER_FORM_GORON) {
} else if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA ||
gSaveContext.save.playerForm == PLAYER_FORM_GORON) {
textId = 0x3484;
} else if (!(gSaveContext.weekEventReg[56] & 4)) {
} else if (!(gSaveContext.save.weekEventReg[56] & 4)) {
textId = 0x346D;
} else {
textId = 0x3482;
}
break;
case 4:
if (gSaveContext.playerForm == PLAYER_FORM_ZORA || gSaveContext.playerForm == PLAYER_FORM_GORON) {
if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA ||
gSaveContext.save.playerForm == PLAYER_FORM_GORON) {
textId = 0x348A;
} else if (gSaveContext.playerForm == PLAYER_FORM_DEKU) {
} else if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
textId = 0x348B;
} else if (!(gSaveContext.weekEventReg[16] & 1)) {
} else if (!(gSaveContext.save.weekEventReg[16] & 1)) {
textId = 0x3486;
} else {
textId = 0x3489;
@@ -509,19 +510,19 @@ u16 func_808F3DD4(GlobalContext* globalCtx, EnIn* this, u32 arg2) {
case 5:
if (func_808F33B8()) {
textId = 0x34B3;
} else if (!(gSaveContext.weekEventReg[16] & 2)) {
} else if (!(gSaveContext.save.weekEventReg[16] & 2)) {
textId = 0x348E;
} else {
textId = 0x3493;
}
break;
case 7:
if (gSaveContext.playerForm == PLAYER_FORM_DEKU) {
if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
textId = 0x34A8;
} else if (gSaveContext.playerForm == PLAYER_FORM_ZORA ||
gSaveContext.playerForm == PLAYER_FORM_GORON) {
} else if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA ||
gSaveContext.save.playerForm == PLAYER_FORM_GORON) {
textId = 0x34A7;
} else if (!(gSaveContext.weekEventReg[16] & 4)) {
} else if (!(gSaveContext.save.weekEventReg[16] & 4)) {
textId = 0x3495;
} else {
textId = 0x34A5;
@@ -572,9 +573,9 @@ s32 func_808F4150(GlobalContext* globalCtx, EnIn* this, s32 arg2, MessageContext
if (msgCtx->choiceIndex == 0) {
func_8019F208();
if (gSaveContext.rupees >= globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees >= globalCtx->msgCtx.unk1206C) {
func_801159EC(-globalCtx->msgCtx.unk1206C);
if (!(gSaveContext.weekEventReg[57] & 1)) {
if (!(gSaveContext.save.weekEventReg[57] & 1)) {
func_808F4108(this, globalCtx, 0x3474);
} else if (this->unk4AC & 8) {
func_808F4108(this, globalCtx, 0x3475);
@@ -598,9 +599,9 @@ s32 func_808F4270(GlobalContext* globalCtx, EnIn* this, s32 arg2, MessageContext
if (msgCtx->choiceIndex == 0) {
func_8019F208();
if (gSaveContext.rupees >= fee) {
if (gSaveContext.save.playerData.rupees >= fee) {
func_801159EC(-fee);
if (!(gSaveContext.weekEventReg[57] & 1)) {
if (!(gSaveContext.save.weekEventReg[57] & 1)) {
if (arg4 != 0) {
func_800E8EA0(globalCtx, &this->actor, 0x3474);
} else {
@@ -648,7 +649,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
break;
case 0x34A9:
func_808F4108(this, globalCtx, 0x34AA);
gSaveContext.weekEventReg[63] |= 0x40;
gSaveContext.save.weekEventReg[63] |= 0x40;
ret = false;
break;
case 0x34AA:
@@ -679,7 +680,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
case 0:
switch (textId) {
case 0x3458:
gSaveContext.weekEventReg[15] |= 8;
gSaveContext.save.weekEventReg[15] |= 8;
func_800E8EA0(globalCtx, &this->actor, 0x3459);
ret = false;
break;
@@ -728,7 +729,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
case 1:
switch (textId) {
case 0x3463:
gSaveContext.weekEventReg[15] |= 0x10;
gSaveContext.save.weekEventReg[15] |= 0x10;
func_800E8EA0(globalCtx, &this->actor, 0x3464);
ret = false;
break;
@@ -743,7 +744,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
case 0x3466:
if (msgCtx->choiceIndex == 0) {
func_8019F208();
if (gSaveContext.rupees >= globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees >= globalCtx->msgCtx.unk1206C) {
if (Interface_HasEmptyBottle()) {
this->actionFunc = func_808F3C40;
Actor_PickUp(&this->actor, globalCtx, GI_MILK, 500.0f, 100.0f);
@@ -804,12 +805,12 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
break;
case 0x3472:
func_808F43E0(this);
gSaveContext.weekEventReg[56] &= (u8)~8;
gSaveContext.save.weekEventReg[56] &= (u8)~8;
func_80151BB4(globalCtx, 0x11);
ret = true;
break;
case 0x3473:
gSaveContext.weekEventReg[56] &= (u8)~8;
gSaveContext.save.weekEventReg[56] &= (u8)~8;
func_80151BB4(globalCtx, 0x11);
break;
case 0x3475:
@@ -818,7 +819,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
globalCtx->nextEntranceIndex = 0xCE50;
globalCtx->unk_1887F = 5;
globalCtx->sceneLoadFlag = 0x14;
gSaveContext.weekEventReg[57] |= 1;
gSaveContext.save.weekEventReg[57] |= 1;
break;
case 0x3478:
if (msgCtx->choiceIndex == 0) {
@@ -826,14 +827,14 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
ret = false;
} else {
func_8019F230();
gSaveContext.weekEventReg[56] &= (u8)~8;
gSaveContext.save.weekEventReg[56] &= (u8)~8;
func_808F4108(this, globalCtx, 0x3479);
ret = false;
}
break;
case 0x347B:
func_808F4108(this, globalCtx, 0x347C);
gSaveContext.weekEventReg[56] &= (u8)~8;
gSaveContext.save.weekEventReg[56] &= (u8)~8;
ret = false;
break;
}
@@ -842,8 +843,8 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
switch (textId) {
case 0x346D:
func_808F4108(this, globalCtx, 0x346E);
gSaveContext.weekEventReg[56] |= 4;
gSaveContext.weekEventReg[56] |= 8;
gSaveContext.save.weekEventReg[56] |= 4;
gSaveContext.save.weekEventReg[56] |= 8;
ret = false;
break;
case 0x346F:
@@ -852,7 +853,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
break;
case 0x3482:
func_808F4108(this, globalCtx, 0x3483);
gSaveContext.weekEventReg[56] |= 8;
gSaveContext.save.weekEventReg[56] |= 8;
ret = false;
break;
case 0x3484:
@@ -872,7 +873,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
ret = false;
break;
case 0x3477:
gSaveContext.weekEventReg[56] |= 8;
gSaveContext.save.weekEventReg[56] |= 8;
func_808F4108(this, globalCtx, 0x3478);
ret = false;
break;
@@ -883,7 +884,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
func_800E8EA0(globalCtx, &this->actor, 0x347E);
ret = false;
} else {
gSaveContext.weekEventReg[56] |= 8;
gSaveContext.save.weekEventReg[56] |= 8;
func_808F4108(this, globalCtx, 0x347B);
ret = false;
}
@@ -939,7 +940,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
switch (textId) {
case 0x3486:
func_800E8EA0(globalCtx, &this->actor, 0x3487);
gSaveContext.weekEventReg[16] |= 1;
gSaveContext.save.weekEventReg[16] |= 1;
ret = false;
break;
case 0x3487:
@@ -980,7 +981,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
case 0x348E:
case 0x34B3:
func_800E8EA0(globalCtx, &this->actor, 0x348F);
gSaveContext.weekEventReg[16] |= 2;
gSaveContext.save.weekEventReg[16] |= 2;
ret = false;
break;
case 0x3493:
@@ -995,7 +996,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
case 0x3490:
if (msgCtx->choiceIndex == 0) {
func_8019F208();
if (gSaveContext.rupees >= globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees >= globalCtx->msgCtx.unk1206C) {
if (Interface_HasEmptyBottle()) {
this->actionFunc = func_808F3C40;
Actor_PickUp(&this->actor, globalCtx, GI_MILK, 500.0f, 100.0f);
@@ -1032,8 +1033,8 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
break;
case 0x3495:
func_808F4108(this, globalCtx, 0x3496);
gSaveContext.weekEventReg[16] |= 4;
gSaveContext.weekEventReg[56] |= 8;
gSaveContext.save.weekEventReg[16] |= 4;
gSaveContext.save.weekEventReg[56] |= 8;
ret = false;
break;
case 0x3497:
@@ -1048,11 +1049,11 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
break;
case 0x34A5:
func_808F4108(this, globalCtx, 0x34A6);
gSaveContext.weekEventReg[56] |= 8;
gSaveContext.save.weekEventReg[56] |= 8;
ret = false;
break;
case 0x3473:
gSaveContext.weekEventReg[56] &= (u8)~8;
gSaveContext.save.weekEventReg[56] &= (u8)~8;
func_80151BB4(globalCtx, 0x11);
break;
case 0x3474:
@@ -1065,7 +1066,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
globalCtx->nextEntranceIndex = 0xCE50;
globalCtx->unk_1887F = 5;
globalCtx->sceneLoadFlag = 0x14;
gSaveContext.weekEventReg[57] |= 1;
gSaveContext.save.weekEventReg[57] |= 1;
break;
case 0x349D:
func_808F30B0(&this->skelAnime, 1);
@@ -1074,7 +1075,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
func_800E8EA0(globalCtx, &this->actor, 0x34A1);
ret = false;
} else {
gSaveContext.weekEventReg[56] |= 8;
gSaveContext.save.weekEventReg[56] |= 8;
func_808F4108(this, globalCtx, 0x349E);
ret = false;
}
@@ -1157,13 +1158,13 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
break;
case 0x3472:
func_808F43E0(this);
gSaveContext.weekEventReg[56] &= (u8)~8;
gSaveContext.save.weekEventReg[56] &= (u8)~8;
func_80151BB4(globalCtx, 0x11);
ret = true;
break;
case 0x349E:
func_808F4108(this, globalCtx, 0x349F);
gSaveContext.weekEventReg[56] &= (u8)~8;
gSaveContext.save.weekEventReg[56] &= (u8)~8;
ret = false;
break;
}
@@ -1274,7 +1275,7 @@ s32 func_808F5994(EnIn* this, GlobalContext* globalCtx, Vec3f* arg2, s16 arg3) {
}
void func_808F5A34(EnIn* this, GlobalContext* globalCtx) {
if (gSaveContext.day != 3) {
if (gSaveContext.save.day != 3) {
func_808F5728(globalCtx, this, 3, &this->unk48C);
} else {
func_808F5728(globalCtx, this, 7, &this->unk48C);
@@ -1283,13 +1284,13 @@ void func_808F5A34(EnIn* this, GlobalContext* globalCtx) {
void func_808F5A94(EnIn* this, GlobalContext* globalCtx) {
if (func_800F41E4(globalCtx, &globalCtx->actorCtx)) {
if (gSaveContext.day == 3) {
if (gSaveContext.save.day == 3) {
func_808F5728(globalCtx, this, 7, &this->unk48C);
} else {
func_808F5728(globalCtx, this, 3, &this->unk48C);
}
} else {
if (gSaveContext.day == 3) {
if (gSaveContext.save.day == 3) {
func_808F5728(globalCtx, this, 5, &this->unk48C);
} else {
func_808F5728(globalCtx, this, 1, &this->unk48C);
@@ -1299,17 +1300,17 @@ void func_808F5A94(EnIn* this, GlobalContext* globalCtx) {
void func_808F5B58(EnIn* this, GlobalContext* globalCtx) {
if (func_800F41E4(globalCtx, &globalCtx->actorCtx)) {
if ((Player_GetMask(globalCtx) == PLAYER_MASK_CIRCUS_LEADER && gSaveContext.weekEventReg[63] & 0x40) ||
gSaveContext.weekEventReg[56] & 8) {
if (gSaveContext.day == 3) {
if ((Player_GetMask(globalCtx) == PLAYER_MASK_CIRCUS_LEADER && gSaveContext.save.weekEventReg[63] & 0x40) ||
gSaveContext.save.weekEventReg[56] & 8) {
if (gSaveContext.save.day == 3) {
func_808F5728(globalCtx, this, 6, &this->unk48C);
} else {
func_808F5728(globalCtx, this, 2, &this->unk48C);
}
}
} else if (Player_GetMask(globalCtx) != PLAYER_MASK_CIRCUS_LEADER ||
(Player_GetMask(globalCtx) == PLAYER_MASK_CIRCUS_LEADER && gSaveContext.weekEventReg[63] & 0x40)) {
if (gSaveContext.day == 3) {
(Player_GetMask(globalCtx) == PLAYER_MASK_CIRCUS_LEADER && gSaveContext.save.weekEventReg[63] & 0x40)) {
if (gSaveContext.save.day == 3) {
func_808F5728(globalCtx, this, 4, &this->unk48C);
} else {
func_808F5728(globalCtx, this, 0, &this->unk48C);
@@ -1321,9 +1322,9 @@ void func_808F5C98(EnIn* this, GlobalContext* globalCtx) {
if (this->unk4B0 == RACE_FLAG_END) {
this->actionFunc = func_808F5B58;
}
if ((Player_GetMask(globalCtx) == PLAYER_MASK_CIRCUS_LEADER && gSaveContext.weekEventReg[63] & 0x40) ||
gSaveContext.weekEventReg[56] & 8) {
if (gSaveContext.day != 3) {
if ((Player_GetMask(globalCtx) == PLAYER_MASK_CIRCUS_LEADER && gSaveContext.save.weekEventReg[63] & 0x40) ||
gSaveContext.save.weekEventReg[56] & 8) {
if (gSaveContext.save.day != 3) {
func_808F5728(globalCtx, this, 2, &this->unk48C);
} else {
func_808F5728(globalCtx, this, 6, &this->unk48C);
@@ -1385,7 +1386,7 @@ void EnIn_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk23D = 0;
if (type == ENIN_YELLOW_SHIRT || type == ENIN_BLUE_SHIRT) {
if (GET_RACE_FLAGS == RACE_FLAG_2 || (GET_RACE_FLAGS) == RACE_FLAG_3) {
gSaveContext.weekEventReg[56] &= (u8)~8;
gSaveContext.save.weekEventReg[56] &= (u8)~8;
this->unk4A8 = 0;
this->unk4AC |= 2;
func_808F35AC(this, globalCtx);
@@ -1406,7 +1407,7 @@ void EnIn_Init(Actor* thisx, GlobalContext* globalCtx) {
}
} else {
if (GET_RACE_FLAGS != RACE_FLAG_START) {
gSaveContext.weekEventReg[56] &= (u8)~8;
gSaveContext.save.weekEventReg[56] &= (u8)~8;
this->unk23C = 0;
this->unk4AC |= 2;
if (type == ENIN_BLUE_SHIRT) {
@@ -1414,7 +1415,7 @@ void EnIn_Init(Actor* thisx, GlobalContext* globalCtx) {
func_808F30B0(&this->skelAnime, 0);
this->actionFunc = func_808F5A94;
} else {
if (gSaveContext.weekEventReg[52] & 1) {
if (gSaveContext.save.weekEventReg[52] & 1) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_KANBAN, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, this->actor.shape.rot.x,
this->actor.shape.rot.y, this->actor.shape.rot.z, 0xF);
@@ -1425,7 +1426,7 @@ void EnIn_Init(Actor* thisx, GlobalContext* globalCtx) {
}
}
} else {
if (gSaveContext.weekEventReg[52] & 1) {
if (gSaveContext.save.weekEventReg[52] & 1) {
Actor_MarkForDeath(&this->actor);
} else {
func_808F30B0(&this->skelAnime, 7);
@@ -628,9 +628,10 @@ void func_80B439B0(s32 arg0, s32 arg1) {
}
if (!(arg0 & 1)) {
gSaveContext.unk_E88[arg0 >> 1] = (gSaveContext.unk_E88[arg0 >> 1] & 0xFFFF0000) | (arg1 & 0xFFFF);
gSaveContext.save.unk_E88[arg0 >> 1] = (gSaveContext.save.unk_E88[arg0 >> 1] & 0xFFFF0000) | (arg1 & 0xFFFF);
} else {
gSaveContext.unk_E88[arg0 >> 1] = (gSaveContext.unk_E88[arg0 >> 1] & 0xFFFF) | ((arg1 & 0xFFFF) << 0x10);
gSaveContext.save.unk_E88[arg0 >> 1] =
(gSaveContext.save.unk_E88[arg0 >> 1] & 0xFFFF) | ((arg1 & 0xFFFF) << 0x10);
}
}
@@ -638,19 +639,19 @@ s32 func_80B43A24(s32 arg0) {
u32 phi_v1;
if ((arg0 & 1) == 0) {
phi_v1 = gSaveContext.unk_E88[arg0 >> 1] & 0xFFFF;
phi_v1 = gSaveContext.save.unk_E88[arg0 >> 1] & 0xFFFF;
} else {
phi_v1 = (gSaveContext.unk_E88[arg0 >> 1] & 0xFFFF0000) >> 0x10;
phi_v1 = (gSaveContext.save.unk_E88[arg0 >> 1] & 0xFFFF0000) >> 0x10;
}
return phi_v1 + 0x1AAA;
}
void func_80B43A74(s32 arg0) {
gSaveContext.unk_E88[4] = (gSaveContext.unk_E88[4] & ~0xFF) | (arg0 & 0xFF);
gSaveContext.save.unk_E88[4] = (gSaveContext.save.unk_E88[4] & ~0xFF) | (arg0 & 0xFF);
}
s32 func_80B43A9C(void) {
return (gSaveContext.unk_E88[4] >> 0) & 0xFF;
return (gSaveContext.save.unk_E88[4] >> 0) & 0xFF;
}
s32 func_80B43AB0(void) {
@@ -664,7 +665,7 @@ s32 func_80B43AB0(void) {
}
void func_80B43AF0(s32 arg0) {
s32 currentTime = gSaveContext.time;
s32 currentTime = gSaveContext.save.time;
if (((CURRENT_DAY == 1) && (currentTime >= CLOCK_TIME(2, 30))) && (currentTime < CLOCK_TIME(5, 15))) {
s32 adjustment = (0xC - func_80B43A9C()) * 25.0f;
@@ -872,7 +873,7 @@ s32 func_80B44234(EnInvadepoh* this, Vec3f* vec) {
void func_80B442E4(EnInvadepoh* this) {
s32 pad;
s32 sp18 = gSaveContext.time;
s32 sp18 = gSaveContext.save.time;
s32 temp_v1_2 = sp18 - func_80B43A24(this->actor.params & 7);
if (D_80B4E940 == 1) {
@@ -945,7 +946,7 @@ void func_80B44540(EnInvadepoh* this, GlobalContext* globalCtx) {
}
void func_80B44570(EnInvadepoh* this) {
s32 currentTime = gSaveContext.time;
s32 currentTime = gSaveContext.save.time;
if ((currentTime < CLOCK_TIME(2, 0)) || (currentTime >= CLOCK_TIME(6, 0))) {
this->clockTime = 0.0f;
@@ -989,7 +990,7 @@ void func_80B446D0(EnInvadepoh* this, GlobalContext* globalCtx) {
}
void func_80B44700(EnInvadepoh* this) {
s32 currentTime = gSaveContext.time;
s32 currentTime = gSaveContext.save.time;
s32 new_var4 = 0xFFFF2AAB;
if ((currentTime < CLOCK_TIME(20, 0)) && (currentTime >= CLOCK_TIME(6, 0))) {
@@ -1262,7 +1263,7 @@ void func_80B451A0(EnInvadepoh* this, GlobalContext* globalCtx) {
if (CURRENT_DAY <= 0) {
D_80B4E940 = 1;
} else if (CURRENT_DAY == 1) {
currentTime = gSaveContext.time;
currentTime = gSaveContext.save.time;
if ((currentTime < CLOCK_TIME(2, 30)) || (currentTime >= CLOCK_TIME(6, 0))) {
D_80B4E940 = 1;
} else if (currentTime < CLOCK_TIME(5, 15)) {
@@ -1283,7 +1284,7 @@ void func_80B451A0(EnInvadepoh* this, GlobalContext* globalCtx) {
}
if (D_80B4E940 == 0) {
if (gSaveContext.weekEventReg[22] & 1) {
if (gSaveContext.save.weekEventReg[22] & 1) {
D_80B4E940 = 3;
} else {
D_80B4E940 = 4;
@@ -1648,7 +1649,7 @@ void func_80B4627C(EnInvadepoh* this, GlobalContext* globalCtx) {
if (D_80B4E940 == 1) {
func_80B46DA8(this);
} else if (D_80B4E940 == 2) {
if (gSaveContext.time < CLOCK_TIME(2, 31)) {
if (gSaveContext.save.time < CLOCK_TIME(2, 31)) {
func_80B46DA8(this);
} else {
func_80B454BC(this, globalCtx);
@@ -1657,10 +1658,10 @@ void func_80B4627C(EnInvadepoh* this, GlobalContext* globalCtx) {
func_80B46F88(this);
}
} else if (D_80B4E940 == 3) {
if (gSaveContext.entranceIndex == 0x6460) {
if (gSaveContext.save.entranceIndex == 0x6460) {
func_80B471C0(this);
} else if (gSaveContext.entranceIndex == 0x6470) {
} else if (gSaveContext.save.entranceIndex == 0x6470) {
func_80B47248(this);
} else {
func_80B47248(this);
@@ -1747,23 +1748,23 @@ void EnInvadepoh_InitRomani(EnInvadepoh* this, GlobalContext* globalCtx) {
Actor_MarkForDeath(&this->actor);
}
if (temp == 5) {
if (gSaveContext.weekEventReg[22] & 1) {
if (gSaveContext.save.weekEventReg[22] & 1) {
Actor_MarkForDeath(&this->actor);
return;
}
} else if (temp == 7) {
if (gSaveContext.time < CLOCK_TIME(6, 0) && gSaveContext.time >= CLOCK_TIME(2, 15)) {
if (gSaveContext.save.time < CLOCK_TIME(6, 0) && gSaveContext.save.time >= CLOCK_TIME(2, 15)) {
Actor_MarkForDeath(&this->actor);
return;
}
} else if (temp != 8) {
if (temp == 9) {
if (gSaveContext.entranceIndex != 0x6460) {
if (gSaveContext.save.entranceIndex != 0x6460) {
Actor_MarkForDeath(&this->actor);
return;
}
} else if (temp == 0xC) {
if (!(gSaveContext.weekEventReg[22] & 1)) {
if (!(gSaveContext.save.weekEventReg[22] & 1)) {
Actor_MarkForDeath(&this->actor);
}
D_80B503F4 = this;
@@ -1776,7 +1777,7 @@ void func_80B468B4(EnInvadepoh* this, GlobalContext* globalCtx) {
this->actor.update = func_80B49B1C;
this->actor.draw = func_80B4E3F0;
func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_NPC);
if (D_80B4E940 == 1 || gSaveContext.time < CLOCK_TIME(2, 31)) {
if (D_80B4E940 == 1 || gSaveContext.save.time < CLOCK_TIME(2, 31)) {
this->actor.world.pos.x += D_80B4E934.x;
this->actor.world.pos.y += D_80B4E934.y + 3000.0f;
this->actor.world.pos.z += D_80B4E934.z;
@@ -1818,7 +1819,7 @@ void EnInvadepoh_InitCremia(EnInvadepoh* this, GlobalContext* globalCtx) {
if (this->bankIndex < 0) {
Actor_MarkForDeath(&this->actor);
}
if (!(gSaveContext.weekEventReg[22] & 1)) {
if (!(gSaveContext.save.weekEventReg[22] & 1)) {
Actor_MarkForDeath(&this->actor);
}
D_80B503F8 = this;
@@ -1899,7 +1900,7 @@ void func_80B46DA8(EnInvadepoh* this) {
}
void func_80B46DC8(EnInvadepoh* this, GlobalContext* globalCtx) {
if ((gSaveContext.time < CLOCK_TIME(6, 0)) && (gSaveContext.time >= CLOCK_TIME(2, 30))) {
if ((gSaveContext.save.time < CLOCK_TIME(6, 0)) && (gSaveContext.save.time >= CLOCK_TIME(2, 30))) {
func_80B454BC(this, globalCtx);
func_80B452EC(this, globalCtx);
func_80B46E20(this);
@@ -1954,8 +1955,8 @@ void func_80B46F88(EnInvadepoh* this) {
void func_80B46FA8(EnInvadepoh* this, GlobalContext* globalCtx) {
s32 i;
if ((gSaveContext.time < CLOCK_TIME(6, 0)) && (gSaveContext.time >= CLOCK_TIME(5, 15))) {
gSaveContext.weekEventReg[22] |= 1;
if ((gSaveContext.save.time < CLOCK_TIME(6, 0)) && (gSaveContext.save.time >= CLOCK_TIME(5, 15))) {
gSaveContext.save.weekEventReg[22] |= 1;
func_80B47064(this);
} else {
func_80B457A0(this);
@@ -2040,7 +2041,7 @@ void func_80B47298(EnInvadepoh* this, GlobalContext* globalCtx) {
globalCtx->sceneLoadFlag = 0x14;
globalCtx->unk_1887F = 0x48;
gSaveContext.nextTransition = 0x48;
gSaveContext.weekEventReg[89] |= 0x10;
gSaveContext.save.weekEventReg[89] |= 0x10;
func_80B47304(this);
}
@@ -2289,7 +2290,7 @@ void func_80B47BAC(Actor* thisx, GlobalContext* globalCtx) {
func_80B447C0(this, globalCtx);
func_80B43F0C(this);
func_80B4516C(this);
if (D_80B4E940 == 1 || gSaveContext.time < CLOCK_TIME(2, 31)) {
if (D_80B4E940 == 1 || gSaveContext.save.time < CLOCK_TIME(2, 31)) {
func_80B47380(this);
} else if (D_80B4E940 == 2) {
if (this->clockTime >= 0.0001f) {
@@ -3061,7 +3062,7 @@ void func_80B49DFC(EnInvadepoh* this, GlobalContext* globalCtx) {
substruct->unk26.y = CLAMP(temp_v1, -0x1F40, 0x1F40);
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
if (this->actor.textId == 0x332D) {
gSaveContext.weekEventReg[54] |= 0x10;
gSaveContext.save.weekEventReg[54] |= 0x10;
this->actor.textId = 0x332E;
}
func_80B49BD0(this);
@@ -3074,7 +3075,7 @@ void func_80B49F88(Actor* thisx, GlobalContext* globalCtx) {
s32 sp38;
if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) {
sp38 = gSaveContext.time;
sp38 = gSaveContext.save.time;
this->actor.objBankIndex = this->bankIndex;
Actor_SetObjectDependency(globalCtx, &this->actor);
func_80B44F58();
@@ -3086,8 +3087,8 @@ void func_80B49F88(Actor* thisx, GlobalContext* globalCtx) {
func_80B44C24(this, globalCtx);
func_80B43F0C(this);
func_80B4516C(this);
if (0x20 & gSaveContext.weekEventReg[21]) {
if (gSaveContext.weekEventReg[54] & 0x10) {
if (0x20 & gSaveContext.save.weekEventReg[21]) {
if (gSaveContext.save.weekEventReg[54] & 0x10) {
this->actor.textId = 0x332E;
} else {
this->actor.textId = 0x332D;
@@ -3113,7 +3114,7 @@ void func_80B49F88(Actor* thisx, GlobalContext* globalCtx) {
void func_80B4A168(Actor* thisx, GlobalContext* globalCtx) {
EnInvadepoh* this = THIS;
if ((gSaveContext.time < CLOCK_TIME(6, 0)) && (gSaveContext.time >= CLOCK_TIME(2, 0))) {
if ((gSaveContext.save.time < CLOCK_TIME(6, 0)) && (gSaveContext.save.time >= CLOCK_TIME(2, 0))) {
this->actor.update = func_80B4A1B8;
this->actor.draw = func_80B4E324;
func_80B49BD0(this);
@@ -3288,7 +3289,7 @@ void func_80B4A81C(EnInvadepoh* this, GlobalContext* globalCtx) {
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
if (this->actor.textId == 0x332D) {
gSaveContext.weekEventReg[54] |= 0x10;
gSaveContext.save.weekEventReg[54] |= 0x10;
this->actor.textId = 0x332E;
}
if (this->pathIndex == this->endPoint) {
@@ -3305,7 +3306,7 @@ void func_80B4A9C8(Actor* thisx, GlobalContext* globalCtx) {
s32 sp38;
if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) {
sp38 = gSaveContext.time;
sp38 = gSaveContext.save.time;
this->actor.objBankIndex = this->bankIndex;
Actor_SetObjectDependency(globalCtx, &this->actor);
func_80B44F58();
@@ -3327,8 +3328,8 @@ void func_80B4A9C8(Actor* thisx, GlobalContext* globalCtx) {
func_80B43F0C(this);
func_800B4AEC(globalCtx, &this->actor, 50.0f);
func_80B4516C(this);
if (gSaveContext.weekEventReg[21] & 0x20) {
if (gSaveContext.weekEventReg[54] & 0x10) {
if (gSaveContext.save.weekEventReg[21] & 0x20) {
if (gSaveContext.save.weekEventReg[54] & 0x10) {
this->actor.textId = 0x332E;
} else {
this->actor.textId = 0x332D;
@@ -3342,7 +3343,7 @@ void func_80B4A9C8(Actor* thisx, GlobalContext* globalCtx) {
void func_80B4AB8C(Actor* thisx, GlobalContext* globalCtx) {
EnInvadepoh* this = THIS;
if ((gSaveContext.time < CLOCK_TIME(6, 0)) && (gSaveContext.time >= CLOCK_TIME(2, 15))) {
if ((gSaveContext.save.time < CLOCK_TIME(6, 0)) && (gSaveContext.save.time >= CLOCK_TIME(2, 15))) {
this->actor.update = func_80B4ABDC;
this->actor.draw = func_80B4E324;
func_80B4A614(this);
@@ -3376,7 +3377,7 @@ void func_80B4ACDC(EnInvadepoh* this) {
}
void func_80B4ACF0(EnInvadepoh* this, GlobalContext* globalCtx) {
if (gSaveContext.weekEventReg[22] & 1) {
if (gSaveContext.save.weekEventReg[22] & 1) {
this->actor.draw = func_80B4E324;
this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
func_80B4AD3C(this);
@@ -3404,7 +3405,7 @@ void func_80B4ADB8(EnInvadepoh* this) {
void func_80B4ADCC(EnInvadepoh* this, GlobalContext* globalCtx) {
if ((Message_GetState(&globalCtx->msgCtx) == 5) && Message_ShouldAdvance(globalCtx)) {
if (this->textId == 0x3331) {
if (gSaveContext.weekEventReg[22] & 2) {
if (gSaveContext.save.weekEventReg[22] & 2) {
EnInvadepoh_SetTextID(this, globalCtx, 0x3334);
func_80151BB4(globalCtx, 0x1D);
func_80151BB4(globalCtx, 5);
@@ -3436,7 +3437,7 @@ void func_80B4AEDC(EnInvadepoh* this, GlobalContext* globalCtx) {
}
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
gSaveContext.weekEventReg[22] |= 2;
gSaveContext.save.weekEventReg[22] |= 2;
func_80B4AF80(this);
} else {
Actor_PickUp(&this->actor, globalCtx, GI_MILK_BOTTLE, 2000.0f, 2000.0f);
@@ -3791,7 +3792,7 @@ void func_80B4BC4C(EnInvadepoh* this, GlobalContext* globalCtx) {
(Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK);
}
if (gSaveContext.time > CLOCK_TIME(20, 15)) {
if (gSaveContext.save.time > CLOCK_TIME(20, 15)) {
Actor_MarkForDeath(&this->actor);
} else if ((temp_t6 != NULL) && (temp_t6->actionFunc == func_80B4CB0C)) {
func_80B4C1BC(this);
@@ -3868,7 +3869,7 @@ void func_80B4C3A0(Actor* thisx, GlobalContext* globalCtx) {
if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) {
s32 pad[2];
s32 currentTime = gSaveContext.time;
s32 currentTime = gSaveContext.save.time;
this->actor.objBankIndex = this->bankIndex;
Actor_SetObjectDependency(globalCtx, &this->actor);
@@ -3904,7 +3905,7 @@ void func_80B4C3A0(Actor* thisx, GlobalContext* globalCtx) {
void func_80B4C568(Actor* thisx, GlobalContext* globalCtx) {
EnInvadepoh* this = THIS;
if ((gSaveContext.time >= 0xD573) && (gSaveContext.time < CLOCK_TIME(20, 15))) {
if ((gSaveContext.save.time >= 0xD573) && (gSaveContext.save.time < CLOCK_TIME(20, 15))) {
this->actor.update = func_80B4C5C0;
this->actor.draw = func_80B4E7BC;
func_80B4BBE0(this);
@@ -4089,7 +4090,7 @@ void func_80B4CE54(Actor* thisx, GlobalContext* globalCtx) {
s32 sp38;
if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) {
sp38 = gSaveContext.time;
sp38 = gSaveContext.save.time;
this->actor.objBankIndex = this->bankIndex;
Actor_SetObjectDependency(globalCtx, &this->actor);
@@ -4120,7 +4121,7 @@ void func_80B4CE54(Actor* thisx, GlobalContext* globalCtx) {
void func_80B4CFFC(Actor* thisx, GlobalContext* globalCtx) {
EnInvadepoh* this = THIS;
if ((gSaveContext.time >= CLOCK_TIME(20, 0)) && (gSaveContext.time < 0xD7E1)) {
if ((gSaveContext.save.time >= CLOCK_TIME(20, 0)) && (gSaveContext.save.time < 0xD7E1)) {
this->actor.update = func_80B4D054;
this->actor.draw = func_80B4E324;
func_80B4C6C8(this);
+1 -1
View File
@@ -291,7 +291,7 @@ void func_80BC2150(EnJa* this, GlobalContext* globalCtx) {
}
void func_80BC21A8(EnJa* this, GlobalContext* globalCtx) {
u32* unk_14 = &gSaveContext.unk_14;
u32* unk_14 = &gSaveContext.save.daySpeed;
struct_80133038_arg2 sp18;
this->unk_35C = REG(15) + *unk_14;
+9 -9
View File
@@ -493,14 +493,14 @@ void EnJg_Talk(EnJg* this, GlobalContext* globalCtx) {
temp = this->textId;
if ((temp == 0xDBB) || (temp == 0xDBC)) {
if (!(gSaveContext.weekEventReg[24] & 0x80)) {
if (!(gSaveContext.save.weekEventReg[24] & 0x80)) {
// The player hasn't talked to the Goron Child at least once, so they can't learn
// the Lullaby Intro. End the current conversation with the player.
globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->flags &= ~FLAG_LOOKING_AT_PLAYER;
this->actionFunc = EnJg_SetupWalk;
} else if (((gSaveContext.weekEventReg[24] & 0x40)) ||
} else if (((gSaveContext.save.weekEventReg[24] & 0x40)) ||
(CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) || CHECK_QUEST_ITEM(QUEST_SONG_LULLABY_INTRO))) {
// The player already has the Lullaby or Lullaby Intro, so say "I'm counting on you"
this->textId = EnJg_GetNextTextId(this);
@@ -700,7 +700,7 @@ void EnJg_LullabyIntroCutsceneAction(EnJg* this, GlobalContext* globalCtx) {
} else {
this->csAction = 99;
this->freezeTimer = 1000;
gSaveContext.weekEventReg[24] |= 0x40;
gSaveContext.save.weekEventReg[24] |= 0x40;
this->actionFunc = EnJg_Idle;
}
}
@@ -830,7 +830,7 @@ s32 EnJg_GetNextTextId(EnJg* this) {
return 0xDDC; // Everyone would accept you
case 0xDDC: // Everyone would accept you
gSaveContext.weekEventReg[77] |= 0x80;
gSaveContext.save.weekEventReg[77] |= 0x80;
return 0xDDD; // Think it over slowly
default:
@@ -848,7 +848,7 @@ s32 EnJg_GetStartingConversationTextId(EnJg* this, GlobalContext* globalCtx) {
if (!EN_JG_IS_IN_GORON_SHRINE(&this->actor)) {
if (player->transformation == PLAYER_FORM_GORON) {
if ((gSaveContext.weekEventReg[24] & 0x10) || CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) ||
if ((gSaveContext.save.weekEventReg[24] & 0x10) || CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) ||
CHECK_QUEST_ITEM(QUEST_SONG_LULLABY_INTRO)) {
// The player has already talked as a Goron at least once.
return 0xDBC; // Following me won't do you any good
@@ -858,7 +858,7 @@ s32 EnJg_GetStartingConversationTextId(EnJg* this, GlobalContext* globalCtx) {
return 0xDB6; // "Hunh???"
}
if (gSaveContext.weekEventReg[24] & 0x20) {
if (gSaveContext.save.weekEventReg[24] & 0x20) {
// The player has already talked as a non-Goron at least once.
return 0xDB5; // This is our problem (repeat)
}
@@ -868,7 +868,7 @@ s32 EnJg_GetStartingConversationTextId(EnJg* this, GlobalContext* globalCtx) {
}
if (player->transformation == PLAYER_FORM_GORON) {
if (gSaveContext.weekEventReg[77] & 0x80) {
if (gSaveContext.save.weekEventReg[77] & 0x80) {
// The player has heard the Goron Shrine cheer as a Goron at least once.
return 0xDDE; // Come back after entering the race
}
@@ -908,9 +908,9 @@ void EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(EnJg* this, GlobalContext*
if (this->textId == 0xDAC) {
this->action = EN_JG_ACTION_FIRST_THAW;
} else if (this->textId == 0xDAE) {
gSaveContext.weekEventReg[24] |= 0x20;
gSaveContext.save.weekEventReg[24] |= 0x20;
} else if (this->textId == 0xDB6) {
gSaveContext.weekEventReg[24] |= 0x10;
gSaveContext.save.weekEventReg[24] |= 0x10;
}
Message_StartTextbox(globalCtx, this->textId, &this->actor);
@@ -94,7 +94,7 @@ void EnJgameTsn_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.velocity.y = 0.0f;
if (gSaveContext.entranceIndex == 0x68D0) {
if (gSaveContext.save.entranceIndex == 0x68D0) {
this->actor.flags |= ACTOR_FLAG_10000;
}
@@ -141,7 +141,7 @@ void EnJgameTsn_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnJgameTsn* this = THIS;
Collider_DestroyCylinder(globalCtx, &this->collider);
gSaveContext.weekEventReg[90] &= (u8)~0x20;
gSaveContext.save.weekEventReg[90] &= (u8)~0x20;
}
void func_80C13B74(EnJgameTsn* this) {
@@ -168,8 +168,8 @@ void func_80C13BB8(EnJgameTsn* this, GlobalContext* globalCtx) {
Message_StartTextbox(globalCtx, 0x10A3, &this->actor);
this->unk_300 = 0x10A3;
}
} else if (((gSaveContext.time > CLOCK_TIME(4, 0)) && (gSaveContext.time < CLOCK_TIME(7, 0))) ||
((gSaveContext.time > CLOCK_TIME(16, 0)) && (gSaveContext.time < CLOCK_TIME(19, 0)))) {
} else if (((gSaveContext.save.time > CLOCK_TIME(4, 0)) && (gSaveContext.save.time < CLOCK_TIME(7, 0))) ||
((gSaveContext.save.time > CLOCK_TIME(16, 0)) && (gSaveContext.save.time < CLOCK_TIME(19, 0)))) {
Message_StartTextbox(globalCtx, 0x1094, &this->actor);
this->unk_300 = 0x1094;
} else if (this->unk_2F8 == 0) {
@@ -190,7 +190,7 @@ void func_80C13BB8(EnJgameTsn* this, GlobalContext* globalCtx) {
}
if ((player->actor.bgCheckFlags & 1) && !(player->stateFlags1 & 0x2000) && (this->unk_2FE == 0) &&
(gSaveContext.playerForm == PLAYER_FORM_HUMAN) && func_80C149B0(globalCtx, &this->unk_1F8)) {
(gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) && func_80C149B0(globalCtx, &this->unk_1F8)) {
this->unk_2FE = 1;
func_80C13E6C(this);
} else if (!(player->actor.bgCheckFlags & 1)) {
@@ -209,8 +209,8 @@ void func_80C13E6C(EnJgameTsn* this) {
void func_80C13E90(EnJgameTsn* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->actor.flags &= ~ACTOR_FLAG_10000;
if (((gSaveContext.time > CLOCK_TIME(4, 0)) && (gSaveContext.time < CLOCK_TIME(7, 0))) ||
((gSaveContext.time > CLOCK_TIME(16, 0)) && (gSaveContext.time < CLOCK_TIME(19, 0)))) {
if (((gSaveContext.save.time > CLOCK_TIME(4, 0)) && (gSaveContext.save.time < CLOCK_TIME(7, 0))) ||
((gSaveContext.save.time > CLOCK_TIME(16, 0)) && (gSaveContext.save.time < CLOCK_TIME(19, 0)))) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
Message_StartTextbox(globalCtx, 0x1094, &this->actor);
this->unk_300 = 0x1094;
@@ -286,7 +286,7 @@ void func_80C1410C(EnJgameTsn* this, GlobalContext* globalCtx) {
func_801A2BB8(0x25);
globalCtx->interfaceCtx.unk_280 = 1;
func_80112AFC(globalCtx);
gSaveContext.weekEventReg[90] |= 0x20;
gSaveContext.save.weekEventReg[90] |= 0x20;
func_8010E9F0(4, 0x78);
this->actionFunc = func_80C1418C;
}
@@ -379,11 +379,11 @@ void func_80C14540(EnJgameTsn* this) {
void func_80C14554(EnJgameTsn* this, GlobalContext* globalCtx) {
if (Actor_HasParent(&this->actor, globalCtx)) {
if (!(gSaveContext.weekEventReg[82] & 0x10)) {
gSaveContext.weekEventReg[82] |= 0x10;
if (!(gSaveContext.save.weekEventReg[82] & 0x10)) {
gSaveContext.save.weekEventReg[82] |= 0x10;
}
func_80C145FC(this);
} else if (gSaveContext.weekEventReg[82] & 0x10) {
} else if (gSaveContext.save.weekEventReg[82] & 0x10) {
Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_PURPLE, 500.0f, 100.0f);
} else {
Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 500.0f, 100.0f);
@@ -407,7 +407,7 @@ void func_80C14610(EnJgameTsn* this, GlobalContext* globalCtx) {
void func_80C14684(EnJgameTsn* this, GlobalContext* globalCtx) {
if (Message_ShouldAdvance(globalCtx)) {
if (globalCtx->msgCtx.choiceIndex == 0) {
if (gSaveContext.rupees >= 20) {
if (gSaveContext.save.playerData.rupees >= 20) {
Message_StartTextbox(globalCtx, 0x109E, &this->actor);
this->unk_300 = 0x109E;
func_801159EC(-20);
@@ -480,7 +480,7 @@ void func_80C147B4(EnJgameTsn* this, GlobalContext* globalCtx) {
func_801477B4(globalCtx);
gSaveContext.minigameState = 3;
gSaveContext.unk_3DD0[4] = 5;
gSaveContext.weekEventReg[90] &= (u8)~0x20;
gSaveContext.save.weekEventReg[90] &= (u8)~0x20;
func_80C144E4(this);
break;
+22 -22
View File
@@ -176,14 +176,14 @@ void EnKakasi_Init(Actor* thisx, GlobalContext* globalCtx) {
}
if (this->aboveGroundStatus) {
if (gSaveContext.weekEventReg[79] & 8) {
if (gSaveContext.save.weekEventReg[79] & 8) {
this->aboveGroundStatus = ENKAKASI_ABOVE_GROUND_TYPE;
this->songSummonDist = 80.0f;
EnKakasi_SetupIdleUnderground(this);
} else {
Actor_SetFocus(&this->actor, 60.0f);
this->unkFunc = EnKakasi_8096F88C;
if (gSaveContext.weekEventReg[83] & 1) {
if (gSaveContext.save.weekEventReg[83] & 1) {
EnKakasi_InitTimeSkipDialogue(this);
} else {
EnKakasi_SetupIdleStanding(this);
@@ -302,13 +302,13 @@ void EnKakasi_TimeSkipDialogue(EnKakasi* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (gSaveContext.respawnFlag != -4 && gSaveContext.respawnFlag != -8) {
if (gSaveContext.time != CLOCK_TIME(6, 0) && gSaveContext.time != CLOCK_TIME(18, 0) &&
if (gSaveContext.save.time != CLOCK_TIME(6, 0) && gSaveContext.save.time != CLOCK_TIME(18, 0) &&
!(gSaveContext.eventInf[1] & 0x80)) {
if (this->actor.textId == 0) {
// dialogue after skipped time 'did you feel that? went by in an instant'
this->actor.textId = 0x1653;
gSaveContext.weekEventReg[83] &= (u8)~1;
gSaveContext.save.weekEventReg[83] &= (u8)~1;
this->unkMsgState1AC = 5;
player->stateFlags1 |= 0x20;
this->actor.flags |= ACTOR_FLAG_10000;
@@ -332,7 +332,7 @@ void EnKakasi_SetupIdleStanding(EnKakasi* this) {
}
void EnKakasi_IdleStanding(EnKakasi* this, GlobalContext* globalCtx) {
u32 saveContextDay = gSaveContext.day;
u32 saveContextDay = gSaveContext.save.day;
s16 x;
s16 y;
@@ -361,7 +361,7 @@ void EnKakasi_IdleStanding(EnKakasi* this, GlobalContext* globalCtx) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
this->skelanime.playSpeed = 2.0f;
}
} else if (saveContextDay == 3 && gSaveContext.isNight) {
} else if (saveContextDay == 3 && gSaveContext.save.isNight) {
this->skelanime.playSpeed = 1.0f;
if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
EnKakasi_SetAnimation(this, 1);
@@ -388,7 +388,7 @@ void EnKakasi_SetupDialogue(EnKakasi* this) {
}
void EnKakasi_RegularDialogue(EnKakasi* this, GlobalContext* globalCtx) {
u32 saveContextDay = gSaveContext.day;
u32 saveContextDay = gSaveContext.save.day;
f32 currentAnimeFrame = this->skelanime.curFrame;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 2000, 0);
@@ -425,16 +425,16 @@ void EnKakasi_RegularDialogue(EnKakasi* this, GlobalContext* globalCtx) {
// after timeskip
if (this->actor.textId == 0x1653) {
u32 saveContextDay2 = gSaveContext.day;
u32 saveContextDay2 = gSaveContext.save.day;
if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
}
if (saveContextDay2 == 3 && gSaveContext.isNight) {
if (saveContextDay2 == 3 && gSaveContext.save.isNight) {
// text: dangerous outside
this->actor.textId = 0x164F;
} else if (gSaveContext.isNight) {
} else if (gSaveContext.save.isNight) {
// text: would you like to skip time?
this->actor.textId = 0x164E;
} else {
@@ -475,7 +475,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, GlobalContext* globalCtx) {
if (this->animIndex != ENKAKASI_ANIM_SIDEWAYS_SHAKING) {
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_SIDEWAYS_SHAKING);
}
if (gSaveContext.isNight) {
if (gSaveContext.save.isNight) {
this->actor.textId = 0x164E;
} else {
this->actor.textId = 0x1645;
@@ -519,7 +519,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, GlobalContext* globalCtx) {
this->actor.textId = 0x1658;
} else if (this->actor.textId == 0x165C) {
this->actor.textId = 0x165E;
} else if (saveContextDay == 3 && gSaveContext.isNight) {
} else if (saveContextDay == 3 && gSaveContext.save.isNight) {
this->actor.textId = 0x164F;
} else {
this->actor.textId = 0x1652;
@@ -788,7 +788,7 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, GlobalContext* globalCtx) {
* talking before dancing the night away, and cutscene setup
*/
void EnKakasi_DancingRemark(EnKakasi* this, GlobalContext* globalCtx) {
u32 currentDay = gSaveContext.day;
u32 currentDay = gSaveContext.save.day;
this->unkState196 = 3;
if (ActorCutscene_GetCurrentIndex() == 0x7C) {
@@ -799,7 +799,7 @@ void EnKakasi_DancingRemark(EnKakasi* this, GlobalContext* globalCtx) {
} else {
ActorCutscene_StartAndSetUnkLinkFields(this->actorCutscenes[0], &this->actor);
this->cutsceneCamId = ActorCutscene_GetCurrentCamera(this->actor.cutscene);
if (currentDay == 3 && gSaveContext.isNight) {
if (currentDay == 3 && gSaveContext.save.isNight) {
EnKakasi_SetupDigAway(this);
} else {
func_801A2BB8(NA_BGM_SARIAS_SONG);
@@ -931,20 +931,20 @@ void EnKakasi_DancingNightAway(EnKakasi* this, GlobalContext* globalCtx) {
if (this->unk204 == 0) {
player = GET_PLAYER(globalCtx);
Play_SetRespawnData(&globalCtx->state, 0, Entrance_CreateIndexFromSpawn(0), player->unk_3CE, 0xBFF,
&player->unk_3C0, player->unk_3CC);
Play_SetRespawnData(&globalCtx->state, RESTART_MODE_DOWN, Entrance_CreateIndexFromSpawn(0),
player->unk_3CE, 0xBFF, &player->unk_3C0, player->unk_3CC);
func_80169EFC(&globalCtx->state);
if (0) {}
if (gSaveContext.time > CLOCK_TIME(18, 0) || gSaveContext.time < CLOCK_TIME(6, 0)) {
gSaveContext.time = CLOCK_TIME(6, 0);
if (gSaveContext.save.time > CLOCK_TIME(18, 0) || gSaveContext.save.time < CLOCK_TIME(6, 0)) {
gSaveContext.save.time = CLOCK_TIME(6, 0);
gSaveContext.respawnFlag = -4;
gSaveContext.eventInf[2] |= 0x80;
} else {
gSaveContext.time = CLOCK_TIME(18, 0);
gSaveContext.save.time = CLOCK_TIME(18, 0);
gSaveContext.respawnFlag = -8;
}
gSaveContext.weekEventReg[83] |= 1;
gSaveContext.save.weekEventReg[83] |= 1;
this->unk190 = 0;
this->actionFunc = EnKakasi_DoNothing;
}
@@ -1013,7 +1013,7 @@ void EnKakasi_DiggingAway(EnKakasi* this, GlobalContext* globalCtx) {
Math_ApproachF(&this->actor.shape.yOffset, -6000.0f, 0.5f, 200.0f);
if (fabsf(this->actor.shape.yOffset + 6000.0f) < 10.0f) {
gSaveContext.weekEventReg[79] |= 8;
gSaveContext.save.weekEventReg[79] |= 8;
func_800B7298(globalCtx, &this->actor, 6);
ActorCutscene_Stop(this->actorCutscenes[0]);
this->aboveGroundStatus = ENKAKASI_ABOVE_GROUND_TYPE;
@@ -1031,7 +1031,7 @@ void EnKakasi_SetupIdleUnderground(EnKakasi* this) {
}
void EnKakasi_IdleUnderground(EnKakasi* this, GlobalContext* globalCtx) {
if ((gSaveContext.weekEventReg[79] & 8) && this->actor.xzDistToPlayer < this->songSummonDist &&
if ((gSaveContext.save.weekEventReg[79] & 8) && this->actor.xzDistToPlayer < this->songSummonDist &&
(BREG(1) != 0 || globalCtx->msgCtx.ocarinaMode == 0xD)) {
this->actor.flags &= ~ACTOR_FLAG_8000000;
globalCtx->msgCtx.ocarinaMode = 4;
@@ -991,7 +991,7 @@ void EnKanban_Draw(Actor* thisx, GlobalContext* globalCtx) {
if ((this->actor.projectedPos.z <= 400.0f) && (this->actor.projectedPos.z > 0.0f) &&
(this->actor.floorHeight > -3000.0f) && ((this->bounceX != 0) || (this->bounceZ != 0))) {
u16 dayTime = gSaveContext.time;
u16 dayTime = gSaveContext.save.time;
f32 shadowAlpha;
if (dayTime >= CLOCK_TIME(12, 0)) {
+5 -5
View File
@@ -71,12 +71,12 @@ void EnKbt_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
s32 func_80B33E64(GlobalContext* globalCtx) {
return gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 1;
return gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 1;
}
s32 func_80B33E8C(GlobalContext* globalCtx) {
if ((CURRENT_DAY == 3) ||
((CURRENT_DAY == 2) && (gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 2))) {
((CURRENT_DAY == 2) && (gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 2))) {
return true;
}
return false;
@@ -250,7 +250,7 @@ void func_80B34314(EnKbt* this, GlobalContext* globalCtx) {
} else if (this->actor.xzDistToPlayer < 250.0f) {
if ((this->unk_278 != NULL) && (this->unk_278->xzDistToPlayer < 250.0f)) {
if (this->unk_27C & 4) {
playerForm = gSaveContext.playerForm;
playerForm = gSaveContext.save.playerForm;
if (((playerForm ^ 0) != PLAYER_FORM_HUMAN) || ((CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_KOKIRI) &&
(CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_RAZOR) &&
(CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_GILDED))) {
@@ -266,10 +266,10 @@ void func_80B34314(EnKbt* this, GlobalContext* globalCtx) {
if (this->actor.textId != 0xC37) {
if (((this->actor.textId == 0xC4E) || (this->actor.textId == 0xC4F) || (this->actor.textId == 0xC50)) &&
(gSaveContext.playerForm != PLAYER_FORM_HUMAN)) {
(gSaveContext.save.playerForm != PLAYER_FORM_HUMAN)) {
this->actor.textId = 0xC37;
}
} else if (gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
} else if (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN) {
if (func_80B33E8C(globalCtx)) {
this->actor.textId = 0xC50;
} else {
@@ -109,7 +109,8 @@ void EnKendoJs_Init(Actor* thisx, GlobalContext* globalCtx) {
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_js_Skel_006990, &object_js_Anim_000F4C, this->jointTable,
this->morphTable, 13);
if ((CURRENT_DAY == 3) && !((gSaveContext.time <= CLOCK_TIME(23, 0)) && (gSaveContext.time >= CLOCK_TIME(6, 0)))) {
if ((CURRENT_DAY == 3) &&
!((gSaveContext.save.time <= CLOCK_TIME(23, 0)) && (gSaveContext.save.time >= CLOCK_TIME(6, 0)))) {
if (ENKENDOJS_GET_FF(&this->actor) != ENKENDOJS_FF_1) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_KANBAN, this->actor.home.pos.x,
this->actor.home.pos.y, this->actor.home.pos.z - 10.0f, this->actor.home.rot.x,
@@ -145,7 +146,7 @@ void EnKendoJs_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnKendoJs* this = THIS;
Collider_DestroyCylinder(globalCtx, &this->collider);
gSaveContext.weekEventReg[82] &= (u8)~8;
gSaveContext.save.weekEventReg[82] &= (u8)~8;
}
void func_80B26538(EnKendoJs* this) {
@@ -166,8 +167,8 @@ void func_80B2654C(EnKendoJs* this, GlobalContext* globalCtx) {
if (ENKENDOJS_GET_FF(&this->actor) == ENKENDOJS_FF_1) {
Message_StartTextbox(globalCtx, 0x273C, &this->actor);
this->unk_288 = 0x273C;
} else if (gSaveContext.playerForm != PLAYER_FORM_HUMAN) {
switch (gSaveContext.playerForm) {
} else if (gSaveContext.save.playerForm != PLAYER_FORM_HUMAN) {
switch (gSaveContext.save.playerForm) {
case PLAYER_FORM_DEKU:
phi_v0 = 0;
break;
@@ -215,12 +216,12 @@ void func_80B26758(EnKendoJs* this, GlobalContext* globalCtx) {
if (Message_ShouldAdvance(globalCtx) && (this->unk_288 == 0x2716)) {
switch (globalCtx->msgCtx.choiceIndex) {
case 0:
if (CUR_EQUIP_VALUE_VOID(EQUIP_SWORD) == EQUIP_SWORD) {
if (GET_CUR_EQUIP_VALUE(EQUIP_SWORD) == EQUIP_SWORD) {
play_sound(NA_SE_SY_ERROR);
Message_StartTextbox(globalCtx, 0x272C, &this->actor);
this->unk_288 = 0x272C;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
} else if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
} else if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
play_sound(NA_SE_SY_ERROR);
Message_StartTextbox(globalCtx, 0x2718, &this->actor);
this->unk_288 = 0x2718;
@@ -233,12 +234,12 @@ void func_80B26758(EnKendoJs* this, GlobalContext* globalCtx) {
break;
case 1:
if (CUR_EQUIP_VALUE_VOID(EQUIP_SWORD) == EQUIP_SWORD) {
if (GET_CUR_EQUIP_VALUE(EQUIP_SWORD) == EQUIP_SWORD) {
play_sound(NA_SE_SY_ERROR);
Message_StartTextbox(globalCtx, 0x272C, &this->actor);
this->unk_288 = 0x272C;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
} else if (gSaveContext.rupees < globalCtx->msgCtx.unk12070) {
} else if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk12070) {
play_sound(NA_SE_SY_ERROR);
Message_StartTextbox(globalCtx, 0x2718, &this->actor);
this->unk_288 = 0x2718;
@@ -492,7 +493,7 @@ void func_80B27030(EnKendoJs* this, GlobalContext* globalCtx) {
}
void func_80B2714C(EnKendoJs* this) {
gSaveContext.weekEventReg[82] |= 8;
gSaveContext.save.weekEventReg[82] |= 8;
this->unk_28C = 1;
this->unk_290 = 0;
this->unk_284 = 0;
@@ -553,14 +554,14 @@ void func_80B27188(EnKendoJs* this, GlobalContext* globalCtx) {
}
if (this->unk_284 == 7) {
gSaveContext.weekEventReg[82] &= (u8)~8;
gSaveContext.save.weekEventReg[82] &= (u8)~8;
func_80B26AE8(this);
}
}
}
void func_80B273D0(EnKendoJs* this) {
gSaveContext.weekEventReg[82] |= 8;
gSaveContext.save.weekEventReg[82] |= 8;
this->unk_290 = 120;
this->unk_284 = 0;
this->unk_286 = 1;
@@ -593,7 +594,7 @@ void func_80B274BC(EnKendoJs* this, GlobalContext* globalCtx) {
this->unk_288 = 0x272E;
}
player->stateFlags1 |= 0x20;
gSaveContext.weekEventReg[82] &= (u8)~8;
gSaveContext.save.weekEventReg[82] &= (u8)~8;
func_80B26AE8(this);
return;
}
@@ -635,7 +636,7 @@ void func_80B276D8(EnKendoJs* this, GlobalContext* globalCtx) {
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
func_80B27760(this);
} else if (!(gSaveContext.weekEventReg[63] & 0x20)) {
} else if (!(gSaveContext.save.weekEventReg[63] & 0x20)) {
Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 800.0f, 100.0f);
} else {
Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_RED, 800.0f, 100.0f);
@@ -650,8 +651,8 @@ void func_80B27774(EnKendoJs* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
if (!(gSaveContext.weekEventReg[63] & 0x20)) {
gSaveContext.weekEventReg[63] |= 0x20;
if (!(gSaveContext.save.weekEventReg[63] & 0x20)) {
gSaveContext.save.weekEventReg[63] |= 0x20;
Message_StartTextbox(globalCtx, 0x272F, &this->actor);
this->unk_288 = 0x272F;
} else {
+15 -15
View File
@@ -60,10 +60,10 @@ void EnKgy_Init(Actor* thisx, GlobalContext* globalCtx) {
this->zubora = EnKgy_FindZubora(globalCtx);
this->iceBlock = EnKgy_FindIceBlock(globalCtx);
Flags_UnsetSwitch(globalCtx, ENKGY_GET_FE00(&this->actor) + 1);
if (Flags_GetSwitch(globalCtx, ENKGY_GET_FE00(&this->actor)) || (gSaveContext.weekEventReg[33] & 0x80)) {
if (Flags_GetSwitch(globalCtx, ENKGY_GET_FE00(&this->actor)) || (gSaveContext.save.weekEventReg[33] & 0x80)) {
Flags_SetSwitch(globalCtx, ENKGY_GET_FE00(&this->actor) + 1);
globalCtx->envCtx.lightSettingOverride = 1;
gSaveContext.weekEventReg[21] |= 1;
gSaveContext.save.weekEventReg[21] |= 1;
if (!func_80B40D64(globalCtx)) {
EnKgy_ChangeAnim(this, 4, 0, 0);
this->actionFunc = func_80B425A0;
@@ -80,7 +80,7 @@ void EnKgy_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.textId = 0xC50;
}
} else {
if (gSaveContext.weekEventReg[20] & 0x80) {
if (gSaveContext.save.weekEventReg[20] & 0x80) {
EnKgy_ChangeAnim(this, 4, 0, 0);
} else {
EnKgy_ChangeAnim(this, 0, 0, 0);
@@ -153,33 +153,33 @@ ObjIcePoly* EnKgy_FindIceBlock(GlobalContext* globalCtx) {
}
void func_80B40C74(GlobalContext* globalCtx) {
gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 |= 1;
gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 |= 1;
if (CURRENT_DAY == 1) {
gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 |= 2;
gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 |= 2;
} else {
gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 &= ~2;
gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 &= ~2;
}
}
void func_80B40D00(GlobalContext* globalCtx) {
gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 |= 4;
gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 |= 4;
}
void func_80B40D30(GlobalContext* globalCtx) {
gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 &= ~7;
gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 &= ~7;
}
s32 func_80B40D64(GlobalContext* globalCtx) {
return gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 1;
return gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 1;
}
s32 func_80B40D8C(GlobalContext* globalCtx) {
return gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 4;
return gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 4;
}
s32 func_80B40DB4(GlobalContext* globalCtx) {
if ((CURRENT_DAY == 3) ||
((CURRENT_DAY == 2) && (gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 2))) {
((CURRENT_DAY == 2) && (gSaveContext.save.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 2))) {
return true;
}
return false;
@@ -362,7 +362,7 @@ void func_80B413C8(EnKgy* this) {
}
s32 func_80B41460(void) {
if ((gSaveContext.playerForm != PLAYER_FORM_HUMAN) ||
if ((gSaveContext.save.playerForm != PLAYER_FORM_HUMAN) ||
((CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_KOKIRI) && (CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_RAZOR) &&
(CUR_FORM_EQUIP(EQUIP_SLOT_B) != ITEM_SWORD_GILDED))) {
return 0xC38;
@@ -623,7 +623,7 @@ void func_80B41E18(EnKgy* this, GlobalContext* globalCtx) {
case 0xC3B:
switch (globalCtx->msgCtx.choiceIndex) {
case 0:
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
if (gSaveContext.save.playerData.rupees < globalCtx->msgCtx.unk1206C) {
play_sound(NA_SE_SY_ERROR);
func_80B40E74(this, globalCtx, 0xC3F);
} else {
@@ -1056,7 +1056,7 @@ void func_80B42D28(EnKgy* this, GlobalContext* globalCtx) {
func_80B40BC0(this, 1);
} else {
EnKgy_ChangeAnim(this, 5, 2, -5.0f);
gSaveContext.weekEventReg[20] |= 0x80;
gSaveContext.save.weekEventReg[20] |= 0x80;
}
func_80B411DC(this, globalCtx, 0);
func_80B40E18(this, this->actor.textId);
@@ -1064,7 +1064,7 @@ void func_80B42D28(EnKgy* this, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, ENKGY_GET_FE00(&this->actor))) {
this->actor.textId = 0xC30;
this->actionFunc = func_80B4296C;
gSaveContext.weekEventReg[21] |= 1;
gSaveContext.save.weekEventReg[21] |= 1;
} else if (this->actor.xzDistToPlayer < 200.0f) {
if (this->unk_2D2 == 4) {
this->actor.textId = 0xC2D;
@@ -297,7 +297,7 @@ void EnLookNuts_SendPlayerToSpawn(EnLookNuts* this, GlobalContext* globalCtx) {
gSaveContext.nextCutsceneIndex = 0;
Scene_SetExitFade(globalCtx);
globalCtx->sceneLoadFlag = 0x14;
gSaveContext.weekEventReg[17] |= 4;
gSaveContext.save.weekEventReg[17] |= 4;
}
}
@@ -339,7 +339,7 @@ void EnLookNuts_Update(Actor* thisx, GlobalContext* globalCtx) {
Matrix_StatePop();
if (!this->isPlayerDetected) {
s16 drawFlag = 1;
if (gSaveContext.isNight) {
if (gSaveContext.save.isNight) {
drawFlag = 0;
}
if (Player_GetMask(globalCtx) != PLAYER_MASK_STONE) {

Some files were not shown because too many files have changed in this diff Show More