Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
dmg_item.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "effects.h"
4
7 ActorState* state = &battleStatus->playerActor->state;
8 s32 actorID = battleStatus->curTargetID;
11 Actor* actor;
13
14 battleStatus->curTargetID2 = battleStatus->curTargetID;
16 battleStatus->curTargetPart2 = currentTargetPartS8;
17
18 actor = get_actor(actorID);
19 if (actor == nullptr) {
20 return HIT_RESULT_HIT;
21 }
22
24 ASSERT(actorPart != nullptr);
25
26 if (actorPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY) {
27 return HIT_RESULT_MISS;
28 }
29
31 return HIT_RESULT_MISS;
32 }
33
34 if (actor->stoneStatus == STATUS_KEY_STONE) {
36 return HIT_RESULT_IMMUNE;
37 }
38
39 if ((battleStatus->curAttackElement & DAMAGE_TYPE_JUMP)
40 && (actorPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP))
41 {
44 }
45
46 return HIT_RESULT_HIT;
47}
48
51 Actor* player = battleStatus->playerActor;
52 s32 currentTargetID = battleStatus->curTargetID;
53 Actor* partner = battleStatus->partnerActor;
54 s32 currentTargetPartID = battleStatus->curTargetPart;
56 s32 wasSpecialHit = false;
58 s32 isFireDamage = false;
59 s32 isWaterDamage = false;
60 s32 isShockDamage = false;
61 s32 isIceDamage = false;
64 Evt* script;
66 s32 temp;
67 ActorState* state;
69 s32 wasStatusInflicted;
71
72 battleStatus->wasStatusInflicted = false;
73 battleStatus->lastAttackDamage = 0;
74 battleStatus->attackerActorID = player->actorID;
75 battleStatus->curTargetID2 = battleStatus->curTargetID;
76 battleStatus->curTargetPart2 = battleStatus->curTargetPart;
78 wasStatusInflicted = false;
79
80 if (target == nullptr) {
81 return HIT_RESULT_HIT;
82 }
83
85 if (targetPart == nullptr) {
86 PANIC();
87 }
88
89 target->lastDamageTaken = 0;
92 state = &player->state;
93 } else {
94 state = &partner->state;
95 }
96
97 if (battleStatus->curAttackElement & DAMAGE_TYPE_FIRE) {
98 fx_ring_blast(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f, 1.0f, 24);
99 isFireDamage = true;
100 }
101 if (battleStatus->curAttackElement & DAMAGE_TYPE_SHOCK) {
103 isShockDamage = true;
104 }
105 if (battleStatus->curAttackElement & DAMAGE_TYPE_WATER) {
106 fx_water_splash(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f, 1.0f, 24);
107 isWaterDamage = true;
108 }
109 if (battleStatus->curAttackElement & DAMAGE_TYPE_ICE) {
110 fx_big_snowflakes(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f);
111 isIceDamage = true;
112 }
113
114 if (!(battleStatus->curAttackElement & DAMAGE_TYPE_REMOVE_BUFFS)) {
115 if ((targetPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY)
116 || (target->transparentStatus == STATUS_KEY_TRANSPARENT)
117 || (targetPart->eventFlags & ACTOR_EVENT_FLAG_BURIED && !(battleStatus->curAttackElement & DAMAGE_TYPE_QUAKE))
118 ) {
119 return HIT_RESULT_MISS;
120 }
121 }
122
123 if (target->stoneStatus == STATUS_KEY_STONE) {
125 show_immune_bonk(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 1);
126 show_next_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 0);
128 return HIT_RESULT_NICE;
129 }
130 return HIT_RESULT_HIT;
131 }
132
133 if (targetPart->elementalImmunities & battleStatus->curAttackElement) {
134 partImmuneToElement = true;
135 } else {
136 partImmuneToElement = false;
137 }
138
140 battleStatus->curAttackElement &= ~DAMAGE_TYPE_IGNORE_DEFENSE;
141 }
142
143 temp = get_defense(target, targetPart->defenseTable, battleStatus->curAttackElement);
144 if (!(battleStatus->curAttackElement & DAMAGE_TYPE_IGNORE_DEFENSE)) {
145 temp += target->defenseBoost;
146 }
147
148 attackDamage = battleStatus->curAttackDamage;
149 if (attackDamage > 99) {
150 attackDamage = 99;
151 }
152 if (attackDamage <= 0) {
153 temp = 0;
154 }
155
157 target->hpChangeCounter = 0;
158
159 if (attackDamage <= 0) {
160 target->hpChangeCounter = 0;
162
163 if (!(battleStatus->curAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS)) {
166 battleStatus->lastAttackDamage = 0;
167 } else {
169 battleStatus->lastAttackDamage = 0;
170 }
171 } else {
172 target->damageCounter += attackDamage;
173 target->hpChangeCounter -= attackDamage;
174 battleStatus->lastAttackDamage = 0;
177
180 && !(targetPart->targetFlags & ACTOR_PART_TARGET_NO_DAMAGE)
181 ) {
182 target->curHP -= attackDamage;
183 if (target->curHP <= 0) {
184 target->curHP = 0;
186 }
187 }
188 battleStatus->lastAttackDamage += attackDamage;
189 target->lastDamageTaken = battleStatus->lastAttackDamage;
190 target->hpChangeCounter = 0;
191 }
192
195 show_immune_bonk(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 3);
198 }
199
200 if (battleStatus->curAttackElement & DAMAGE_TYPE_DEATH) {
201 battleStatus->lastAttackDamage = 0;
204 }
205
209 }
212 }
213 if (target->curHP <= 0 && dispatchEvent == EVENT_IMMUNE) {
215 }
216 } else if (dispatchEvent == EVENT_DEATH) {
218 }
219
221 if (battleStatus->curAttackElement & DAMAGE_TYPE_REMOVE_BUFFS) {
223 if (targetPart->eventFlags & ACTOR_EVENT_FLAG_ENCHANTED) {
225 wasStatusInflicted = true;
226 }
229 wasStatusInflicted = true;
230 }
233 }
235 }
236 }
237
238 if (battleStatus->curAttackElement & DAMAGE_TYPE_REMOVE_BUFFS) {
240 if ((target->attackBoost > 0 || target->defenseBoost > 0) ||
241 ((target->staticStatus == 0 && target->transparentStatus != 0) || target->staticStatus != 0))
242 {
243 target->attackBoost = 0;
244 target->defenseBoost = 0;
245 target->isGlowing = false;
247 if (target->staticStatus != 0) {
248 target->staticStatus = 0;
249 target->staticDuration = 0;
250 remove_status_static(target->hudElementDataIndex);
251 }
252 if (target->transparentStatus != 0) {
253 target->transparentStatus = 0;
254 target->transparentDuration = 0;
255 remove_status_transparent(target->hudElementDataIndex);
256 }
257 wasStatusInflicted = true;
259 }
260 }
261 }
262
264 if (battleStatus->curAttackElement & DAMAGE_TYPE_PEACH_BEAM) {
266 if (targetPart->eventFlags & ACTOR_EVENT_FLAG_ENCHANTED) {
268 wasStatusInflicted = true;
269 }
272 wasStatusInflicted = true;
273 }
274 }
275 }
276
278 if (battleStatus->curAttackElement & DAMAGE_TYPE_SPIN_SMASH) {
279 if (dispatchEvent == EVENT_HIT) {
281 }
282 if (dispatchEvent == EVENT_DEATH) {
284 }
285 }
286 }
287
289 && (battleStatus->curAttackElement & (DAMAGE_TYPE_JUMP | DAMAGE_TYPE_POW))
290 && (targetPart->eventFlags & ACTOR_EVENT_FLAG_GROUNDABLE)
291 ) {
292 if (dispatchEvent == EVENT_HIT) {
294 }
297 }
298 }
299
301 && (battleStatus->curAttackElement & DAMAGE_TYPE_POW)
303 ) {
304 if (dispatchEvent == EVENT_HIT) {
306 }
309 }
310 }
311
314 && (targetPart->eventFlags & ACTOR_EVENT_FLAG_FLIPABLE)
315 ) {
316 if (dispatchEvent == EVENT_HIT) {
318 }
321 }
322 }
323
325 if (battleStatus->curAttackElement & DAMAGE_TYPE_FIRE) {
326 if (dispatchEvent == EVENT_HIT) {
328 }
329 if (dispatchEvent == EVENT_DEATH) {
331 }
332 isFireDamage = true;
333 }
334 }
335
337 && battleStatus->lastAttackDamage >= 0
341 ) {
342 // Using this macro because it's nicer to look at, and it also is necessary to wrap the first 5 of these in a
343 // do-while-0 OR to wrap each one individually. It's more likely that it's a macro instead, and much cleaner
344 #define INFLICT_STATUS(STATUS_TYPE) \
345 if ((battleStatus->curAttackStatus & STATUS_FLAG_##STATUS_TYPE) && \
346 try_inflict_status(target, STATUS_KEY_##STATUS_TYPE, STATUS_TURN_MOD_##STATUS_TYPE)) { \
347 wasStatusInflicted = true; \
348 } \
349
358
359 #undef INFLICT_STATUS
360
361 if ((battleStatus->curAttackStatus & STATUS_FLAG_UNUSED) &&
363 wasStatusInflicted = true;
364 }
365
366 if (wasStatusInflicted) {
369 }
372 }
373 }
374 }
375
376 temp = target->actorBlueprint->spookChance;
377 temp = (battleStatus->statusChance * temp) / 100;
378
380 if (rand_int(99) < temp
381 && (target->debuff != STATUS_KEY_UNUSED
382 && target->debuff != STATUS_KEY_DIZZY
383 && target->debuff != STATUS_KEY_PARALYZE
384 && target->debuff != STATUS_KEY_SLEEP
385 && target->debuff != STATUS_KEY_FROZEN
386 && target->debuff != STATUS_KEY_STOP)
387 && !(target->flags & ACTOR_FLAG_FLIPPED))
388 {
391 wasSpecialHit = true;
394 wasStatusInflicted = true;
396 } else {
399 }
400 }
401
402 battleStatus->wasStatusInflicted = wasStatusInflicted;
403
406 ) {
407 if (battleStatus->lastAttackDamage > 0) {
409 }
410
411 if (battleStatus->lastAttackDamage > 0 || ((battleStatus->curAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS) && wasSpecialHit)) {
414 } else {
416 }
417 }
418 }
419
422 }
423
425
426 if (actorClass == ACTOR_PARTNER) {
427 if ((battleStatus->lastAttackDamage > 0) && (gBattleStatus.flags1 & BS_FLAGS1_TRIGGER_EVENTS)) {
428 inflict_status(target, STATUS_KEY_KO, battleStatus->lastAttackDamage);
429 }
430 }
431
432 if (!(target->flags & ACTOR_FLAG_NO_DMG_POPUP)) {
433 if (battleStatus->lastAttackDamage == 0) {
434 if (!wasSpecialHit && !wasStatusInflicted) {
435 show_immune_bonk(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 3);
436 }
437 } else if (!partImmuneToElement) {
438 if (battleStatus->curAttackElement & (DAMAGE_TYPE_MULTIPLE_POPUPS | DAMAGE_TYPE_SMASH)) {
439 show_next_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 0);
440 } else {
441 show_primary_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 0);
442 }
443 if (!(targetPart->targetFlags & ACTOR_PART_TARGET_NO_DAMAGE)) {
444 show_damage_fx(target, state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage);
445 }
446 }
447 }
448
449 if (battleStatus->lastAttackDamage > 0 && !partImmuneToElement) {
451 if (isFireDamage) {
453 } else if (isShockDamage) {
455 } else if (isIceDamage) {
457 } else {
459 }
460 }
461
462 if ((battleStatus->lastAttackDamage <= 0 && !wasStatusInflicted) || (targetPart->flags & ACTOR_FLAG_DAMAGE_IMMUNE)) {
464 }
465
466 if ((battleStatus->curAttackStatus & STATUS_FLAG_SLEEP) && wasStatusInflicted) {
468 script->varTable[0] = state->goalPos.x;
469 script->varTable[1] = state->goalPos.y;
470 script->varTable[2] = state->goalPos.z;
472 }
473 if ((battleStatus->curAttackStatus & STATUS_FLAG_DIZZY) && wasStatusInflicted) {
475 script->varTable[0] = state->goalPos.x;
476 script->varTable[1] = state->goalPos.y;
477 script->varTable[2] = state->goalPos.z;
479 }
480 if ((battleStatus->curAttackStatus & STATUS_FLAG_PARALYZE) && wasStatusInflicted) {
482 script->varTable[0] = state->goalPos.x;
483 script->varTable[1] = state->goalPos.y;
484 script->varTable[2] = state->goalPos.z;
486 }
487 if ((battleStatus->curAttackStatus & STATUS_FLAG_POISON) && wasStatusInflicted) {
489 script->varTable[0] = state->goalPos.x;
490 script->varTable[1] = state->goalPos.y;
491 script->varTable[2] = state->goalPos.z;
493 }
494 if ((battleStatus->curAttackStatus & STATUS_FLAG_STOP) && wasStatusInflicted) {
496 script->varTable[0] = state->goalPos.x;
497 script->varTable[1] = state->goalPos.y;
498 script->varTable[2] = state->goalPos.z;
500 }
501 if ((battleStatus->curAttackStatus & STATUS_FLAG_FROZEN) && wasStatusInflicted) {
503 script->varTable[0] = state->goalPos.x;
504 script->varTable[1] = state->goalPos.y;
505 script->varTable[2] = state->goalPos.z;
506 script->varTablePtr[3] = target;
508 }
509 if ((battleStatus->curAttackStatus & STATUS_FLAG_SHRINK) && wasStatusInflicted) {
511 script->varTable[0] = state->goalPos.x;
512 script->varTable[1] = state->goalPos.y;
513 script->varTable[2] = state->goalPos.z;
514 script->varTablePtr[3] = target;
516 }
517 if ((battleStatus->curAttackElement & DAMAGE_TYPE_SMASH) && (target->actorType == ACTOR_TYPE_GOOMNUT_TREE)) {
519 }
520
522
524 if (hitResult == HIT_RESULT_HIT) {
526 }
529 }
530 }
531
532 return hitResult;
533}
534
535API_CALLABLE(ItemDamageEnemy) {
537 Bytecode* args = script->ptrReadPos;
538 s32 hitResultVarOut = *args++;
539 s32 flags;
540 Actor* actor;
542
543 battleStatus->curAttackElement = *args++;
544 battleStatus->curAttackEventSuppression = 0;
545 battleStatus->curAttackStatus = *args++;
546 battleStatus->curAttackDamage = evt_get_variable(script, *args++);
547 flags = *args++;
548
552 } else if (flags & BS_FLAGS1_INCLUDE_POWER_UPS) {
555 } else if (flags & BS_FLAGS1_TRIGGER_EVENTS) {
558 } else {
561 }
562
565 } else {
567 }
568
571 } else {
573 }
574
577 } else {
579 }
580
581 actor = get_actor(script->owner1.actorID);
582 battleStatus->curTargetID = actor->targetActorID;
583 battleStatus->curTargetPart = actor->targetPartID;
584 battleStatus->statusChance = battleStatus->curAttackStatus;
585
586 if (battleStatus->statusChance == STATUS_KEY_NEVER) {
587 battleStatus->statusChance = 0;
588 }
589
590 battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8;
591
593 if (hitResult < 0) {
594 return ApiStatus_FINISH;
595 }
596
599 return ApiStatus_FINISH;
600 }
601
602 return ApiStatus_DONE2;
603}
604
605API_CALLABLE(ItemSpookEnemy) {
607 Bytecode* args = script->ptrReadPos;
608 s32 hitResultVarOut = *args++;
609 Actor* actor;
611 s32 flags;
612
613 battleStatus->curAttackElement = *args++;
614 battleStatus->curAttackEventSuppression = 0;
615 battleStatus->curAttackStatus = *args++;
616 battleStatus->curAttackStatus |= evt_get_variable(script, *args++);
617 battleStatus->curAttackDamage = evt_get_variable(script, *args++);
618 flags = *args++;
619
622 } else if (flags & BS_FLAGS1_INCLUDE_POWER_UPS) {
625 } else if (flags & BS_FLAGS1_TRIGGER_EVENTS) {
628 } else {
631 }
632
635 } else {
637 }
638
641 } else {
643 }
644
647 } else {
649 }
650
651 actor = get_actor(script->owner1.actorID);
652 battleStatus->curTargetID = actor->targetActorID;
653 battleStatus->curTargetPart = actor->targetPartID;
654 battleStatus->statusChance = battleStatus->curAttackStatus;
655
656 if (battleStatus->statusChance == STATUS_KEY_NEVER) {
657 battleStatus->statusChance = 0;
658 }
659
660 battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8;
661
663 if (hitResult < 0) {
664 return ApiStatus_FINISH;
665 }
666
669 return ApiStatus_FINISH;
670 }
671
672 return ApiStatus_DONE2;
673}
674
675API_CALLABLE(ItemAfflictEnemy) {
677 Bytecode* args = script->ptrReadPos;
678 s32 hitResultVarOut = *args++;
679 s32 flags;
680 Actor* actor;
682
683 battleStatus->curAttackElement = *args++;
684 battleStatus->curAttackEventSuppression = 0;
685 battleStatus->curAttackStatus = evt_get_variable(script, *args++);
686 battleStatus->curAttackDamage = evt_get_variable(script, *args++);
687 flags = *args++;
688
691 } else if (flags & BS_FLAGS1_INCLUDE_POWER_UPS) {
694 } else if (flags & BS_FLAGS1_TRIGGER_EVENTS) {
697 } else {
700 }
701
704 } else {
706 }
707
710 } else {
712 }
713
716 } else {
718 }
719
720 actor = get_actor(script->owner1.actorID);
721 battleStatus->curTargetID = actor->targetActorID;
722 battleStatus->curTargetPart = actor->targetPartID;
723 battleStatus->statusChance = battleStatus->curAttackStatus;
724
725 if (battleStatus->statusChance == STATUS_KEY_NEVER) {
726 battleStatus->statusChance = 0;
727 }
728
729 battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8;
730
732 if (hitResult < 0) {
733 return ApiStatus_FINISH;
734 }
735
738 return ApiStatus_FINISH;
739 }
740
741 return ApiStatus_DONE2;
742}
743
744API_CALLABLE(ItemCheckHit) {
746 Bytecode* args = script->ptrReadPos;
747 s32 hitResultVarOut = *args++;
748 s32 flags;
749 Actor* actor;
751
752 battleStatus->curAttackElement = *args++;
753 battleStatus->curAttackEventSuppression = 0;
754 battleStatus->curAttackStatus = *args++;
755 battleStatus->curAttackDamage = evt_get_variable(script, *args++);
756 flags = *args++;
757
761 } else if (flags & BS_FLAGS1_INCLUDE_POWER_UPS) {
764 } else if (flags & BS_FLAGS1_TRIGGER_EVENTS) {
767 } else {
770 }
771
774 } else {
776 }
777
780 } else {
782 }
783
786 } else {
788 }
789
790 actor = get_actor(script->owner1.actorID);
791 battleStatus->curTargetID = actor->targetActorID;
792 battleStatus->curTargetPart = actor->targetPartID;
793 battleStatus->statusChance = battleStatus->curAttackStatus;
794
795 if (battleStatus->statusChance == STATUS_KEY_NEVER) {
796 battleStatus->statusChance = 0;
797 }
798
799 battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8;
800
802 if (hitResult < 0) {
803 return ApiStatus_FINISH;
804 }
805
807
808 return ApiStatus_DONE2;
809}
BSS s32 PopupMenu_SelectedIndex
s8 transparentStatus
ActorState state
s16 targetActorID
s8 flags
Definition demo_api.c:15
HitResult calc_item_check_hit(void)
Definition dmg_item.c:5
HitResult calc_item_damage_enemy(void)
Definition dmg_item.c:49
#define INFLICT_STATUS(STATUS_TYPE)
#define sfx_play_sound_at_position
#define rand_int
#define ASSERT(condition)
@ ACTION_RATING_SUPER
sets nice hits = 2
Definition enums.h:2008
@ ACTION_RATING_NICE
sets nice hits = 1
Definition enums.h:2005
@ ACTOR_CLASS_MASK
Definition enums.h:2113
@ BS_FLAGS1_NO_RATING
Definition enums.h:3610
@ BS_FLAGS1_PARTNER_ACTING
Definition enums.h:3621
@ BS_FLAGS1_SUPER_HIT
Definition enums.h:3612
@ BS_FLAGS1_NICE_HIT
Definition enums.h:3609
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3608
@ BS_FLAGS1_SHOW_PLAYER_DECORATIONS
Definition enums.h:3601
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3604
@ BS_FLAGS1_ACTORS_VISIBLE
Definition enums.h:3598
@ ACTOR_EVENT_FLAG_RIDING_BROOMSTICK
Actor is on Magikoopa Broomstick, effect seems to be redundant.
Definition enums.h:3424
@ ACTOR_EVENT_FLAG_STAR_ROD_ENCHANTED
Actor glows and listens for Star Beam and Peach Beam events.
Definition enums.h:3420
@ ACTOR_EVENT_FLAG_GROUNDABLE
Actor can be knocked down from flight; triggered by jump attacks.
Definition enums.h:3416
@ ACTOR_EVENT_FLAG_ATTACK_CHARGED
Actor has charged an attack that can be removed with Star Beam.
Definition enums.h:3423
@ ACTOR_EVENT_FLAG_BURIED
Actor can only by hit by quake-element attacks.
Definition enums.h:3413
@ ACTOR_EVENT_FLAG_FLIPABLE
Actor can be flipped; triggered by jump and quake attacks.
Definition enums.h:3414
@ ACTOR_EVENT_FLAG_ILLUSORY
Player attacks pass through and miss.
Definition enums.h:3408
@ ACTOR_EVENT_FLAG_SPIKY_TOP
Player takes spike damage from jump attacks.
Definition enums.h:3407
@ ACTOR_EVENT_FLAG_ENCHANTED
Actor glows and listens for the Star Beam event.
Definition enums.h:3419
@ ACTOR_PART_TARGET_NO_DAMAGE
Definition enums.h:1903
@ STATUS_KEY_PARALYZE
Definition enums.h:2806
@ STATUS_KEY_FROZEN
Definition enums.h:2808
@ STATUS_TURN_MOD_UNUSED
Definition enums.h:2836
@ STATUS_KEY_TRANSPARENT
Definition enums.h:2815
@ STATUS_KEY_KO
Definition enums.h:2814
@ STATUS_KEY_SLEEP
Definition enums.h:2807
@ STATUS_KEY_UNUSED
Definition enums.h:2804
@ STATUS_KEY_STONE
Definition enums.h:2813
@ STATUS_KEY_STOP
Definition enums.h:2809
@ STATUS_KEY_DIZZY
Definition enums.h:2805
HitResult
Definition enums.h:1974
@ HIT_RESULT_LANDED_ON_SPIKE
Definition enums.h:1980
@ HIT_RESULT_NO_DAMAGE
Definition enums.h:1978
@ HIT_RESULT_HIT
Definition enums.h:1976
@ HIT_RESULT_IMMUNE
Definition enums.h:1984
@ HIT_RESULT_NICE_NO_DAMAGE
Definition enums.h:1979
@ HIT_RESULT_NICE
Definition enums.h:1977
@ HIT_RESULT_MISS
Definition enums.h:1982
@ STATUS_FLAG_STOP
Definition enums.h:2855
@ STATUS_FLAG_FROZEN
Definition enums.h:2848
@ STATUS_FLAG_SHRINK
Definition enums.h:2853
@ STATUS_FLAG_PARALYZE
Definition enums.h:2850
@ STATUS_FLAG_DIZZY
Definition enums.h:2852
@ STATUS_FLAG_SLEEP
Definition enums.h:2846
@ STATUS_FLAG_POISON
Definition enums.h:2851
@ STATUS_FLAG_UNUSED
Definition enums.h:2849
@ SOUND_IMMUNE
Definition enums.h:748
@ SOUND_DAMAGE_STARS
Definition enums.h:953
@ SOUND_INFLICT_STATUS
Definition enums.h:1358
@ SOUND_HIT_NORMAL
Definition enums.h:727
@ SOUND_SMACK_TREE
Definition enums.h:790
@ SOUND_HIT_SHOCK
Definition enums.h:1198
@ SOUND_HIT_ICE
Definition enums.h:729
@ SOUND_HIT_FIRE
Definition enums.h:728
@ SOUND_INFLICT_SLEEP
Definition enums.h:1357
@ ACTOR_PARTNER
Definition enums.h:2119
@ ACTOR_FLAG_DAMAGE_IMMUNE
Definition enums.h:3367
@ ACTOR_FLAG_NO_DMG_POPUP
Hide damage popup.
Definition enums.h:3375
@ ACTOR_FLAG_FLIPPED
Actor has been flipped over.
Definition enums.h:3364
@ SOUND_SPACE_DEFAULT
Definition enums.h:1740
@ EVENT_HIT
Definition enums.h:2165
@ EVENT_INVUNERABLE_TAUNT
Definition enums.h:2183
@ EVENT_SCARE_AWAY
Definition enums.h:2207
@ EVENT_BURN_HIT
Definition enums.h:2169
@ EVENT_STAR_BEAM
Definition enums.h:2173
@ EVENT_IMMUNE
Definition enums.h:2179
@ EVENT_FALL_TRIGGER
Definition enums.h:2167
@ EVENT_PEACH_BEAM
Definition enums.h:2174
@ EVENT_BURN_DEATH
Definition enums.h:2190
@ EVENT_ZERO_DAMAGE
Definition enums.h:2177
@ EVENT_SPIN_SMASH_HIT
Definition enums.h:2166
@ EVENT_EXPLODE_TRIGGER
Definition enums.h:2188
@ EVENT_SPIN_SMASH_DEATH
Definition enums.h:2187
@ EVENT_HIT_COMBO
Definition enums.h:2164
@ EVENT_DEATH
Definition enums.h:2186
@ EVENT_FLIP_TRIGGER
Definition enums.h:2168
@ ACTOR_PART_FLAG_DAMAGE_IMMUNE
electrified Plays extra hurt SFX?
Definition enums.h:3392
@ DAMAGE_TYPE_SPIN_SMASH
Definition enums.h:2910
@ DAMAGE_TYPE_POW
Definition enums.h:2895
@ DAMAGE_TYPE_ICE
Definition enums.h:2888
@ DAMAGE_TYPE_STATUS_ALWAYS_HITS
Definition enums.h:2914
@ DAMAGE_TYPE_SMASH
Definition enums.h:2891
@ DAMAGE_TYPE_PEACH_BEAM
Definition enums.h:2907
@ DAMAGE_TYPE_IGNORE_DEFENSE
Definition enums.h:2911
@ DAMAGE_TYPE_REMOVE_BUFFS
Definition enums.h:2906
@ DAMAGE_TYPE_SHOCK
Definition enums.h:2890
@ DAMAGE_TYPE_FIRE
Definition enums.h:2886
@ DAMAGE_TYPE_DEATH
Definition enums.h:2898
@ DAMAGE_TYPE_QUAKE
Definition enums.h:2896
@ DAMAGE_TYPE_JUMP
Definition enums.h:2892
@ DAMAGE_TYPE_FEAR
Definition enums.h:2897
@ DAMAGE_TYPE_MULTIPLE_POPUPS
Definition enums.h:2913
@ DAMAGE_TYPE_WATER
Definition enums.h:2887
@ EVT_PRIORITY_A
Definition evt.h:154
#define ApiStatus_DONE2
Definition evt.h:119
s32 Bytecode
Definition evt.h:7
#define ApiStatus_FINISH
Definition evt.h:121
void show_primary_damage_popup(f32 x, f32 y, f32 z, s32 attack, s32 a)
Definition 190B20.c:1999
s32 does_script_exist_by_ref(Evt *script)
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1730
void show_immune_bonk(f32 x, f32 y, f32 z, s32, s32, s32)
void dispatch_event_actor(Actor *, s32)
Definition 1A5830.c:102
void show_actor_health_bar(Actor *)
Definition 190B20.c:2235
void remove_status_static(s32)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
Definition evt.c:1887
void remove_status_transparent(s32)
void set_actor_flash_mode(Actor *actor, s32 arg1)
Definition 190B20.c:2426
void show_damage_fx(Actor *actor, f32 x, f32 y, f32 z, s32 damage)
Definition 190B20.c:2064
void cancel_action_rating_combo(Actor *)
Definition 190B20.c:2169
Evt * start_script(EvtScript *source, s32 priority, s32 initialState)
s32 inflict_status(Actor *, s32, s32)
Definition 190B20.c:1814
ActorPart * get_actor_part(Actor *actor, s32 partID)
Definition 190B20.c:923
void show_next_damage_popup(f32 x, f32 y, f32 z, s32 damageAmount, s32 angle)
Definition 190B20.c:2025
s32 get_defense(Actor *actor, s32 *defenseTable, s32 elementFlags)
Definition 190B20.c:1949
Actor * get_actor(s32 actorID)
Definition actor_api.c:155
void apply_shock_effect(Actor *)
void show_action_rating(s32, Actor *, f32, f32, f32)
Definition 190B20.c:2090
s32 try_inflict_status(Actor *, s32, s32)
Definition 190B20.c:2262
EvtScript EVS_PlayStopHitFX
Definition dmg_player.c:109
EvtScript EVS_PlayFreezeHitFX
Definition dmg_player.c:115
EvtScript EVS_PlayShrinkHitFX
Definition dmg_player.c:125
EvtScript EVS_PlayParalyzeHitFX
Definition dmg_player.c:97
EvtScript EVS_PlayPoisonHitFX
Definition dmg_player.c:103
EvtScript EVS_PlaySleepHitFX
Definition dmg_player.c:85
EvtScript EVS_PlayDizzyHitFX
Definition dmg_player.c:91
#define PANIC()
Definition macros.h:54
#define STATUS_KEY_NEVER
Definition macros.h:234
BattleStatus gBattleStatus
Definition battle.cpp:14