From 6dea1ab0aab98993ef1f9124f6991f1f388b0538 Mon Sep 17 00:00:00 2001 From: z64a Date: Sun, 20 Oct 2024 02:29:58 -0400 Subject: [PATCH] mash bar -> meter consistent terminology --- include/enums.h | 2 +- src/audio/sfx.c | 2 +- src/battle/action_cmd.c | 10 +-- src/battle/action_cmd.h | 22 +++--- src/battle/action_cmd/air_lift.c | 64 ++++++++--------- src/battle/action_cmd/air_raid.c | 56 +++++++-------- src/battle/action_cmd/body_slam.c | 36 +++++----- src/battle/action_cmd/bomb.c | 50 ++++++------- src/battle/action_cmd/break_free.c | 22 +++--- .../action_cmd/common/MashCommandDraw.inc.c | 6 +- src/battle/action_cmd/dizzy_shell.c | 62 ++++++++-------- src/battle/action_cmd/fire_shell.c | 56 +++++++-------- src/battle/action_cmd/flee.c | 28 ++++---- src/battle/action_cmd/hammer.c | 14 ++-- src/battle/action_cmd/hurricane.c | 62 ++++++++-------- src/battle/action_cmd/mega_shock.c | 66 ++++++++--------- src/battle/action_cmd/power_shock.c | 72 +++++++++---------- src/battle/action_cmd/smack.c | 58 +++++++-------- src/battle/action_cmd/spiny_surge.c | 54 +++++++------- src/battle/action_cmd/spook.c | 72 +++++++++---------- src/battle/action_cmd/squirt.c | 50 ++++++------- src/battle/action_cmd/stop_leech.c | 24 +++---- src/battle/action_cmd/three_chances.c | 8 +-- src/battle/action_cmd/tidal_wave.c | 14 ++-- src/battle/action_cmd/unused_flee.c | 26 +++---- src/battle/action_cmd/unused_mash_a.c | 30 ++++---- src/battle/action_cmd/whirlwind.c | 40 +++++------ 27 files changed, 503 insertions(+), 503 deletions(-) diff --git a/include/enums.h b/include/enums.h index a9602d37e7..dfaedb0e28 100644 --- a/include/enums.h +++ b/include/enums.h @@ -1643,7 +1643,7 @@ enum SoundIDs { SOUND_LOOP_TIK_UNUSED3_FLOW3 = 0x8000003E, // #unused SOUND_LOOP_TIK_UNUSED3_FLOW2 = 0x8000003F, // #unused SOUND_LOOP_SAM_STAIRS_RISE = 0x80000040, - SOUND_LOOP_CHARGE_BAR = 0x80000041, + SOUND_LOOP_CHARGE_METER = 0x80000041, SOUND_LOOP_CRYSTAL_BALL_GLOW = 0x80000042, SOUND_LOOP_TIK18_WATER = 0x80000043, SOUND_LOOP_TIK19_WATER = 0x80000044, diff --git a/src/audio/sfx.c b/src/audio/sfx.c index 29c50e3658..a8eea87e0a 100644 --- a/src/audio/sfx.c +++ b/src/audio/sfx.c @@ -75,7 +75,7 @@ s32 LoopingSounds[] = { [SOUND_LOOP_IDX(SOUND_LOOP_TIK_UNUSED3_FLOW3)] SOUND_LRAW_WATER_FLOWING_3, [SOUND_LOOP_IDX(SOUND_LOOP_TIK_UNUSED3_FLOW2)] SOUND_LRAW_WATER_FLOWING_2, [SOUND_LOOP_IDX(SOUND_LOOP_SAM_STAIRS_RISE)] SOUND_LRAW_SAM_STAIRS_RISE, - [SOUND_LOOP_IDX(SOUND_LOOP_CHARGE_BAR)] SOUND_LRAW_CHARGE_BAR, + [SOUND_LOOP_IDX(SOUND_LOOP_CHARGE_METER)] SOUND_LRAW_CHARGE_BAR, [SOUND_LOOP_IDX(SOUND_LOOP_CRYSTAL_BALL_GLOW)] SOUND_LRAW_CRYSTAL_BALL_GLOW, [SOUND_LOOP_IDX(SOUND_LOOP_TIK18_WATER)] SOUND_LRAW_TIK_WATER, [SOUND_LOOP_IDX(SOUND_LOOP_TIK19_WATER)] SOUND_LRAW_TIK_WATER, diff --git a/src/battle/action_cmd.c b/src/battle/action_cmd.c index ca76f4e768..369e1d8661 100644 --- a/src/battle/action_cmd.c +++ b/src/battle/action_cmd.c @@ -150,11 +150,11 @@ void draw_mash_meter(s32 posX, s32 posY, s32 fillValue, s32 colorMode) { } //difference between current and previous filled value - offsetX = width - acs->barFillWidth; + offsetX = width - acs->meterFillWidth; if (abs(offsetX) >= MashMeterSmoothDivisor * 100) { - acs->barFillWidth += offsetX / MashMeterSmoothDivisor; + acs->meterFillWidth += offsetX / MashMeterSmoothDivisor; } else { - acs->barFillWidth = width; + acs->meterFillWidth = width; } offsetX = 0; @@ -202,7 +202,7 @@ void draw_mash_meter(s32 posX, s32 posY, s32 fillValue, s32 colorMode) { } filledWidth = cutOff * 60 / maxCutOff - offsetX; - width = acs->barFillWidth / 100 - offsetX; + width = acs->meterFillWidth / 100 - offsetX; if (width < 0) { break; @@ -737,7 +737,7 @@ API_CALLABLE(InterruptActionCommand) { } } - sfx_stop_sound(SOUND_LOOP_CHARGE_BAR); + sfx_stop_sound(SOUND_LOOP_CHARGE_METER); close_action_command_instruction_popup(); return ApiStatus_DONE2; diff --git a/src/battle/action_cmd.h b/src/battle/action_cmd.h index d149549928..b1128e8a04 100644 --- a/src/battle/action_cmd.h +++ b/src/battle/action_cmd.h @@ -38,7 +38,7 @@ enum { AC_STATE_DISPOSE = 12, // delay and disappear }; -enum { +enum ActionCommandDifficulty { AC_DIFFICULTY_0 = 0, // easiest AC_DIFFICULTY_1 = 1, // very easy AC_DIFFICULTY_2 = 2, // easy @@ -81,13 +81,13 @@ enum ActionCommandModes { typedef struct ActionCommandStatus { /* 0x00 */ s32 workerID; /* 0x04 */ s32 hudElements[16]; - /* 0x44 */ s16 barFillLevel; // 0 to MAX_MASH_UNITS + /* 0x44 */ s16 meterFillLevel; // 0 to MAX_MASH_UNITS /* 0x46 */ s16 escapeThreshold; - /* 0x48 */ s16 barFillWidth; // X100 + /* 0x48 */ s16 meterFillWidth; // X100 /* 0x4A */ s16 actionCommandID; /* 0x4C */ s16 state; /* 0x4E */ s16 prepareTime; - /* 0x50 */ s16 difficulty; // values from 0 to 7 + /* 0x50 */ s16 difficulty; // see enum: ActionCommandDifficulty /* 0x52 */ s16 duration; /* 0x54 */ s16 stateTimer; /* 0x56 */ s16 hudPosX; @@ -133,20 +133,20 @@ typedef struct ActionCommandStatus { } tidalWave; }; /* 0x5E */ s8 autoSucceed; - /* 0x5F */ s8 hammerMissedStart; - /* 0x60 */ s8 wrongButtonPressed; - /* 0x61 */ s8 showHud; - /* 0x62 */ s8 playHammerSounds; + /* 0x5F */ b8 hammerMissedStart; + /* 0x60 */ b8 wrongButtonPressed; + /* 0x61 */ b8 showHud; + /* 0x62 */ b8 playHammerSounds; /* 0x63 */ char pad_63[1]; /* 0x64 */ union { s16 variation; // used to select different variants of an action command s16 statusChance; // chance of applying special status; higher values make mashing easier }; /* 0x66 */ s16 thresholdMoveDir; - /* 0x68 */ s16 isBarFilled; - /* 0x6A */ s16 berserkerEnabled; + /* 0x68 */ b16 isMeterFilled; + /* 0x6A */ b16 berserkerEnabled; /* 0x6C */ s16 hudPrepareTime; - /* 0x6E */ s16 hitsTakenIsMax; + /* 0x6E */ b16 hitsTakenIsMax; /* 0x70 */ s16 lookBackCounter; /* 0x72 */ s16 wrongInputFrameCounter; /* 0x74 */ s16 mashMeterCutoffs[6]; // upper bounds for each interval diff --git a/src/battle/action_cmd/air_lift.c b/src/battle/action_cmd/air_lift.c index 3dfd1a80b0..ba5e6f19ea 100644 --- a/src/battle/action_cmd/air_lift.c +++ b/src/battle/action_cmd/air_lift.c @@ -44,9 +44,9 @@ API_CALLABLE(N(init)) { acs->showHud = TRUE; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; - acs->isBarFilled = FALSE; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; + acs->isMeterFilled = FALSE; battleStatus->actionQuality = 0; battleStatus->actionProgress = 0; @@ -154,59 +154,59 @@ void N(update)(void) { hud_element_set_script(acs->hudElements[HIDX_BUTTON], &HES_MashAButton); N(HasStarted) = TRUE; acs->stateTimer = acs->duration; - sfx_play_sound_with_params(SOUND_LOOP_CHARGE_BAR, 0, 0, 0); + sfx_play_sound_with_params(SOUND_LOOP_CHARGE_METER, 0, 0, 0); acs->state = AC_STATE_ACTIVE; // fallthrough case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // bar can drain if it hasn't been fully filled - if (!acs->isBarFilled) { + // meter can drain if it hasn't been fully filled + if (!acs->isMeterFilled) { if (acs->escapeChance != 0) { s32 maxFillLevel = acs->mashMeterCutoffs[acs->mashMeterNumIntervals]; - acs->barFillLevel -= GET_DRAIN_RATE(acs->barFillLevel / maxFillLevel); - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= GET_DRAIN_RATE(acs->meterFillLevel / maxFillLevel); + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } else { - acs->barFillLevel -= 10; - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= 10; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } } - // check for bar-filling input + // check for meter-filling input if (battleStatus->actionCommandMode != AC_MODE_NOT_LEARNED && (battleStatus->curButtonsPressed & BUTTON_A)) { if (acs->escapeChance != 0) { // fill rate = 820 multiplied by two values expressed as percentages s32 difficultyPct = battleStatus->actionCmdDifficultyTable[acs->difficulty]; s32 effectivenessPct = METER_FILL_RATE * acs->escapeChance; // divide by 100 for each percent-based multiplier - acs->barFillLevel += (difficultyPct * effectivenessPct) / (100 * 100); + acs->meterFillLevel += (difficultyPct * effectivenessPct) / (100 * 100); } else { - acs->barFillLevel += ONE_PCT_MASH; - if (acs->barFillLevel >= 5 * ONE_PCT_MASH) { - acs->barFillLevel = 5 * ONE_PCT_MASH; + acs->meterFillLevel += ONE_PCT_MASH; + if (acs->meterFillLevel >= 5 * ONE_PCT_MASH) { + acs->meterFillLevel = 5 * ONE_PCT_MASH; } } } - // handle bar reaching 100% - if (acs->barFillLevel > MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; - acs->isBarFilled = TRUE; + // handle meter reaching 100% + if (acs->meterFillLevel > MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; + acs->isMeterFilled = TRUE; hid = acs->hudElements[HIDX_100_PCT]; hud_element_set_render_pos(hid, acs->hudPosX + 50, acs->hudPosY + 28); hud_element_clear_flags(hid, HUD_ELEMENT_FLAG_DISABLED); } - battleStatus->actionQuality = acs->barFillLevel / ONE_PCT_MASH; + battleStatus->actionQuality = acs->meterFillLevel / ONE_PCT_MASH; if (battleStatus->actionProgress < battleStatus->actionQuality) { battleStatus->actionProgress = battleStatus->actionQuality; } - sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_BAR, 0, 0, battleStatus->actionQuality * 12); + sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_METER, 0, 0, battleStatus->actionQuality * 12); if (acs->stateTimer != 0) { acs->stateTimer--; @@ -217,7 +217,7 @@ void N(update)(void) { battleStatus->actionProgress = 0; } - // threshold for success is completely random, only guaranteed if the bar is 100% filled + // threshold for success is completely random, only guaranteed if the meter is 100% filled battleStatus->actionQuality = battleStatus->actionProgress; if (rand_int(99) < battleStatus->actionQuality) { battleStatus->actionResult = ACTION_RESULT_SUCCESS; @@ -232,15 +232,15 @@ void N(update)(void) { } btl_set_popup_duration(POPUP_MSG_OFF); - sfx_stop_sound(SOUND_LOOP_CHARGE_BAR); + sfx_stop_sound(SOUND_LOOP_CHARGE_METER); acs->stateTimer = 20; acs->state = AC_STATE_DISPOSE; break; case AC_STATE_DISPOSE: if (acs->escapeChance == 0) { - acs->barFillLevel -= ONE_PCT_MASH; - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= ONE_PCT_MASH; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } if (acs->stateTimer != 0) { @@ -266,11 +266,11 @@ void N(draw)(void) { hud_element_get_render_pos(hid, &hudX, &hudY); if (!N(HasStarted)) { - draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH, 1); - } else if (!acs->isBarFilled) { - draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH, 4); + draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH, 1); + } else if (!acs->isMeterFilled) { + draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH, 4); } else { - draw_mash_meter_blink_with_divisor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH, 4); + draw_mash_meter_blink_with_divisor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH, 4); } hud_element_draw_clipped(acs->hudElements[HIDX_100_PCT]); diff --git a/src/battle/action_cmd/air_raid.c b/src/battle/action_cmd/air_raid.c index a23d1a1225..101d7c24ca 100644 --- a/src/battle/action_cmd/air_raid.c +++ b/src/battle/action_cmd/air_raid.c @@ -46,9 +46,9 @@ API_CALLABLE(N(init)) { acs->hudPrepareTime = 30; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; - acs->isBarFilled = FALSE; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; + acs->isMeterFilled = FALSE; battleStatus->actionQuality = 0; acs->hudPosX = -48; acs->hudPosY = 80; @@ -93,8 +93,8 @@ API_CALLABLE(N(start)) { acs->statusChance = evt_get_variable(script, *args++); // unused acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_NONE; battleStatus->maxActionQuality = acs->mashMeterCutoffs[(acs->mashMeterNumIntervals - 1)]; @@ -156,61 +156,61 @@ void N(update)(void) { } hud_element_set_script(acs->hudElements[HIDX_STICK], &HES_StickMashLeft); - acs->barFillLevel = 0; + acs->meterFillLevel = 0; battleStatus->resultTier = 0; acs->airRaid.holdingLeft = FALSE; acs->stateTimer = acs->duration; - sfx_play_sound_with_params(SOUND_LOOP_CHARGE_BAR, 0, 0, 0); + sfx_play_sound_with_params(SOUND_LOOP_CHARGE_METER, 0, 0, 0); acs->state = AC_STATE_ACTIVE; // fallthrough case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // bar can drain if it hasn't been fully filled - if (!acs->isBarFilled) { + // meter can drain if it hasn't been fully filled + if (!acs->isMeterFilled) { cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals]; - acs->barFillLevel -= GET_DRAIN_RATE(acs->barFillLevel / cutoff); - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= GET_DRAIN_RATE(acs->meterFillLevel / cutoff); + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } - // check for bar-filling input - if (!acs->isBarFilled) { + // check for meter-filling input + if (!acs->isMeterFilled) { if (battleStatus->curButtonsDown & BUTTON_STICK_LEFT) { acs->airRaid.holdingLeft = TRUE; } if (!(battleStatus->curButtonsDown & BUTTON_STICK_LEFT)) { if (acs->airRaid.holdingLeft) { - acs->barFillLevel += SCALE_BY_PCT(METER_FILL_RATE, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel += SCALE_BY_PCT(METER_FILL_RATE, battleStatus->actionCmdDifficultyTable[acs->difficulty]); acs->airRaid.holdingLeft = FALSE; } } - // right stick inputs actively drain the bar + // right stick inputs actively drain the meter if (battleStatus->curButtonsPressed & BUTTON_STICK_RIGHT) { - acs->barFillLevel -= SCALE_BY_PCT(METER_FILL_RATE, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel -= SCALE_BY_PCT(METER_FILL_RATE, battleStatus->actionCmdDifficultyTable[acs->difficulty]); } } - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } - // handle bar reaching 100% - if (acs->barFillLevel > MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; - acs->isBarFilled = TRUE; + // handle meter reaching 100% + if (acs->meterFillLevel > MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; + acs->isMeterFilled = TRUE; hid = acs->hudElements[HIDX_100_PCT]; hud_element_set_render_pos(hid, acs->hudPosX + 50, acs->hudPosY + 28); hud_element_clear_flags(hid, HUD_ELEMENT_FLAG_DISABLED); } - battleStatus->actionProgress = acs->barFillLevel / ONE_PCT_MASH; - sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_BAR, 0, 0, battleStatus->actionProgress * 12); + battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH; + sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_METER, 0, 0, battleStatus->actionProgress * 12); // resultTier is not used by this move; uses actionProgress instead via the move script switch (partner->actorBlueprint->level) { @@ -246,10 +246,10 @@ void N(update)(void) { break; } - if (acs->barFillLevel == 0) { + if (acs->meterFillLevel == 0) { battleStatus->actionQuality = AC_QUALITY_FAILED; } else { - battleStatus->actionQuality = acs->barFillLevel / ONE_PCT_MASH; + battleStatus->actionQuality = acs->meterFillLevel / ONE_PCT_MASH; } cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals - 1]; @@ -265,7 +265,7 @@ void N(update)(void) { } btl_set_popup_duration(POPUP_MSG_OFF); - sfx_stop_sound(SOUND_LOOP_CHARGE_BAR); + sfx_stop_sound(SOUND_LOOP_CHARGE_METER); acs->stateTimer = 5; acs->state = AC_STATE_DISPOSE; break; diff --git a/src/battle/action_cmd/body_slam.c b/src/battle/action_cmd/body_slam.c index 7ff177589c..28f39ba60d 100644 --- a/src/battle/action_cmd/body_slam.c +++ b/src/battle/action_cmd/body_slam.c @@ -34,9 +34,9 @@ API_CALLABLE(N(init)) { acs->showHud = TRUE; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; - acs->isBarFilled = FALSE; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; + acs->isMeterFilled = FALSE; battleStatus->actionQuality = 0; acs->hudPosX = -48; acs->hudPosY = 80; @@ -86,8 +86,8 @@ API_CALLABLE(N(start)) { acs->statusChance = evt_get_variable(script, *args++); // unused acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_NONE; battleStatus->maxActionQuality = acs->mashMeterCutoffs[(acs->mashMeterNumIntervals - 1)]; @@ -152,37 +152,37 @@ void N(update)(void) { return; } hud_element_set_script(acs->hudElements[HIDX_BUTTON], &HES_AButtonDown); - acs->barFillLevel = 0; + acs->meterFillLevel = 0; acs->escapeThreshold = 0; acs->stateTimer = acs->duration; - sfx_play_sound_with_params(SOUND_LOOP_CHARGE_BAR, 0, 0, 0); + sfx_play_sound_with_params(SOUND_LOOP_CHARGE_METER, 0, 0, 0); acs->state = AC_STATE_ACTIVE; // fallthrough case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // check for bar-filling input + // check for meter-filling input if (battleStatus->curButtonsDown & BUTTON_A) { - acs->barFillLevel += METER_FILL_RATE; + acs->meterFillLevel += METER_FILL_RATE; acs->escapeThreshold += METER_FILL_RATE; } else { acs->stateTimer = 0; } - // handle bar reaching 100% - if (acs->barFillLevel >= MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; + // handle meter reaching 100% + if (acs->meterFillLevel >= MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; hud_element_set_script(acs->hudElements[HIDX_LIGHT], &HES_TimingReady); hud_element_set_script(acs->hudElements[HIDX_BUTTON], &HES_AButton); - if (!acs->isBarFilled) { + if (!acs->isMeterFilled) { sfx_play_sound(SOUND_TIMING_BAR_GO); - acs->isBarFilled = TRUE; + acs->isMeterFilled = TRUE; } } - battleStatus->actionProgress = acs->barFillLevel / ONE_PCT_MASH; - sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_BAR, 0, 0, battleStatus->actionProgress * 12); + battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH; + sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_METER, 0, 0, battleStatus->actionProgress * 12); if (acs->stateTimer != 0) { acs->stateTimer--; return; @@ -208,7 +208,7 @@ void N(update)(void) { } btl_set_popup_duration(POPUP_MSG_OFF); - sfx_stop_sound(SOUND_LOOP_CHARGE_BAR); + sfx_stop_sound(SOUND_LOOP_CHARGE_METER); acs->stateTimer = 5; acs->state = AC_STATE_DISPOSE; break; @@ -231,7 +231,7 @@ void N(draw)(void) { hud_element_draw_clipped(hid); hud_element_get_render_pos(hid, &hudX, &hudY); hud_element_draw_clipped(gActionCommandStatus.hudElements[HIDX_FRAME]); - draw_mash_meter_multicolor(hudX, hudY, gActionCommandStatus.barFillLevel / ONE_PCT_MASH); + draw_mash_meter_multicolor(hudX, hudY, gActionCommandStatus.meterFillLevel / ONE_PCT_MASH); hud_element_draw_clipped(gActionCommandStatus.hudElements[HIDX_LIGHT]); } diff --git a/src/battle/action_cmd/bomb.c b/src/battle/action_cmd/bomb.c index 7f9ec79e5f..35603282dc 100644 --- a/src/battle/action_cmd/bomb.c +++ b/src/battle/action_cmd/bomb.c @@ -40,9 +40,9 @@ API_CALLABLE(N(init)) { acs->showHud = TRUE; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; - acs->isBarFilled = FALSE; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; + acs->isMeterFilled = FALSE; battleStatus->actionQuality = 0; acs->hudPosX = -48; @@ -88,8 +88,8 @@ API_CALLABLE(N(start)) { acs->variation = evt_get_variable(script, *args++); acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_NONE; battleStatus->maxActionQuality = acs->mashMeterCutoffs[(acs->mashMeterNumIntervals - 1)]; @@ -144,60 +144,60 @@ void N(update)(void) { } hud_element_set_script(acs->hudElements[HIDX_BUTTON], &HES_MashAButton); - acs->barFillLevel = 0; + acs->meterFillLevel = 0; acs->stateTimer = acs->duration; - sfx_play_sound_with_params(SOUND_LOOP_CHARGE_BAR, 0, 0, 0); + sfx_play_sound_with_params(SOUND_LOOP_CHARGE_METER, 0, 0, 0); acs->state = AC_STATE_ACTIVE; // fallthrough case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // bar can drain if it hasn't been fully filled - if (!acs->isBarFilled) { + // meter can drain if it hasn't been fully filled + if (!acs->isMeterFilled) { cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals]; - acs->barFillLevel -= GET_DRAIN_RATE(acs->barFillLevel / cutoff); - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= GET_DRAIN_RATE(acs->meterFillLevel / cutoff); + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } - // check for bar-filling input + // check for meter-filling input if (battleStatus->curButtonsPressed & BUTTON_A) { switch (acs->variation) { case ACV_BOMB_BASIC: - acs->barFillLevel += SCALE_BY_PCT(BASIC_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel += SCALE_BY_PCT(BASIC_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); break; case ACV_BOMB_SUPER: - acs->barFillLevel += SCALE_BY_PCT(SUPER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel += SCALE_BY_PCT(SUPER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); break; case ACV_BOMB_ULTRA: - acs->barFillLevel += SCALE_BY_PCT(ULTRA_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel += SCALE_BY_PCT(ULTRA_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); break; } } - // handle bar reaching 100% - if (acs->barFillLevel > MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; - acs->isBarFilled = TRUE; + // handle meter reaching 100% + if (acs->meterFillLevel > MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; + acs->isMeterFilled = TRUE; hid = acs->hudElements[HIDX_100_PCT]; hud_element_set_render_pos(hid, acs->hudPosX + 50, acs->hudPosY + 28); hud_element_clear_flags(hid, HUD_ELEMENT_FLAG_DISABLED); } - battleStatus->actionProgress = acs->barFillLevel / ONE_PCT_MASH; - sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_BAR, 0, 0, battleStatus->actionProgress * 12); + battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH; + sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_METER, 0, 0, battleStatus->actionProgress * 12); if (acs->stateTimer != 0) { acs->stateTimer--; break; } - if (acs->barFillLevel == 0) { + if (acs->meterFillLevel == 0) { battleStatus->actionQuality = AC_QUALITY_FAILED; } else { - battleStatus->actionQuality = acs->barFillLevel / ONE_PCT_MASH; + battleStatus->actionQuality = acs->meterFillLevel / ONE_PCT_MASH; } cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals - 1]; @@ -212,7 +212,7 @@ void N(update)(void) { increment_action_command_success_count(); } - sfx_stop_sound(SOUND_LOOP_CHARGE_BAR); + sfx_stop_sound(SOUND_LOOP_CHARGE_METER); btl_set_popup_duration(POPUP_MSG_OFF); acs->stateTimer = 5; acs->state = AC_STATE_DISPOSE; diff --git a/src/battle/action_cmd/break_free.c b/src/battle/action_cmd/break_free.c index e513b97605..cbccfc0ad6 100644 --- a/src/battle/action_cmd/break_free.c +++ b/src/battle/action_cmd/break_free.c @@ -36,9 +36,9 @@ API_CALLABLE(N(init)) { acs->showHud = TRUE; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; + acs->meterFillLevel = 0; acs->escapeThreshold = 0; - acs->barFillWidth = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; acs->hudPosX = -48; acs->hudPosY = 80; @@ -89,9 +89,9 @@ API_CALLABLE(N(start)) { acs->difficulty = adjust_action_command_difficulty(acs->difficulty); acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; + acs->meterFillLevel = 0; acs->escapeThreshold = 0; - acs->barFillWidth = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_NONE; @@ -180,14 +180,14 @@ void N(update)(void) { } } - // unlike most other mash inputs, this command doesn't just increment barFillLevel with inputs + // unlike most other mash inputs, this command doesn't just increment meterFillLevel with inputs // instead we sum the total number of inputs during the last N frames of the input buffer if (!acs->berserkerEnabled) { s32 inputBufPos = battleStatus->inputBufferPos; s32 windowLen = acs->duration - acs->stateTimer; s32 i; - acs->barFillLevel = 0; + acs->meterFillLevel = 0; inputBufPos -= windowLen; if (inputBufPos < 0) { @@ -199,15 +199,15 @@ void N(update)(void) { inputBufPos -= ARRAY_COUNT(battleStatus->pushInputBuffer); } if (battleStatus->pushInputBuffer[inputBufPos] & BUTTON_A) { - acs->barFillLevel += SCALE_BY_PCT(METER_FILL_RATE, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel += SCALE_BY_PCT(METER_FILL_RATE, battleStatus->actionCmdDifficultyTable[acs->difficulty]); } } } else { - acs->barFillLevel += SCALE_BY_PCT(25, battleStatus->actionCmdDifficultyTable[acs->difficulty]); - acs->barFillLevel += rand_int(SCALE_BY_PCT(25, battleStatus->actionCmdDifficultyTable[acs->difficulty])); + acs->meterFillLevel += SCALE_BY_PCT(25, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel += rand_int(SCALE_BY_PCT(25, battleStatus->actionCmdDifficultyTable[acs->difficulty])); } - battleStatus->actionQuality = acs->barFillLevel / ONE_PCT_MASH; + battleStatus->actionQuality = acs->meterFillLevel / ONE_PCT_MASH; if (acs->stateTimer != 0) { acs->stateTimer--; break; @@ -257,7 +257,7 @@ void N(draw)(void) { hud_element_draw_clipped(hid); hud_element_get_render_pos(hid, &hudX, &hudY); - draw_mash_meter_multicolor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH); + draw_mash_meter_multicolor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH); hud_element_draw_clipped(hudElements[HIDX_RUN_AWAY]); hud_element_draw_clipped(hudElements[HIDX_OK]); } diff --git a/src/battle/action_cmd/common/MashCommandDraw.inc.c b/src/battle/action_cmd/common/MashCommandDraw.inc.c index 37d994c704..9754dff52b 100644 --- a/src/battle/action_cmd/common/MashCommandDraw.inc.c +++ b/src/battle/action_cmd/common/MashCommandDraw.inc.c @@ -11,10 +11,10 @@ void N(draw)(void) { hud_element_draw_clipped(hid); hud_element_get_render_pos(hid, &hudX, &hudY); - if (!acs->isBarFilled) { - draw_mash_meter_multicolor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH); + if (!acs->isMeterFilled) { + draw_mash_meter_multicolor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH); } else { - draw_mash_meter_blink(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH); + draw_mash_meter_blink(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH); } hud_element_draw_clipped(acs->hudElements[2]); diff --git a/src/battle/action_cmd/dizzy_shell.c b/src/battle/action_cmd/dizzy_shell.c index 340f002b15..fa9c628efd 100644 --- a/src/battle/action_cmd/dizzy_shell.c +++ b/src/battle/action_cmd/dizzy_shell.c @@ -40,9 +40,9 @@ API_CALLABLE(N(init)) { acs->showHud = TRUE; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; - acs->isBarFilled = FALSE; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; + acs->isMeterFilled = FALSE; battleStatus->actionQuality = 0; acs->hudPosX = -48; acs->hudPosY = 80; @@ -87,8 +87,8 @@ API_CALLABLE(N(start)) { acs->statusChance = evt_get_variable(script, *args++); // average chance for enemies to be affected acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_NONE; battleStatus->maxActionQuality = acs->mashMeterCutoffs[(acs->mashMeterNumIntervals - 1)]; @@ -141,32 +141,32 @@ void N(update)(void) { return; } hud_element_set_script(acs->hudElements[HIDX_BUTTON], &HES_MashAButton); - acs->barFillLevel = 0; + acs->meterFillLevel = 0; acs->stateTimer = acs->duration; - sfx_play_sound_with_params(SOUND_LOOP_CHARGE_BAR, 0, 0, 0); + sfx_play_sound_with_params(SOUND_LOOP_CHARGE_METER, 0, 0, 0); acs->state = AC_STATE_ACTIVE; // fallthrough case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // bar can drain if it hasn't been fully filled - if (!acs->isBarFilled) { + // meter can drain if it hasn't been fully filled + if (!acs->isMeterFilled) { if (acs->statusChance != 0) { s32 maxFillLevel = acs->mashMeterCutoffs[acs->mashMeterNumIntervals]; - acs->barFillLevel -= GET_DRAIN_RATE (acs->barFillLevel / maxFillLevel); - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= GET_DRAIN_RATE (acs->meterFillLevel / maxFillLevel); + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } else { - acs->barFillLevel -= 10; - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= 10; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } } - // check for bar-filling input + // check for meter-filling input if (battleStatus->curButtonsPressed & BUTTON_A) { s32 difficultyPct = battleStatus->actionCmdDifficultyTable[acs->difficulty]; s32 effectivenessPct = METER_FILL_TICK * acs->statusChance; @@ -174,33 +174,33 @@ void N(update)(void) { s32 fillAmt = (difficultyPct * effectivenessPct) / (100 * 100); if (fillAmt != 0) { - acs->barFillLevel += fillAmt; + acs->meterFillLevel += fillAmt; } else { - acs->barFillLevel += ONE_PCT_MASH; - if (acs->barFillLevel >= 5 * ONE_PCT_MASH) { - acs->barFillLevel = 5 * ONE_PCT_MASH; + acs->meterFillLevel += ONE_PCT_MASH; + if (acs->meterFillLevel >= 5 * ONE_PCT_MASH) { + acs->meterFillLevel = 5 * ONE_PCT_MASH; } } } - // handle bar reaching 100% - if (acs->barFillLevel >= MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; - acs->isBarFilled = TRUE; + // handle meter reaching 100% + if (acs->meterFillLevel >= MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; + acs->isMeterFilled = TRUE; hid = acs->hudElements[HIDX_100_PCT]; hud_element_set_render_pos(hid, acs->hudPosX + 50, acs->hudPosY + 28); hud_element_clear_flags(hid, HUD_ELEMENT_FLAG_DISABLED); } - battleStatus->actionProgress = acs->barFillLevel / ONE_PCT_MASH; - sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_BAR, 0, 0, battleStatus->actionProgress * 12); + battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH; + sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_METER, 0, 0, battleStatus->actionProgress * 12); if (acs->stateTimer != 0) { acs->stateTimer--; break; } - fillLevel = acs->barFillLevel; + fillLevel = acs->meterFillLevel; if (acs->statusChance == 0) { fillLevel = 0; } @@ -223,16 +223,16 @@ void N(update)(void) { // only could 100% fill as success for this action command increment_action_command_success_count(); } - sfx_stop_sound(SOUND_LOOP_CHARGE_BAR); + sfx_stop_sound(SOUND_LOOP_CHARGE_METER); btl_set_popup_duration(POPUP_MSG_OFF); acs->stateTimer = 5; acs->state = AC_STATE_DISPOSE; break; case AC_STATE_DISPOSE: if (acs->statusChance == 0) { - acs->barFillLevel -= 100; - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= 100; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } diff --git a/src/battle/action_cmd/fire_shell.c b/src/battle/action_cmd/fire_shell.c index 9df8d25888..deb4c67a57 100644 --- a/src/battle/action_cmd/fire_shell.c +++ b/src/battle/action_cmd/fire_shell.c @@ -45,9 +45,9 @@ API_CALLABLE(N(init)) { acs->hudPrepareTime = 30; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; - acs->isBarFilled = FALSE; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; + acs->isMeterFilled = FALSE; battleStatus->actionQuality = 0; acs->hudPosX = -48; acs->hudPosY = 80; @@ -92,8 +92,8 @@ API_CALLABLE(N(start)) { acs->statusChance = evt_get_variable(script, *args++); // unused acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_NONE; battleStatus->maxActionQuality = acs->mashMeterCutoffs[(acs->mashMeterNumIntervals - 1)]; @@ -147,28 +147,28 @@ void N(update)(void) { return; } hud_element_set_script(acs->hudElements[HIDX_STICK], &HES_StickMashLeft); - acs->barFillLevel = 0; + acs->meterFillLevel = 0; battleStatus->resultTier = 0; acs->fireShell.holdingLeft = FALSE; acs->stateTimer = acs->duration; - sfx_play_sound_with_params(SOUND_LOOP_CHARGE_BAR, 0, 0, 0); + sfx_play_sound_with_params(SOUND_LOOP_CHARGE_METER, 0, 0, 0); acs->state = AC_STATE_ACTIVE; // fallthrough case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // bar can drain if it hasn't been fully filled - if (!acs->isBarFilled) { + // meter can drain if it hasn't been fully filled + if (!acs->isMeterFilled) { cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals]; - acs->barFillLevel -= GET_DRAIN_RATE(acs->barFillLevel / cutoff); - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= GET_DRAIN_RATE(acs->meterFillLevel / cutoff); + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } - // check for bar-filling input - if (!acs->isBarFilled) { + // check for meter-filling input + if (!acs->isMeterFilled) { if (battleStatus->curButtonsDown & BUTTON_STICK_LEFT) { acs->fireShell.holdingLeft = TRUE; } @@ -176,33 +176,33 @@ void N(update)(void) { if (!(battleStatus->curButtonsDown & BUTTON_STICK_LEFT)) { if (acs->fireShell.holdingLeft != 0) { s32 difficultyPct = battleStatus->actionCmdDifficultyTable[acs->difficulty]; - acs->barFillLevel += SCALE_BY_PCT(METER_FILL_TICK, difficultyPct); + acs->meterFillLevel += SCALE_BY_PCT(METER_FILL_TICK, difficultyPct); acs->fireShell.holdingLeft = FALSE; } } - // right stick inputs actively drain the bar + // right stick inputs actively drain the meter if (battleStatus->curButtonsPressed & BUTTON_STICK_RIGHT) { s32 difficultyPct = battleStatus->actionCmdDifficultyTable[acs->difficulty]; - acs->barFillLevel -= SCALE_BY_PCT(METER_FILL_TICK, difficultyPct); + acs->meterFillLevel -= SCALE_BY_PCT(METER_FILL_TICK, difficultyPct); } } - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } - // handle bar reaching 100% - if (acs->barFillLevel > MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; - acs->isBarFilled = TRUE; + // handle meter reaching 100% + if (acs->meterFillLevel > MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; + acs->isMeterFilled = TRUE; hid = acs->hudElements[HIDX_100_PCT]; hud_element_set_render_pos(hid, acs->hudPosX + 50, acs->hudPosY + 28); hud_element_clear_flags(hid, HUD_ELEMENT_FLAG_DISABLED); } - battleStatus->actionProgress = acs->barFillLevel / ONE_PCT_MASH; - sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_BAR, 0, 0, battleStatus->actionProgress * 12); + battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH; + sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_METER, 0, 0, battleStatus->actionProgress * 12); // resultTier is not used by this move; uses actionProgress instead via the move script switch (partner->actorBlueprint->level) { @@ -237,10 +237,10 @@ void N(update)(void) { break; } - if (acs->barFillLevel == 0) { + if (acs->meterFillLevel == 0) { battleStatus->actionQuality = AC_QUALITY_FAILED; } else { - battleStatus->actionQuality = acs->barFillLevel / ONE_PCT_MASH; + battleStatus->actionQuality = acs->meterFillLevel / ONE_PCT_MASH; } cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals - 1]; @@ -255,7 +255,7 @@ void N(update)(void) { increment_action_command_success_count(); } - sfx_stop_sound(SOUND_LOOP_CHARGE_BAR); + sfx_stop_sound(SOUND_LOOP_CHARGE_METER); btl_set_popup_duration(POPUP_MSG_OFF); acs->stateTimer = 5; acs->state = AC_STATE_DISPOSE; diff --git a/src/battle/action_cmd/flee.c b/src/battle/action_cmd/flee.c index 71f46de6c6..cf7df11bfd 100644 --- a/src/battle/action_cmd/flee.c +++ b/src/battle/action_cmd/flee.c @@ -37,12 +37,12 @@ API_CALLABLE(N(init)) { acs->actionCommandID = ACTION_COMMAND_FLEE; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = acs->escapeChance * 100; + acs->meterFillLevel = acs->escapeChance * 100; acs->escapeThreshold = rand_int(50); - acs->barFillWidth = 0; + acs->meterFillWidth = 0; acs->flee.dir = 1; acs->escapeChance = rand_int(1); - acs->isBarFilled = FALSE; + acs->isMeterFilled = FALSE; battleStatus->actionQuality = 0; N(HasStarted) = FALSE; acs->hudPosX = -48; @@ -162,21 +162,21 @@ void N(update)(void) { // fallthrough case AC_STATE_ACTIVE: - // check for bar-filling input + // check for meter-filling input if (battleStatus->actionCommandMode != AC_MODE_NOT_LEARNED && (battleStatus->curButtonsPressed & BUTTON_A)) { - acs->barFillLevel += SCALE_BY_PCT(METER_FILL_RATE, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel += SCALE_BY_PCT(METER_FILL_RATE, battleStatus->actionCmdDifficultyTable[acs->difficulty]); } - // handle bar reaching 100% - if (acs->barFillLevel >= MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; - acs->isBarFilled = TRUE; + // handle meter reaching 100% + if (acs->meterFillLevel >= MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; + acs->isMeterFilled = TRUE; hid = acs->hudElements[HIDX_100_PCT]; hud_element_set_render_pos(hid, acs->hudPosX + 50, acs->hudPosY + 28); hud_element_clear_flags(hid, HUD_ELEMENT_FLAG_DISABLED); } - battleStatus->actionQuality = acs->barFillLevel / ONE_PCT_MASH; + battleStatus->actionQuality = acs->meterFillLevel / ONE_PCT_MASH; if (acs->stateTimer != 0) { acs->stateTimer--; @@ -247,11 +247,11 @@ void N(draw)(void) { hud_element_get_render_pos(hid, &hudX, &hudY); if (!N(HasStarted)) { - draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH, 1); - } else if (!acs->isBarFilled) { - draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH, 4); + draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH, 1); + } else if (!acs->isMeterFilled) { + draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH, 4); } else { - draw_mash_meter_blink(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH); + draw_mash_meter_blink(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH); } hud_element_draw_clipped(acs->hudElements[HIDX_RUN_AWAY]); diff --git a/src/battle/action_cmd/hammer.c b/src/battle/action_cmd/hammer.c index 50056f3e13..5e84569dce 100644 --- a/src/battle/action_cmd/hammer.c +++ b/src/battle/action_cmd/hammer.c @@ -7,7 +7,7 @@ extern s32 actionCmdTableHammer[]; // indices into ActionCommandStatus::hudElements for this action command enum { - HIDX_BAR = 0, + HIDX_FRAME = 0, HIDX_WAIT = 1, HIDX_CHARGE_A = 2, HIDX_CHARGE_B = 3, @@ -39,7 +39,7 @@ API_CALLABLE(N(init)) { acs->hudPosY = 96; hid = hud_element_create(&HES_TimingBar1Chance); - acs->hudElements[HIDX_BAR] = hid; + acs->hudElements[HIDX_FRAME] = hid; hud_element_set_flags(hid, HUD_ELEMENT_FLAG_80 | HUD_ELEMENT_FLAG_DISABLED); hud_element_set_render_pos(hid, acs->hudPosX, acs->hudPosY); hud_element_set_render_depth(hid, 10); @@ -134,7 +134,7 @@ void N(update)(void) { case AC_STATE_INIT: btl_set_popup_duration(POPUP_MSG_ON); - hid = acs->hudElements[HIDX_BAR]; + hid = acs->hudElements[HIDX_FRAME]; if (acs->showHud) { hud_element_clear_flags(hid, HUD_ELEMENT_FLAG_DISABLED); } @@ -178,7 +178,7 @@ void N(update)(void) { if (acs->hudPosX > 50) { acs->hudPosX = 50; } - hud_element_set_render_pos(acs->hudElements[HIDX_BAR], acs->hudPosX, acs->hudPosY); + hud_element_set_render_pos(acs->hudElements[HIDX_FRAME], acs->hudPosX, acs->hudPosY); hud_element_set_render_pos(acs->hudElements[HIDX_WAIT], acs->hudPosX + 21, acs->hudPosY - 3); hud_element_set_render_pos(acs->hudElements[HIDX_CHARGE_A], acs->hudPosX + 5, acs->hudPosY + 1); hud_element_set_render_pos(acs->hudElements[HIDX_CHARGE_B], acs->hudPosX - 7, acs->hudPosY + 1); @@ -196,7 +196,7 @@ void N(update)(void) { case AC_STATE_START: btl_set_popup_duration(POPUP_MSG_ON); if (acs->prepareTime < 15) { - hud_element_set_alpha(acs->hudElements[HIDX_BAR], 255); + hud_element_set_alpha(acs->hudElements[HIDX_FRAME], 255); hud_element_set_alpha(acs->hudElements[HIDX_WAIT], 255); hud_element_set_alpha(acs->hudElements[HIDX_CHARGE_A], 255); hud_element_set_alpha(acs->hudElements[HIDX_CHARGE_B], 255); @@ -333,7 +333,7 @@ void N(update)(void) { } void N(draw)(void) { - hud_element_draw_clipped(gActionCommandStatus.hudElements[HIDX_BAR]); + hud_element_draw_clipped(gActionCommandStatus.hudElements[HIDX_FRAME]); hud_element_draw_clipped(gActionCommandStatus.hudElements[HIDX_WAIT]); hud_element_draw_clipped(gActionCommandStatus.hudElements[HIDX_CHARGE_A]); hud_element_draw_clipped(gActionCommandStatus.hudElements[HIDX_CHARGE_B]); @@ -343,7 +343,7 @@ void N(draw)(void) { } void N(free)(void) { - hud_element_free(gActionCommandStatus.hudElements[HIDX_BAR]); + hud_element_free(gActionCommandStatus.hudElements[HIDX_FRAME]); hud_element_free(gActionCommandStatus.hudElements[HIDX_WAIT]); hud_element_free(gActionCommandStatus.hudElements[HIDX_CHARGE_A]); hud_element_free(gActionCommandStatus.hudElements[HIDX_CHARGE_B]); diff --git a/src/battle/action_cmd/hurricane.c b/src/battle/action_cmd/hurricane.c index e19396af6c..89b6e955d0 100644 --- a/src/battle/action_cmd/hurricane.c +++ b/src/battle/action_cmd/hurricane.c @@ -39,9 +39,9 @@ API_CALLABLE(N(init)) { acs->hudPosX = -48; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; - acs->isBarFilled = FALSE; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; + acs->isMeterFilled = FALSE; acs->hudPosY = 80; hid = hud_element_create(&HES_AButton); @@ -90,8 +90,8 @@ API_CALLABLE(N(start)) { acs->statusChance = evt_get_variable(script, *args++); // average chance for enemies to be affected acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_FAIL; acs->state = AC_STATE_START; @@ -160,7 +160,7 @@ void N(update)(void) { } hud_element_set_script(acs->hudElements[HIDX_A_BUTTON], &HES_MashAButton); hud_element_set_script(acs->hudElements[HIDX_B_BUTTON], &HES_MashBButton1); - acs->barFillLevel = 0; + acs->meterFillLevel = 0; acs->any.unk_5C = 0; acs->stateTimer = acs->duration; acs->state = AC_STATE_ACTIVE; @@ -169,18 +169,18 @@ void N(update)(void) { case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // bar can drain if it hasn't been fully filled - if (!acs->isBarFilled) { + // meter can drain if it hasn't been fully filled + if (!acs->isMeterFilled) { if (acs->statusChance != 0) { cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals]; - acs->barFillLevel -= GET_DRAIN_RATE(acs->barFillLevel / cutoff); - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= GET_DRAIN_RATE(acs->meterFillLevel / cutoff); + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } else { - acs->barFillLevel -= 10; - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= 10; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } } @@ -217,12 +217,12 @@ void N(update)(void) { // TODO: Find a way to avoid reusing buttonsPushed. buttonsPushed = amt; - acs->barFillLevel += buttonsPushed; + acs->meterFillLevel += buttonsPushed; } else { - acs->barFillLevel += ONE_PCT_MASH; + acs->meterFillLevel += ONE_PCT_MASH; - if (acs->barFillLevel >= 5 * ONE_PCT_MASH) { - acs->barFillLevel = 5 * ONE_PCT_MASH; + if (acs->meterFillLevel >= 5 * ONE_PCT_MASH) { + acs->meterFillLevel = 5 * ONE_PCT_MASH; } } @@ -243,16 +243,16 @@ void N(update)(void) { } } - // handle bar reaching 100% - if (acs->barFillLevel > MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; - acs->isBarFilled = TRUE; + // handle meter reaching 100% + if (acs->meterFillLevel > MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; + acs->isMeterFilled = TRUE; hid = acs->hudElements[HIDX_100_PCT]; hud_element_set_render_pos(hid, acs->hudPosX + 50, acs->hudPosY + 28); hud_element_clear_flags(hid, HUD_ELEMENT_FLAG_DISABLED); } - battleStatus->actionProgress = acs->barFillLevel / ONE_PCT_MASH; + battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH; if (acs->stateTimer != 0) { acs->stateTimer--; @@ -262,7 +262,7 @@ void N(update)(void) { // Again, reusing buttonsPushed specifically for reg-alloc. See above. // // TODO: Find a way to avoid reusing buttonsPushed. - buttonsPushed = acs->barFillLevel; + buttonsPushed = acs->meterFillLevel; if (acs->statusChance == 0) { buttonsPushed = 0; } @@ -273,7 +273,7 @@ void N(update)(void) { battleStatus->actionQuality = buttonsPushed / ONE_PCT_MASH; } - // a good result is filling the bar over halfway to the second-highest interval + // a good result is filling the meter over halfway to the second-highest interval cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals - 1]; if (battleStatus->actionProgress <= cutoff / 2) { battleStatus->actionResult = ACTION_RESULT_METER_BELOW_HALF; @@ -292,9 +292,9 @@ void N(update)(void) { break; case AC_STATE_DISPOSE: if (acs->statusChance == 0) { - acs->barFillLevel -= ONE_PCT_MASH; - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= ONE_PCT_MASH; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } @@ -319,10 +319,10 @@ void N(draw)(void) { hud_element_draw_clipped(hid); hud_element_get_render_pos(hid, &hudX, &hudY); - if (!acs->isBarFilled) { - draw_mash_meter_multicolor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH); + if (!acs->isMeterFilled) { + draw_mash_meter_multicolor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH); } else { - draw_mash_meter_blink(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH); + draw_mash_meter_blink(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH); } hud_element_draw_clipped(acs->hudElements[HIDX_100_PCT]); diff --git a/src/battle/action_cmd/mega_shock.c b/src/battle/action_cmd/mega_shock.c index 4dcd8b810e..99b03c8c66 100644 --- a/src/battle/action_cmd/mega_shock.c +++ b/src/battle/action_cmd/mega_shock.c @@ -41,9 +41,9 @@ API_CALLABLE(N(init)) { acs->state = AC_STATE_INIT; acs->hudPrepareTime = 30; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; - acs->isBarFilled = FALSE; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; + acs->isMeterFilled = FALSE; acs->hudPosX = -48; acs->hudPosY = 80; @@ -93,8 +93,8 @@ API_CALLABLE(N(start)) { acs->statusChance = evt_get_variable(script, *args++); // average chance for enemies to be affected acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_FAIL; acs->state = AC_STATE_START; @@ -163,28 +163,28 @@ void N(update)(void) { } hud_element_set_script(acs->hudElements[HIDX_A_BUTTON], &HES_MashAButton); hud_element_set_script(acs->hudElements[HIDX_B_BUTTON], &HES_MashBButton1); - acs->barFillLevel = 0; + acs->meterFillLevel = 0; acs->any.unk_5C = 0; acs->stateTimer = acs->duration; - sfx_play_sound_with_params(SOUND_LOOP_CHARGE_BAR, 0, 0, 0); + sfx_play_sound_with_params(SOUND_LOOP_CHARGE_METER, 0, 0, 0); acs->state = AC_STATE_ACTIVE; // fallthrough case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // bar can drain if it hasn't been fully filled - if (!acs->isBarFilled) { + // meter can drain if it hasn't been fully filled + if (!acs->isMeterFilled) { if (acs->statusChance != 0) { cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals]; - acs->barFillLevel -= GET_DRAIN_RATE(acs->barFillLevel / cutoff); - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= GET_DRAIN_RATE(acs->meterFillLevel / cutoff); + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } else { - acs->barFillLevel -= 10; - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= 10; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } } @@ -221,12 +221,12 @@ void N(update)(void) { // TODO: Find a way to avoid reusing buttonsPushed. buttonsPushed = amt; - acs->barFillLevel += buttonsPushed; + acs->meterFillLevel += buttonsPushed; } else { - acs->barFillLevel += ONE_PCT_MASH; + acs->meterFillLevel += ONE_PCT_MASH; - if (acs->barFillLevel >= 5 * ONE_PCT_MASH) { - acs->barFillLevel = 5 * ONE_PCT_MASH; + if (acs->meterFillLevel >= 5 * ONE_PCT_MASH) { + acs->meterFillLevel = 5 * ONE_PCT_MASH; } } @@ -247,16 +247,16 @@ void N(update)(void) { } } - if (acs->barFillLevel > MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; - acs->isBarFilled = TRUE; + if (acs->meterFillLevel > MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; + acs->isMeterFilled = TRUE; hid = acs->hudElements[HIDX_100_PCT]; hud_element_set_render_pos(hid, acs->hudPosX + 50, acs->hudPosY + 28); hud_element_clear_flags(hid, HUD_ELEMENT_FLAG_DISABLED); } - battleStatus->actionProgress = acs->barFillLevel / ONE_PCT_MASH; - sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_BAR, 0, 0, battleStatus->actionProgress * 12); + battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH; + sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_METER, 0, 0, battleStatus->actionProgress * 12); if (acs->stateTimer != 0) { acs->stateTimer--; @@ -266,7 +266,7 @@ void N(update)(void) { // Again, reusing buttonsPushed specifically for reg-alloc. See above. // // TODO: Find a way to avoid reusing buttonsPushed. - buttonsPushed = acs->barFillLevel; + buttonsPushed = acs->meterFillLevel; if (acs->statusChance == 0) { buttonsPushed = 0; } @@ -277,7 +277,7 @@ void N(update)(void) { battleStatus->actionQuality = buttonsPushed / ONE_PCT_MASH; } - // a good result is filling the bar over halfway to the second-highest interval + // a good result is filling the meter over halfway to the second-highest interval cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals - 1]; if (battleStatus->actionProgress <= cutoff / 2) { battleStatus->actionResult = ACTION_RESULT_METER_BELOW_HALF; @@ -290,16 +290,16 @@ void N(update)(void) { increment_action_command_success_count(); } - sfx_stop_sound(SOUND_LOOP_CHARGE_BAR); + sfx_stop_sound(SOUND_LOOP_CHARGE_METER); btl_set_popup_duration(POPUP_MSG_OFF); acs->stateTimer = 5; acs->state = AC_STATE_DISPOSE; break; case AC_STATE_DISPOSE: if (acs->statusChance == 0) { - acs->barFillLevel -= ONE_PCT_MASH; - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= ONE_PCT_MASH; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } @@ -324,10 +324,10 @@ void N(draw)(void) { hud_element_draw_clipped(hid); hud_element_get_render_pos(hid, &hudX, &hudY); - if (!acs->isBarFilled) { - draw_mash_meter_multicolor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH); + if (!acs->isMeterFilled) { + draw_mash_meter_multicolor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH); } else { - draw_mash_meter_blink(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH); + draw_mash_meter_blink(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH); } hud_element_draw_clipped(acs->hudElements[HIDX_100_PCT]); diff --git a/src/battle/action_cmd/power_shock.c b/src/battle/action_cmd/power_shock.c index 386fa76ff5..e646b29b95 100644 --- a/src/battle/action_cmd/power_shock.c +++ b/src/battle/action_cmd/power_shock.c @@ -52,11 +52,11 @@ API_CALLABLE(N(init)) { acs->actionCommandID = ACTION_COMMAND_POWER_SHOCK; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; acs->escapeThreshold = rand_int(100); acs->hudPrepareTime = 30; - acs->isBarFilled = FALSE; + acs->isMeterFilled = FALSE; acs->thresholdMoveDir = 0; N(HasStarted) = FALSE; @@ -111,8 +111,8 @@ API_CALLABLE(N(start)) { acs->statusChance = evt_get_variable(script, *args++); // chance for enemy to be affected acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_FAIL; acs->state = AC_STATE_START; @@ -175,66 +175,66 @@ void N(update)(void) { break; } hud_element_set_script(acs->hudElements[HIDX_BUTTON], &HES_MashAButton); - acs->barFillLevel = 0; + acs->meterFillLevel = 0; acs->any.unk_5C = 0; N(HasStarted) = TRUE; acs->stateTimer = acs->duration; - sfx_play_sound_with_params(SOUND_LOOP_CHARGE_BAR, 0, 0, 0); + sfx_play_sound_with_params(SOUND_LOOP_CHARGE_METER, 0, 0, 0); acs->state = AC_STATE_ACTIVE; // fallthrough case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // bar can drain if it hasn't been fully filled - if (!acs->isBarFilled) { + // meter can drain if it hasn't been fully filled + if (!acs->isMeterFilled) { if (acs->statusChance != 0) { cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals]; - acs->barFillLevel -= GET_DRAIN_RATE(acs->barFillLevel / cutoff); - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= GET_DRAIN_RATE(acs->meterFillLevel / cutoff); + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } else { - acs->barFillLevel -= 10; - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= 10; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } } - // check for bar-filling input + // check for meter-filling input if (battleStatus->curButtonsPressed & BUTTON_A) { if (acs->statusChance != 0) { s32 difficultyPct = battleStatus->actionCmdDifficultyTable[acs->difficulty]; amt = SCALE_BY_PCT(SCALE_BY_PCT(METER_FILL_TICK, difficultyPct), acs->statusChance); - acs->barFillLevel += amt; + acs->meterFillLevel += amt; } else { - acs->barFillLevel += ONE_PCT_MASH; - if (acs->barFillLevel >= 5 * ONE_PCT_MASH) { - acs->barFillLevel = 5 * ONE_PCT_MASH; + acs->meterFillLevel += ONE_PCT_MASH; + if (acs->meterFillLevel >= 5 * ONE_PCT_MASH) { + acs->meterFillLevel = 5 * ONE_PCT_MASH; } } } - // handle bar reaching 100% - if (acs->barFillLevel > MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; - acs->isBarFilled = TRUE; + // handle meter reaching 100% + if (acs->meterFillLevel > MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; + acs->isMeterFilled = TRUE; hid = acs->hudElements[HIDX_100_PCT]; hud_element_set_render_pos(hid, acs->hudPosX + 50, acs->hudPosY + 28); hud_element_clear_flags(hid, HUD_ELEMENT_FLAG_DISABLED); } - battleStatus->actionProgress = acs->barFillLevel / ONE_PCT_MASH; - sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_BAR, 0, 0, battleStatus->actionProgress * 12); + battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH; + sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_METER, 0, 0, battleStatus->actionProgress * 12); if (acs->stateTimer != 0) { acs->stateTimer--; break; } - amt = acs->barFillLevel; + amt = acs->meterFillLevel; if (acs->statusChance == 0) { amt = 0; } @@ -248,7 +248,7 @@ void N(update)(void) { battleStatus->actionQuality = 0; } - // a good result is filling the bar over halfway to the second-highest interval + // a good result is filling the meter over halfway to the second-highest interval cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals - 1]; if (battleStatus->actionProgress <= cutoff / 2) { battleStatus->actionResult = ACTION_RESULT_METER_BELOW_HALF; @@ -260,16 +260,16 @@ void N(update)(void) { increment_action_command_success_count(); } - sfx_stop_sound(SOUND_LOOP_CHARGE_BAR); + sfx_stop_sound(SOUND_LOOP_CHARGE_METER); btl_set_popup_duration(POPUP_MSG_OFF); acs->stateTimer = 5; acs->state = AC_STATE_DISPOSE; break; case AC_STATE_DISPOSE: if (acs->statusChance == 0) { - acs->barFillLevel -= ONE_PCT_MASH; - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= ONE_PCT_MASH; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } if (acs->stateTimer != 0) { @@ -318,11 +318,11 @@ void N(draw)(void) { hud_element_get_render_pos(hid, &hudX, &hudY); if (!N(HasStarted)) { - draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH, 1); - } else if (!acs->isBarFilled) { - draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH, 4); + draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH, 1); + } else if (!acs->isMeterFilled) { + draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH, 4); } else { - draw_mash_meter_blink_with_divisor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH, 4); + draw_mash_meter_blink_with_divisor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH, 4); } hid = acs->hudElements[HIDX_100_PCT]; hud_element_draw_clipped(hid); diff --git a/src/battle/action_cmd/smack.c b/src/battle/action_cmd/smack.c index a40c8d0466..743f0346fa 100644 --- a/src/battle/action_cmd/smack.c +++ b/src/battle/action_cmd/smack.c @@ -46,9 +46,9 @@ API_CALLABLE(N(init)) { acs->hudPrepareTime = 30; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; - acs->isBarFilled = FALSE; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; + acs->isMeterFilled = FALSE; battleStatus->actionQuality = 0; battleStatus->actionProgress = 0; acs->hudPosX = -48; @@ -94,8 +94,8 @@ API_CALLABLE(N(start)) { acs->variation = evt_get_variable(script, *args++); acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_NONE; battleStatus->maxActionQuality = acs->mashMeterCutoffs[(acs->mashMeterNumIntervals - 1)]; @@ -152,28 +152,28 @@ void N(update)(void) { break; } hud_element_set_script(acs->hudElements[HIDX_STICK], &HES_StickMashLeft); - acs->barFillLevel = 0; + acs->meterFillLevel = 0; battleStatus->resultTier = 0; acs->smack.holdingLeft = FALSE; acs->stateTimer = acs->duration; - sfx_play_sound_with_params(SOUND_LOOP_CHARGE_BAR, 0, 0, 0); + sfx_play_sound_with_params(SOUND_LOOP_CHARGE_METER, 0, 0, 0); acs->state = AC_STATE_ACTIVE; // fallthrough case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // bar can drain if it hasn't been fully filled - if (!acs->isBarFilled) { + // meter can drain if it hasn't been fully filled + if (!acs->isMeterFilled) { cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals]; - acs->barFillLevel -= GET_DRAIN_RATE(acs->barFillLevel / cutoff); - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= GET_DRAIN_RATE(acs->meterFillLevel / cutoff); + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } - // check for bar-filling input - if (!acs->isBarFilled) { + // check for meter-filling input + if (!acs->isMeterFilled) { if (battleStatus->curButtonsDown & BUTTON_STICK_LEFT) { acs->smack.holdingLeft = TRUE; } @@ -182,35 +182,35 @@ void N(update)(void) { if (acs->smack.holdingLeft) { if (acs->variation == ACV_SMACK_HAND) { // regular smack - acs->barFillLevel += SCALE_BY_PCT(HAND_METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel += SCALE_BY_PCT(HAND_METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); } else { // fan smack - acs->barFillLevel += SCALE_BY_PCT(FAN_METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel += SCALE_BY_PCT(FAN_METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); } acs->smack.holdingLeft = FALSE; } } - // right stick inputs actively drain the bar + // right stick inputs actively drain the meter if (battleStatus->curButtonsPressed & BUTTON_STICK_RIGHT) { - acs->barFillLevel -= SCALE_BY_PCT(FAIL_METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel -= SCALE_BY_PCT(FAIL_METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); } } - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } - // handle bar reaching 100% - if (acs->barFillLevel > MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; - acs->isBarFilled = TRUE; + // handle meter reaching 100% + if (acs->meterFillLevel > MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; + acs->isMeterFilled = TRUE; hid = acs->hudElements[HIDX_100_PCT]; hud_element_set_render_pos(hid, acs->hudPosX + 50, acs->hudPosY + 28); hud_element_clear_flags(hid, HUD_ELEMENT_FLAG_DISABLED); } - battleStatus->actionProgress = acs->barFillLevel / ONE_PCT_MASH; - sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_BAR, 0, 0, battleStatus->actionProgress * 12); + battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH; + sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_METER, 0, 0, battleStatus->actionProgress * 12); switch (partnerActor->actorBlueprint->level) { case PARTNER_RANK_NORMAL: @@ -265,10 +265,10 @@ void N(update)(void) { break; } - if (acs->barFillLevel == 0) { + if (acs->meterFillLevel == 0) { battleStatus->actionQuality = AC_QUALITY_FAILED; } else { - battleStatus->actionQuality = acs->barFillLevel / ONE_PCT_MASH; + battleStatus->actionQuality = acs->meterFillLevel / ONE_PCT_MASH; } cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals - 1]; @@ -283,7 +283,7 @@ void N(update)(void) { } btl_set_popup_duration(POPUP_MSG_OFF); - sfx_stop_sound(SOUND_LOOP_CHARGE_BAR); + sfx_stop_sound(SOUND_LOOP_CHARGE_METER); acs->stateTimer = 5; acs->state = AC_STATE_DISPOSE; break; diff --git a/src/battle/action_cmd/spiny_surge.c b/src/battle/action_cmd/spiny_surge.c index fff0695136..1265c2dacc 100644 --- a/src/battle/action_cmd/spiny_surge.c +++ b/src/battle/action_cmd/spiny_surge.c @@ -39,9 +39,9 @@ API_CALLABLE(N(init)) { acs->actionCommandID = ACTION_COMMAND_SPINY_SURGE; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; - acs->isBarFilled = FALSE; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; + acs->isMeterFilled = FALSE; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_FAIL; acs->hudPrepareTime = 30; @@ -87,8 +87,8 @@ API_CALLABLE(N(start)) { acs->difficulty = adjust_action_command_difficulty(acs->difficulty); acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; acs->state = AC_STATE_START; battleStatus->flags1 &= ~BS_FLAGS1_FREE_ACTION_COMMAND; @@ -150,41 +150,41 @@ void N(update)(void) { acs->spinySurge.tossState = SPINY_SURGE_NONE; PrevButtons = 0; acs->stateTimer = acs->duration; - sfx_play_sound_with_params(SOUND_LOOP_CHARGE_BAR, 0, 0, 0); + sfx_play_sound_with_params(SOUND_LOOP_CHARGE_METER, 0, 0, 0); acs->state = AC_STATE_ACTIVE; // fallthrough case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // bar can drain if it hasn't been fully filled - if (!acs->isBarFilled) { + // meter can drain if it hasn't been fully filled + if (!acs->isMeterFilled) { cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals]; - acs->barFillLevel -= GET_DRAIN_RATE(acs->barFillLevel / cutoff); - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= GET_DRAIN_RATE(acs->meterFillLevel / cutoff); + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } - // check for bar-filling input - if (!acs->isBarFilled) { + // check for meter-filling input + if (!acs->isMeterFilled) { if (battleStatus->curButtonsPressed & BUTTON_STICK_LEFT) { - acs->barFillLevel += SCALE_BY_PCT(METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel += SCALE_BY_PCT(METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); } - // right stick inputs actively drain the bar + // right stick inputs actively drain the meter if (battleStatus->curButtonsPressed & BUTTON_STICK_RIGHT) { - acs->barFillLevel -= SCALE_BY_PCT(METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel -= SCALE_BY_PCT(METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); } } - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } - // handle bar reaching 100% - if (acs->barFillLevel > MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; - acs->isBarFilled = TRUE; + // handle meter reaching 100% + if (acs->meterFillLevel > MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; + acs->isMeterFilled = TRUE; hid = acs->hudElements[HIDX_100_PCT]; hud_element_set_render_pos(hid, acs->hudPosX + 50, acs->hudPosY + 28); hud_element_clear_flags(hid, HUD_ELEMENT_FLAG_DISABLED); @@ -203,21 +203,21 @@ void N(update)(void) { ) { acs->spinySurge.tossState = SPINY_SURGE_THROW; } - battleStatus->actionQuality = acs->barFillLevel / ONE_PCT_MASH; + battleStatus->actionQuality = acs->meterFillLevel / ONE_PCT_MASH; PrevButtons = battleStatus->curButtonsDown; battleStatus->actionProgress = acs->spinySurge.tossState; - sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_BAR, 0, 0, battleStatus->actionQuality * 12); + sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_METER, 0, 0, battleStatus->actionQuality * 12); if (acs->stateTimer != 0) { acs->stateTimer--; break; } - if (acs->barFillLevel == 0) { + if (acs->meterFillLevel == 0) { battleStatus->actionQuality = AC_QUALITY_FAILED; } else { - battleStatus->actionQuality = acs->barFillLevel / ONE_PCT_MASH; + battleStatus->actionQuality = acs->meterFillLevel / ONE_PCT_MASH; } cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals - 1]; @@ -233,7 +233,7 @@ void N(update)(void) { } btl_set_popup_duration(POPUP_MSG_OFF); - sfx_stop_sound(SOUND_LOOP_CHARGE_BAR); + sfx_stop_sound(SOUND_LOOP_CHARGE_METER); acs->stateTimer = 5; acs->state = AC_STATE_DISPOSE; break; diff --git a/src/battle/action_cmd/spook.c b/src/battle/action_cmd/spook.c index 183f9579f3..b054704dad 100644 --- a/src/battle/action_cmd/spook.c +++ b/src/battle/action_cmd/spook.c @@ -38,9 +38,9 @@ API_CALLABLE(N(init)) { acs->hudPrepareTime = 30; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; - acs->isBarFilled = FALSE; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; + acs->isMeterFilled = FALSE; battleStatus->actionQuality = 0; battleStatus->actionProgress = 0; acs->hudPosX = -48; @@ -86,8 +86,8 @@ API_CALLABLE(N(start)) { acs->statusChance = evt_get_variable(script, *args++); // average chance for enemies to be affected acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_NONE; battleStatus->maxActionQuality = acs->mashMeterCutoffs[(acs->mashMeterNumIntervals - 1)]; @@ -141,35 +141,35 @@ void N(update)(void) { return; } hud_element_set_script(acs->hudElements[HIDX_STICK], &HES_StickMashLeft); - acs->barFillLevel = 0; + acs->meterFillLevel = 0; battleStatus->actionProgress = 0; acs->spook.holdingLeft = FALSE; acs->stateTimer = acs->duration; - sfx_play_sound_with_params(SOUND_LOOP_CHARGE_BAR, 0, 0, 0); + sfx_play_sound_with_params(SOUND_LOOP_CHARGE_METER, 0, 0, 0); acs->state = AC_STATE_ACTIVE; // fallthrough case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // bar can drain if it hasn't been fully filled - if (!acs->isBarFilled) { + // meter can drain if it hasn't been fully filled + if (!acs->isMeterFilled) { if (acs->statusChance != 0) { cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals]; - acs->barFillLevel -= GET_DRAIN_RATE(acs->barFillLevel / cutoff); - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= GET_DRAIN_RATE(acs->meterFillLevel / cutoff); + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } else { - acs->barFillLevel -= 10; - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= 10; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } } - // check for bar-filling input - if (!acs->isBarFilled) { + // check for meter-filling input + if (!acs->isMeterFilled) { if (acs->statusChance != 0) { if (battleStatus->curButtonsDown & BUTTON_STICK_LEFT) { @@ -180,7 +180,7 @@ void N(update)(void) { s32 a = battleStatus->actionCmdDifficultyTable[acs->difficulty]; s32 b = METER_FILL_TICK * acs->statusChance; // divide by 100 for each percent-based multiplier - acs->barFillLevel += (a * b) / (100 * 100); + acs->meterFillLevel += (a * b) / (100 * 100); acs->spook.holdingLeft = FALSE; } @@ -188,7 +188,7 @@ void N(update)(void) { s32 a = battleStatus->actionCmdDifficultyTable[acs->difficulty]; s32 b = METER_FILL_TICK * acs->statusChance; // divide by 100 for each percent-based multiplier - acs->barFillLevel -= (a * b) / (100 * 100); + acs->meterFillLevel -= (a * b) / (100 * 100); } } else { if (battleStatus->curButtonsDown & BUTTON_STICK_LEFT) { @@ -196,41 +196,41 @@ void N(update)(void) { } if (!(battleStatus->curButtonsDown & BUTTON_STICK_LEFT) && acs->spook.holdingLeft) { - acs->barFillLevel += ONE_PCT_MASH; - if (acs->barFillLevel >= 5 * ONE_PCT_MASH) { - acs->barFillLevel = 5 * ONE_PCT_MASH; + acs->meterFillLevel += ONE_PCT_MASH; + if (acs->meterFillLevel >= 5 * ONE_PCT_MASH) { + acs->meterFillLevel = 5 * ONE_PCT_MASH; } acs->spook.holdingLeft = FALSE; } if (battleStatus->curButtonsPressed & BUTTON_STICK_RIGHT) { - acs->barFillLevel -= ONE_PCT_MASH; + acs->meterFillLevel -= ONE_PCT_MASH; } } } - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } - // handle bar reaching 100% - if (acs->barFillLevel > MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; - acs->isBarFilled = TRUE; + // handle meter reaching 100% + if (acs->meterFillLevel > MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; + acs->isMeterFilled = TRUE; hid = acs->hudElements[HIDX_100_PCT]; hud_element_set_render_pos(hid, acs->hudPosX + 50, acs->hudPosY + 28); hud_element_clear_flags(hid, HUD_ELEMENT_FLAG_DISABLED); } - battleStatus->actionProgress = acs->barFillLevel / ONE_PCT_MASH; - sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_BAR, 0, 0, battleStatus->actionProgress * 12); + battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH; + sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_METER, 0, 0, battleStatus->actionProgress * 12); if (acs->stateTimer != 0) { acs->stateTimer--; break; } - fillLevel = acs->barFillLevel; + fillLevel = acs->meterFillLevel; if (acs->statusChance == 0) { fillLevel = 0; } @@ -255,15 +255,15 @@ void N(update)(void) { } btl_set_popup_duration(POPUP_MSG_OFF); - sfx_stop_sound(SOUND_LOOP_CHARGE_BAR); + sfx_stop_sound(SOUND_LOOP_CHARGE_METER); acs->stateTimer = 5; acs->state = AC_STATE_DISPOSE; break; case AC_STATE_DISPOSE: if (acs->statusChance == 0) { - acs->barFillLevel -= ONE_PCT_MASH; - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= ONE_PCT_MASH; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } diff --git a/src/battle/action_cmd/squirt.c b/src/battle/action_cmd/squirt.c index e7fdaf69dc..5639001d58 100644 --- a/src/battle/action_cmd/squirt.c +++ b/src/battle/action_cmd/squirt.c @@ -38,8 +38,8 @@ API_CALLABLE(N(init)) { acs->actionCommandID = ACTION_COMMAND_SQUIRT; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionProgress = 0; acs->hudPosX = -48; acs->squirt.draining = FALSE; @@ -78,8 +78,8 @@ API_CALLABLE(N(start)) { acs->difficulty = adjust_action_command_difficulty(acs->difficulty); acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_FAIL; acs->state = AC_STATE_START; @@ -136,43 +136,43 @@ void N(update)(void) { } hud_element_set_script(acs->hudElements[HIDX_BUTTON], &HES_AButtonDown); - acs->barFillLevel = 0; + acs->meterFillLevel = 0; acs->squirt.draining = FALSE; acs->stateTimer = acs->duration; - sfx_play_sound_with_params(SOUND_LOOP_CHARGE_BAR, 0, 0, 0); + sfx_play_sound_with_params(SOUND_LOOP_CHARGE_METER, 0, 0, 0); acs->state = AC_STATE_ACTIVE; // fallthrough case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // bar filling and draining + // meter filling and draining cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals]; - fillPct = acs->barFillLevel / cutoff; + fillPct = acs->meterFillLevel / cutoff; if (!acs->squirt.draining) { if (!(battleStatus->curButtonsDown & BUTTON_A)) { - acs->barFillLevel -= GET_DRAIN_RATE(fillPct); - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= GET_DRAIN_RATE(fillPct); + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } } else { s32 amt = GET_FILL_RATE(fillPct); - acs->barFillLevel += SCALE_BY_PCT(amt, battleStatus->actionCmdDifficultyTable[acs->difficulty]); - if (acs->barFillLevel > MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; + acs->meterFillLevel += SCALE_BY_PCT(amt, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + if (acs->meterFillLevel > MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; acs->squirt.draining = TRUE; } } } else { - acs->barFillLevel -= METER_DRAIN_RATE; - if (acs->barFillLevel <= 0) { - acs->barFillLevel = 0; + acs->meterFillLevel -= METER_DRAIN_RATE; + if (acs->meterFillLevel <= 0) { + acs->meterFillLevel = 0; acs->squirt.draining = FALSE; } } - battleStatus->actionProgress = acs->barFillLevel / ONE_PCT_MASH; - sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_BAR, 0, 0, battleStatus->actionProgress * 12); + battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH; + sfx_adjust_env_sound_params(SOUND_LOOP_CHARGE_METER, 0, 0, battleStatus->actionProgress * 12); hid = acs->hudElements[HIDX_BUTTON]; if (fillPct < 80) { @@ -190,13 +190,13 @@ void N(update)(void) { break; } - if (acs->barFillLevel == 0) { + if (acs->meterFillLevel == 0) { battleStatus->actionQuality = AC_QUALITY_FAILED; } else { battleStatus->actionQuality = battleStatus->actionProgress; } - // a good result is filling the bar over halfway to the second-highest interval + // a good result is filling the meter over halfway to the second-highest interval cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals - 1]; if (battleStatus->actionProgress <= cutoff / 2) { battleStatus->actionResult = ACTION_RESULT_METER_BELOW_HALF; @@ -210,7 +210,7 @@ void N(update)(void) { } btl_set_popup_duration(POPUP_MSG_OFF); - sfx_stop_sound(SOUND_LOOP_CHARGE_BAR); + sfx_stop_sound(SOUND_LOOP_CHARGE_METER); acs->stateTimer = 5; acs->state = AC_STATE_DISPOSE; break; @@ -234,14 +234,14 @@ void N(draw)(void) { hud_element_draw_clipped(hid); hud_element_get_render_pos(hid, &hudX, &hudY); if (!acs->squirt.draining) { - draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH, 1); + draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH, 1); } else { - draw_mash_meter_mode_with_divisor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH, 1, MASH_METER_MODE_ONE_COLOR); + draw_mash_meter_mode_with_divisor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH, 1, MASH_METER_MODE_ONE_COLOR); } } void N(free)(void) { - sfx_stop_sound(SOUND_LOOP_CHARGE_BAR); + sfx_stop_sound(SOUND_LOOP_CHARGE_METER); hud_element_free(gActionCommandStatus.hudElements[HIDX_BUTTON]); hud_element_free(gActionCommandStatus.hudElements[HIDX_METER]); } diff --git a/src/battle/action_cmd/stop_leech.c b/src/battle/action_cmd/stop_leech.c index 985dad11a6..847a07a111 100644 --- a/src/battle/action_cmd/stop_leech.c +++ b/src/battle/action_cmd/stop_leech.c @@ -37,8 +37,8 @@ API_CALLABLE(N(init)) { acs->hudPosX = -48; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; acs->hudPosY = 80; hid = hud_element_create(&HES_AButton); @@ -73,8 +73,8 @@ API_CALLABLE(N(start)) { acs->difficulty = adjust_action_command_difficulty(acs->difficulty); acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_FAIL; acs->state = AC_STATE_START; @@ -119,7 +119,7 @@ void N(update)(void) { break; } hud_element_set_script(acs->hudElements[HIDX_BUTTON], &HES_MashAButton); - acs->barFillLevel = 0; + acs->meterFillLevel = 0; acs->state = AC_STATE_ACTIVE; acs->stateTimer = acs->duration; @@ -127,18 +127,18 @@ void N(update)(void) { case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // check for bar-filling input + // check for meter-filling input if (!acs->berserkerEnabled) { if (battleStatus->curButtonsPressed & BUTTON_A) { - acs->barFillLevel += SCALE_BY_PCT(METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel += SCALE_BY_PCT(METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); } } else { - acs->barFillLevel += SCALE_BY_PCT(METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]) / 6; - acs->barFillLevel += rand_int(SCALE_BY_PCT(METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]) / 6); + acs->meterFillLevel += SCALE_BY_PCT(METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]) / 6; + acs->meterFillLevel += rand_int(SCALE_BY_PCT(METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]) / 6); } - battleStatus->actionProgress = acs->barFillLevel / ONE_PCT_MASH; + battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH; - // handle filling the bar + // handle filling the meter if (acs->mashMeterCutoffs[acs->mashMeterNumIntervals] <= battleStatus->actionProgress) { acs->stateTimer = 0; } @@ -176,7 +176,7 @@ void N(draw)(void) { hid = acs->hudElements[HIDX_METER]; hud_element_draw_clipped(hid); hud_element_get_render_pos(hid, &hudX, &hudY); - draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH, 2); + draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH, 2); } void N(free)(void) { diff --git a/src/battle/action_cmd/three_chances.c b/src/battle/action_cmd/three_chances.c index d464d09b0c..7b2c39757b 100644 --- a/src/battle/action_cmd/three_chances.c +++ b/src/battle/action_cmd/three_chances.c @@ -107,8 +107,8 @@ API_CALLABLE(N(init)) { acs->actionCommandID = ACTION_COMMAND_THREE_CHANCES; acs->state = THREE_CHANCES_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; acs->variation = evt_get_variable(script, *args++); battleStatus->actionProgress = 1; acs->hudPrepareTime = 30; @@ -210,8 +210,8 @@ API_CALLABLE(N(start)) { acs->difficulty = adjust_action_command_difficulty(acs->difficulty); acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionProgress = 1; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_FAIL; diff --git a/src/battle/action_cmd/tidal_wave.c b/src/battle/action_cmd/tidal_wave.c index fd915201cb..53813465a6 100644 --- a/src/battle/action_cmd/tidal_wave.c +++ b/src/battle/action_cmd/tidal_wave.c @@ -52,8 +52,8 @@ API_CALLABLE(N(init)) { acs->actionCommandID = ACTION_COMMAND_TIDAL_WAVE; acs->state = TIDAL_WAVE_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionProgress = 0; acs->hudPosX = -48; acs->hudPosY = 80; @@ -93,8 +93,8 @@ API_CALLABLE(N(start)) { acs->difficulty = adjust_action_command_difficulty(acs->difficulty); acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionProgress = 0; battleStatus->actionResult = ACTION_RESULT_FAIL; @@ -280,9 +280,9 @@ void N(update)(void) { hud_element_set_scale(hid, 0.5f); hud_element_set_render_pos(hid, acs->hudPosX + ((acs->tidalWave.inputCount - 1) * 20), acs->hudPosY + 7); acs->tidalWave.inputCount++; - acs->barFillLevel += battleStatus->actionCmdDifficultyTable[acs->difficulty] * 18; - if (acs->barFillLevel > MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; + acs->meterFillLevel += battleStatus->actionCmdDifficultyTable[acs->difficulty] * 18; + if (acs->meterFillLevel > MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; } acs->state = TIDAL_WAVE_STATE_NEXT_BUTTON; battleStatus->actionProgress++; diff --git a/src/battle/action_cmd/unused_flee.c b/src/battle/action_cmd/unused_flee.c index f1fdb026a3..6812baa1b0 100644 --- a/src/battle/action_cmd/unused_flee.c +++ b/src/battle/action_cmd/unused_flee.c @@ -6,7 +6,7 @@ * The player must mash A to fill a meter up to an OK mark. * * Unlike the normal flee command, the OK mark does not move and the command will only - * succeed of the bar is filled. Once filled, it rapidly drains and must be refilled. + * succeed of the meter is filled. Once filled, it rapidly drains and must be refilled. */ #define NAMESPACE action_command_unused_flee @@ -41,9 +41,9 @@ API_CALLABLE(N(init)) { acs->actionCommandID = ACTION_COMMAND_UNUSED_FLEE; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = evt_get_variable(script, *args); + acs->meterFillLevel = evt_get_variable(script, *args); acs->hudPosX = -48; - acs->barFillWidth = 0; + acs->meterFillWidth = 0; N(HasStarted) = FALSE; acs->hudPosY = 80; @@ -153,31 +153,31 @@ void N(update)(void) { case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // check for bar-filling input + // check for meter-filling input if (battleStatus->curButtonsPressed & BUTTON_A) { s32 fillAmt = SCALE_BY_PCT(METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); if (acs->flee.drainDelay == 0) { - acs->barFillLevel += fillAmt; + acs->meterFillLevel += fillAmt; } } - // handle bar reaching 100% - if (acs->barFillLevel > MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; + // handle meter reaching 100% + if (acs->meterFillLevel > MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; acs->flee.drainDelay = 3; } - // bar can reset if mashing stops after it's been fully filled + // meter can reset if mashing stops after it's been fully filled if (acs->flee.drainDelay != 0) { acs->flee.drainDelay--; if (acs->flee.drainDelay == 0) { - acs->barFillLevel = 0; + acs->meterFillLevel = 0; battleStatus->actionQuality++; } } - battleStatus->actionProgress = acs->barFillLevel / ONE_PCT_MASH; + battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH; if (acs->stateTimer != 0) { acs->stateTimer--; @@ -208,9 +208,9 @@ void N(draw)(void) { hud_element_get_render_pos(hid, &hudX, &hudY); if (!N(HasStarted)) { - draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH, 1); + draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH, 1); } else { - draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH, 2); + draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH, 2); } hud_element_draw_clipped(acs->hudElements[HIDX_OK]); diff --git a/src/battle/action_cmd/unused_mash_a.c b/src/battle/action_cmd/unused_mash_a.c index a507e33bd5..be484f0a3d 100644 --- a/src/battle/action_cmd/unused_mash_a.c +++ b/src/battle/action_cmd/unused_mash_a.c @@ -41,9 +41,9 @@ API_CALLABLE(N(init)) { acs->showHud = TRUE; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; - acs->isBarFilled = FALSE; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; + acs->isMeterFilled = FALSE; battleStatus->actionQuality = 0; acs->hudPosX = -48; acs->hudPosY = 80; @@ -88,8 +88,8 @@ API_CALLABLE(N(start)) { acs->statusChance = evt_get_variable(script, *args++); // unused acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_NONE; battleStatus->maxActionQuality = acs->mashMeterCutoffs[(acs->mashMeterNumIntervals - 1)]; @@ -145,7 +145,7 @@ void N(update)(void) { } hud_element_set_script(acs->hudElements[HIDX_BUTTON], &HES_MashAButton); - acs->barFillLevel = 0; + acs->meterFillLevel = 0; acs->state = AC_STATE_ACTIVE; acs->stateTimer = acs->duration; @@ -153,31 +153,31 @@ void N(update)(void) { case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // check for bar-filling input + // check for meter-filling input if (battleStatus->curButtonsPressed & BUTTON_A) { - acs->barFillLevel += SCALE_BY_PCT(METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel += SCALE_BY_PCT(METER_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); } - // handle bar reaching 100% - if (acs->barFillLevel >= MAX_MASH_UNITS) { - acs->barFillLevel = MAX_MASH_UNITS; - acs->isBarFilled = TRUE; + // handle meter reaching 100% + if (acs->meterFillLevel >= MAX_MASH_UNITS) { + acs->meterFillLevel = MAX_MASH_UNITS; + acs->isMeterFilled = TRUE; hid = acs->hudElements[HIDX_100_PCT]; hud_element_set_render_pos(hid, acs->hudPosX + 50, acs->hudPosY + 28); hud_element_clear_flags(hid, HUD_ELEMENT_FLAG_DISABLED); } - battleStatus->actionProgress = acs->barFillLevel / ONE_PCT_MASH; + battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH; if (acs->stateTimer != 0) { acs->stateTimer--; break; } - if (acs->barFillLevel == 0) { + if (acs->meterFillLevel == 0) { battleStatus->actionQuality = AC_QUALITY_FAILED; } else { - battleStatus->actionQuality = acs->barFillLevel / ONE_PCT_MASH; + battleStatus->actionQuality = acs->meterFillLevel / ONE_PCT_MASH; } cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals - 1]; diff --git a/src/battle/action_cmd/whirlwind.c b/src/battle/action_cmd/whirlwind.c index e81a879367..d4ddc0abe3 100644 --- a/src/battle/action_cmd/whirlwind.c +++ b/src/battle/action_cmd/whirlwind.c @@ -89,8 +89,8 @@ API_CALLABLE(N(init)) { acs->actionCommandID = ACTION_COMMAND_WHIRLWIND; acs->state = AC_STATE_INIT; acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; if (acs->variation == ACV_WHIRLWIND_HUFF) { battleStatus->actionProgress = 0; } else { @@ -144,8 +144,8 @@ API_CALLABLE(N(start)) { acs->difficulty = adjust_action_command_difficulty(acs->difficulty); acs->wrongButtonPressed = FALSE; - acs->barFillLevel = 0; - acs->barFillWidth = 0; + acs->meterFillLevel = 0; + acs->meterFillWidth = 0; battleStatus->actionQuality = 0; battleStatus->actionResult = ACTION_RESULT_FAIL; if (acs->variation == ACV_WHIRLWIND_HUFF) { @@ -215,7 +215,7 @@ void N(update)(void) { return; } hud_element_set_script(acs->hudElements[HIDX_BUTTON], &HES_MashAButton); - acs->barFillLevel = 0; + acs->meterFillLevel = 0; acs->state = AC_STATE_ACTIVE; acs->stateTimer = acs->duration; @@ -223,21 +223,21 @@ void N(update)(void) { case AC_STATE_ACTIVE: btl_set_popup_duration(POPUP_MSG_ON); - // apply bar draining every frame + // apply meter draining every frame cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals]; - fillPct = acs->barFillLevel / cutoff; + fillPct = acs->meterFillLevel / cutoff; if (acs->variation == ACV_WHIRLWIND_HUFF) { amt = GET_DRAIN_RATE_HUFF(fillPct); } else { amt = GET_DRAIN_RATE_BUZZAR(fillPct); } - acs->barFillLevel -= amt; + acs->meterFillLevel -= amt; - if (acs->barFillLevel < 0) { - acs->barFillLevel = 0; + if (acs->meterFillLevel < 0) { + acs->meterFillLevel = 0; } - // check for bar-filling input + // check for meter-filling input if (!acs->berserkerEnabled) { if (battleStatus->curButtonsPressed & BUTTON_A) { if (acs->variation == ACV_WHIRLWIND_HUFF) { @@ -245,22 +245,22 @@ void N(update)(void) { } else { amt = SCALE_BY_PCT(BUZZAR_FILL_TICK, battleStatus->actionCmdDifficultyTable[acs->difficulty]); } - acs->barFillLevel += amt; + acs->meterFillLevel += amt; } } else { - acs->barFillLevel += SCALE_BY_PCT(25, battleStatus->actionCmdDifficultyTable[acs->difficulty]); - acs->barFillLevel += rand_int(SCALE_BY_PCT(25, battleStatus->actionCmdDifficultyTable[acs->difficulty])); + acs->meterFillLevel += SCALE_BY_PCT(25, battleStatus->actionCmdDifficultyTable[acs->difficulty]); + acs->meterFillLevel += rand_int(SCALE_BY_PCT(25, battleStatus->actionCmdDifficultyTable[acs->difficulty])); } - // cap bar to maximum fill level - if (acs->barFillLevel > cutoff * 100) { - acs->barFillLevel = cutoff * 100; + // cap meter to maximum fill level + if (acs->meterFillLevel > cutoff * 100) { + acs->meterFillLevel = cutoff * 100; } if (acs->variation == ACV_WHIRLWIND_HUFF) { - battleStatus->actionProgress = (acs->barFillLevel / ONE_PCT_MASH) / 20; + battleStatus->actionProgress = (acs->meterFillLevel / ONE_PCT_MASH) / 20; } else { - battleStatus->actionProgress = N(BuzzarQuality)[(acs->barFillLevel / ONE_PCT_MASH) / 10]; + battleStatus->actionProgress = N(BuzzarQuality)[(acs->meterFillLevel / ONE_PCT_MASH) / 10]; } if (acs->stateTimer != 0) { @@ -296,7 +296,7 @@ void N(draw)(void) { hud_element_draw_clipped(hid); hud_element_get_render_pos(hid, &hudX, &hudY); - draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->barFillLevel / ONE_PCT_MASH, 1); + draw_mash_meter_multicolor_with_divisor(hudX, hudY, acs->meterFillLevel / ONE_PCT_MASH, 1); hud_element_draw_clipped(acs->hudElements[HIDX_BUBBLE]); hid = acs->hudElements[HIDX_DIGIT];