mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Magic docs (sync with OoT)
This commit is contained in:
@@ -75,9 +75,9 @@
|
||||
<Texture Name="gAmmoDigit9Tex" OutName="ammo_digit_9" Format="ia8" Width="8" Height="8" Offset="0x4CE0"/>
|
||||
<Texture Name="gAmmoDigitHalfTex" OutName="ammo_digit_half" Format="ia8" Width="16" Height="8" Offset="0x4D20"/>
|
||||
|
||||
<Texture Name="gMagicBarEndTex" OutName="magic_bar_end" Format="ia8" Width="8" Height="16" Offset="0x4DA0"/>
|
||||
<Texture Name="gMagicBarMidTex" OutName="magic_bar_mid" Format="ia8" Width="24" Height="16" Offset="0x4E20"/>
|
||||
<Texture Name="gMagicBarFillTex" OutName="magic_bar_fill" Format="ia8" Width="8" Height="8" Offset="0x4FA0"/>
|
||||
<Texture Name="gMagicMeterEndTex" OutName="magic_meter_end" Format="ia8" Width="8" Height="16" Offset="0x4DA0"/>
|
||||
<Texture Name="gMagicMeterMidTex" OutName="magic_meter_mid" Format="ia8" Width="24" Height="16" Offset="0x4E20"/>
|
||||
<Texture Name="gMagicMeterFillTex" OutName="magic_meter_fill" Format="ia8" Width="8" Height="8" Offset="0x4FA0"/>
|
||||
|
||||
<!-- The analog clock from day one until midnight of the final day -->
|
||||
<Texture Name="gThreeDayClockDiamondTex" OutName="three_day_clock_diamond" Format="ia8" Width="40" Height="32" Offset="0x4FE0"/>
|
||||
|
||||
+5
-5
@@ -1935,12 +1935,12 @@ void Health_GiveHearts(s16 hearts);
|
||||
void Rupees_ChangeBy(s16 rupeeChange);
|
||||
void Inventory_ChangeAmmo(s16 item, s16 ammoChange);
|
||||
void Magic_Add(GlobalContext* globalCtx, s16 arg1);
|
||||
void Magic_ResetBar(GameState* gamestate);
|
||||
void Magic_Reset(GameState* gamestate);
|
||||
// void Magic_Consume(void);
|
||||
// void Magic_UpdateAdd(void);
|
||||
// void Magic_UpdateBarBorderColor(void);
|
||||
// void Magic_UpdateBar(void);
|
||||
// void Magic_DrawBar(void);
|
||||
// void Magic_UpdateAddRequest(void);
|
||||
// void Magic_UpdateMeterBorderColor(void);
|
||||
// void Magic_Update(void);
|
||||
// void Magic_DrawMeter(void);
|
||||
// void func_80116FD8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
// void func_801170B8(void);
|
||||
// void Interface_DrawItemButtons(void);
|
||||
|
||||
+31
-31
@@ -24,23 +24,23 @@ typedef enum RespawnMode {
|
||||
|
||||
#define SAVE_BUFFER_SIZE 0x4000
|
||||
|
||||
typedef enum MagicBarAction {
|
||||
/* 00 */ MAGIC_BAR_ACTION_IDLE, // Regular gameplay
|
||||
/* 01 */ MAGIC_BAR_ACTION_CONSUME_SETUP, // Sets the speed in which magic border flashes
|
||||
/* 02 */ MAGIC_BAR_ACTION_CONSUME, // Consume magic until target is reached or no more magic is available
|
||||
/* 03 */ MAGIC_BAR_ACTION_BORDER_CHANGE_1, // Flashes border and freezes Dark Link
|
||||
/* 04 */ MAGIC_BAR_ACTION_BORDER_CHANGE_2, // Flashes border and draws yellow magic to preview target consumption
|
||||
/* 05 */ MAGIC_BAR_ACTION_RESTORE_IDLE, // Reset colors and return to idle
|
||||
/* 06 */ MAGIC_BAR_ACTION_BORDER_CHANGE_3, // Flashes border with no additional behaviour
|
||||
/* 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_GORON_ZORA_SETUP,
|
||||
/* 11 */ MAGIC_BAR_ACTION_CONSUME_GORON_ZORA,
|
||||
/* 12 */ MAGIC_BAR_ACTION_CONSUME_GIANTS_MASK
|
||||
} MagicBarAction;
|
||||
typedef enum {
|
||||
/* 00 */ MAGIC_STATE_IDLE, // Regular gameplay
|
||||
/* 01 */ MAGIC_STATE_CONSUME_SETUP, // Sets the speed in which magic border flashes
|
||||
/* 02 */ MAGIC_STATE_CONSUME, // Consume magic until target is reached or no more magic is available
|
||||
/* 03 */ MAGIC_STATE_METER_FLASH_1, // Flashes border
|
||||
/* 04 */ MAGIC_STATE_METER_FLASH_2, // Flashes border and draws yellow magic to preview target consumption
|
||||
/* 05 */ MAGIC_STATE_RESET, // Reset colors and return to idle
|
||||
/* 06 */ MAGIC_STATE_METER_FLASH_3, // Flashes border with no additional behaviour
|
||||
/* 07 */ MAGIC_STATE_CONSUME_LENS, // Magic slowly consumed by lens
|
||||
/* 08 */ MAGIC_STATE_STEP_CAPACITY, // Step `magicCapacity` to full capacity
|
||||
/* 09 */ MAGIC_STATE_FILL, // Add magic until magicFillTarget is reached
|
||||
/* 10 */ MAGIC_STATE_CONSUME_GORON_ZORA_SETUP,
|
||||
/* 11 */ MAGIC_STATE_CONSUME_GORON_ZORA, // Magic slowly consumed by goron spikes or zora shocks
|
||||
/* 12 */ MAGIC_STATE_CONSUME_GIANTS_MASK // Magic slowly consumed by giants mask
|
||||
} MagicState;
|
||||
|
||||
typedef enum MagicBarChange {
|
||||
typedef enum {
|
||||
/* 0 */ MAGIC_BAR_CONSUME_NOW, // Consume Magic immediately without preview
|
||||
/* 1 */ MAGIC_BAR_CONSUME_WAIT_NO_PREVIEW, // Sets consume target but waits to consume. No yellow magic preview to target consumption. Unused
|
||||
/* 2 */ MAGIC_BAR_CONSUME_NOW_ALT, // Identical behaviour to MAGIC_BAR_CONSUME_NOW. Unused
|
||||
@@ -48,11 +48,11 @@ typedef enum MagicBarChange {
|
||||
/* 4 */ MAGIC_BAR_CONSUME_WAIT_PREVIEW, // Sets consume target but waits to consume. Draws yellow magic to target consumption
|
||||
/* 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;
|
||||
/* 7 */ MAGIC_BAR_CONSUME_DEITY_BEAM // Fierce Deity Beam consumption, consumed magic now and not via request
|
||||
} MagicChangeType;
|
||||
|
||||
#define MAGIC_HALF_BAR 0x30
|
||||
#define MAGIC_FULL_BAR (2 * MAGIC_HALF_BAR)
|
||||
#define MAGIC_NORMAL_METER 0x30
|
||||
#define MAGIC_DOUBLE_METER (2 * MAGIC_NORMAL_METER)
|
||||
|
||||
typedef struct SramContext {
|
||||
/* 0x00 */ u8* readBuff;
|
||||
@@ -134,13 +134,13 @@ typedef struct SavePlayerData {
|
||||
/* 0x0008 */ char playerName[8]; // "player_name"
|
||||
/* 0x0010 */ s16 healthCapacity; // "max_life"
|
||||
/* 0x0012 */ s16 health; // "now_life"
|
||||
/* 0x0014 */ s8 magicLevel; // "magic_max"
|
||||
/* 0x0015 */ s8 magic; // "magic_now"
|
||||
/* 0x0014 */ s8 magicLevel; // 0 for no magic/new load, 1 for magic, 2 for double magic "magic_max"
|
||||
/* 0x0015 */ s8 magic; // current magic available for use "magic_now"
|
||||
/* 0x0016 */ s16 rupees; // "lupy_count"
|
||||
/* 0x0018 */ u16 swordHealth; // "long_sword_hp"
|
||||
/* 0x001A */ u16 tatlTimer; // "navi_timer"
|
||||
/* 0x001C */ u8 isMagicAcquired; // "magic_mode"
|
||||
/* 0x001D */ u8 isDoubleMagicAcquired; // "magic_ability"
|
||||
/* 0x001C */ u8 isMagicAcquired; // "magic_mode"
|
||||
/* 0x001D */ u8 isDoubleMagicAcquired; // "magic_ability"
|
||||
/* 0x001E */ u8 doubleDefense; // "life_ability"
|
||||
/* 0x001F */ u8 unk_1F; // "ocarina_round"
|
||||
/* 0x0020 */ u8 unk_20; // "first_memory"
|
||||
@@ -255,13 +255,13 @@ typedef struct SaveContext {
|
||||
/* 0x3F22 */ u16 unk_3F22; // "prev_alpha_type"
|
||||
/* 0x3F24 */ u16 unk_3F24; // "alpha_count"
|
||||
/* 0x3F26 */ u16 unk_3F26; // "last_time_type"
|
||||
/* 0x3F28 */ s16 magicBarAction; // "magic_flag"
|
||||
/* 0x3F2A */ s16 isMagicRequested; // "recovery_magic_flag"
|
||||
/* 0x3F2C */ s16 unk_3F2C; // "keep_magic_flag"
|
||||
/* 0x3F2E */ s16 magicCapacityDrawn; // "magic_now_max"
|
||||
/* 0x3F30 */ s16 magicCapacity; // "magic_now_now"
|
||||
/* 0x3F32 */ s16 magicToConsume; // "magic_used"
|
||||
/* 0x3F34 */ s16 magicToAdd; // "magic_recovery"
|
||||
/* 0x3F28 */ s16 magicState; // determines magic meter behavior on each frame "magic_flag"
|
||||
/* 0x3F2A */ s16 isMagicRequested; // a request to add magic has been given "recovery_magic_flag"
|
||||
/* 0x3F2C */ s16 magicUnusedFlag; // Set to 0 in func_80812D94, otherwise unused "keep_magic_flag"
|
||||
/* 0x3F2E */ s16 magicCapacity; // maximum magic available "magic_now_max"
|
||||
/* 0x3F30 */ s16 magicFillTarget; // target used to fill magic "magic_now_now"
|
||||
/* 0x3F32 */ s16 magicToConsume; // accumulated magic that is requested to be consumed "magic_used"
|
||||
/* 0x3F34 */ s16 magicToAdd; // accumulated magic that is requested to be added "magic_recovery"
|
||||
/* 0x3F36 */ u16 mapIndex; // "scene_ID"
|
||||
/* 0x3F38 */ u16 minigameState; // "yabusame_mode"
|
||||
/* 0x3F3A */ u16 minigameScore; // "yabusame_total"
|
||||
|
||||
+1
-1
@@ -2217,7 +2217,7 @@ s32 func_800B90AC(GlobalContext* globalCtx, Actor* actor, CollisionPoly* polygon
|
||||
void Actor_DisableLens(GlobalContext* globalCtx) {
|
||||
if (globalCtx->actorCtx.lensActive) {
|
||||
globalCtx->actorCtx.lensActive = false;
|
||||
Magic_ResetBar(&globalCtx->state);
|
||||
Magic_Reset(&globalCtx->state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,8 +73,8 @@ void KaleidoSetup_Update(GlobalContext* globalCtx) {
|
||||
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 != MAGIC_BAR_ACTION_GROW_WIDE) &&
|
||||
(gSaveContext.magicBarAction != MAGIC_BAR_ACTION_FILL)) {
|
||||
if ((globalCtx->unk_1887C < 2) && (gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) &&
|
||||
(gSaveContext.magicState != MAGIC_STATE_FILL)) {
|
||||
if (!(gSaveContext.eventInf[1] & 0x80) && !(player->stateFlags1 & 0x20)) {
|
||||
if (!(globalCtx->actorCtx.unk5 & 2) && !(globalCtx->actorCtx.unk5 & 4)) {
|
||||
if ((globalCtx->actorCtx.unk268 == 0) &&
|
||||
|
||||
+112
-117
@@ -3162,17 +3162,16 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange) {
|
||||
}
|
||||
|
||||
void Magic_Add(GlobalContext* globalCtx, s16 magicToAdd) {
|
||||
if (((void)0, gSaveContext.save.playerData.magic) < ((void)0, gSaveContext.magicCapacityDrawn)) {
|
||||
if (((void)0, gSaveContext.save.playerData.magic) < ((void)0, gSaveContext.magicCapacity)) {
|
||||
gSaveContext.magicToAdd += magicToAdd;
|
||||
gSaveContext.isMagicRequested = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Magic_ResetBar(GameState* gamestate) {
|
||||
if ((gSaveContext.magicBarAction != MAGIC_BAR_ACTION_GROW_WIDE) &&
|
||||
(gSaveContext.magicBarAction != MAGIC_BAR_ACTION_FILL)) {
|
||||
void Magic_Reset(GameState* gamestate) {
|
||||
if ((gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) && (gSaveContext.magicState != MAGIC_STATE_FILL)) {
|
||||
sMagicBarOutlinePrimRed = sMagicBarOutlinePrimGreen = sMagicBarOutlinePrimBlue = 255;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_IDLE;
|
||||
gSaveContext.magicState = MAGIC_STATE_IDLE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3184,7 +3183,7 @@ s32 Magic_Consume(GlobalContext* globalCtx, s16 magicToConsume, s16 consumeType)
|
||||
}
|
||||
|
||||
if ((gSaveContext.save.playerData.magic - magicToConsume) < 0) {
|
||||
if (gSaveContext.magicCapacityDrawn != 0) {
|
||||
if (gSaveContext.magicCapacity != 0) {
|
||||
play_sound(NA_SE_SY_ERROR);
|
||||
}
|
||||
return false;
|
||||
@@ -3193,16 +3192,16 @@ s32 Magic_Consume(GlobalContext* globalCtx, s16 magicToConsume, s16 consumeType)
|
||||
switch (consumeType) {
|
||||
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)) {
|
||||
if (gSaveContext.magicBarAction == MAGIC_BAR_ACTION_LENS_CONSUME) {
|
||||
if ((gSaveContext.magicState == MAGIC_STATE_IDLE) ||
|
||||
(gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS)) {
|
||||
if (gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS) {
|
||||
globalCtx->actorCtx.lensActive = false;
|
||||
}
|
||||
if (gSaveContext.save.weekEventReg[14] & 8) {
|
||||
magicToConsume = 0;
|
||||
}
|
||||
gSaveContext.magicToConsume = magicToConsume;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_CONSUME_SETUP;
|
||||
gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP;
|
||||
return true;
|
||||
} else {
|
||||
play_sound(NA_SE_SY_ERROR);
|
||||
@@ -3210,16 +3209,16 @@ s32 Magic_Consume(GlobalContext* globalCtx, s16 magicToConsume, s16 consumeType)
|
||||
}
|
||||
|
||||
case MAGIC_BAR_CONSUME_WAIT_NO_PREVIEW:
|
||||
if ((gSaveContext.magicBarAction == MAGIC_BAR_ACTION_IDLE) ||
|
||||
(gSaveContext.magicBarAction == MAGIC_BAR_ACTION_LENS_CONSUME)) {
|
||||
if (gSaveContext.magicBarAction == MAGIC_BAR_ACTION_LENS_CONSUME) {
|
||||
if ((gSaveContext.magicState == MAGIC_STATE_IDLE) ||
|
||||
(gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS)) {
|
||||
if (gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS) {
|
||||
globalCtx->actorCtx.lensActive = false;
|
||||
}
|
||||
if (gSaveContext.save.weekEventReg[14] & 8) {
|
||||
magicToConsume = 0;
|
||||
}
|
||||
gSaveContext.magicToConsume = magicToConsume;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_BORDER_CHANGE_3;
|
||||
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_3;
|
||||
return true;
|
||||
} else {
|
||||
play_sound(NA_SE_SY_ERROR);
|
||||
@@ -3227,28 +3226,28 @@ s32 Magic_Consume(GlobalContext* globalCtx, s16 magicToConsume, s16 consumeType)
|
||||
}
|
||||
|
||||
case MAGIC_BAR_CONSUME_LENS: // Lens
|
||||
if (gSaveContext.magicBarAction == MAGIC_BAR_ACTION_IDLE) {
|
||||
if (gSaveContext.magicState == MAGIC_STATE_IDLE) {
|
||||
if (gSaveContext.save.playerData.magic != 0) {
|
||||
interfaceCtx->magicConsumptionTimer = 80;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_LENS_CONSUME;
|
||||
gSaveContext.magicState = MAGIC_STATE_CONSUME_LENS;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if (gSaveContext.magicBarAction == MAGIC_BAR_ACTION_LENS_CONSUME) {
|
||||
} else if (gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
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) {
|
||||
if ((gSaveContext.magicState == MAGIC_STATE_IDLE) ||
|
||||
(gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS)) {
|
||||
if (gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS) {
|
||||
globalCtx->actorCtx.lensActive = false;
|
||||
}
|
||||
gSaveContext.magicToConsume = magicToConsume;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_BORDER_CHANGE_2;
|
||||
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_2;
|
||||
return true;
|
||||
} else {
|
||||
play_sound(NA_SE_SY_ERROR);
|
||||
@@ -3258,32 +3257,32 @@ s32 Magic_Consume(GlobalContext* globalCtx, s16 magicToConsume, s16 consumeType)
|
||||
case MAGIC_BAR_CONSUME_GORON_ZORA: // Zora Shock, Goron Spike Roll
|
||||
if (gSaveContext.save.playerData.magic != 0) {
|
||||
interfaceCtx->magicConsumptionTimer = 10;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_CONSUME_GORON_ZORA_SETUP;
|
||||
gSaveContext.magicState = MAGIC_STATE_CONSUME_GORON_ZORA_SETUP;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
case MAGIC_BAR_CONSUME_GIANTS_MASK: // Giants Mask
|
||||
if (gSaveContext.magicBarAction == MAGIC_BAR_ACTION_IDLE) {
|
||||
if (gSaveContext.magicState == MAGIC_STATE_IDLE) {
|
||||
if (gSaveContext.save.playerData.magic != 0) {
|
||||
interfaceCtx->magicConsumptionTimer = R_MAGIC_CONSUME_TIMER_GIANT;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_CONSUME_GIANTS_MASK;
|
||||
gSaveContext.magicState = MAGIC_STATE_CONSUME_GIANTS_MASK;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (gSaveContext.magicBarAction == MAGIC_BAR_ACTION_CONSUME_GIANTS_MASK) {
|
||||
if (gSaveContext.magicState == MAGIC_STATE_CONSUME_GIANTS_MASK) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
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) {
|
||||
if ((gSaveContext.magicState == MAGIC_STATE_IDLE) ||
|
||||
(gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS)) {
|
||||
if (gSaveContext.magicState == MAGIC_STATE_CONSUME_LENS) {
|
||||
globalCtx->actorCtx.lensActive = false;
|
||||
}
|
||||
if (gSaveContext.save.weekEventReg[14] & 8) {
|
||||
@@ -3301,13 +3300,13 @@ s32 Magic_Consume(GlobalContext* globalCtx, s16 magicToConsume, s16 consumeType)
|
||||
}
|
||||
}
|
||||
|
||||
void Magic_UpdateAdd(void) {
|
||||
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.magicCapacityDrawn)) {
|
||||
gSaveContext.save.playerData.magic = gSaveContext.magicCapacityDrawn;
|
||||
if (((void)0, gSaveContext.save.playerData.magic) >= ((void)0, gSaveContext.magicCapacity)) {
|
||||
gSaveContext.save.playerData.magic = gSaveContext.magicCapacity;
|
||||
gSaveContext.magicToAdd = 0;
|
||||
gSaveContext.isMagicRequested = false;
|
||||
} else {
|
||||
@@ -3326,7 +3325,7 @@ s16 sMagicBorderColors[][3] = {
|
||||
};
|
||||
s16 sMagicBorderIndices[] = { 0, 1, 1, 0 };
|
||||
s16 sMagicBorderColorTimerIndex[] = { 2, 1, 2, 1 };
|
||||
void Magic_UpdateBarBorderColor(void) {
|
||||
void Magic_UpdateMeterBorderColor(void) {
|
||||
s16 borderChangeR;
|
||||
s16 borderChangeG;
|
||||
s16 borderChangeB;
|
||||
@@ -3369,121 +3368,119 @@ void Magic_UpdateBarBorderColor(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void Magic_UpdateBar(GlobalContext* globalCtx) {
|
||||
void Magic_Update(GlobalContext* globalCtx) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
s16 magicCapacity;
|
||||
s16 magicCapacityTarget;
|
||||
|
||||
if (gSaveContext.save.weekEventReg[14] & 8) {
|
||||
Magic_UpdateBarBorderColor();
|
||||
Magic_UpdateMeterBorderColor();
|
||||
}
|
||||
|
||||
switch (gSaveContext.magicBarAction) {
|
||||
case MAGIC_BAR_ACTION_GROW_WIDE:
|
||||
magicCapacity = gSaveContext.save.playerData.magicLevel * MAGIC_HALF_BAR;
|
||||
if (gSaveContext.magicCapacityDrawn != magicCapacity) {
|
||||
if (gSaveContext.magicCapacityDrawn < magicCapacity) {
|
||||
gSaveContext.magicCapacityDrawn += 0x10;
|
||||
if (gSaveContext.magicCapacityDrawn > magicCapacity) {
|
||||
gSaveContext.magicCapacityDrawn = magicCapacity;
|
||||
switch (gSaveContext.magicState) {
|
||||
case MAGIC_STATE_STEP_CAPACITY:
|
||||
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.magicCapacityDrawn -= 0x10;
|
||||
if (gSaveContext.magicCapacityDrawn <= magicCapacity) {
|
||||
gSaveContext.magicCapacityDrawn = magicCapacity;
|
||||
gSaveContext.magicCapacity -= 0x10;
|
||||
if (gSaveContext.magicCapacity <= magicCapacityTarget) {
|
||||
gSaveContext.magicCapacity = magicCapacityTarget;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_FILL;
|
||||
gSaveContext.magicState = MAGIC_STATE_FILL;
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGIC_BAR_ACTION_FILL:
|
||||
case MAGIC_STATE_FILL:
|
||||
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.magicCapacity)) {
|
||||
gSaveContext.save.playerData.magic = gSaveContext.magicCapacity;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_IDLE;
|
||||
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_BAR_ACTION_CONSUME_SETUP:
|
||||
case MAGIC_STATE_CONSUME_SETUP:
|
||||
sMagicBorderRatio = 2;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_CONSUME;
|
||||
gSaveContext.magicState = MAGIC_STATE_CONSUME;
|
||||
break;
|
||||
|
||||
case MAGIC_BAR_ACTION_CONSUME:
|
||||
case MAGIC_STATE_CONSUME:
|
||||
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.magicBarAction = MAGIC_BAR_ACTION_BORDER_CHANGE_1;
|
||||
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_1;
|
||||
sMagicBarOutlinePrimRed = sMagicBarOutlinePrimGreen = sMagicBarOutlinePrimBlue = 255;
|
||||
}
|
||||
// fallthrough
|
||||
|
||||
case MAGIC_BAR_ACTION_BORDER_CHANGE_1:
|
||||
case MAGIC_BAR_ACTION_BORDER_CHANGE_2:
|
||||
case MAGIC_BAR_ACTION_BORDER_CHANGE_3:
|
||||
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_UpdateBarBorderColor();
|
||||
Magic_UpdateMeterBorderColor();
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGIC_BAR_ACTION_RESTORE_IDLE:
|
||||
case MAGIC_STATE_RESET:
|
||||
sMagicBarOutlinePrimRed = sMagicBarOutlinePrimGreen = sMagicBarOutlinePrimBlue = 255;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_IDLE;
|
||||
gSaveContext.magicState = MAGIC_STATE_IDLE;
|
||||
break;
|
||||
|
||||
case MAGIC_BAR_ACTION_LENS_CONSUME:
|
||||
case MAGIC_STATE_CONSUME_LENS:
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && (msgCtx->msgMode == 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)) ||
|
||||
((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)) ||
|
||||
!globalCtx->actorCtx.lensActive) {
|
||||
globalCtx->actorCtx.lensActive = false;
|
||||
play_sound(NA_SE_SY_GLASSMODE_OFF);
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_IDLE;
|
||||
sMagicBarOutlinePrimRed = sMagicBarOutlinePrimGreen = sMagicBarOutlinePrimBlue = 255;
|
||||
break;
|
||||
}
|
||||
(globalCtx->transitionMode == 0) && !Play_InCsMode(globalCtx)) {
|
||||
|
||||
interfaceCtx->magicConsumptionTimer--;
|
||||
if (interfaceCtx->magicConsumptionTimer == 0) {
|
||||
if (!(gSaveContext.save.weekEventReg[14] & 8)) {
|
||||
gSaveContext.save.playerData.magic--;
|
||||
}
|
||||
interfaceCtx->magicConsumptionTimer = 80;
|
||||
if ((gSaveContext.save.playerData.magic == 0) ||
|
||||
((func_801242DC(globalCtx) >= 2) && (func_801242DC(globalCtx) < 5)) ||
|
||||
((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)) ||
|
||||
!globalCtx->actorCtx.lensActive) {
|
||||
globalCtx->actorCtx.lensActive = false;
|
||||
play_sound(NA_SE_SY_GLASSMODE_OFF);
|
||||
gSaveContext.magicState = MAGIC_STATE_IDLE;
|
||||
sMagicBarOutlinePrimRed = sMagicBarOutlinePrimGreen = sMagicBarOutlinePrimBlue = 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_UpdateBarBorderColor();
|
||||
Magic_UpdateMeterBorderColor();
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGIC_BAR_ACTION_CONSUME_GORON_ZORA_SETUP:
|
||||
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.magicBarAction = MAGIC_BAR_ACTION_CONSUME_GORON_ZORA;
|
||||
gSaveContext.magicState = MAGIC_STATE_CONSUME_GORON_ZORA;
|
||||
// fallthrough
|
||||
|
||||
case MAGIC_BAR_ACTION_CONSUME_GORON_ZORA:
|
||||
case MAGIC_STATE_CONSUME_GORON_ZORA:
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && (msgCtx->msgMode == 0) &&
|
||||
(globalCtx->gameOverCtx.state == 0) && (globalCtx->sceneLoadFlag == 0) &&
|
||||
(globalCtx->transitionMode == 0)) {
|
||||
@@ -3501,11 +3498,11 @@ void Magic_UpdateBar(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
if (!(gSaveContext.save.weekEventReg[14] & 8)) {
|
||||
Magic_UpdateBarBorderColor();
|
||||
Magic_UpdateMeterBorderColor();
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGIC_BAR_ACTION_CONSUME_GIANTS_MASK:
|
||||
case MAGIC_STATE_CONSUME_GIANTS_MASK:
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && (msgCtx->msgMode == 0) &&
|
||||
(globalCtx->gameOverCtx.state == 0) && (globalCtx->sceneLoadFlag == 0) &&
|
||||
(globalCtx->transitionMode == 0)) {
|
||||
@@ -3523,17 +3520,17 @@ void Magic_UpdateBar(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
if (!(gSaveContext.save.weekEventReg[14] & 8)) {
|
||||
Magic_UpdateBarBorderColor();
|
||||
Magic_UpdateMeterBorderColor();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_IDLE;
|
||||
gSaveContext.magicState = MAGIC_STATE_IDLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Magic_DrawBar(GlobalContext* globalCtx) {
|
||||
void Magic_DrawMeter(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
s16 magicBarY;
|
||||
|
||||
@@ -3550,16 +3547,16 @@ void Magic_DrawBar(GlobalContext* globalCtx) {
|
||||
|
||||
gDPSetEnvColor(OVERLAY_DISP++, 100, 50, 50, 255);
|
||||
|
||||
OVERLAY_DISP = func_8010CFBC(OVERLAY_DISP, gMagicBarEndTex, 8, 16, 18, magicBarY, 8, 16, 1 << 10, 1 << 10,
|
||||
OVERLAY_DISP = func_8010CFBC(OVERLAY_DISP, gMagicMeterEndTex, 8, 16, 18, magicBarY, 8, 16, 1 << 10, 1 << 10,
|
||||
sMagicBarOutlinePrimRed, sMagicBarOutlinePrimGreen, sMagicBarOutlinePrimBlue,
|
||||
interfaceCtx->magicAlpha);
|
||||
OVERLAY_DISP =
|
||||
func_8010CFBC(OVERLAY_DISP, gMagicBarMidTex, 24, 16, 26, magicBarY,
|
||||
((void)0, gSaveContext.magicCapacityDrawn), 16, 1 << 10, 1 << 10, sMagicBarOutlinePrimRed,
|
||||
sMagicBarOutlinePrimGreen, sMagicBarOutlinePrimBlue, interfaceCtx->magicAlpha);
|
||||
func_8010CFBC(OVERLAY_DISP, gMagicMeterMidTex, 24, 16, 26, magicBarY, ((void)0, gSaveContext.magicCapacity),
|
||||
16, 1 << 10, 1 << 10, sMagicBarOutlinePrimRed, sMagicBarOutlinePrimGreen,
|
||||
sMagicBarOutlinePrimBlue, interfaceCtx->magicAlpha);
|
||||
OVERLAY_DISP =
|
||||
func_8010D480(OVERLAY_DISP, gMagicBarEndTex, 8, 16, ((void)0, gSaveContext.magicCapacityDrawn) + 26,
|
||||
magicBarY, 8, 16, 1 << 10, 1 << 10, sMagicBarOutlinePrimRed, sMagicBarOutlinePrimGreen,
|
||||
func_8010D480(OVERLAY_DISP, gMagicMeterEndTex, 8, 16, ((void)0, gSaveContext.magicCapacity) + 26, magicBarY,
|
||||
8, 16, 1 << 10, 1 << 10, sMagicBarOutlinePrimRed, sMagicBarOutlinePrimGreen,
|
||||
sMagicBarOutlinePrimBlue, interfaceCtx->magicAlpha, 3, 0x100);
|
||||
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
@@ -3567,16 +3564,16 @@ void Magic_DrawBar(GlobalContext* globalCtx) {
|
||||
ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE);
|
||||
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
|
||||
|
||||
if (gSaveContext.magicBarAction == MAGIC_BAR_ACTION_BORDER_CHANGE_2) {
|
||||
// Yellow part of the bar indicating the amount of magic to be subtracted
|
||||
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++, gMagicBarFillTex, G_IM_FMT_I, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
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 bar with the normal magic color
|
||||
// Fill the rest of the meter with the normal magic color
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
if (gSaveContext.save.weekEventReg[14] & 8) {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 200, interfaceCtx->magicAlpha);
|
||||
@@ -3589,14 +3586,14 @@ void Magic_DrawBar(GlobalContext* globalCtx) {
|
||||
((((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 bar with the normal magic color
|
||||
// Fill the whole meter with the normal magic color
|
||||
if (gSaveContext.save.weekEventReg[14] & 8) {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 200, interfaceCtx->magicAlpha);
|
||||
} else {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 200, 0, interfaceCtx->magicAlpha);
|
||||
}
|
||||
|
||||
gDPLoadTextureBlock_4b(OVERLAY_DISP++, gMagicBarFillTex, G_IM_FMT_I, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
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,
|
||||
@@ -6031,7 +6028,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
||||
1 << 10);
|
||||
}
|
||||
|
||||
Magic_DrawBar(globalCtx);
|
||||
Magic_DrawMeter(globalCtx);
|
||||
func_8010A54C(globalCtx);
|
||||
|
||||
if ((SREG(94) != 2) && (SREG(94) != 3)) {
|
||||
@@ -6523,7 +6520,7 @@ void Interface_Update(GlobalContext* globalCtx) {
|
||||
gSaveContext.save.playerData.isMagicAcquired = true;
|
||||
}
|
||||
gSaveContext.save.playerData.isDoubleMagicAcquired = true;
|
||||
gSaveContext.save.playerData.magic = MAGIC_FULL_BAR;
|
||||
gSaveContext.save.playerData.magic = MAGIC_DOUBLE_METER;
|
||||
gSaveContext.save.playerData.magicLevel = 0;
|
||||
XREG(4) = 0;
|
||||
} else if (XREG(4) == -1) {
|
||||
@@ -6531,23 +6528,21 @@ void Interface_Update(GlobalContext* globalCtx) {
|
||||
gSaveContext.save.playerData.isMagicAcquired = true;
|
||||
}
|
||||
gSaveContext.save.playerData.isDoubleMagicAcquired = false;
|
||||
gSaveContext.save.playerData.magic = MAGIC_HALF_BAR;
|
||||
gSaveContext.save.playerData.magic = MAGIC_NORMAL_METER;
|
||||
gSaveContext.save.playerData.magicLevel = 0;
|
||||
XREG(4) = 0;
|
||||
}
|
||||
|
||||
if (gSaveContext.save.playerData.isMagicAcquired) {
|
||||
if (gSaveContext.save.playerData.magicLevel == 0) {
|
||||
gSaveContext.save.playerData.magicLevel = gSaveContext.save.playerData.isDoubleMagicAcquired + 1;
|
||||
gSaveContext.magicCapacity = gSaveContext.save.playerData.magic;
|
||||
gSaveContext.save.playerData.magic = 0;
|
||||
gSaveContext.magicBarAction = MAGIC_BAR_ACTION_GROW_WIDE;
|
||||
BUTTON_ITEM_EQUIP(PLAYER_FORM_DEKU, EQUIP_SLOT_B) = ITEM_NUT;
|
||||
}
|
||||
if ((gSaveContext.save.playerData.isMagicAcquired) && (gSaveContext.save.playerData.magicLevel == 0)) {
|
||||
gSaveContext.save.playerData.magicLevel = gSaveContext.save.playerData.isDoubleMagicAcquired + 1;
|
||||
gSaveContext.magicFillTarget = gSaveContext.save.playerData.magic;
|
||||
gSaveContext.save.playerData.magic = 0;
|
||||
gSaveContext.magicState = MAGIC_STATE_STEP_CAPACITY;
|
||||
BUTTON_ITEM_EQUIP(PLAYER_FORM_DEKU, EQUIP_SLOT_B) = ITEM_NUT;
|
||||
}
|
||||
|
||||
Magic_UpdateBar(globalCtx);
|
||||
Magic_UpdateAdd();
|
||||
Magic_Update(globalCtx);
|
||||
Magic_UpdateAddRequest();
|
||||
}
|
||||
|
||||
if (gSaveContext.unk_3DD0[5] == 0) {
|
||||
|
||||
@@ -576,7 +576,7 @@ SavePlayerData sSaveDefaultPlayerData = {
|
||||
0x30, // healthCapacity
|
||||
0x30, // health
|
||||
0, // magicLevel
|
||||
MAGIC_HALF_BAR, // magic
|
||||
MAGIC_NORMAL_METER, // magic
|
||||
0, // rupees
|
||||
0, // swordHealth
|
||||
0, // tatlTimer
|
||||
@@ -674,7 +674,7 @@ SavePlayerData sSaveDebugPlayerData = {
|
||||
0x80, // healthCapacity
|
||||
0x80, // health
|
||||
0, // magicLevel
|
||||
MAGIC_HALF_BAR, // magic
|
||||
MAGIC_NORMAL_METER, // magic
|
||||
50, // rupees
|
||||
100, // swordHealth
|
||||
0, // tatlTimer
|
||||
|
||||
@@ -81,7 +81,7 @@ void ArrowFire_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void ArrowFire_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ArrowFire* this = THIS;
|
||||
|
||||
Magic_ResetBar(&globalCtx->state);
|
||||
Magic_Reset(&globalCtx->state);
|
||||
Collider_DestroyQuad(globalCtx, &this->collider1);
|
||||
Collider_DestroyQuad(globalCtx, &this->collider2);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ void ArrowIce_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void ArrowIce_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Magic_ResetBar(&globalCtx->state);
|
||||
Magic_Reset(&globalCtx->state);
|
||||
(void)"消滅"; // Unreferenced in retail, means "Disappearance"
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ void ArrowLight_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void ArrowLight_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Magic_ResetBar(&globalCtx->state);
|
||||
Magic_Reset(&globalCtx->state);
|
||||
(void)"消滅"; // Unreferenced in retail, means "Disappearance"
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ void EnArrow_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if ((this->actor.params >= ENARROW_3) && (this->actor.params < ENARROW_6) && (this->actor.child == NULL)) {
|
||||
Magic_ResetBar(&globalCtx->state);
|
||||
Magic_Reset(&globalCtx->state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,13 +162,13 @@ void func_8088A594(EnArrow* this, GlobalContext* globalCtx) {
|
||||
this->bubble.unk_148++;
|
||||
if (this->bubble.unk_148 > 20) {
|
||||
this->actionFunc = func_8088ACE0;
|
||||
Magic_ResetBar(&globalCtx->state);
|
||||
Magic_Reset(&globalCtx->state);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ((this->actor.params != ENARROW_8) && (player->unk_D57 == 0)) {
|
||||
if (this->actor.params == ENARROW_7) {
|
||||
Magic_ResetBar(&globalCtx->state);
|
||||
Magic_Reset(&globalCtx->state);
|
||||
}
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
return;
|
||||
@@ -202,7 +202,7 @@ void func_8088A594(EnArrow* this, GlobalContext* globalCtx) {
|
||||
this->bubble.unk_144 = CLAMP_MIN(this->bubble.unk_144, 3.5f);
|
||||
func_8088A514(this);
|
||||
this->unk_260 = 99;
|
||||
Magic_ResetBar(&globalCtx->state);
|
||||
Magic_Reset(&globalCtx->state);
|
||||
} 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);
|
||||
@@ -311,7 +311,7 @@ void func_8088AA98(EnArrow* this, GlobalContext* globalCtx) {
|
||||
return;
|
||||
}
|
||||
|
||||
Magic_ResetBar(&globalCtx->state);
|
||||
Magic_Reset(&globalCtx->state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -675,8 +675,8 @@ void func_8088DD34(EnElf* this, GlobalContext* globalCtx) {
|
||||
!func_8088C804(&this->actor.world.pos, &refActor->actor.world.pos, 10.0f)) {
|
||||
Health_ChangeBy(globalCtx, 0x80);
|
||||
if (this->fairyFlags & 0x200) {
|
||||
Magic_Add(globalCtx, ((void)0, gSaveContext.magicCapacity) +
|
||||
(gSaveContext.save.playerData.isDoubleMagicAcquired + 1) * MAGIC_HALF_BAR);
|
||||
Magic_Add(globalCtx, ((void)0, gSaveContext.magicFillTarget) +
|
||||
(gSaveContext.save.playerData.isDoubleMagicAcquired + 1) * MAGIC_NORMAL_METER);
|
||||
}
|
||||
gSaveContext.jinxTimer = 0;
|
||||
this->unk_254 = 50.0f;
|
||||
|
||||
@@ -478,8 +478,8 @@ void func_80A3A610(EnElfgrp* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (this->unk_144 == 60) {
|
||||
Magic_Add(globalCtx, ((void)0, gSaveContext.magicCapacity) +
|
||||
(gSaveContext.save.playerData.isDoubleMagicAcquired + 1) * MAGIC_HALF_BAR);
|
||||
Magic_Add(globalCtx, ((void)0, gSaveContext.magicFillTarget) +
|
||||
(gSaveContext.save.playerData.isDoubleMagicAcquired + 1) * MAGIC_NORMAL_METER);
|
||||
gSaveContext.healthAccumulator = 320;
|
||||
}
|
||||
|
||||
|
||||
@@ -652,8 +652,8 @@ void func_80962A10(EnFu* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if ((gSaveContext.save.playerForm == PLAYER_FORM_DEKU) && gSaveContext.save.playerData.isMagicAcquired) {
|
||||
Magic_Add(globalCtx, ((void)0, gSaveContext.magicCapacity) +
|
||||
(gSaveContext.save.playerData.isDoubleMagicAcquired + 1) * MAGIC_HALF_BAR);
|
||||
Magic_Add(globalCtx, ((void)0, gSaveContext.magicFillTarget) +
|
||||
(gSaveContext.save.playerData.isDoubleMagicAcquired + 1) * MAGIC_NORMAL_METER);
|
||||
}
|
||||
|
||||
func_80962F10(this);
|
||||
|
||||
@@ -727,8 +727,9 @@ void func_80B51B40(EnGk* this, GlobalContext* globalCtx) {
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
globalCtx->unk_1887F = 3;
|
||||
gSaveContext.nextTransition = 3;
|
||||
Magic_Add(globalCtx, ((void)0, gSaveContext.magicCapacity) +
|
||||
(gSaveContext.save.playerData.isDoubleMagicAcquired + 1) * MAGIC_HALF_BAR);
|
||||
Magic_Add(globalCtx,
|
||||
((void)0, gSaveContext.magicFillTarget) +
|
||||
(gSaveContext.save.playerData.isDoubleMagicAcquired + 1) * MAGIC_NORMAL_METER);
|
||||
} else {
|
||||
this->actionFunc = func_80B51760;
|
||||
}
|
||||
|
||||
@@ -433,8 +433,8 @@ void EnMttag_PotentiallyRestartRace(EnMttag* this, GlobalContext* globalCtx) {
|
||||
gSaveContext.nextTransition = 2;
|
||||
func_801477B4(globalCtx);
|
||||
func_800B7298(globalCtx, &this->actor, 7);
|
||||
Magic_Add(globalCtx, ((void)0, gSaveContext.magicCapacity) +
|
||||
(gSaveContext.save.playerData.isDoubleMagicAcquired + 1) * MAGIC_HALF_BAR);
|
||||
Magic_Add(globalCtx, ((void)0, gSaveContext.magicFillTarget) +
|
||||
(gSaveContext.save.playerData.isDoubleMagicAcquired + 1) * MAGIC_NORMAL_METER);
|
||||
|
||||
gSaveContext.eventInf[1] &= (u8)~1;
|
||||
gSaveContext.eventInf[1] &= (u8)~2;
|
||||
|
||||
@@ -38,7 +38,7 @@ void OceffWipe6_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void OceffWipe6_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Magic_ResetBar(&globalCtx->state);
|
||||
Magic_Reset(&globalCtx->state);
|
||||
globalCtx->msgCtx.unk120B0 = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -2135,12 +2135,12 @@
|
||||
0x801159EC:("Rupees_ChangeBy",),
|
||||
0x80115A14:("Inventory_ChangeAmmo",),
|
||||
0x80115D14:("Magic_Add",),
|
||||
0x80115D5C:("Magic_ResetBar",),
|
||||
0x80115D5C:("Magic_Reset",),
|
||||
0x80115DB4:("Magic_Consume",),
|
||||
0x80116088:("Magic_UpdateAdd",),
|
||||
0x80116114:("Magic_UpdateBarBorderColor",),
|
||||
0x80116348:("Magic_UpdateBar",),
|
||||
0x80116918:("Magic_DrawBar",),
|
||||
0x80116088:("Magic_UpdateAddRequest",),
|
||||
0x80116114:("Magic_UpdateMeterBorderColor",),
|
||||
0x80116348:("Magic_Update",),
|
||||
0x80116918:("Magic_DrawMeter",),
|
||||
0x80116FD8:("func_80116FD8",),
|
||||
0x801170B8:("func_801170B8",),
|
||||
0x80117100:("Interface_DrawItemButtons",),
|
||||
|
||||
@@ -1649,12 +1649,12 @@ asm/non_matchings/code/z_parameter/Health_GiveHearts.s,Health_GiveHearts,0x80115
|
||||
asm/non_matchings/code/z_parameter/Rupees_ChangeBy.s,Rupees_ChangeBy,0x801159EC,0xA
|
||||
asm/non_matchings/code/z_parameter/Inventory_ChangeAmmo.s,Inventory_ChangeAmmo,0x80115A14,0xC0
|
||||
asm/non_matchings/code/z_parameter/Magic_Add.s,Magic_Add,0x80115D14,0x12
|
||||
asm/non_matchings/code/z_parameter/Magic_ResetBar.s,Magic_ResetBar,0x80115D5C,0x16
|
||||
asm/non_matchings/code/z_parameter/Magic_Reset.s,Magic_Reset,0x80115D5C,0x16
|
||||
asm/non_matchings/code/z_parameter/Magic_Consume.s,Magic_Consume,0x80115DB4,0xB5
|
||||
asm/non_matchings/code/z_parameter/Magic_UpdateAdd.s,Magic_UpdateAdd,0x80116088,0x23
|
||||
asm/non_matchings/code/z_parameter/Magic_UpdateBarBorderColor.s,Magic_UpdateBarBorderColor,0x80116114,0x8D
|
||||
asm/non_matchings/code/z_parameter/Magic_UpdateBar.s,Magic_UpdateBar,0x80116348,0x174
|
||||
asm/non_matchings/code/z_parameter/Magic_DrawBar.s,Magic_DrawBar,0x80116918,0x1B0
|
||||
asm/non_matchings/code/z_parameter/Magic_UpdateAddRequest.s,Magic_UpdateAddRequest,0x80116088,0x23
|
||||
asm/non_matchings/code/z_parameter/Magic_UpdateMeterBorderColor.s,Magic_UpdateMeterBorderColor,0x80116114,0x8D
|
||||
asm/non_matchings/code/z_parameter/Magic_Update.s,Magic_Update,0x80116348,0x174
|
||||
asm/non_matchings/code/z_parameter/Magic_DrawMeter.s,Magic_DrawMeter,0x80116918,0x1B0
|
||||
asm/non_matchings/code/z_parameter/func_80116FD8.s,func_80116FD8,0x80116FD8,0x38
|
||||
asm/non_matchings/code/z_parameter/func_801170B8.s,func_801170B8,0x801170B8,0x12
|
||||
asm/non_matchings/code/z_parameter/Interface_DrawItemButtons.s,Interface_DrawItemButtons,0x80117100,0x248
|
||||
|
||||
|
Reference in New Issue
Block a user