Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
fire_shell.c File Reference

Go to the source code of this file.

Functions

void N update (void)
 

Variables

s32 D_802A9950_427320 [5] = { 0, 25, 50, 75, 75 }
 
s32 D_802A9964_427334 [4] = { 40, 70, 99, 200 }
 
s32 D_802A9974_427344 [5] = { 35, 60, 80, 99, 200 }
 
s32 D_802A9988_427358 [6] = { 35, 35, 60, 80, 99, 200 }
 
s32 actionCmdTableFireShell []
 

Function Documentation

◆ update()

void N update ( void )

Definition at line 63 of file fire_shell.c.

63 {
64 ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;
65 BattleStatus* battleStatus = &gBattleStatus;
66 Actor* partner = battleStatus->partnerActor;
67 s32 id;
68 s32 cutoff;
69 s32 fillLevel;
70
71 switch (actionCommandStatus->state) {
72 case 0:
74
75 id = actionCommandStatus->hudElements[0];
76 hud_element_set_alpha(id, 255);
77 if (actionCommandStatus->showHud) {
79 }
80
81 id = actionCommandStatus->hudElements[1];
82 hud_element_set_alpha(id, 255);
83 if (actionCommandStatus->showHud) {
85 }
86
87 actionCommandStatus->state = 1;
88 break;
89 case 1:
91 actionCommandStatus->hudPosX += 20;
92 if (actionCommandStatus->hudPosX > 50) {
93 actionCommandStatus->hudPosX = 50;
94 }
95 hud_element_set_render_pos(actionCommandStatus->hudElements[0], actionCommandStatus->hudPosX, actionCommandStatus->hudPosY);
96 hud_element_set_render_pos(actionCommandStatus->hudElements[1], actionCommandStatus->hudPosX, actionCommandStatus->hudPosY + 28);
97 break;
98 case 10:
100 if (actionCommandStatus->prepareTime != 0) {
101 actionCommandStatus->prepareTime--;
102 return;
103 }
104 hud_element_set_script(actionCommandStatus->hudElements[0], &HES_StickMashLeft);
105 actionCommandStatus->barFillLevel = 0;
106 battleStatus->unk_85 = 0;
107 actionCommandStatus->unk_5C = 0;
108 actionCommandStatus->frameCounter = actionCommandStatus->duration;
110 actionCommandStatus->state = 11;
111 case 11:
113
114 if (!actionCommandStatus->isBarFilled) {
115 cutoff = actionCommandStatus->mashMeterCutoffs[actionCommandStatus->mashMeterIntervals];
116 actionCommandStatus->barFillLevel -= D_802A9950_427320[actionCommandStatus->barFillLevel / cutoff / 20];
117 if (actionCommandStatus->barFillLevel < 0) {
118 actionCommandStatus->barFillLevel = 0;
119 }
120 if (!actionCommandStatus->isBarFilled) {
121 if (battleStatus->curButtonsDown & BUTTON_STICK_LEFT) {
122 actionCommandStatus->unk_5C = 1;
123 }
124
125 if (!(battleStatus->curButtonsDown & BUTTON_STICK_LEFT) && (actionCommandStatus->unk_5C != 0)) {
126 actionCommandStatus->barFillLevel += (battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 950) / 100;
127 actionCommandStatus->unk_5C = 0;
128 }
129
130 if (battleStatus->curButtonsPressed & BUTTON_STICK_RIGHT) {
131 actionCommandStatus->barFillLevel -= (battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 950) / 100;
132 }
133 }
134 }
135
136 if (actionCommandStatus->barFillLevel < 0) {
137 actionCommandStatus->barFillLevel = 0;
138 }
139
140 if (actionCommandStatus->barFillLevel > 10000) {
141 id = actionCommandStatus->hudElements[2];
142 actionCommandStatus->barFillLevel = 10000;
143 actionCommandStatus->isBarFilled = TRUE;
144 hud_element_set_render_pos(id, actionCommandStatus->hudPosX + 50, actionCommandStatus->hudPosY + 28);
146 }
147
148 battleStatus->actionQuality = actionCommandStatus->barFillLevel / 100;
150 switch (partner->actorBlueprint->level) {
152 if (battleStatus->actionQuality >= D_802A9964_427334[battleStatus->unk_85]) {
153 battleStatus->unk_85++;
154 }
155 if (battleStatus->unk_85 > 0 && (battleStatus->actionQuality < D_802A9964_427334[battleStatus->unk_85 - 1])) {
156 battleStatus->unk_85--;
157 }
158 break;
160 if (battleStatus->actionQuality >= D_802A9974_427344[battleStatus->unk_85]) {
161 battleStatus->unk_85++;
162 }
163 if (battleStatus->unk_85 > 0 && (battleStatus->actionQuality < D_802A9974_427344[battleStatus->unk_85 - 1])) {
164 battleStatus->unk_85--;
165 }
166 break;
168 if (battleStatus->actionQuality >= D_802A9988_427358[battleStatus->unk_85]) {
169 battleStatus->unk_85++;
170 }
171 if (battleStatus->unk_85 > 0 && (battleStatus->actionQuality < D_802A9988_427358[battleStatus->unk_85 - 1])) {
172 battleStatus->unk_85--;
173 }
174 break;
175 }
176
177 if (actionCommandStatus->frameCounter != 0) {
178 actionCommandStatus->frameCounter--;
179 return;
180 }
181
182 if (actionCommandStatus->barFillLevel == 0) {
183 battleStatus->actionSuccess = -1;
184 } else {
185 battleStatus->actionSuccess = actionCommandStatus->barFillLevel / 100;
186 }
187
188 cutoff = actionCommandStatus->mashMeterCutoffs[actionCommandStatus->mashMeterIntervals - 1];
189 if (cutoff >= battleStatus->actionSuccess) {
190 battleStatus->actionResult = ACTION_RESULT_MINUS_2;
191 } else {
192 battleStatus->actionResult = ACTION_RESULT_SUCCESS;
193 }
194
195 if (battleStatus->actionSuccess == 100) {
197 }
200 actionCommandStatus->frameCounter = 5;
201 actionCommandStatus->state = 12;
202 break;
203 case 12:
204 if (actionCommandStatus->frameCounter != 0) {
205 actionCommandStatus->frameCounter--;
206 return;
207 }
209 break;
210 }
211}
BSS ActionCommandStatus gActionCommandStatus
Definition action_cmd.c:91
void func_80269160(void)
Definition action_cmd.c:655
void action_command_free(void)
Definition action_cmd.c:446
HudScript HES_StickMashLeft
struct ActorBlueprint * actorBlueprint
@ BUTTON_STICK_LEFT
Definition enums.h:2793
@ BUTTON_STICK_RIGHT
Definition enums.h:2794
@ PARTNER_RANK_NORMAL
Definition enums.h:2018
@ PARTNER_RANK_SUPER
Definition enums.h:2019
@ PARTNER_RANK_ULTRA
Definition enums.h:2020
@ SOUND_LOOP_CHARGE_BAR
Definition enums.h:1646
@ ACTION_RESULT_SUCCESS
Definition enums.h:1968
@ ACTION_RESULT_MINUS_2
Definition enums.h:1965
s32 D_802A9988_427358[6]
Definition fire_shell.c:9
s32 D_802A9950_427320[5]
Definition fire_shell.c:6
s32 D_802A9964_427334[4]
Definition fire_shell.c:7
s32 D_802A9974_427344[5]
Definition fire_shell.c:8
void btl_set_popup_duration(s32 duration)
void hud_element_set_alpha(s32 id, s32 opacity)
void hud_element_set_script(s32 id, HudScript *anim)
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
void hud_element_clear_flags(s32 id, s32 flags)
Turns off the given flags.
void sfx_stop_sound(s32 soundID)
Definition sfx.c:507
void sfx_adjust_env_sound_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
Definition sfx.c:492
void sfx_play_sound_with_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
Definition sfx.c:458
struct Actor * partnerActor
s32 * actionCmdDifficultyTable
BattleStatus gBattleStatus
Definition battle.c:11

Variable Documentation

◆ D_802A9950_427320

s32 D_802A9950_427320[5] = { 0, 25, 50, 75, 75 }

Definition at line 6 of file fire_shell.c.

6{ 0, 25, 50, 75, 75 };

Referenced by update().

◆ D_802A9964_427334

s32 D_802A9964_427334[4] = { 40, 70, 99, 200 }

Definition at line 7 of file fire_shell.c.

7{ 40, 70, 99, 200 };

Referenced by update().

◆ D_802A9974_427344

s32 D_802A9974_427344[5] = { 35, 60, 80, 99, 200 }

Definition at line 8 of file fire_shell.c.

8{ 35, 60, 80, 99, 200 };

Referenced by update().

◆ D_802A9988_427358

s32 D_802A9988_427358[6] = { 35, 35, 60, 80, 99, 200 }

Definition at line 9 of file fire_shell.c.

9{ 35, 35, 60, 80, 99, 200 };

Referenced by update().

◆ actionCmdTableFireShell

s32 actionCmdTableFireShell[]
extern

Definition at line 36 of file action_cmd.c.

36{ 130, 120, 110, 100, 90, 80, 70, 60 };