mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
More magic docs
This commit is contained in:
@@ -70,6 +70,7 @@
|
||||
#define R_A_ICON_Y XREG(19)
|
||||
#define R_A_ICON_X XREG(20)
|
||||
#define R_A_BTN_COLOR(i) XREG(22 + i)
|
||||
#define R_MAGIC_CONSUME_TIMER_GIANT XREG(41)
|
||||
#define R_MAGIC_BAR_SMALL_Y XREG(48)
|
||||
#define R_MAGIC_BAR_X XREG(49)
|
||||
#define R_MAGIC_BAR_LARGE_Y XREG(50)
|
||||
|
||||
+2
-2
@@ -657,7 +657,7 @@ typedef struct {
|
||||
/* 0x252 */ s16 lifeSizeChange;
|
||||
/* 0x254 */ s16 lifeSizeChangeDirection; // 1 means shrinking, 0 growing
|
||||
/* 0x256 */ s16 unk_256;
|
||||
/* 0x258 */ s16 lensMagicDepletionTimer;
|
||||
/* 0x258 */ s16 magicConsumptionTimer;
|
||||
/* 0x25A */ u8 numHorseBoosts;
|
||||
/* 0x25C */ u16 unk_25C;
|
||||
/* 0x25E */ u16 unk_25E;
|
||||
@@ -1416,7 +1416,7 @@ struct GlobalContext {
|
||||
/* 0x18B20 */ u16 envFlags[20];
|
||||
/* 0x18B48 */ u8 curSpawn;
|
||||
/* 0x18B49 */ u8 unk_18B49;
|
||||
/* 0x18B4A */ u8 unk_18B4A;
|
||||
/* 0x18B4A */ u8 transitionMode;
|
||||
/* 0x18B4C */ PreRender pauseBgPreRender;
|
||||
/* 0x18B9C */ char unk_18B9C[0x2B8];
|
||||
/* 0x18E54 */ SceneTableEntry* loadedScene;
|
||||
|
||||
+6
-6
@@ -35,9 +35,9 @@ typedef enum MagicBarAction {
|
||||
/* 07 */ MAGIC_BAR_ACTION_LENS_CONSUME, // Magic slowly consumed by lens.
|
||||
/* 08 */ MAGIC_BAR_ACTION_GROW_WIDE, // Init magic on a new load, grow from a width of 0 to magicCapacity
|
||||
/* 09 */ MAGIC_BAR_ACTION_FILL,
|
||||
/* 10 */ MAGIC_BAR_ACTION_CONSUME_2,
|
||||
/* 11 */ MAGIC_BAR_ACTION_CONSUME_3,
|
||||
/* 12 */ MAGIC_BAR_ACTION_CONSUME_4
|
||||
/* 10 */ MAGIC_BAR_ACTION_CONSUME_GORON_ZORA_SETUP,
|
||||
/* 11 */ MAGIC_BAR_ACTION_CONSUME_GORON_ZORA,
|
||||
/* 12 */ MAGIC_BAR_ACTION_CONSUME_GIANTS_MASK
|
||||
} MagicBarAction;
|
||||
|
||||
typedef enum MagicBarChange {
|
||||
@@ -46,9 +46,9 @@ typedef enum MagicBarChange {
|
||||
/* 2 */ MAGIC_BAR_CONSUME_NOW_ALT, // Identical behaviour to MAGIC_BAR_CONSUME_NOW. Unused
|
||||
/* 3 */ MAGIC_BAR_CONSUME_LENS, // Lens consumption
|
||||
/* 4 */ MAGIC_BAR_CONSUME_WAIT_PREVIEW, // Sets consume target but waits to consume. Draws yellow magic to target consumption
|
||||
/* 5 */ MAGIC_BAR_CONSUME_2,
|
||||
/* 6 */ MAGIC_BAR_CONSUME_4,
|
||||
/* 7 */ MAGIC_BAR_CONSUME_UNK
|
||||
/* 5 */ MAGIC_BAR_CONSUME_GORON_ZORA, // Zora shock and Goron Spike Roll slow consumption
|
||||
/* 6 */ MAGIC_BAR_CONSUME_GIANTS_MASK, // Giants Mask Slow consumption
|
||||
/* 7 */ MAGIC_BAR_CONSUME_DEITY_BEAM // Fierce Deity Beam consumption, consumed magic now and directly
|
||||
} MagicBarChange;
|
||||
|
||||
#define MAGIC_HALF_BAR 0x30
|
||||
|
||||
+19
-19
@@ -3,30 +3,30 @@
|
||||
|
||||
void TitleSetup_GameStateResetContext(void) {
|
||||
XREG(2) = 0;
|
||||
XREG(10) = 0x1A;
|
||||
XREG(11) = 0x14;
|
||||
XREG(12) = 0xE;
|
||||
XREG(10) = 26;
|
||||
XREG(11) = 20;
|
||||
XREG(12) = 14;
|
||||
XREG(13) = 0;
|
||||
XREG(31) = 0;
|
||||
XREG(41) = 0x50;
|
||||
R_MAGIC_CONSUME_TIMER_GIANT = 80;
|
||||
XREG(43) = 0xFC54;
|
||||
|
||||
XREG(44) = 0xD7;
|
||||
XREG(45) = 0xDA;
|
||||
XREG(68) = 0x61;
|
||||
XREG(69) = 0x93;
|
||||
XREG(70) = 0x28;
|
||||
XREG(73) = 0x1E;
|
||||
XREG(74) = 0x42;
|
||||
XREG(75) = 0x1E;
|
||||
XREG(76) = 0x1C;
|
||||
XREG(77) = 0x3C;
|
||||
XREG(78) = 0x2F;
|
||||
XREG(79) = 0x62;
|
||||
XREG(44) = 215;
|
||||
XREG(45) = 218;
|
||||
XREG(68) = 97;
|
||||
XREG(69) = 147;
|
||||
XREG(70) = 40;
|
||||
XREG(73) = 30;
|
||||
XREG(74) = 66;
|
||||
XREG(75) = 30;
|
||||
XREG(76) = 28;
|
||||
XREG(77) = 60;
|
||||
XREG(78) = 47;
|
||||
XREG(79) = 98;
|
||||
XREG(87) = 0;
|
||||
XREG(88) = 0x56;
|
||||
XREG(89) = 0x258;
|
||||
XREG(90) = 0x1C2;
|
||||
XREG(88) = 86;
|
||||
XREG(89) = 600;
|
||||
XREG(90) = 450;
|
||||
XREG(91) = 0;
|
||||
XREG(94) = 0;
|
||||
XREG(95) = 0;
|
||||
|
||||
@@ -70,11 +70,11 @@ void KaleidoSetup_Update(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if ((pauseCtx->state == 0) && (pauseCtx->debugState == 0) && (globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE)) {
|
||||
if ((globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_18B4A == 0)) {
|
||||
if ((globalCtx->sceneLoadFlag == 0) && (globalCtx->transitionMode == 0)) {
|
||||
if ((gSaveContext.save.cutscene < 0xFFF0) && (gSaveContext.nextCutsceneIndex < 0xFFF0)) {
|
||||
if (!Play_InCsMode(globalCtx) || ((msgCtx->msgMode != 0) && (msgCtx->currentTextId == 0xFF))) {
|
||||
if ((globalCtx->unk_1887C < 2) && (gSaveContext.magicBarAction != 8) &&
|
||||
(gSaveContext.magicBarAction != 9)) {
|
||||
if ((globalCtx->unk_1887C < 2) && (gSaveContext.magicBarAction != MAGIC_BAR_ACTION_GROW_WIDE) &&
|
||||
(gSaveContext.magicBarAction != MAGIC_BAR_ACTION_FILL)) {
|
||||
if (!(gSaveContext.eventInf[1] & 0x80) && !(player->stateFlags1 & 0x20)) {
|
||||
if (!(globalCtx->actorCtx.unk5 & 2) && !(globalCtx->actorCtx.unk5 & 4)) {
|
||||
if ((globalCtx->actorCtx.unk268 == 0) &&
|
||||
|
||||
+61
-55
@@ -1637,7 +1637,7 @@ void func_80110038(GlobalContext* globalCtx) {
|
||||
gSaveContext.unk_3F22 = 0;
|
||||
}
|
||||
|
||||
if ((globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_18B4A == 0)) {
|
||||
if ((globalCtx->sceneLoadFlag == 0) && (globalCtx->transitionMode == 0)) {
|
||||
if (ActorCutscene_GetCurrentIndex() == -1) {
|
||||
Interface_ChangeAlpha(50);
|
||||
}
|
||||
@@ -1897,7 +1897,8 @@ void func_80110038(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
if (phi_t3 && (globalCtx->activeCamera == 0) && (globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_18B4A == 0)) {
|
||||
if (phi_t3 && (globalCtx->activeCamera == 0) && (globalCtx->sceneLoadFlag == 0) &&
|
||||
(globalCtx->transitionMode == 0)) {
|
||||
gSaveContext.unk_3F22 = 0;
|
||||
Interface_ChangeAlpha(50);
|
||||
}
|
||||
@@ -1977,7 +1978,7 @@ void func_80111CB4(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
if (globalCtx->unk_18B4A != 0) {
|
||||
if (globalCtx->transitionMode != 0) {
|
||||
Interface_ChangeAlpha(1);
|
||||
} else if ((gSaveContext.minigameState == 1) && (gSaveContext.save.entranceIndex == 0x6400) &&
|
||||
(Cutscene_GetSceneSetupIndex(globalCtx) != 0) && (globalCtx->sceneLoadFlag == 0)) {
|
||||
@@ -2035,7 +2036,7 @@ void func_80111CB4(GlobalContext* globalCtx) {
|
||||
gSaveContext.buttonStatus[EQUIP_SLOT_C_RIGHT] = BTN_DISABLED;
|
||||
Interface_ChangeAlpha(6);
|
||||
|
||||
if (globalCtx->unk_18B4A != 0) {
|
||||
if (globalCtx->transitionMode != 0) {
|
||||
Interface_ChangeAlpha(1);
|
||||
} else if ((gSaveContext.minigameState == 1) && (gSaveContext.save.entranceIndex == 0x6400) &&
|
||||
(Cutscene_GetSceneSetupIndex(globalCtx) != 0) && (globalCtx->sceneLoadFlag == 0)) {
|
||||
@@ -2106,13 +2107,13 @@ void func_80111CB4(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
} else if ((gSaveContext.minigameState == 1) && (gSaveContext.save.entranceIndex == 0x8E10) &&
|
||||
(globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_18B4A == 0)) {
|
||||
(globalCtx->sceneLoadFlag == 0) && (globalCtx->transitionMode == 0)) {
|
||||
gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT] = BTN_DISABLED;
|
||||
gSaveContext.buttonStatus[EQUIP_SLOT_C_DOWN] = BTN_DISABLED;
|
||||
gSaveContext.buttonStatus[EQUIP_SLOT_C_RIGHT] = BTN_DISABLED;
|
||||
Interface_ChangeAlpha(12);
|
||||
} else if ((gSaveContext.save.entranceIndex == 0xD010) && (globalCtx->sceneLoadFlag == 0) &&
|
||||
(globalCtx->unk_18B4A == 0)) {
|
||||
(globalCtx->transitionMode == 0)) {
|
||||
gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT] = BTN_DISABLED;
|
||||
gSaveContext.buttonStatus[EQUIP_SLOT_C_DOWN] = BTN_DISABLED;
|
||||
gSaveContext.buttonStatus[EQUIP_SLOT_C_RIGHT] = BTN_DISABLED;
|
||||
@@ -2134,7 +2135,7 @@ void func_80111CB4(GlobalContext* globalCtx) {
|
||||
}
|
||||
if (sp28) {
|
||||
gSaveContext.unk_3F22 = 0;
|
||||
if ((globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_18B4A == 0)) {
|
||||
if ((globalCtx->sceneLoadFlag == 0) && (globalCtx->transitionMode == 0)) {
|
||||
Interface_ChangeAlpha(50);
|
||||
}
|
||||
}
|
||||
@@ -3187,7 +3188,7 @@ s32 Magic_Consume(GlobalContext* globalCtx, s16 magicToConsume, s16 consumeType)
|
||||
}
|
||||
|
||||
switch (consumeType) {
|
||||
case MAGIC_BAR_CONSUME_NOW:
|
||||
case MAGIC_BAR_CONSUME_NOW: // Deku Bubble
|
||||
case MAGIC_BAR_CONSUME_NOW_ALT:
|
||||
if ((gSaveContext.magicBarAction == MAGIC_BAR_ACTION_IDLE) ||
|
||||
(gSaveContext.magicBarAction == MAGIC_BAR_ACTION_LENS_CONSUME)) {
|
||||
@@ -3222,10 +3223,10 @@ s32 Magic_Consume(GlobalContext* globalCtx, s16 magicToConsume, s16 consumeType)
|
||||
return false;
|
||||
}
|
||||
|
||||
case MAGIC_BAR_CONSUME_LENS:
|
||||
case MAGIC_BAR_CONSUME_LENS: // Lens
|
||||
if (gSaveContext.magicBarAction == MAGIC_BAR_ACTION_IDLE) {
|
||||
if (gSaveContext.save.playerData.magic != 0) {
|
||||
interfaceCtx->lensMagicDepletionTimer = 80;
|
||||
interfaceCtx->magicConsumptionTimer = 80;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_LENS_CONSUME;
|
||||
return true;
|
||||
} else {
|
||||
@@ -3237,7 +3238,7 @@ s32 Magic_Consume(GlobalContext* globalCtx, s16 magicToConsume, s16 consumeType)
|
||||
return false;
|
||||
}
|
||||
|
||||
case MAGIC_BAR_CONSUME_WAIT_PREVIEW:
|
||||
case MAGIC_BAR_CONSUME_WAIT_PREVIEW: // Spin Attack
|
||||
if ((gSaveContext.magicBarAction == MAGIC_BAR_ACTION_IDLE) ||
|
||||
(gSaveContext.magicBarAction == MAGIC_BAR_ACTION_LENS_CONSUME)) {
|
||||
if (gSaveContext.magicBarAction == MAGIC_BAR_ACTION_LENS_CONSUME) {
|
||||
@@ -3251,32 +3252,32 @@ s32 Magic_Consume(GlobalContext* globalCtx, s16 magicToConsume, s16 consumeType)
|
||||
return false;
|
||||
}
|
||||
|
||||
case MAGIC_BAR_CONSUME_2:
|
||||
case MAGIC_BAR_CONSUME_GORON_ZORA: // Zora Shock, Goron Spike Roll
|
||||
if (gSaveContext.save.playerData.magic != 0) {
|
||||
interfaceCtx->lensMagicDepletionTimer = 10;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_CONSUME_2;
|
||||
interfaceCtx->magicConsumptionTimer = 10;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_CONSUME_GORON_ZORA_SETUP;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
case MAGIC_BAR_CONSUME_4:
|
||||
case MAGIC_BAR_CONSUME_GIANTS_MASK: // Giants Mask
|
||||
if (gSaveContext.magicBarAction == MAGIC_BAR_ACTION_IDLE) {
|
||||
if (gSaveContext.save.playerData.magic != 0) {
|
||||
interfaceCtx->lensMagicDepletionTimer = XREG(41);
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_CONSUME_4;
|
||||
interfaceCtx->magicConsumptionTimer = R_MAGIC_CONSUME_TIMER_GIANT;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_CONSUME_GIANTS_MASK;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (gSaveContext.magicBarAction == MAGIC_BAR_ACTION_CONSUME_4) {
|
||||
if (gSaveContext.magicBarAction == MAGIC_BAR_ACTION_CONSUME_GIANTS_MASK) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
case MAGIC_BAR_CONSUME_UNK:
|
||||
case MAGIC_BAR_CONSUME_DEITY_BEAM: // Fierce Deity Beam
|
||||
if ((gSaveContext.magicBarAction == MAGIC_BAR_ACTION_IDLE) ||
|
||||
(gSaveContext.magicBarAction == MAGIC_BAR_ACTION_LENS_CONSUME)) {
|
||||
if (gSaveContext.magicBarAction == MAGIC_BAR_ACTION_LENS_CONSUME) {
|
||||
@@ -3301,6 +3302,7 @@ void Magic_UpdateAdd(void) {
|
||||
if (gSaveContext.isMagicRequested) {
|
||||
gSaveContext.save.playerData.magic += 4;
|
||||
play_sound(NA_SE_SY_GAUGE_UP - SFX_FLAG);
|
||||
|
||||
if (((void)0, gSaveContext.save.playerData.magic) >= ((void)0, gSaveContext.magicCapacityDrawn)) {
|
||||
gSaveContext.save.playerData.magic = gSaveContext.magicCapacityDrawn;
|
||||
gSaveContext.magicToAdd = 0;
|
||||
@@ -3315,13 +3317,13 @@ void Magic_UpdateAdd(void) {
|
||||
}
|
||||
}
|
||||
|
||||
s16 sMagicBorderColors[][3] = {
|
||||
{ 255, 255, 255 },
|
||||
{ 150, 150, 150 },
|
||||
};
|
||||
s16 sMagicBorderIndices[] = { 0, 1, 1, 0 };
|
||||
s16 sMagicBorderColorTimerIndex[] = { 2, 1, 2, 1 };
|
||||
void Magic_UpdateBarBorderColor(void) {
|
||||
static s16 sMagicBorderColors[][3] = {
|
||||
{ 255, 255, 255 },
|
||||
{ 150, 150, 150 },
|
||||
};
|
||||
static s16 sMagicBorderIndices[] = { 0, 1, 1, 0 };
|
||||
static s16 sMagicBorderColorTimerIndex[] = { 2, 1, 2, 1 };
|
||||
s16 borderChangeR;
|
||||
s16 borderChangeG;
|
||||
s16 borderChangeB;
|
||||
@@ -3350,12 +3352,13 @@ void Magic_UpdateBarBorderColor(void) {
|
||||
}
|
||||
|
||||
sMagicBorderRatio--;
|
||||
|
||||
if (sMagicBorderRatio == 0) {
|
||||
sMagicBarOutlinePrimRed = sMagicBorderColors[index][0];
|
||||
sMagicBarOutlinePrimGreen = sMagicBorderColors[index][1];
|
||||
sMagicBarOutlinePrimBlue = sMagicBorderColors[index][2];
|
||||
|
||||
sMagicBorderRatio = sMagicBorderColorTimerIndex[sMagicBorderStep];
|
||||
|
||||
sMagicBorderStep++;
|
||||
if (sMagicBorderStep >= 4) {
|
||||
sMagicBorderStep = 0;
|
||||
@@ -3366,7 +3369,7 @@ void Magic_UpdateBarBorderColor(void) {
|
||||
void Magic_UpdateBar(GlobalContext* globalCtx) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
s16 temp;
|
||||
s16 magicCapacity;
|
||||
|
||||
if (gSaveContext.save.weekEventReg[14] & 8) {
|
||||
Magic_UpdateBarBorderColor();
|
||||
@@ -3374,17 +3377,17 @@ void Magic_UpdateBar(GlobalContext* globalCtx) {
|
||||
|
||||
switch (gSaveContext.magicBarAction) {
|
||||
case MAGIC_BAR_ACTION_GROW_WIDE:
|
||||
temp = gSaveContext.save.playerData.magicLevel * MAGIC_HALF_BAR; // magicCapacity
|
||||
if (gSaveContext.magicCapacityDrawn != temp) {
|
||||
if (gSaveContext.magicCapacityDrawn < temp) {
|
||||
magicCapacity = gSaveContext.save.playerData.magicLevel * MAGIC_HALF_BAR;
|
||||
if (gSaveContext.magicCapacityDrawn != magicCapacity) {
|
||||
if (gSaveContext.magicCapacityDrawn < magicCapacity) {
|
||||
gSaveContext.magicCapacityDrawn += 0x10;
|
||||
if (gSaveContext.magicCapacityDrawn > temp) {
|
||||
gSaveContext.magicCapacityDrawn = temp;
|
||||
if (gSaveContext.magicCapacityDrawn > magicCapacity) {
|
||||
gSaveContext.magicCapacityDrawn = magicCapacity;
|
||||
}
|
||||
} else {
|
||||
gSaveContext.magicCapacityDrawn -= 0x10;
|
||||
if (gSaveContext.magicCapacityDrawn <= temp) {
|
||||
gSaveContext.magicCapacityDrawn = temp;
|
||||
if (gSaveContext.magicCapacityDrawn <= magicCapacity) {
|
||||
gSaveContext.magicCapacityDrawn = magicCapacity;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -3437,7 +3440,8 @@ void Magic_UpdateBar(GlobalContext* globalCtx) {
|
||||
|
||||
case MAGIC_BAR_ACTION_LENS_CONSUME:
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && (msgCtx->msgMode == 0) &&
|
||||
(globalCtx->gameOverCtx.state == 0) && (globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_18B4A == 0)) {
|
||||
(globalCtx->gameOverCtx.state == 0) && (globalCtx->sceneLoadFlag == 0) &&
|
||||
(globalCtx->transitionMode == 0)) {
|
||||
if (!Play_InCsMode(globalCtx)) {
|
||||
if ((gSaveContext.save.playerData.magic == 0) ||
|
||||
((func_801242DC(globalCtx) >= 2) && (func_801242DC(globalCtx) < 5)) ||
|
||||
@@ -3447,17 +3451,17 @@ void Magic_UpdateBar(GlobalContext* globalCtx) {
|
||||
!globalCtx->actorCtx.lensActive) {
|
||||
globalCtx->actorCtx.lensActive = false;
|
||||
play_sound(NA_SE_SY_GLASSMODE_OFF);
|
||||
gSaveContext.magicBarAction = 0;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_IDLE;
|
||||
sMagicBarOutlinePrimRed = sMagicBarOutlinePrimGreen = sMagicBarOutlinePrimBlue = 255;
|
||||
break;
|
||||
}
|
||||
|
||||
interfaceCtx->lensMagicDepletionTimer--;
|
||||
if (interfaceCtx->lensMagicDepletionTimer == 0) {
|
||||
interfaceCtx->magicConsumptionTimer--;
|
||||
if (interfaceCtx->magicConsumptionTimer == 0) {
|
||||
if (!(gSaveContext.save.weekEventReg[14] & 8)) {
|
||||
gSaveContext.save.playerData.magic--;
|
||||
}
|
||||
interfaceCtx->lensMagicDepletionTimer = 80;
|
||||
interfaceCtx->magicConsumptionTimer = 80;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3466,29 +3470,30 @@ void Magic_UpdateBar(GlobalContext* globalCtx) {
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGIC_BAR_ACTION_CONSUME_2:
|
||||
case MAGIC_BAR_ACTION_CONSUME_GORON_ZORA_SETUP:
|
||||
if (!(gSaveContext.save.weekEventReg[14] & 8)) {
|
||||
gSaveContext.save.playerData.magic -= 2;
|
||||
}
|
||||
if (gSaveContext.save.playerData.magic <= 0) {
|
||||
gSaveContext.save.playerData.magic = 0;
|
||||
}
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_CONSUME_3;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_CONSUME_GORON_ZORA;
|
||||
// fallthrough
|
||||
|
||||
case MAGIC_BAR_ACTION_CONSUME_3:
|
||||
case MAGIC_BAR_ACTION_CONSUME_GORON_ZORA:
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && (msgCtx->msgMode == 0) &&
|
||||
(globalCtx->gameOverCtx.state == 0) && (globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_18B4A == 0)) {
|
||||
(globalCtx->gameOverCtx.state == 0) && (globalCtx->sceneLoadFlag == 0) &&
|
||||
(globalCtx->transitionMode == 0)) {
|
||||
if (!Play_InCsMode(globalCtx)) {
|
||||
interfaceCtx->lensMagicDepletionTimer--;
|
||||
if (interfaceCtx->lensMagicDepletionTimer == 0) {
|
||||
interfaceCtx->magicConsumptionTimer--;
|
||||
if (interfaceCtx->magicConsumptionTimer == 0) {
|
||||
if (!(gSaveContext.save.weekEventReg[14] & 8)) {
|
||||
gSaveContext.save.playerData.magic--;
|
||||
}
|
||||
if (gSaveContext.save.playerData.magic <= 0) {
|
||||
gSaveContext.save.playerData.magic = 0;
|
||||
}
|
||||
interfaceCtx->lensMagicDepletionTimer = 10;
|
||||
interfaceCtx->magicConsumptionTimer = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3497,19 +3502,20 @@ void Magic_UpdateBar(GlobalContext* globalCtx) {
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGIC_BAR_ACTION_CONSUME_4:
|
||||
case MAGIC_BAR_ACTION_CONSUME_GIANTS_MASK:
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && (msgCtx->msgMode == 0) &&
|
||||
(globalCtx->gameOverCtx.state == 0) && (globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_18B4A == 0)) {
|
||||
(globalCtx->gameOverCtx.state == 0) && (globalCtx->sceneLoadFlag == 0) &&
|
||||
(globalCtx->transitionMode == 0)) {
|
||||
if (!Play_InCsMode(globalCtx)) {
|
||||
interfaceCtx->lensMagicDepletionTimer--;
|
||||
if (interfaceCtx->lensMagicDepletionTimer == 0) {
|
||||
interfaceCtx->magicConsumptionTimer--;
|
||||
if (interfaceCtx->magicConsumptionTimer == 0) {
|
||||
if (!(gSaveContext.save.weekEventReg[14] & 8)) {
|
||||
gSaveContext.save.playerData.magic--;
|
||||
}
|
||||
if (gSaveContext.save.playerData.magic <= 0) {
|
||||
gSaveContext.save.playerData.magic = 0;
|
||||
}
|
||||
interfaceCtx->lensMagicDepletionTimer = XREG(41);
|
||||
interfaceCtx->magicConsumptionTimer = R_MAGIC_CONSUME_TIMER_GIANT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5167,7 +5173,7 @@ void Interface_DrawTimers(GlobalContext* globalCtx) {
|
||||
(globalCtx->gameOverCtx.state == 0) &&
|
||||
((msgCtx->msgMode == 0) ||
|
||||
((msgCtx->msgMode != 0) && (msgCtx->currentTextId >= 0x1BB2) && (msgCtx->currentTextId <= 0x1BB6))) &&
|
||||
!(player->stateFlags1 & 0x200) && (globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_18B4A == 0) &&
|
||||
!(player->stateFlags1 & 0x200) && (globalCtx->sceneLoadFlag == 0) && (globalCtx->transitionMode == 0) &&
|
||||
!Play_InCsMode(globalCtx)) {
|
||||
|
||||
if (D_801BF968) {
|
||||
@@ -5595,7 +5601,7 @@ void Interface_UpdateTimers(GlobalContext* globalCtx) {
|
||||
(globalCtx->gameOverCtx.state == 0) &&
|
||||
((msgCtx->msgMode == 0) || ((msgCtx->currentTextId >= 0x100) && (msgCtx->currentTextId <= 0x200)) ||
|
||||
((msgCtx->currentTextId >= 0x1BB2) && (msgCtx->currentTextId <= 0x1BB6))) &&
|
||||
(globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_18B4A == 0) && !Play_InCsMode(globalCtx)) {
|
||||
(globalCtx->sceneLoadFlag == 0) && (globalCtx->transitionMode == 0) && !Play_InCsMode(globalCtx)) {
|
||||
|
||||
if (D_801BF96C) {
|
||||
var3 = osGetTime();
|
||||
@@ -6511,7 +6517,7 @@ void Interface_Update(GlobalContext* globalCtx) {
|
||||
if (!(player->stateFlags1 & 0x200)) {
|
||||
if (XREG(4) == 1) {
|
||||
if (!gSaveContext.save.playerData.isMagicAcquired) {
|
||||
gSaveContext.save.playerData.isMagicAcquired = 1;
|
||||
gSaveContext.save.playerData.isMagicAcquired = true;
|
||||
}
|
||||
gSaveContext.save.playerData.isDoubleMagicAcquired = true;
|
||||
gSaveContext.save.playerData.magic = MAGIC_FULL_BAR;
|
||||
@@ -6689,7 +6695,7 @@ void Interface_Init(GlobalContext* globalCtx) {
|
||||
|
||||
View_Init(&interfaceCtx->view, globalCtx->state.gfxCtx);
|
||||
|
||||
interfaceCtx->lensMagicDepletionTimer = 16;
|
||||
interfaceCtx->magicConsumptionTimer = 16;
|
||||
interfaceCtx->unkTimer = 200;
|
||||
|
||||
parameterStaticSize = SEGMENT_ROM_SIZE(parameter_static);
|
||||
|
||||
@@ -572,7 +572,7 @@ void Boss02_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
} else {
|
||||
this->unk_1D20 = 1;
|
||||
}
|
||||
XREG(41) = KREG(14) + 20;
|
||||
R_MAGIC_CONSUME_TIMER_GIANT = KREG(14) + 20;
|
||||
this->unk_01AC = 1.0f;
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_TANRON5, 0.0f, 1000.0f, 0.0f, 0, 0,
|
||||
0, 0);
|
||||
|
||||
@@ -129,7 +129,7 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
|
||||
s32 grottoType = DOORANA_GET_TYPE(&this->actor);
|
||||
|
||||
if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f)) {
|
||||
if (this->actor.targetMode != 0 && globalCtx->sceneLoadFlag == 0 && globalCtx->unk_18B4A == 0 &&
|
||||
if (this->actor.targetMode != 0 && globalCtx->sceneLoadFlag == 0 && globalCtx->transitionMode == 0 &&
|
||||
(player->stateFlags1 & 0x80000000) && player->unk_AE7 == 0) {
|
||||
|
||||
if (grottoType == DOORANA_TYPE_VISIBLE_SCENE_EXIT) {
|
||||
|
||||
@@ -162,7 +162,7 @@ void EnHoll_VisibleIdle(EnHoll* this, GlobalContext* globalCtx) {
|
||||
func_800B9010(&this->actor, NA_SE_EV_INVISIBLE_MONKEY - SFX_FLAG);
|
||||
}
|
||||
}
|
||||
if ((globalCtx->sceneLoadFlag != 0) || (globalCtx->unk_18B4A != 0)) {
|
||||
if ((globalCtx->sceneLoadFlag != 0) || (globalCtx->transitionMode != 0)) {
|
||||
this->alpha = 255;
|
||||
} else {
|
||||
f32 enHollBottom = EN_HOLL_BOTTOM_DEFAULT;
|
||||
@@ -309,7 +309,7 @@ void EnHoll_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnHoll* this = THIS;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_18B4A == 0) && !(player->stateFlags1 & 0x200)) {
|
||||
if ((globalCtx->sceneLoadFlag == 0) && (globalCtx->transitionMode == 0) && !(player->stateFlags1 & 0x200)) {
|
||||
this->actionFunc(this, globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -369,7 +369,7 @@ void EnTest4_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void func_80A42AB8(EnTest4* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((globalCtx->unk_18B4A == 0) && !Play_InCsMode(globalCtx) && (globalCtx->numSetupActors <= 0) &&
|
||||
if ((globalCtx->transitionMode == 0) && !Play_InCsMode(globalCtx) && (globalCtx->numSetupActors <= 0) &&
|
||||
(globalCtx->roomCtx.unk31 == 0) && (func_8016A168() == 0)) {
|
||||
s16 temp_a2;
|
||||
u16 temp_a0 = D_80A43364[this->unk_144];
|
||||
|
||||
@@ -413,7 +413,7 @@ s32 func_80AECE60(EnTk* this, GlobalContext* globalCtx) {
|
||||
this->unk_3CE |= 4;
|
||||
}
|
||||
|
||||
if ((globalCtx->unk_18B4A != 0) || (this->unk_3D0 == 0)) {
|
||||
if ((globalCtx->transitionMode != 0) || (this->unk_3D0 == 0)) {
|
||||
sp78 = this->unk_3F0;
|
||||
sp74 = this->unk_3EC;
|
||||
sp7C = this->actor.world.pos;
|
||||
@@ -430,7 +430,7 @@ s32 func_80AECE60(EnTk* this, GlobalContext* globalCtx) {
|
||||
this->actor.world.rot.y = Math_Vec3f_Yaw(&sp94, &sp88);
|
||||
}
|
||||
|
||||
if ((globalCtx->unk_18B4A != 0) || (this->unk_3D0 == 0)) {
|
||||
if ((globalCtx->transitionMode != 0) || (this->unk_3D0 == 0)) {
|
||||
this->unk_3F0 = sp78;
|
||||
this->unk_3EC = sp74;
|
||||
this->unk_3D4 = sp7C;
|
||||
|
||||
Reference in New Issue
Block a user