1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-18 04:52:03 +00:00

Document Magic (#1199)

* Magic docs WIP

* More docs, first round finished

* Better docs

* More renaming

* Simpler name

* Another small adjustment

* rm if(1)

* Better names again after in-game testing

* Change comments

* change comment

* Big rename based on all the suggestions

* Small touch-up

* More PR Suggestions

* RESTORE_IDLE -> RESET

* More docs

* Capitalization

* PR suggestions

* Make declaration consistent

* Health_ChangeBy (amount)

* PR Suggestions

* Missed one

* More PR Suggestions

* Change comment

* Add another clarity comment

* Discord discussions on `magicFillTarget`

* Comments

* grammar

* More comment clarity

* Another bad comment

* PR suggestions, improved comments

* One more comment

* one more thing

* bar -> meter
This commit is contained in:
engineer124 2022-05-24 02:52:01 +10:00 committed by GitHub
parent 2e6279bc8e
commit e68f321777
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 327 additions and 249 deletions

View file

@ -1473,8 +1473,8 @@ void FileChoose_LoadGame(GameState* thisx) {
gSaveContext.unk_13EE = 0x32;
gSaveContext.nayrusLoveTimer = 0;
gSaveContext.healthAccumulator = 0;
gSaveContext.unk_13F0 = 0;
gSaveContext.unk_13F2 = 0;
gSaveContext.magicState = MAGIC_STATE_IDLE;
gSaveContext.prevMagicState = MAGIC_STATE_IDLE;
gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
gSaveContext.skyboxTime = CLOCK_TIME(0, 0);
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
@ -1488,16 +1488,16 @@ void FileChoose_LoadGame(GameState* thisx) {
gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;
gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC =
gSaveContext.unk_13F4 = 0;
gSaveContext.magicCapacity = 0;
gSaveContext.unk_13F6 = gSaveContext.magic;
gSaveContext.magic = 0;
gSaveContext.magicLevel = gSaveContext.magic;
if (1) {}
// Set the fill target to be the saved magic amount
gSaveContext.magicFillTarget = gSaveContext.magic;
// Set `magicLevel` and `magic` to 0 so `magicCapacity` then `magic` grows from nothing to respectively the full
// capacity and `magicFillTarget`
gSaveContext.magicLevel = gSaveContext.magic = 0;
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("Z_MAGIC_NOW_NOW=%d MAGIC_NOW=%d\n", ((void)0, gSaveContext.unk_13F6), gSaveContext.magic);
osSyncPrintf("Z_MAGIC_NOW_NOW=%d MAGIC_NOW=%d\n", ((void)0, gSaveContext.magicFillTarget), gSaveContext.magic);
osSyncPrintf(VT_RST);
gSaveContext.naviTimer = 0;

View file

@ -20,10 +20,12 @@ void Select_LoadGame(SelectContext* this, s32 entranceIndex) {
osSyncPrintf(VT_RST);
if (gSaveContext.fileNum == 0xFF) {
Sram_InitDebugSave();
gSaveContext.unk_13F6 = gSaveContext.magic;
gSaveContext.magic = 0;
gSaveContext.unk_13F4 = 0;
gSaveContext.magicLevel = gSaveContext.magic;
// Set the fill target to be the saved magic amount
gSaveContext.magicFillTarget = gSaveContext.magic;
// Set `magicLevel` and `magic` to 0 so `magicCapacity` then `magic` grows from nothing
// to respectively the full capacity and `magicFillTarget`
gSaveContext.magicCapacity = 0;
gSaveContext.magicLevel = gSaveContext.magic = 0;
}
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;