15#define NAMESPACE action_command_power_shock
29#define METER_FILL_TICK 850
33#define GET_DRAIN_RATE(pct) (N(DrainRateTable)[((pct) / (ONE_PCT_MASH / 5))])
37API_CALLABLE(N(
init)) {
55 acs->meterFillLevel = 0;
56 acs->meterFillWidth = 0;
58 acs->hudPrepareTime = 30;
60 acs->thresholdMoveDir = 0;
90 offsetX = 29 - ((100 -
acs->escapeThreshold) * 60) / 100;
95API_CALLABLE(N(start)) {
114 acs->meterFillLevel = 0;
115 acs->meterFillWidth = 0;
134 switch (
acs->state) {
156 if (
acs->hudPrepareTime != 0) {
157 acs->hudPrepareTime--;
160 if (
acs->hudPosX > 50) {
166 amt = 100 -
acs->escapeThreshold;
167 offsetX = 29 - (
amt * 60) / 100;
173 if (
acs->prepareTime != 0) {
178 acs->meterFillLevel = 0;
181 acs->stateTimer =
acs->duration;
190 if (!
acs->isMeterFilled) {
191 if (
acs->statusChance != 0) {
192 cutoff =
acs->mashMeterCutoffs[
acs->mashMeterNumIntervals];
194 if (
acs->meterFillLevel < 0) {
195 acs->meterFillLevel = 0;
198 acs->meterFillLevel -= 10;
199 if (
acs->meterFillLevel < 0) {
200 acs->meterFillLevel = 0;
207 if (
acs->statusChance != 0) {
211 acs->meterFillLevel +=
amt;
232 if (
acs->stateTimer != 0) {
237 amt =
acs->meterFillLevel;
238 if (
acs->statusChance == 0) {
252 cutoff =
acs->mashMeterCutoffs[
acs->mashMeterNumIntervals - 1];
269 if (
acs->statusChance == 0) {
271 if (
acs->meterFillLevel < 0) {
272 acs->meterFillLevel = 0;
275 if (
acs->stateTimer != 0) {
285 switch (
acs->state) {
289 if (
acs->thresholdMoveDir == 0) {
290 acs->escapeThreshold += 7;
291 if (
acs->escapeThreshold >= 100) {
292 acs->escapeThreshold = 100;
293 acs->thresholdMoveDir = 1;
296 acs->escapeThreshold -= 7;
297 if (
acs->escapeThreshold <= 0) {
298 acs->escapeThreshold = 0;
299 acs->thresholdMoveDir = 0;
310 hudX = 60 - (
acs->escapeThreshold * 60 / 100);
322 }
else if (!
acs->isMeterFilled) {
BSS s32 PopupMenu_SelectedIndex
void draw_mash_meter_blink_with_divisor(s32 posX, s32 posY, s32 fillValue, s32 divisor)
BSS ActionCommandStatus gActionCommandStatus
void action_command_free(void)
void increment_action_command_attempt_count(void)
void draw_mash_meter_multicolor_with_divisor(s32 posX, s32 posY, s32 fillValue, s32 divisor)
s32 adjust_action_command_difficulty(s32 difficultyLevel)
void increment_action_command_success_count(void)
void action_command_init_status(void)
#define AC_QUALITY_FAILED
#define SCALE_BY_PCT(x, pct)
HudScript HES_MashAButton
@ ACTION_COMMAND_POWER_SHOCK
@ SOUND_LOOP_CHARGE_METER
@ ACTION_RESULT_METER_BELOW_HALF
void btl_set_popup_duration(s32 duration)
s32 evt_get_variable(Evt *script, Bytecode var)
void hud_element_get_render_pos(s32 id, s32 *x, s32 *y)
void hud_element_set_alpha(s32 id, s32 opacity)
void hud_element_set_script(s32 id, HudScript *anim)
void hud_element_set_render_depth(s32 id, s32 z)
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
s32 hud_element_create(HudScript *anim)
Creates a new HUD element and returns its ID.
void hud_element_set_flags(s32 id, s32 flags)
Turns on the given flags.
void hud_element_clear_flags(s32 id, s32 flags)
Turns off the given flags.
void hud_element_draw_clipped(s32 id)
void hud_element_free(s32 id)
@ HUD_ELEMENT_FLAG_DISABLED
#define GET_DRAIN_RATE(pct)
s32 actionCmdTablePowerShock[]
void sfx_stop_sound(s32 soundID)
void sfx_adjust_env_sound_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
void sfx_play_sound_with_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
BattleStatus gBattleStatus
void N init(Npc *bombette)