mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-05 01:19:06 -04:00
z_parameter: Magic (#934)
* Document magic * Cleanup * Few fixes * PR Suggestions, More Lens Docs * Few comments * missed a spot * Better macros/names * Deactivate Lens * more PR suggestions * fix names
This commit is contained in:
@@ -8,7 +8,7 @@ void TitleSetup_GameStateResetContext(void) {
|
||||
XREG(12) = 0xE;
|
||||
XREG(13) = 0;
|
||||
XREG(31) = 0;
|
||||
XREG(41) = 0x50;
|
||||
R_MAGIC_CONSUME_TIMER_GIANTS_MASK = 80;
|
||||
XREG(43) = 0xFC54;
|
||||
|
||||
XREG(44) = 0xD7;
|
||||
|
||||
+21
-22
@@ -2212,10 +2212,10 @@ s32 func_800B90AC(PlayState* play, Actor* actor, CollisionPoly* polygon, s32 bgI
|
||||
return false;
|
||||
}
|
||||
|
||||
void func_800B90F4(PlayState* play) {
|
||||
if (play->actorCtx.unk3 != 0) {
|
||||
play->actorCtx.unk3 = 0;
|
||||
func_80115D5C(&play->state);
|
||||
void Actor_DeactivateLens(PlayState* play) {
|
||||
if (play->actorCtx.lensActive) {
|
||||
play->actorCtx.lensActive = false;
|
||||
Magic_Reset(play);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2594,7 +2594,7 @@ void func_800B9D1C(Actor* actor) {
|
||||
|
||||
void Actor_DrawAllSetup(PlayState* play) {
|
||||
play->actorCtx.undrawnActorCount = 0;
|
||||
play->actorCtx.unkB = 0;
|
||||
play->actorCtx.lensActorsDrawn = false;
|
||||
}
|
||||
|
||||
s32 Actor_RecordUndrawnActor(PlayState* play, Actor* actor) {
|
||||
@@ -2607,13 +2607,12 @@ s32 Actor_RecordUndrawnActor(PlayState* play, Actor* actor) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void func_800B9E84(Gfx** arg0, s32 arg1) {
|
||||
func_80164C14(arg0, D_801DE890, 4, 0, 6, 6, ((100 - arg1) * 0.003f) + 1.0f);
|
||||
void Actor_DrawLensOverlay(Gfx** gfxP, s32 lensMaskSize) {
|
||||
func_80164C14(gfxP, &gCircleTex, 4, 0, 6, 6, ((LENS_MASK_ACTIVE_SIZE - lensMaskSize) * 0.003f) + 1.0f);
|
||||
}
|
||||
|
||||
#ifdef NON_EQUIVALENT
|
||||
// Related to draw actors with lens
|
||||
void func_800B9EF4(PlayState* play, s32 numActors, Actor** actors) {
|
||||
void Actor_DrawLensActors(PlayState* play, s32 numActors, Actor** actors) {
|
||||
s32 spB4;
|
||||
Gfx* spAC;
|
||||
void* spA8; // pad
|
||||
@@ -2684,7 +2683,7 @@ void func_800B9EF4(PlayState* play, s32 numActors, Actor** actors) {
|
||||
}
|
||||
|
||||
// spAC = phi_s1;
|
||||
func_800B9E84(&spAC, play->actorCtx.unk4);
|
||||
Actor_DrawLensOverlay(&spAC, play->actorCtx.lensMaskSize);
|
||||
phi_s1_2 = func_801660B8(play, spAC);
|
||||
|
||||
for (spB4 = 0; spB4 < numActors; spB4++, actors++) {
|
||||
@@ -2744,7 +2743,7 @@ void func_800B9EF4(PlayState* play, s32 numActors, Actor** actors) {
|
||||
spAC = phi_s1_2;
|
||||
|
||||
// spAC = temp_s1_11;
|
||||
func_800B9E84(&spAC, (s32)play->actorCtx.unk4);
|
||||
Actor_DrawLensOverlay(&spAC, (s32)play->actorCtx.lensMaskSize);
|
||||
// temp_s1_11->words.w0 = 0xE7000000;
|
||||
// temp_s1_11->words.w1 = 0;
|
||||
// temp_s1_12 = temp_s1_11 + 8;
|
||||
@@ -2796,15 +2795,15 @@ void func_800B9EF4(PlayState* play, s32 numActors, Actor** actors) {
|
||||
// spAC = temp_s1_18 + 8;
|
||||
gDPSetPrimColor(spAC++, 0, 0, 74, 0, 0, 74);
|
||||
|
||||
func_800B9E84(&spAC, (s32)play->actorCtx.unk4);
|
||||
Actor_DrawLensOverlay(&spAC, (s32)play->actorCtx.lensMaskSize);
|
||||
|
||||
OVERLAY_DISP = spAC;
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
#else
|
||||
void func_800B9EF4(PlayState* play, s32 numActors, Actor** actors);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B9EF4.s")
|
||||
void Actor_DrawLensActors(PlayState* play, s32 numActors, Actor** actors);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_DrawLensActors.s")
|
||||
#endif
|
||||
|
||||
s32 func_800BA2D8(PlayState* play, Actor* actor) {
|
||||
@@ -2883,7 +2882,7 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) {
|
||||
actor->isDrawn = false;
|
||||
if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & actorFlags)) {
|
||||
if ((actor->flags & ACTOR_FLAG_80) &&
|
||||
((play->roomCtx.currRoom.unk5 == 0) || (play->actorCtx.unk4 == 0x64) ||
|
||||
((play->roomCtx.currRoom.unk5 == 0) || (play->actorCtx.lensMaskSize == LENS_MASK_ACTIVE_SIZE) ||
|
||||
(actor->room != play->roomCtx.currRoom.num))) {
|
||||
if (Actor_RecordUndrawnActor(play, actor)) {}
|
||||
} else {
|
||||
@@ -2903,17 +2902,17 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) {
|
||||
gSPDisplayList(sp58, &ref2[1]);
|
||||
POLY_XLU_DISP = &ref2[1];
|
||||
|
||||
if (play->actorCtx.unk3 != 0) {
|
||||
Math_StepToC(&play->actorCtx.unk4, 100, 20);
|
||||
if (play->actorCtx.lensActive) {
|
||||
Math_StepToC(&play->actorCtx.lensMaskSize, LENS_MASK_ACTIVE_SIZE, 20);
|
||||
if (GET_PLAYER(play)->stateFlags2 & 0x8000000) {
|
||||
func_800B90F4(play);
|
||||
Actor_DeactivateLens(play);
|
||||
}
|
||||
} else {
|
||||
Math_StepToC(&play->actorCtx.unk4, 0, 10);
|
||||
Math_StepToC(&play->actorCtx.lensMaskSize, 0, 10);
|
||||
}
|
||||
if (play->actorCtx.unk4 != 0) {
|
||||
play->actorCtx.unkB = 1;
|
||||
func_800B9EF4(play, play->actorCtx.undrawnActorCount, play->actorCtx.undrawnActors);
|
||||
if (play->actorCtx.lensMaskSize != 0) {
|
||||
play->actorCtx.lensActorsDrawn = true;
|
||||
Actor_DrawLensActors(play, play->actorCtx.undrawnActorCount, play->actorCtx.undrawnActors);
|
||||
}
|
||||
|
||||
tmp2 = POLY_XLU_DISP;
|
||||
|
||||
@@ -25,7 +25,7 @@ u16 ElfMessage_GetFirstCycleHint(PlayState* play) {
|
||||
}
|
||||
return 0x21D;
|
||||
}
|
||||
if (gSaveContext.save.playerData.magicAcquired != true) {
|
||||
if (gSaveContext.save.playerData.isMagicAcquired != true) {
|
||||
return 0x21F;
|
||||
}
|
||||
if (INV_CONTENT(ITEM_DEED_LAND) == ITEM_DEED_LAND) {
|
||||
|
||||
@@ -500,7 +500,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
}
|
||||
|
||||
if (play->gameOverCtx.state != 0) {
|
||||
if (play->gameOverCtx.state != GAMEOVER_INACTIVE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,8 @@ void KaleidoSetup_Update(PlayState* play) {
|
||||
if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) {
|
||||
if ((gSaveContext.save.cutscene < 0xFFF0) && (gSaveContext.nextCutsceneIndex < 0xFFF0)) {
|
||||
if (!Play_InCsMode(play) || ((msgCtx->msgMode != 0) && (msgCtx->currentTextId == 0xFF))) {
|
||||
if ((play->unk_1887C < 2) && (gSaveContext.unk_3F28 != 8) && (gSaveContext.unk_3F28 != 9)) {
|
||||
if ((play->unk_1887C < 2) && (gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) &&
|
||||
(gSaveContext.magicState != MAGIC_STATE_FILL)) {
|
||||
if (!(gSaveContext.eventInf[1] & 0x80) && !(player->stateFlags1 & 0x20)) {
|
||||
if (!(play->actorCtx.unk5 & 2) && !(play->actorCtx.unk5 & 4)) {
|
||||
if ((play->actorCtx.unk268 == 0) && CHECK_BTN_ALL(input->press.button, BTN_START)) {
|
||||
|
||||
+477
-17
@@ -139,11 +139,11 @@ u16 sMinigameScoreDigits[] = { 0, 0, 0, 0 };
|
||||
u16 sCUpInvisible = 0;
|
||||
u16 sCUpTimer = 0;
|
||||
|
||||
s16 sMagicBarOutlinePrimRed = 255;
|
||||
s16 sMagicBarOutlinePrimGreen = 255;
|
||||
s16 sMagicBarOutlinePrimBlue = 255;
|
||||
s16 D_801BF8AC = 2; // sMagicBorderRatio
|
||||
s16 D_801BF8B0 = 1;
|
||||
s16 sMagicMeterOutlinePrimRed = 255;
|
||||
s16 sMagicMeterOutlinePrimGreen = 255;
|
||||
s16 sMagicMeterOutlinePrimBlue = 255;
|
||||
s16 sMagicBorderRatio = 2;
|
||||
s16 sMagicBorderStep = 1;
|
||||
|
||||
s16 sExtraItemBases[] = {
|
||||
ITEM_STICK, // ITEM_STICKS_5
|
||||
@@ -225,10 +225,14 @@ s16 sFinalHoursClockColorTargetIndex = 0;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010CD98.s")
|
||||
|
||||
Gfx* func_8010CFBC(Gfx* displayListHead, void* texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop,
|
||||
s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy, s16 r, s16 g, s16 b, s16 a);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010CFBC.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010D2D4.s")
|
||||
|
||||
Gfx* func_8010D480(Gfx* displayListHead, void* texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop,
|
||||
s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy, s16 r, s16 g, s16 b, s16 a, s32 argE, s32 argF);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010D480.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8010D7D0.s")
|
||||
@@ -600,7 +604,7 @@ u8 Item_Give(PlayState* play, u8 item) {
|
||||
return item;
|
||||
|
||||
} else if (item == ITEM_MAGIC_SMALL) {
|
||||
Parameter_AddMagic(play, 0x18);
|
||||
Magic_Add(play, MAGIC_NORMAL_METER / 2);
|
||||
if (!(gSaveContext.save.weekEventReg[12] & 0x80)) {
|
||||
gSaveContext.save.weekEventReg[12] |= 0x80;
|
||||
return ITEM_NONE;
|
||||
@@ -608,7 +612,7 @@ u8 Item_Give(PlayState* play, u8 item) {
|
||||
return item;
|
||||
|
||||
} else if (item == ITEM_MAGIC_LARGE) {
|
||||
Parameter_AddMagic(play, 0x30);
|
||||
Magic_Add(play, MAGIC_NORMAL_METER);
|
||||
if (!(gSaveContext.save.weekEventReg[12] & 0x80)) {
|
||||
gSaveContext.save.weekEventReg[12] |= 0x80;
|
||||
return ITEM_NONE;
|
||||
@@ -1145,26 +1149,482 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Parameter_AddMagic.s")
|
||||
void Magic_Add(PlayState* play, s16 magicToAdd) {
|
||||
if (((void)0, gSaveContext.save.playerData.magic) < ((void)0, gSaveContext.magicCapacity)) {
|
||||
gSaveContext.magicToAdd += magicToAdd;
|
||||
gSaveContext.isMagicRequested = true;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80115D5C.s")
|
||||
void Magic_Reset(PlayState* play) {
|
||||
if ((gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) && (gSaveContext.magicState != MAGIC_STATE_FILL)) {
|
||||
sMagicMeterOutlinePrimRed = sMagicMeterOutlinePrimGreen = sMagicMeterOutlinePrimBlue = 255;
|
||||
gSaveContext.magicState = MAGIC_STATE_IDLE;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80115DB4.s")
|
||||
/**
|
||||
* Request to consume magic.
|
||||
*
|
||||
* @param magicToConsume the positive-valued amount to decrease magic by
|
||||
* @param type how the magic is consumed.
|
||||
* @return false if the request failed
|
||||
*/
|
||||
s32 Magic_Consume(PlayState* play, s16 magicToConsume, s16 type) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80116088.s")
|
||||
// Magic is not acquired yet
|
||||
if (!gSaveContext.save.playerData.isMagicAcquired) {
|
||||
return false;
|
||||
}
|
||||
|
||||
s16 magicBorderColors[][3] = {
|
||||
// Not enough magic available to consume
|
||||
if ((gSaveContext.save.playerData.magic - magicToConsume) < 0) {
|
||||
if (gSaveContext.magicCapacity != 0) {
|
||||
play_sound(NA_SE_SY_ERROR);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case MAGIC_CONSUME_NOW:
|
||||
case MAGIC_CONSUME_NOW_ALT:
|
||||
// Drain magic immediately e.g. Deku Bubble
|
||||
if ((gSaveContext.magicState == MAGIC_STATE_IDLE) ||
|
||||
(gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS)) {
|
||||
if (gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS) {
|
||||
play->actorCtx.lensActive = false;
|
||||
}
|
||||
if (gSaveContext.save.weekEventReg[14] & 8) {
|
||||
// Drank Chateau Romani
|
||||
magicToConsume = 0;
|
||||
}
|
||||
gSaveContext.magicToConsume = magicToConsume;
|
||||
gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP;
|
||||
return true;
|
||||
} else {
|
||||
play_sound(NA_SE_SY_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
case MAGIC_CONSUME_WAIT_NO_PREVIEW:
|
||||
// Sets consume target but waits to consume.
|
||||
// No yellow magic to preview target consumption.
|
||||
if ((gSaveContext.magicState == MAGIC_STATE_IDLE) ||
|
||||
(gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS)) {
|
||||
if (gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS) {
|
||||
play->actorCtx.lensActive = false;
|
||||
}
|
||||
if (gSaveContext.save.weekEventReg[14] & 8) {
|
||||
// Drank Chateau Romani
|
||||
magicToConsume = 0;
|
||||
}
|
||||
gSaveContext.magicToConsume = magicToConsume;
|
||||
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_3;
|
||||
return true;
|
||||
} else {
|
||||
play_sound(NA_SE_SY_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
case MAGIC_CONSUME_LENS:
|
||||
if (gSaveContext.magicState == MAGIC_STATE_IDLE) {
|
||||
if (gSaveContext.save.playerData.magic != 0) {
|
||||
interfaceCtx->magicConsumptionTimer = 80;
|
||||
gSaveContext.magicState = MAGIC_STATE_CONSUME_LENS;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if (gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
case MAGIC_CONSUME_WAIT_PREVIEW:
|
||||
// Sets consume target but waits to consume.
|
||||
// Preview consumption with a yellow bar. e.g. Spin Attack
|
||||
if ((gSaveContext.magicState == MAGIC_STATE_IDLE) ||
|
||||
(gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS)) {
|
||||
if (gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS) {
|
||||
play->actorCtx.lensActive = false;
|
||||
}
|
||||
gSaveContext.magicToConsume = magicToConsume;
|
||||
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_2;
|
||||
return true;
|
||||
} else {
|
||||
play_sound(NA_SE_SY_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
case MAGIC_CONSUME_GORON_ZORA:
|
||||
// Goron spiked rolling or Zora electric barrier
|
||||
if (gSaveContext.save.playerData.magic != 0) {
|
||||
interfaceCtx->magicConsumptionTimer = 10;
|
||||
gSaveContext.magicState = MAGIC_STATE_CONSUME_GORON_ZORA_SETUP;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
case MAGIC_CONSUME_GIANTS_MASK:
|
||||
// Wearing Giant's Mask
|
||||
if (gSaveContext.magicState == MAGIC_STATE_IDLE) {
|
||||
if (gSaveContext.save.playerData.magic != 0) {
|
||||
interfaceCtx->magicConsumptionTimer = R_MAGIC_CONSUME_TIMER_GIANTS_MASK;
|
||||
gSaveContext.magicState = MAGIC_STATE_CONSUME_GIANTS_MASK;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (gSaveContext.magicState == MAGIC_STATE_CONSUME_GIANTS_MASK) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
case MAGIC_CONSUME_DEITY_BEAM:
|
||||
// Consumes magic immediately
|
||||
if ((gSaveContext.magicState == MAGIC_STATE_IDLE) ||
|
||||
(gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS)) {
|
||||
if (gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS) {
|
||||
play->actorCtx.lensActive = false;
|
||||
}
|
||||
if (gSaveContext.save.weekEventReg[14] & 8) {
|
||||
// Drank Chateau Romani
|
||||
magicToConsume = 0;
|
||||
}
|
||||
gSaveContext.save.playerData.magic -= magicToConsume;
|
||||
return true;
|
||||
} else {
|
||||
play_sound(NA_SE_SY_ERROR);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Magic_UpdateAddRequest(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.magicCapacity)) {
|
||||
gSaveContext.save.playerData.magic = gSaveContext.magicCapacity;
|
||||
gSaveContext.magicToAdd = 0;
|
||||
gSaveContext.isMagicRequested = false;
|
||||
} else {
|
||||
gSaveContext.magicToAdd -= 4;
|
||||
if (gSaveContext.magicToAdd <= 0) {
|
||||
gSaveContext.magicToAdd = 0;
|
||||
gSaveContext.isMagicRequested = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s16 sMagicBorderColors[][3] = {
|
||||
{ 255, 255, 255 },
|
||||
{ 150, 150, 150 },
|
||||
};
|
||||
s16 magicBorderIndices[] = { 0, 1, 1, 0 };
|
||||
s16 magicBorderColorTimerIndex[] = { 2, 1, 2, 1 };
|
||||
s16 sMagicBorderIndices[] = { 0, 1, 1, 0 };
|
||||
s16 sMagicBorderColorTimerIndex[] = { 2, 1, 2, 1 };
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80116114.s")
|
||||
void Magic_FlashMeterBorder(void) {
|
||||
s16 borderChangeR;
|
||||
s16 borderChangeG;
|
||||
s16 borderChangeB;
|
||||
s16 index = sMagicBorderIndices[sMagicBorderStep];
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80116348.s")
|
||||
borderChangeR = ABS_ALT(sMagicMeterOutlinePrimRed - sMagicBorderColors[index][0]) / sMagicBorderRatio;
|
||||
borderChangeG = ABS_ALT(sMagicMeterOutlinePrimGreen - sMagicBorderColors[index][1]) / sMagicBorderRatio;
|
||||
borderChangeB = ABS_ALT(sMagicMeterOutlinePrimBlue - sMagicBorderColors[index][2]) / sMagicBorderRatio;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80116918.s")
|
||||
if (sMagicMeterOutlinePrimRed >= sMagicBorderColors[index][0]) {
|
||||
sMagicMeterOutlinePrimRed -= borderChangeR;
|
||||
} else {
|
||||
sMagicMeterOutlinePrimRed += borderChangeR;
|
||||
}
|
||||
|
||||
if (sMagicMeterOutlinePrimGreen >= sMagicBorderColors[index][1]) {
|
||||
sMagicMeterOutlinePrimGreen -= borderChangeG;
|
||||
} else {
|
||||
sMagicMeterOutlinePrimGreen += borderChangeG;
|
||||
}
|
||||
|
||||
if (sMagicMeterOutlinePrimBlue >= sMagicBorderColors[index][2]) {
|
||||
sMagicMeterOutlinePrimBlue -= borderChangeB;
|
||||
} else {
|
||||
sMagicMeterOutlinePrimBlue += borderChangeB;
|
||||
}
|
||||
|
||||
sMagicBorderRatio--;
|
||||
if (sMagicBorderRatio == 0) {
|
||||
sMagicMeterOutlinePrimRed = sMagicBorderColors[index][0];
|
||||
sMagicMeterOutlinePrimGreen = sMagicBorderColors[index][1];
|
||||
sMagicMeterOutlinePrimBlue = sMagicBorderColors[index][2];
|
||||
|
||||
sMagicBorderRatio = sMagicBorderColorTimerIndex[sMagicBorderStep];
|
||||
|
||||
sMagicBorderStep++;
|
||||
if (sMagicBorderStep >= 4) {
|
||||
sMagicBorderStep = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Magic_Update(PlayState* play) {
|
||||
MessageContext* msgCtx = &play->msgCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s16 magicCapacityTarget;
|
||||
|
||||
if (gSaveContext.save.weekEventReg[14] & 8) {
|
||||
// Drank Chateau Romani
|
||||
Magic_FlashMeterBorder();
|
||||
}
|
||||
|
||||
switch (gSaveContext.magicState) {
|
||||
case MAGIC_STATE_STEP_CAPACITY:
|
||||
// Step magicCapacity to the capacity determined by magicLevel
|
||||
// This changes the width of the magic meter drawn
|
||||
magicCapacityTarget = gSaveContext.save.playerData.magicLevel * MAGIC_NORMAL_METER;
|
||||
if (gSaveContext.magicCapacity != magicCapacityTarget) {
|
||||
if (gSaveContext.magicCapacity < magicCapacityTarget) {
|
||||
gSaveContext.magicCapacity += 0x10;
|
||||
if (gSaveContext.magicCapacity > magicCapacityTarget) {
|
||||
gSaveContext.magicCapacity = magicCapacityTarget;
|
||||
}
|
||||
} else {
|
||||
gSaveContext.magicCapacity -= 0x10;
|
||||
if (gSaveContext.magicCapacity <= magicCapacityTarget) {
|
||||
gSaveContext.magicCapacity = magicCapacityTarget;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Once the capacity has reached its target,
|
||||
// follow up by filling magic to magicFillTarget
|
||||
gSaveContext.magicState = MAGIC_STATE_FILL;
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGIC_STATE_FILL:
|
||||
// Add magic until magicFillTarget is reached
|
||||
gSaveContext.save.playerData.magic += 0x10;
|
||||
|
||||
if ((gSaveContext.gameMode == 0) && (gSaveContext.sceneSetupIndex < 4)) {
|
||||
play_sound(NA_SE_SY_GAUGE_UP - SFX_FLAG);
|
||||
}
|
||||
|
||||
if (((void)0, gSaveContext.save.playerData.magic) >= ((void)0, gSaveContext.magicFillTarget)) {
|
||||
gSaveContext.save.playerData.magic = gSaveContext.magicFillTarget;
|
||||
gSaveContext.magicState = MAGIC_STATE_IDLE;
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGIC_STATE_CONSUME_SETUP:
|
||||
// Sets the speed at which magic border flashes
|
||||
sMagicBorderRatio = 2;
|
||||
gSaveContext.magicState = MAGIC_STATE_CONSUME;
|
||||
break;
|
||||
|
||||
case MAGIC_STATE_CONSUME:
|
||||
// Consume magic until target is reached or no more magic is available
|
||||
if (!(gSaveContext.save.weekEventReg[14] & 8)) {
|
||||
gSaveContext.save.playerData.magic =
|
||||
((void)0, gSaveContext.save.playerData.magic) - ((void)0, gSaveContext.magicToConsume);
|
||||
if (gSaveContext.save.playerData.magic <= 0) {
|
||||
gSaveContext.save.playerData.magic = 0;
|
||||
}
|
||||
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_1;
|
||||
sMagicMeterOutlinePrimRed = sMagicMeterOutlinePrimGreen = sMagicMeterOutlinePrimBlue = 255;
|
||||
}
|
||||
// fallthrough (flash border while magic is being consumed)
|
||||
case MAGIC_STATE_METER_FLASH_1:
|
||||
case MAGIC_STATE_METER_FLASH_2:
|
||||
case MAGIC_STATE_METER_FLASH_3:
|
||||
if (!(gSaveContext.save.weekEventReg[14] & 8)) {
|
||||
Magic_FlashMeterBorder();
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGIC_STATE_RESET:
|
||||
sMagicMeterOutlinePrimRed = sMagicMeterOutlinePrimGreen = sMagicMeterOutlinePrimBlue = 255;
|
||||
gSaveContext.magicState = MAGIC_STATE_IDLE;
|
||||
break;
|
||||
|
||||
case MAGIC_STATE_CONSUME_LENS:
|
||||
// Slowly consume magic while Lens of Truth is active
|
||||
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) &&
|
||||
(msgCtx->msgMode == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
|
||||
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) &&
|
||||
!Play_InCsMode(play)) {
|
||||
|
||||
if ((gSaveContext.save.playerData.magic == 0) ||
|
||||
((func_801242DC(play) >= 2) && (func_801242DC(play) <= 4)) ||
|
||||
((BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_LEFT) != ITEM_LENS) &&
|
||||
(BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_DOWN) != ITEM_LENS) &&
|
||||
(BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_RIGHT) != ITEM_LENS)) ||
|
||||
!play->actorCtx.lensActive) {
|
||||
// Deactivate Lens of Truth and set magic state to idle
|
||||
play->actorCtx.lensActive = false;
|
||||
play_sound(NA_SE_SY_GLASSMODE_OFF);
|
||||
gSaveContext.magicState = MAGIC_STATE_IDLE;
|
||||
sMagicMeterOutlinePrimRed = sMagicMeterOutlinePrimGreen = sMagicMeterOutlinePrimBlue = 255;
|
||||
break;
|
||||
}
|
||||
|
||||
interfaceCtx->magicConsumptionTimer--;
|
||||
if (interfaceCtx->magicConsumptionTimer == 0) {
|
||||
if (!(gSaveContext.save.weekEventReg[14] & 8)) {
|
||||
gSaveContext.save.playerData.magic--;
|
||||
}
|
||||
interfaceCtx->magicConsumptionTimer = 80;
|
||||
}
|
||||
}
|
||||
if (!(gSaveContext.save.weekEventReg[14] & 8)) {
|
||||
Magic_FlashMeterBorder();
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGIC_STATE_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.magicState = MAGIC_STATE_CONSUME_GORON_ZORA;
|
||||
// fallthrough
|
||||
case MAGIC_STATE_CONSUME_GORON_ZORA:
|
||||
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugEditor == 0) && (msgCtx->msgMode == 0) &&
|
||||
(play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
|
||||
(play->transitionMode == TRANS_MODE_OFF)) {
|
||||
if (!Play_InCsMode(play)) {
|
||||
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->magicConsumptionTimer = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!(gSaveContext.save.weekEventReg[14] & 8)) {
|
||||
Magic_FlashMeterBorder();
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGIC_STATE_CONSUME_GIANTS_MASK:
|
||||
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) &&
|
||||
(msgCtx->msgMode == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
|
||||
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) {
|
||||
if (!Play_InCsMode(play)) {
|
||||
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->magicConsumptionTimer = R_MAGIC_CONSUME_TIMER_GIANTS_MASK;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!(gSaveContext.save.weekEventReg[14] & 8)) {
|
||||
Magic_FlashMeterBorder();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
gSaveContext.magicState = MAGIC_STATE_IDLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Magic_DrawMeter(PlayState* play) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s16 magicBarY;
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
if (gSaveContext.save.playerData.magicLevel != 0) {
|
||||
if (gSaveContext.save.playerData.healthCapacity > 0xA0) {
|
||||
magicBarY = 42; // two rows of hearts
|
||||
} else {
|
||||
magicBarY = 34; // one row of hearts
|
||||
}
|
||||
|
||||
func_8012C654(play->state.gfxCtx);
|
||||
|
||||
gDPSetEnvColor(OVERLAY_DISP++, 100, 50, 50, 255);
|
||||
|
||||
OVERLAY_DISP = func_8010CFBC(OVERLAY_DISP, gMagicMeterEndTex, 8, 16, 18, magicBarY, 8, 16, 1 << 10, 1 << 10,
|
||||
sMagicMeterOutlinePrimRed, sMagicMeterOutlinePrimGreen, sMagicMeterOutlinePrimBlue,
|
||||
interfaceCtx->magicAlpha);
|
||||
OVERLAY_DISP =
|
||||
func_8010CFBC(OVERLAY_DISP, gMagicMeterMidTex, 24, 16, 26, magicBarY, ((void)0, gSaveContext.magicCapacity),
|
||||
16, 1 << 10, 1 << 10, sMagicMeterOutlinePrimRed, sMagicMeterOutlinePrimGreen,
|
||||
sMagicMeterOutlinePrimBlue, interfaceCtx->magicAlpha);
|
||||
OVERLAY_DISP =
|
||||
func_8010D480(OVERLAY_DISP, gMagicMeterEndTex, 8, 16, ((void)0, gSaveContext.magicCapacity) + 26, magicBarY,
|
||||
8, 16, 1 << 10, 1 << 10, sMagicMeterOutlinePrimRed, sMagicMeterOutlinePrimGreen,
|
||||
sMagicMeterOutlinePrimBlue, interfaceCtx->magicAlpha, 3, 0x100);
|
||||
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE, PRIMITIVE,
|
||||
ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE);
|
||||
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
|
||||
|
||||
if (gSaveContext.magicState == MAGIC_STATE_METER_FLASH_2) {
|
||||
// Yellow part of the meter indicating the amount of magic to be subtracted
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 250, 250, 0, interfaceCtx->magicAlpha);
|
||||
gDPLoadTextureBlock_4b(OVERLAY_DISP++, gMagicMeterFillTex, G_IM_FMT_I, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
gSPTextureRectangle(OVERLAY_DISP++, 104, (magicBarY + 3) << 2,
|
||||
(((void)0, gSaveContext.save.playerData.magic) + 26) << 2, (magicBarY + 10) << 2,
|
||||
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
|
||||
// Fill the rest of the meter with the normal magic color
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
if (gSaveContext.save.weekEventReg[14] & 8) {
|
||||
// Blue magic (drank Chateau Romani)
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 200, interfaceCtx->magicAlpha);
|
||||
} else {
|
||||
// Green magic (default)
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 200, 0, interfaceCtx->magicAlpha);
|
||||
}
|
||||
|
||||
gSPTextureRectangle(
|
||||
OVERLAY_DISP++, 104, (magicBarY + 3) << 2,
|
||||
((((void)0, gSaveContext.save.playerData.magic) - ((void)0, gSaveContext.magicToConsume)) + 26) << 2,
|
||||
(magicBarY + 10) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
} else {
|
||||
// Fill the whole meter with the normal magic color
|
||||
if (gSaveContext.save.weekEventReg[14] & 8) {
|
||||
// Blue magic (drank Chateau Romani)
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 200, interfaceCtx->magicAlpha);
|
||||
} else {
|
||||
// Green magic (default)
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 200, 0, interfaceCtx->magicAlpha);
|
||||
}
|
||||
|
||||
gDPLoadTextureBlock_4b(OVERLAY_DISP++, gMagicMeterFillTex, G_IM_FMT_I, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
gSPTextureRectangle(OVERLAY_DISP++, 104, (magicBarY + 3) << 2,
|
||||
(((void)0, gSaveContext.save.playerData.magic) + 26) << 2, (magicBarY + 10) << 2,
|
||||
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
}
|
||||
}
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80116FD8.s")
|
||||
|
||||
|
||||
@@ -597,12 +597,12 @@ SavePlayerData sSaveDefaultPlayerData = {
|
||||
0x30, // healthCapacity
|
||||
0x30, // health
|
||||
0, // magicLevel
|
||||
0x30, // magic
|
||||
MAGIC_NORMAL_METER, // magic
|
||||
0, // rupees
|
||||
0, // swordHealth
|
||||
0, // tatlTimer
|
||||
0, // magicAcquired
|
||||
0, // doubleMagic
|
||||
false, // isMagicAcquired
|
||||
false, // isDoubleMagicAcquired
|
||||
0, // doubleDefense
|
||||
0, // unk_1F
|
||||
0xFF, // unk_20
|
||||
@@ -697,12 +697,12 @@ SavePlayerData sSaveDebugPlayerData = {
|
||||
0x80, // healthCapacity
|
||||
0x80, // health
|
||||
0, // magicLevel
|
||||
0x30, // magic
|
||||
0x32, // rupees
|
||||
0x64, // swordHealth
|
||||
MAGIC_NORMAL_METER, // magic
|
||||
50, // rupees
|
||||
100, // swordHealth
|
||||
0, // tatlTimer
|
||||
1, // magicAcquired
|
||||
0, // doubleMagic
|
||||
true, // isMagicAcquired
|
||||
false, // isDoubleMagicAcquired
|
||||
0, // doubleDefense
|
||||
0, // unk_1F
|
||||
0xFF, // unk_20
|
||||
|
||||
@@ -81,7 +81,7 @@ void ArrowFire_Init(Actor* thisx, PlayState* play) {
|
||||
void ArrowFire_Destroy(Actor* thisx, PlayState* play) {
|
||||
ArrowFire* this = THIS;
|
||||
|
||||
func_80115D5C(&play->state);
|
||||
Magic_Reset(play);
|
||||
Collider_DestroyQuad(play, &this->collider1);
|
||||
Collider_DestroyQuad(play, &this->collider2);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ void ArrowIce_Init(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
void ArrowIce_Destroy(Actor* thisx, PlayState* play) {
|
||||
func_80115D5C(&play->state);
|
||||
Magic_Reset(play);
|
||||
(void)"消滅"; // Unreferenced in retail, means "Disappearance"
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ void ArrowLight_Init(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
void ArrowLight_Destroy(Actor* thisx, PlayState* play) {
|
||||
func_80115D5C(&play->state);
|
||||
Magic_Reset(play);
|
||||
(void)"消滅"; // Unreferenced in retail, means "Disappearance"
|
||||
}
|
||||
|
||||
|
||||
@@ -571,7 +571,7 @@ void Boss02_Init(Actor* thisx, PlayState* play) {
|
||||
} else {
|
||||
this->unk_1D20 = 1;
|
||||
}
|
||||
XREG(41) = KREG(14) + 20;
|
||||
R_MAGIC_CONSUME_TIMER_GIANTS_MASK = KREG(14) + 20;
|
||||
this->unk_01AC = 1.0f;
|
||||
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_TANRON5, 0.0f, 1000.0f, 0.0f, 0, 0, 0, 0);
|
||||
} else if (this->actor.params == TWINMOLD_TAIL) {
|
||||
|
||||
@@ -139,7 +139,7 @@ void EnArrow_Destroy(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
if ((this->actor.params >= ENARROW_3) && (this->actor.params < ENARROW_6) && (this->actor.child == NULL)) {
|
||||
func_80115D5C(&play->state);
|
||||
Magic_Reset(play);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,13 +162,13 @@ void func_8088A594(EnArrow* this, PlayState* play) {
|
||||
this->bubble.unk_148++;
|
||||
if (this->bubble.unk_148 > 20) {
|
||||
this->actionFunc = func_8088ACE0;
|
||||
func_80115D5C(&play->state);
|
||||
Magic_Reset(play);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ((this->actor.params != ENARROW_8) && (player->unk_D57 == 0)) {
|
||||
if (this->actor.params == ENARROW_7) {
|
||||
func_80115D5C(&play->state);
|
||||
Magic_Reset(play);
|
||||
}
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
return;
|
||||
@@ -202,7 +202,7 @@ void func_8088A594(EnArrow* this, PlayState* play) {
|
||||
this->bubble.unk_144 = CLAMP_MIN(this->bubble.unk_144, 3.5f);
|
||||
func_8088A514(this);
|
||||
this->unk_260 = 99;
|
||||
func_80115D5C(&play->state);
|
||||
Magic_Reset(play);
|
||||
} else if (this->actor.params >= ENARROW_6) {
|
||||
if ((this->actor.params == ENARROW_8) && (this->actor.world.rot.x < 0)) {
|
||||
Actor_SetScale(&this->actor, 0.009f);
|
||||
@@ -310,7 +310,7 @@ void func_8088AA98(EnArrow* this, PlayState* play) {
|
||||
return;
|
||||
}
|
||||
|
||||
func_80115D5C(&play->state);
|
||||
Magic_Reset(play);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ void func_80B3F78C(EnDai* this, PlayState* play) {
|
||||
};
|
||||
s32 pad;
|
||||
|
||||
if (play->actorCtx.unkB != 0) {
|
||||
if (play->actorCtx.lensActorsDrawn) {
|
||||
this->unk_1CE |= 0x40;
|
||||
} else {
|
||||
Actor_RecordUndrawnActor(play, &this->actor);
|
||||
|
||||
@@ -201,7 +201,7 @@ void func_80A5063C(EnDnb* this, PlayState* play) {
|
||||
void EnDnb_Draw(Actor* thisx, PlayState* play) {
|
||||
EnDnb* this = THIS;
|
||||
|
||||
if (play->actorCtx.unk4 != 0) {
|
||||
if (play->actorCtx.lensMaskSize != 0) {
|
||||
func_80A50510(this, play);
|
||||
} else {
|
||||
func_80A5063C(this, play);
|
||||
|
||||
@@ -675,8 +675,7 @@ void func_8088DD34(EnElf* this, PlayState* play) {
|
||||
!func_8088C804(&this->actor.world.pos, &refActor->actor.world.pos, 10.0f)) {
|
||||
Health_ChangeBy(play, 0x80);
|
||||
if (this->fairyFlags & 0x200) {
|
||||
Parameter_AddMagic(play, ((void)0, gSaveContext.unk_3F30) +
|
||||
(gSaveContext.save.playerData.doubleMagic * 0x30) + 0x30);
|
||||
Magic_Add(play, MAGIC_FILL_TO_CAPACITY);
|
||||
}
|
||||
gSaveContext.jinxTimer = 0;
|
||||
this->unk_254 = 50.0f;
|
||||
|
||||
@@ -99,7 +99,7 @@ void EnElfgrp_Init(Actor* thisx, PlayState* play) {
|
||||
break;
|
||||
|
||||
case ENELFGRP_2:
|
||||
if (gSaveContext.save.playerData.doubleMagic == true) {
|
||||
if (gSaveContext.save.playerData.isDoubleMagicAcquired == true) {
|
||||
func_80A396B0(this, 1);
|
||||
}
|
||||
break;
|
||||
@@ -156,7 +156,7 @@ void EnElfgrp_Init(Actor* thisx, PlayState* play) {
|
||||
func_80A396B0(this, 3);
|
||||
this->unk_14A |= 2;
|
||||
}
|
||||
} else if (gSaveContext.save.playerData.magicAcquired == true) {
|
||||
} else if (gSaveContext.save.playerData.isMagicAcquired == true) {
|
||||
func_80A396B0(this, 1);
|
||||
}
|
||||
} else {
|
||||
@@ -477,8 +477,7 @@ void func_80A3A610(EnElfgrp* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (this->unk_144 == 60) {
|
||||
Parameter_AddMagic(play,
|
||||
((void)0, gSaveContext.unk_3F30) + (gSaveContext.save.playerData.doubleMagic * 0x30) + 0x30);
|
||||
Magic_Add(play, MAGIC_FILL_TO_CAPACITY);
|
||||
gSaveContext.healthAccumulator = 320;
|
||||
}
|
||||
|
||||
|
||||
@@ -739,7 +739,7 @@ s32 EnFirefly_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3
|
||||
Gfx** gfx) {
|
||||
EnFirefly* this = THIS;
|
||||
|
||||
if (this->isInvisible && (play->actorCtx.unk4 != 0x64)) {
|
||||
if (this->isInvisible && (play->actorCtx.lensMaskSize != LENS_MASK_ACTIVE_SIZE)) {
|
||||
*dList = NULL;
|
||||
} else if (limbIndex == 1) {
|
||||
pos->y += 2300.0f;
|
||||
|
||||
@@ -651,9 +651,8 @@ void func_80962A10(EnFu* this, PlayState* play) {
|
||||
this->unk_546 = 1;
|
||||
}
|
||||
|
||||
if ((gSaveContext.save.playerForm == PLAYER_FORM_DEKU) && gSaveContext.save.playerData.magicAcquired) {
|
||||
Parameter_AddMagic(play,
|
||||
((void)0, gSaveContext.unk_3F30) + (gSaveContext.save.playerData.doubleMagic * 48) + 48);
|
||||
if ((gSaveContext.save.playerForm == PLAYER_FORM_DEKU) && gSaveContext.save.playerData.isMagicAcquired) {
|
||||
Magic_Add(play, MAGIC_FILL_TO_CAPACITY);
|
||||
}
|
||||
|
||||
func_80962F10(this);
|
||||
@@ -1139,7 +1138,7 @@ void func_80963DE4(EnFu* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80963EAC(EnFu* this, PlayState* play) {
|
||||
if (gSaveContext.save.playerData.magicAcquired) {
|
||||
if (gSaveContext.save.playerData.isMagicAcquired) {
|
||||
if (this->unk_540 == 1) {
|
||||
Message_StartTextbox(play, 0x2847, &this->actor);
|
||||
this->unk_552 = 0x2847;
|
||||
|
||||
@@ -231,7 +231,7 @@ void func_80B35450(EnGg* this, PlayState* play) {
|
||||
|
||||
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
|
||||
if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80)) {
|
||||
func_800B90F4(play);
|
||||
Actor_DeactivateLens(play);
|
||||
}
|
||||
this->unk_308 = 1;
|
||||
this->actionFunc = func_80B352A4;
|
||||
@@ -682,7 +682,7 @@ void EnGg_Destroy(Actor* thisx, PlayState* play) {
|
||||
void EnGg_Update(Actor* thisx, PlayState* play) {
|
||||
EnGg* this = THIS;
|
||||
|
||||
if (play->actorCtx.unk4 == 100) {
|
||||
if (play->actorCtx.lensMaskSize == LENS_MASK_ACTIVE_SIZE) {
|
||||
this->actor.flags |= ACTOR_FLAG_80;
|
||||
this->actor.flags |= ACTOR_FLAG_1;
|
||||
} else {
|
||||
|
||||
@@ -421,7 +421,7 @@ void EnGg2_Destroy(Actor* thisx, PlayState* play) {
|
||||
void EnGg2_Update(Actor* thisx, PlayState* play) {
|
||||
EnGg2* this = THIS;
|
||||
|
||||
if (play->actorCtx.unk4 == 100) {
|
||||
if (play->actorCtx.lensMaskSize == LENS_MASK_ACTIVE_SIZE) {
|
||||
this->actor.flags |= ACTOR_FLAG_80;
|
||||
this->actor.flags |= ACTOR_FLAG_1;
|
||||
if ((this->unk_2EE == 5) && (this->unk_2EE == 7)) {
|
||||
@@ -443,7 +443,7 @@ void EnGg2_Update(Actor* thisx, PlayState* play) {
|
||||
|
||||
if ((this->unk_2EE == 5) || (this->unk_2EE == 7)) {
|
||||
func_800B9010(&this->actor, NA_SE_EN_SHARP_FLOAT - SFX_FLAG);
|
||||
if ((play->actorCtx.unk4 == 100) && ((play->state.frames % 4) == 0)) {
|
||||
if ((play->actorCtx.lensMaskSize == LENS_MASK_ACTIVE_SIZE) && ((play->state.frames % 4) == 0)) {
|
||||
func_80B3B4B0(this, play);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -724,8 +724,7 @@ void func_80B51B40(EnGk* this, PlayState* play) {
|
||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||
play->transitionType = TRANS_TYPE_03;
|
||||
gSaveContext.nextTransitionType = TRANS_TYPE_03;
|
||||
Parameter_AddMagic(play, ((void)0, gSaveContext.unk_3F30) +
|
||||
(gSaveContext.save.playerData.doubleMagic * 0x30) + 0x30);
|
||||
Magic_Add(play, MAGIC_FILL_TO_CAPACITY);
|
||||
} else {
|
||||
this->actionFunc = func_80B51760;
|
||||
}
|
||||
|
||||
@@ -433,8 +433,7 @@ void EnMttag_PotentiallyRestartRace(EnMttag* this, PlayState* play) {
|
||||
gSaveContext.nextTransitionType = TRANS_TYPE_02;
|
||||
func_801477B4(play);
|
||||
func_800B7298(play, &this->actor, 7);
|
||||
Parameter_AddMagic(play,
|
||||
((void)0, gSaveContext.unk_3F30) + (gSaveContext.save.playerData.doubleMagic * 48) + 48);
|
||||
Magic_Add(play, MAGIC_FILL_TO_CAPACITY);
|
||||
|
||||
gSaveContext.eventInf[1] &= (u8)~1;
|
||||
gSaveContext.eventInf[1] &= (u8)~2;
|
||||
|
||||
@@ -107,7 +107,7 @@ void EnTest2_Update(Actor* thisx, PlayState* play) {
|
||||
void EnTest2_UpdateForLens(Actor* thisx, PlayState* play) {
|
||||
EnTest2* this = THIS;
|
||||
|
||||
if (play->actorCtx.unk4 == 100) {
|
||||
if (play->actorCtx.lensMaskSize == LENS_MASK_ACTIVE_SIZE) {
|
||||
this->actor.flags |= ACTOR_FLAG_80;
|
||||
} else {
|
||||
this->actor.flags &= ~ACTOR_FLAG_80;
|
||||
|
||||
@@ -123,7 +123,7 @@ void ItemEtcetera_Update(Actor* thisx, PlayState* play) {
|
||||
void ItemEtcetera_DrawThroughLens(Actor* thisx, PlayState* play) {
|
||||
ItemEtcetera* this = THIS;
|
||||
|
||||
if (play->actorCtx.unk4 == 100) {
|
||||
if (play->actorCtx.lensMaskSize == LENS_MASK_ACTIVE_SIZE) {
|
||||
func_800B8050(&this->actor, play, 0);
|
||||
func_800B8118(&this->actor, play, 0);
|
||||
GetItem_Draw(play, this->getItemDrawId);
|
||||
|
||||
@@ -72,7 +72,7 @@ void OceffSpot_Destroy(Actor* thisx, PlayState* play2) {
|
||||
|
||||
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode1);
|
||||
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode2);
|
||||
func_80115D5C(&play->state);
|
||||
Magic_Reset(play);
|
||||
}
|
||||
|
||||
void OceffSpot_End(OceffSpot* this, PlayState* play) {
|
||||
|
||||
@@ -42,7 +42,7 @@ void OceffWipe2_Init(Actor* thisx, PlayState* play) {
|
||||
void OceffWipe2_Destroy(Actor* thisx, PlayState* play) {
|
||||
OceffWipe2* this = THIS;
|
||||
|
||||
func_80115D5C(&play->state);
|
||||
Magic_Reset(play);
|
||||
play->msgCtx.unk120B0 = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ void OceffWipe3_Init(Actor* thisx, PlayState* play) {
|
||||
void OceffWipe3_Destroy(Actor* thisx, PlayState* play) {
|
||||
OceffWipe3* this = THIS;
|
||||
|
||||
func_80115D5C(&play->state);
|
||||
Magic_Reset(play);
|
||||
play->msgCtx.unk120B0 = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ void OceffWipe6_Init(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
void OceffWipe6_Destroy(Actor* thisx, PlayState* play) {
|
||||
func_80115D5C(&play->state);
|
||||
Magic_Reset(play);
|
||||
play->msgCtx.unk120B0 = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ void OceffWipe7_Init(Actor* thisx, PlayState* play) {
|
||||
void OceffWipe7_Destroy(Actor* thisx, PlayState* play) {
|
||||
OceffWipe7* this = THIS;
|
||||
|
||||
func_80115D5C(&play->state);
|
||||
Magic_Reset(play);
|
||||
play->msgCtx.unk120B0 = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user