49 {
55 s32 partImmuneToElement;
56 s32 wasSpecialHit = FALSE;
57 s32 actorClass;
58 s32 isFireDamage = FALSE;
59 s32 isWaterDamage = FALSE;
60 s32 isShockDamage = FALSE;
61 s32 isIceDamage = FALSE;
65 s32 attackDamage;
66 s32 temp;
67 s32 targetDefense;
69 s32 dispatchEvent;
70 s32 wasStatusInflicted;
71 s32 hitResult;
72
79 wasStatusInflicted = FALSE;
80
81 if (target == NULL) {
83 }
84
86 if (targetPart == NULL) {
88 }
89
93 state = &player->
state;
94 } else {
95 state = &partner->
state;
96 }
97
100 isFireDamage = TRUE;
101 }
104 isShockDamage = TRUE;
105 }
108 isWaterDamage = TRUE;
109 }
112 isIceDamage = TRUE;
113 }
114
119 ) {
121 }
122 }
123
130 }
132 }
133
135 partImmuneToElement = TRUE;
136 } else {
137 partImmuneToElement = FALSE;
138 }
139
142 }
143
147 }
148
150 if (attackDamage > 99) {
151 attackDamage = 99;
152 }
153 if (attackDamage <= 0) {
154 temp = 0;
155 }
156
157 attackDamage -= temp;
159
160 if (attackDamage <= 0) {
163
168 } else {
171 }
172 } else {
178
180 && !partImmuneToElement
182 ) {
183 target->
curHP -= attackDamage;
184 if (target->
curHP <= 0) {
187 }
188 }
192 }
193
199 }
200
205 }
206
210 }
213 }
216 }
219 }
220
226 wasStatusInflicted = TRUE;
227 }
230 wasStatusInflicted = TRUE;
231 }
234 }
236 }
237 }
238
243 {
252 }
257 }
258 wasStatusInflicted = TRUE;
260 }
261 }
262 }
263
269 wasStatusInflicted = TRUE;
270 }
273 wasStatusInflicted = TRUE;
274 }
275 }
276 }
277
282 }
285 }
286 }
287 }
288
292 ) {
295 }
298 }
299 }
300
304 ) {
307 }
310 }
311 }
312
316 ) {
319 }
322 }
323 }
324
329 }
332 }
333 isFireDamage = TRUE;
334 }
335 }
336
342 ) {
343
344
345 #define INFLICT_STATUS(STATUS_TYPE) \
346 if ((battleStatus->curAttackStatus & STATUS_FLAG_##STATUS_TYPE) && \
347 try_inflict_status(target, STATUS_KEY_##STATUS_TYPE, STATUS_TURN_MOD_##STATUS_TYPE)) { \
348 wasStatusInflicted = TRUE; \
349 } \
350
360
361 #undef INFLICT_STATUS
362
363 if (wasStatusInflicted) {
366 }
369 }
370 }
371 }
372
375
385 {
388 wasSpecialHit = TRUE;
391 wasStatusInflicted = TRUE;
393 } else {
396 }
397 }
398
400
403 ) {
406 }
407
411 } else {
413 }
414 }
415 }
416
419 }
420
422
426 }
427 }
428
431 if (!wasSpecialHit && !wasStatusInflicted) {
433 }
434 } else if (!partImmuneToElement) {
437 } else {
439 }
442 }
443 }
444 }
445
448 if (isFireDamage) {
450 } else if (isShockDamage) {
452 } else if (isIceDamage) {
454 } else {
456 }
457 }
458
461 }
462
465 script->varTable[0] = state->
goalPos.
x;
466 script->varTable[1] = state->
goalPos.
y;
467 script->varTable[2] = state->
goalPos.
z;
469 }
472 script->varTable[0] = state->
goalPos.
x;
473 script->varTable[1] = state->
goalPos.
y;
474 script->varTable[2] = state->
goalPos.
z;
476 }
479 script->varTable[0] = state->
goalPos.
x;
480 script->varTable[1] = state->
goalPos.
y;
481 script->varTable[2] = state->
goalPos.
z;
483 }
486 script->varTable[0] = state->
goalPos.
x;
487 script->varTable[1] = state->
goalPos.
y;
488 script->varTable[2] = state->
goalPos.
z;
490 }
493 script->varTable[0] = state->
goalPos.
x;
494 script->varTable[1] = state->
goalPos.
y;
495 script->varTable[2] = state->
goalPos.
z;
497 }
500 script->varTable[0] = state->
goalPos.
x;
501 script->varTable[1] = state->
goalPos.
y;
502 script->varTable[2] = state->
goalPos.
z;
503 script->varTablePtr[3] = target;
505 }
508 script->varTable[0] = state->
goalPos.
x;
509 script->varTable[1] = state->
goalPos.
y;
510 script->varTable[2] = state->
goalPos.
z;
511 script->varTablePtr[3] = target;
513 }
516 }
517
519
523 }
526 }
527 }
528
529 return hitResult;
530}
struct ActorBlueprint * actorBlueprint
#define INFLICT_STATUS(STATUS_TYPE)
@ ACTION_RATING_SUPER
sets nice hits = 2
@ ACTION_RATING_NICE
sets nice hits = 1
@ BS_FLAGS1_PARTNER_ACTING
@ BS_FLAGS1_TRIGGER_EVENTS
@ BS_FLAGS1_SHOW_PLAYER_DECORATIONS
@ BS_FLAGS1_INCLUDE_POWER_UPS
@ BS_FLAGS1_ACTORS_VISIBLE
@ ACTOR_EVENT_FLAG_RIDING_BROOMSTICK
Actor is on Magikoopa Broomstick, effect seems to be redundant.
@ ACTOR_EVENT_FLAG_STAR_ROD_ENCHANTED
Actor glows and listens for Star Beam and Peach Beam events.
@ ACTOR_EVENT_FLAG_GROUNDABLE
Actor can be knocked down from flight; triggered by jump attacks.
@ ACTOR_EVENT_FLAG_ATTACK_CHARGED
Actor has charged an attack that can be removed with Star Beam.
@ ACTOR_EVENT_FLAG_BURIED
Actor can only by hit by quake-element attacks.
@ ACTOR_EVENT_FLAG_FLIPABLE
Actor can be flipped; triggered by jump and quake attacks.
@ ACTOR_EVENT_FLAG_ENCHANTED
Actor glows and listens for the Star Beam event.
@ ACTOR_PART_TARGET_NO_DAMAGE
@ HIT_RESULT_NICE_NO_DAMAGE
@ ACTOR_FLAG_DAMAGE_IMMUNE
@ ACTOR_FLAG_NO_DMG_POPUP
Hide damage popup.
@ ACTOR_FLAG_FLIPPED
Actor has been flipped over.
@ EVENT_INVUNERABLE_TAUNT
@ ACTOR_PART_FLAG_DAMAGE_IMMUNE
electrified Plays extra hurt SFX?
@ DAMAGE_TYPE_STATUS_ALWAYS_HITS
@ DAMAGE_TYPE_IGNORE_DEFENSE
@ DAMAGE_TYPE_REMOVE_BUFFS
@ DAMAGE_TYPE_MULTIPLE_POPUPS
void show_primary_damage_popup(f32 x, f32 y, f32 z, s32 attack, s32 a)
void show_immune_bonk(f32 x, f32 y, f32 z, s32, s32, s32)
void dispatch_event_actor(Actor *, s32)
void show_actor_health_bar(Actor *)
void remove_status_static(s32)
void remove_status_transparent(s32)
void set_actor_flash_mode(Actor *actor, s32 arg1)
void show_damage_fx(Actor *actor, f32 x, f32 y, f32 z, s32 damage)
Evt * start_script(EvtScript *source, s32 priority, s32 initialState)
s32 inflict_status(Actor *, s32, s32)
s32 get_defense(Actor *actor, s32 *defenseTable, s32 elementFlags)
void func_80266970(Actor *)
void show_next_damage_popup(f32 x, f32 y, f32 z, s32 damageAmount, s32)
void apply_shock_effect(Actor *)
void show_action_rating(s32, Actor *, f32, f32, f32)
EvtScript EVS_PlayStopHitFX
EvtScript EVS_PlayFreezeHitFX
EvtScript EVS_PlayShrinkHitFX
EvtScript EVS_PlayParalyzeHitFX
EvtScript EVS_PlayPoisonHitFX
EvtScript EVS_PlaySleepHitFX
EvtScript EVS_PlayDizzyHitFX
struct Actor * partnerActor