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

Go to the source code of this file.

Macros

#define INFLICT_STATUS(STATUS_TYPE)
 

Functions

b32 dispatch_damage_event_player (s32 damageAmount, s32 event, b32 noHitSound)
 
b32 dispatch_hazard_event_player (s32 damageAmount, s32 event)
 
void dispatch_event_player (s32 eventType)
 
void dispatch_event_player_continue_turn (s32 eventType)
 
HitResult calc_player_test_enemy (void)
 
HitResult calc_player_damage_enemy (void)
 
b32 dispatch_damage_tick_event_player (s32 damageAmount, s32 event)
 

Variables

EvtScript EVS_PlaySleepHitFX
 
EvtScript EVS_PlayDizzyHitFX
 
EvtScript EVS_PlayParalyzeHitFX
 
EvtScript EVS_PlayPoisonHitFX
 
EvtScript EVS_PlayStopHitFX
 
EvtScript EVS_PlayFreezeHitFX
 
EvtScript EVS_PlayShrinkHitFX
 

Macro Definition Documentation

◆ INFLICT_STATUS

#define INFLICT_STATUS ( STATUS_TYPE)
Value:
if ((battleStatus->curAttackStatus & STATUS_FLAG_##STATUS_TYPE) && \
try_inflict_status(target, STATUS_KEY_##STATUS_TYPE, STATUS_TURN_MOD_##STATUS_TYPE)) { \
wasSpecialHit = TRUE; \
wasStatusInflicted = TRUE; \
} \
s32 try_inflict_status(Actor *, s32, s32)
Definition 190B20.c:2532

Function Documentation

◆ dispatch_damage_event_player()

b32 dispatch_damage_event_player ( s32 damageAmount,
s32 event,
b32 noHitSound )

Definition at line 1050 of file dmg_player.c.

1050 {
1051 BattleStatus* battleStatus = &gBattleStatus;
1052 PlayerData* playerData = &gPlayerData;
1053 Actor* player = battleStatus->playerActor;
1054 ActorState* state = &player->state;
1055 s32 oldHPChangeCounter;
1056 s32 flags;
1057 s32 dispatchEvent;
1058 s32 oldPlayerHP;
1059 s32 temp;
1060
1061 battleStatus->curAttackDamage = damageAmount;
1062
1063 temp = (s16)damageAmount; //TODO usage of temp here required to match
1064 player->hpChangeCounter += temp;
1065
1066 temp = player->hpChangeCounter;
1067 player->curHP = playerData->curHP;
1068 player->damageCounter += temp;
1069 player->hpChangeCounter -= temp;
1070 battleStatus->lastAttackDamage = 0;
1071 player->curHP -= temp;
1072 battleStatus->damageTaken += temp;
1073
1074 oldPlayerHP = player->curHP;
1075
1076 dispatchEvent = event;
1077 if (player->curHP < 1) {
1078 battleStatus->lastAttackDamage += oldPlayerHP;
1079 player->curHP = 0;
1080 dispatchEvent = EVENT_DEATH;
1081 }
1082 battleStatus->lastAttackDamage += temp;
1083 playerData->curHP = player->curHP;
1084
1085 if (dispatchEvent == EVENT_HIT_COMBO) {
1086 dispatchEvent = EVENT_HIT;
1087 }
1088 if (dispatchEvent == EVENT_ZERO_DAMAGE) {
1089 dispatchEvent = EVENT_IMMUNE;
1090 }
1091
1092 if (dispatchEvent == EVENT_DEATH) {
1093 if (event == EVENT_SPIKE_CONTACT) {
1094 dispatchEvent = EVENT_SPIKE_DEATH;
1095 }
1096 if (event == EVENT_BURN_CONTACT) {
1097 dispatchEvent = EVENT_BURN_DEATH;
1098 }
1099 if (event == EVENT_SHOCK_HIT) {
1100 dispatchEvent = EVENT_SHOCK_DEATH;
1101 }
1102 }
1103
1104 if (!noHitSound) {
1107 }
1108
1109 show_next_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 1);
1110 show_damage_fx(player, state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage);
1111
1112 if (battleStatus->lastAttackDamage > 0) {
1113 set_actor_flash_mode(player, 1);
1114 }
1115
1117 dispatch_event_player(dispatchEvent);
1118 return flags;
1119}
ActorState state
s16 damageCounter
s16 hpChangeCounter
s8 flags
Definition demo_api.c:15
void dispatch_event_player(s32 eventType)
Definition dmg_player.c:131
#define sfx_play_sound_at_position
@ BS_FLAGS1_SUPER_HIT
Definition enums.h:3579
@ BS_FLAGS1_NICE_HIT
Definition enums.h:3576
@ SOUND_HIT_NORMAL
Definition enums.h:724
@ ACTOR_PLAYER
Definition enums.h:2085
@ SOUND_SPACE_DEFAULT
Definition enums.h:1737
@ EVENT_HIT
Definition enums.h:2132
@ EVENT_SPIKE_DEATH
Definition enums.h:2160
@ EVENT_SPIKE_CONTACT
Definition enums.h:2163
@ EVENT_IMMUNE
Definition enums.h:2146
@ EVENT_BURN_DEATH
Definition enums.h:2157
@ EVENT_ZERO_DAMAGE
Definition enums.h:2144
@ EVENT_SHOCK_DEATH
Definition enums.h:2159
@ EVENT_HIT_COMBO
Definition enums.h:2131
@ EVENT_DEATH
Definition enums.h:2153
@ EVENT_SHOCK_HIT
Definition enums.h:2165
@ EVENT_BURN_CONTACT
Definition enums.h:2164
void set_actor_flash_mode(Actor *actor, s32 arg1)
Definition 190B20.c:2696
void show_damage_fx(Actor *actor, f32 x, f32 y, f32 z, s32 damage)
Definition 190B20.c:2334
void set_goal_pos_to_part(ActorState *state, s32 actorID, s32 partID)
Definition actor_api.c:44
void show_next_damage_popup(f32 x, f32 y, f32 z, s32 damageAmount, s32)
Definition 190B20.c:2295
struct Actor * playerActor
PlayerData gPlayerData
Definition 77480.c:40
BattleStatus gBattleStatus
Definition battle.c:11

Referenced by dispatch_damage_tick_event_player(), and dispatch_hazard_event_player().

◆ dispatch_hazard_event_player()

b32 dispatch_hazard_event_player ( s32 damageAmount,
s32 event )

Definition at line 1131 of file dmg_player.c.

1131 {
1132 return dispatch_damage_event_player(damageAmount, event, TRUE);
1133}
b32 dispatch_damage_event_player(s32 damageAmount, s32 event, b32 noHitSound)

Referenced by calc_player_damage_enemy(), and calc_player_test_enemy().

◆ dispatch_event_player()

void dispatch_event_player ( s32 eventType)

Definition at line 131 of file dmg_player.c.

131 {
133 Evt* oldOnHitScript;
134 s32 oldOnHitID;
135 Evt* eventScript;
136
137 player->lastEventType = eventType;
138
139 oldOnHitScript = player->handleEventScript;
140 oldOnHitID = player->handleEventScriptID;
141
143 player->handleEventScript = eventScript;
144 player->handleEventScriptID = eventScript->id;
145 eventScript->owner1.actor = NULL;
146
147 if (player->takeTurnScript != NULL) {
149 player->takeTurnScript = NULL;
150 }
151
152 if (oldOnHitScript != NULL) {
153 kill_script_by_ID(oldOnHitID);
154 }
155}
struct Evt * takeTurnScript
struct Evt * handleEventScript
s32 takeTurnScriptID
s32 handleEventScriptID
union Evt::@8 owner1
Initially -1.
@ EVT_PRIORITY_A
Definition evt.h:153
@ EVT_FLAG_RUN_IMMEDIATELY
don't wait for next update_scripts call
Definition evt.h:161
Evt * start_script(EvtScript *source, s32 priority, s32 initialState)
void kill_script_by_ID(s32 id)
EvtScript EVS_Player_HandleEvent

Referenced by btl_state_update_begin_player_turn(), btl_state_update_end_training_battle(), btl_state_update_victory(), calc_enemy_damage_target(), dispatch_damage_event_player(), and dispatch_event_general().

◆ dispatch_event_player_continue_turn()

void dispatch_event_player_continue_turn ( s32 eventType)

Definition at line 157 of file dmg_player.c.

157 {
159 Evt* oldOnHitScript;
160 s32 oldOnHitID;
161 Evt* eventScript;
162
163 player->lastEventType = eventType;
164
165 oldOnHitScript = player->handleEventScript;
166 oldOnHitID = player->handleEventScriptID;
167
169 player->handleEventScript = eventScript;
170 player->handleEventScriptID = eventScript->id;
171 eventScript->owner1.actor = NULL;
172
173 if (oldOnHitScript != NULL) {
174 kill_script_by_ID(oldOnHitID);
175 }
176}

◆ calc_player_test_enemy()

HitResult calc_player_test_enemy ( void )

Definition at line 179 of file dmg_player.c.

179 {
180 BattleStatus* battleStatus = &gBattleStatus;
181 Actor* player = battleStatus->playerActor;
182 ActorState* state = &player->state;
183 s32 targetActorID = battleStatus->curTargetID;
184 s32 targetPartIdx = battleStatus->curTargetPart;
185 Actor* target;
186 ActorPart* targetPart;
187
188 battleStatus->curTargetID2 = battleStatus->curTargetID;
189 battleStatus->curTargetPart2 = battleStatus->curTargetPart;
190
191 target = get_actor(targetActorID);
192 if (target == NULL) {
193 return HIT_RESULT_HIT;
194 }
195
196 targetPart = get_actor_part(target, targetPartIdx);
197 ASSERT(targetPart != NULL);
198
199 if (targetPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY) {
200 return HIT_RESULT_MISS;
201 }
202
204 || (targetPart->eventFlags & ACTOR_EVENT_FLAG_BURIED && !(battleStatus->curAttackElement & DAMAGE_TYPE_QUAKE))
205 ) {
206 return HIT_RESULT_MISS;
207 }
208
209 if (target->stoneStatus == STATUS_KEY_STONE) {
211 return HIT_RESULT_IMMUNE;
212 }
213
214 if ((battleStatus->curAttackElement & DAMAGE_TYPE_JUMP)
215 && (targetPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP)
217 {
220 }
221
226 {
230 return HIT_RESULT_BACKFIRE;
231 }
232
233 if (player->staticStatus != STATUS_KEY_STATIC && target->staticStatus == STATUS_KEY_STATIC) {
235 }
236
237 return HIT_RESULT_HIT;
238}
s8 transparentStatus
b32 dispatch_hazard_event_player(s32 damageAmount, s32 event)
#define ASSERT(condition)
@ ACTOR_EVENT_FLAG_SPIKY_FRONT
Player takes spike damage from hammer attacks.
Definition enums.h:3384
@ ACTOR_EVENT_FLAG_BURIED
Actor can only by hit by quake-element attacks.
Definition enums.h:3379
@ ACTOR_EVENT_FLAG_ILLUSORY
Player attacks pass through and miss.
Definition enums.h:3374
@ ACTOR_EVENT_FLAG_SPIKY_TOP
Player takes spike damage from jump attacks.
Definition enums.h:3373
@ STATUS_KEY_TRANSPARENT
Definition enums.h:2210
@ STATUS_KEY_STATIC
Definition enums.h:2207
@ STATUS_KEY_STONE
Definition enums.h:2208
@ HIT_RESULT_LANDED_ON_SPIKE
Definition enums.h:1954
@ HIT_RESULT_HIT_STATIC
Definition enums.h:1957
@ HIT_RESULT_BACKFIRE
Definition enums.h:1949
@ HIT_RESULT_HIT
Definition enums.h:1950
@ HIT_RESULT_IMMUNE
Definition enums.h:1958
@ HIT_RESULT_MISS
Definition enums.h:1956
@ SUPPRESS_EVENT_SPIKY_FRONT
Definition enums.h:2902
@ ABILITY_SPIKE_SHIELD
Definition enums.h:438
@ SOUND_IMMUNE
Definition enums.h:745
@ SOUND_HIT_SPIKE
Definition enums.h:743
@ EVENT_SPIKE_TAUNT
Definition enums.h:2148
@ DAMAGE_TYPE_QUAKE
Definition enums.h:2862
@ DAMAGE_TYPE_JUMP
Definition enums.h:2858
@ DAMAGE_TYPE_NO_CONTACT
Definition enums.h:2878
s32 player_team_is_ability_active(Actor *actor, s32 ability)
Definition 190B20.c:2765
void dispatch_event_actor(Actor *, s32)
Definition 1A5830.c:103
ActorPart * get_actor_part(Actor *actor, s32 partID)
Definition 190B20.c:1191
Actor * get_actor(s32 actorID)
Definition actor_api.c:155
s32 curAttackEventSuppression

◆ calc_player_damage_enemy()

HitResult calc_player_damage_enemy ( void )

Definition at line 240 of file dmg_player.c.

240 {
241 BattleStatus* battleStatus = &gBattleStatus;
242 Actor* player = battleStatus->playerActor;
243 s32 currentTargetID = battleStatus->curTargetID;
244 s32 currentTargetPartID = battleStatus->curTargetPart;
245 ActorState* state;
246 Evt* evt;
247 Actor* target;
248 ActorPart* targetPart;
249 s32 hitResult;
250 s32 currentAttackDamage;
251 s32 targetDefense;
252 s32 dispatchEvent;
253 s32 partImmuneToElement;
254 s32 canBeShocked;
255 s32 missedAllOrNothing;
256 s32 isFireDamage;
257 s32 isShockDamage;
258 s32 isWaterDamage;
259 s32 isIceDamage;
260 s32 wasSpecialHit;
261 s32 wasStatusInflicted;
262 s32 attackFxType;
263
264 canBeShocked = FALSE;
265 isFireDamage = FALSE;
266 isWaterDamage = FALSE;
267 isShockDamage = FALSE;
268 isIceDamage = FALSE;
269 wasSpecialHit = FALSE;
270 partImmuneToElement = FALSE;
271 wasStatusInflicted = FALSE;
272 missedAllOrNothing = FALSE;
273
274 battleStatus->wasStatusInflicted = FALSE;
275 battleStatus->lastAttackDamage = 0;
276 battleStatus->attackerActorID = player->actorID;
277 battleStatus->curTargetID2 = battleStatus->curTargetID;
278 battleStatus->curTargetPart2 = battleStatus->curTargetPart;
279 target = get_actor(currentTargetID);
280 state = &player->state;
281
282 if (target == NULL) {
283 return HIT_RESULT_HIT;
284 }
285
286 targetPart = get_actor_part(target, currentTargetPartID);
287
288 ASSERT(targetPart != NULL);
289
290 target->lastDamageTaken = 0;
291
293 hitResult = HIT_RESULT_NO_DAMAGE;
294 dispatchEvent = EVENT_ZERO_DAMAGE;
295 } else {
297 if (!(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT)) {
298 battleStatus->curAttackElement |= DAMAGE_TYPE_ICE;
299 }
300 }
301
302 if (targetPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY
304 || (targetPart->eventFlags & ACTOR_EVENT_FLAG_BURIED && !(battleStatus->curAttackElement & DAMAGE_TYPE_QUAKE))
305 ) {
306 return HIT_RESULT_MISS;
307 }
308
309 if (target->stoneStatus == STATUS_KEY_STONE) {
311 show_immune_bonk(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 1);
312 show_next_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 0);
314 return HIT_RESULT_NICE;
315 } else {
316 return HIT_RESULT_HIT;
317 }
318 }
319
320 if (targetPart->elementalImmunities & battleStatus->curAttackElement) {
321 partImmuneToElement = TRUE;
322 }
323
324 // check jumping on spiky enemy
325 if ((battleStatus->curAttackElement & DAMAGE_TYPE_JUMP)
326 && (targetPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP)
328 {
332 return HIT_RESULT_BACKFIRE;
333 }
334
335 // check touching fiery enemy and explode on contact
336 if (!(battleStatus->curAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SMASH))) {
341 return HIT_RESULT_BACKFIRE;
342 }
343
344 if (targetPart->eventFlags & ACTOR_EVENT_FLAG_FIREY
348 ) {
352 return HIT_RESULT_BACKFIRE;
353 }
354 }
355
356 // check explode on ignition
358 && battleStatus->curAttackElement & DAMAGE_TYPE_FIRE
360 ) {
364 return HIT_RESULT_NICE;
365 } else {
366 return HIT_RESULT_HIT;
367 }
368 }
369
370 // unknown alternate spiky #1
375 ) {
379 return HIT_RESULT_BACKFIRE;
380 }
381
382 if (battleStatus->curAttackElement & DAMAGE_TYPE_FIRE) {
383 fx_ring_blast(0, state->goalPos.x, state->goalPos.y, state->goalPos.z * 5.0f, 1.0f, 24);
384 isFireDamage = TRUE;
385 }
386
387 if (battleStatus->curAttackElement & DAMAGE_TYPE_SHOCK) {
388 apply_shock_effect(target);
389 isShockDamage = TRUE;
390 }
391
392 if (battleStatus->curAttackElement & DAMAGE_TYPE_WATER) {
393 fx_water_splash(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f, 1.0f, 24);
394 isWaterDamage = TRUE;
395 }
396
397 if (battleStatus->curAttackElement & DAMAGE_TYPE_ICE) {
398 fx_big_snowflakes(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f);
399 isIceDamage = TRUE;
400 }
401
402 attackFxType = player_team_is_ability_active(player, ABILITY_ATTACK_FX);
403
404 if (attackFxType) {
405 fx_breaking_junk(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f, 1.0f, 30);
406
407 switch (attackFxType) {
408 case 1:
410 break;
411 case 2:
413 break;
414 case 3:
416 break;
417 case 4:
419 break;
420 case 5:
422 break;
423 case 6:
425 break;
426 }
427 }
428
430 && player->staticStatus != STATUS_KEY_STATIC
434 ) {
436 canBeShocked = TRUE;
437 }
438
440 battleStatus->curAttackElement &= ~DAMAGE_TYPE_IGNORE_DEFENSE;
441 }
442
443 targetDefense = get_defense(target, targetPart->defenseTable, battleStatus->curAttackElement);
444
445 if (!(battleStatus->curAttackElement & DAMAGE_TYPE_IGNORE_DEFENSE)) {
446 targetDefense += target->defenseBoost;
447 }
448
450 targetDefense += 127;
451 }
452
453 currentAttackDamage = battleStatus->curAttackDamage;
454 currentAttackDamage += count_power_plus(battleStatus->curAttackElement);
455
456 if (battleStatus->merleeAttackBoost > 0
458 ) {
459 currentAttackDamage += battleStatus->merleeAttackBoost;
460 }
461
462 if (battleStatus->jumpCharge && battleStatus->curAttackElement & DAMAGE_TYPE_JUMP) {
463 currentAttackDamage += battleStatus->jumpCharge;
464 gBattleStatus.flags1 &= ~BS_FLAGS1_JUMP_CHARGED;
465 }
466
468 currentAttackDamage += battleStatus->hammerCharge;
469 gBattleStatus.flags1 &= ~BS_FLAGS1_HAMMER_CHARGED;
470 }
471
472 if (battleStatus->unk_98 != 0) {
473 currentAttackDamage += 2;
474 }
475
477 currentAttackDamage += 2;
478 }
479
481 currentAttackDamage++;
482 }
483
485 currentAttackDamage--;
486 }
487
488 if (battleStatus->turboChargeTurnsLeft != 0) {
489 currentAttackDamage++;
490 }
491
492 currentAttackDamage += player->attackBoost;
493
495 battleStatus->hpDrainCount++;
496 currentAttackDamage--;
497
498 if (currentAttackDamage < 0) {
499 battleStatus->hpDrainCount += currentAttackDamage;
500 }
501
503
504 if (battleStatus->hpDrainCount > 5) {
505 battleStatus->hpDrainCount = 5;
506 }
507 }
508
510 battleStatus->hpDrainCount += 2;
511 currentAttackDamage -= 2;
512
513 if (currentAttackDamage < 0) {
514 battleStatus->hpDrainCount += currentAttackDamage;
515 }
516
518
519 if (battleStatus->hpDrainCount > 5) {
520 battleStatus->hpDrainCount = 5;
521 }
522 }
523
526 ) {
527 if (battleStatus->rushFlags & RUSH_FLAG_POWER) {
528 currentAttackDamage += 2;
529 }
530
531 if (battleStatus->rushFlags & RUSH_FLAG_MEGA) {
532 currentAttackDamage += 4;
533 }
534 fx_radial_shimmer(9, state->goalPos.x, state->goalPos.y, state->goalPos.z, 0.5f, 20);
535 }
536
539 ) {
540 currentAttackDamage++;
541
543 missedAllOrNothing = TRUE;
544 currentAttackDamage = 0;
545#if !VERSION_JP
546 targetDefense = 0;
547#endif
548 gBattleStatus.flags1 &= ~BS_FLAGS1_NICE_HIT;
549 gBattleStatus.flags1 &= ~BS_FLAGS1_SUPER_HIT;
550 gBattleStatus.flags1 &= ~BS_FLAGS1_INCLUDE_POWER_UPS;
552 }
553 }
554
555 if (player->debuff == STATUS_KEY_SHRINK) {
556 if (currentAttackDamage > 0) {
557 currentAttackDamage /= 2;
558
559 if (currentAttackDamage == 0) {
560 currentAttackDamage = 1;
561 }
562 }
563 }
564
566 && battleStatus->curAttackElement & DAMAGE_TYPE_BLAST
568 ) {
569 targetDefense = 0;
570 currentAttackDamage = target->curHP;
571 }
572
574 targetDefense = 0;
575 currentAttackDamage = 0;
576 }
577
578 if (currentAttackDamage > 99) {
579 currentAttackDamage = 99;
580 }
581
582 if (currentAttackDamage < 0) {
583 targetDefense = 0;
584 }
585
586 target->hpChangeCounter = 0;
587 currentAttackDamage -= targetDefense;
588
589 if (currentAttackDamage < 0) {
590 currentAttackDamage = 0;
591 }
592
593 if (battleStatus->curAttackElement & DAMAGE_TYPE_POWER_BOUNCE && currentAttackDamage > 0) {
594 currentAttackDamage += battleStatus->powerBounceCounter;
595
596 if (currentAttackDamage < 1) {
597 currentAttackDamage = 1;
598 }
599 }
600
601 battleStatus->lastAttackDamage = 0;
602
603 if (currentAttackDamage < 1) {
604 target->hpChangeCounter = 0;
605 hitResult = HIT_RESULT_NO_DAMAGE;
606
607 if (!(battleStatus->curAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS)) {
608 dispatchEvent = EVENT_ZERO_DAMAGE;
610 } else {
611 if (target->curHP < 1) {
612 dispatchEvent = EVENT_DEATH;
613 } else {
614 dispatchEvent = EVENT_ZERO_DAMAGE;
615 }
616 }
617
618 battleStatus->lastAttackDamage = 0;
619 } else {
620 target->damageCounter += currentAttackDamage;
621 dispatchEvent = EVENT_HIT_COMBO;
622 hitResult = HIT_RESULT_HIT;
623 target->hpChangeCounter -= currentAttackDamage;
624
625 if (!(targetPart->flags & ACTOR_PART_FLAG_DAMAGE_IMMUNE)
627 && !partImmuneToElement
628 && !(targetPart->targetFlags & ACTOR_PART_TARGET_NO_DAMAGE)
629 ) {
630 target->curHP -= currentAttackDamage;
631
632 if (target->curHP < 1) {
633 target->curHP = 0;
634 dispatchEvent = EVENT_DEATH;
635 }
636 }
637
638 battleStatus->lastAttackDamage += currentAttackDamage;
639 target->lastDamageTaken = battleStatus->lastAttackDamage;
640 target->hpChangeCounter = 0;
641 }
642
643 if (targetPart->flags & ACTOR_PART_FLAG_DAMAGE_IMMUNE) {
645 && player->staticStatus != STATUS_KEY_STATIC
647 && !(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT)
649 && !(battleStatus->curAttackElement & DAMAGE_TYPE_SHOCK)
650 ) {
652 apply_shock_effect(player);
654 return HIT_RESULT_BACKFIRE;
655 } else {
657 dispatchEvent = EVENT_ZERO_DAMAGE;
658 } else {
659 dispatchEvent = EVENT_IMMUNE;
660 }
662 dispatch_event_actor(target, dispatchEvent);
663 show_immune_bonk(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 3);
665 return HIT_RESULT_NICE;
666 } else {
667 return HIT_RESULT_HIT;
668 }
669 }
670 }
671
673 if (battleStatus->curAttackElement & DAMAGE_TYPE_FEAR
674 && rand_int(99) < (target->actorBlueprint->escapeChance * battleStatus->statusChance) / 100
675 && (target->debuff != STATUS_KEY_FEAR
676 && target->debuff != STATUS_KEY_DIZZY
677 && target->debuff != STATUS_KEY_PARALYZE
678 && target->debuff != STATUS_KEY_SLEEP
679 && target->debuff != STATUS_KEY_FROZEN
680 && target->debuff != STATUS_KEY_STOP)
681 && !(target->flags & ACTOR_FLAG_FLIPPED)
682 ) {
685 return HIT_RESULT_NICE;
686 } else {
687 return HIT_RESULT_HIT;
688 }
689 }
690 }
691 }
692
694 if (dispatchEvent == EVENT_HIT_COMBO) {
695 dispatchEvent = EVENT_HIT;
696 }
697
698 if (dispatchEvent == EVENT_ZERO_DAMAGE) {
699 dispatchEvent = EVENT_IMMUNE;
700 }
701
702 if (target->curHP < 1) {
703 if (dispatchEvent == EVENT_IMMUNE) {
704 dispatchEvent = EVENT_DEATH;
705 }
706 }
707 } else if (dispatchEvent == EVENT_DEATH) {
708 dispatchEvent = EVENT_HIT_COMBO;
709 }
710
712 clear_part_pal_adjustment(targetPart);
713 }
714
715 // check for special case damage events
717 // if damage is from Spin Smash, convert generic events to Spin Smash specific events
718 if (battleStatus->curAttackElement & DAMAGE_TYPE_SPIN_SMASH) {
719 PlayerData* playerData = &gPlayerData;
720
721 if (target->actorBlueprint->spinSmashReq != 255
722 && playerData->hammerLevel + 1 >= target->actorBlueprint->spinSmashReq
723 && battleStatus->lastAttackDamage > 0
725 ) {
726 if (dispatchEvent == EVENT_HIT_COMBO) {
727 dispatchEvent = EVENT_SPIN_SMASH_HIT;
728 }
729
730 if (dispatchEvent == EVENT_HIT) {
731 dispatchEvent = EVENT_SPIN_SMASH_HIT;
732 }
733
734 if (dispatchEvent == EVENT_ZERO_DAMAGE) {
735 dispatchEvent = EVENT_SPIN_SMASH_HIT;
736 }
737
738 if (dispatchEvent == EVENT_IMMUNE) {
739 dispatchEvent = EVENT_SPIN_SMASH_HIT;
740 }
741
742 if (dispatchEvent == EVENT_DEATH) {
743 dispatchEvent = EVENT_SPIN_SMASH_DEATH;
744 }
745 }
746 }
747
748 // if damage is from Power Bounce, convert generic events to Power Bounce specific events
750 && !(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT)
752 ) {
753 if (dispatchEvent == EVENT_HIT_COMBO) {
754 dispatchEvent = EVENT_POWER_BOUNCE_HIT;
755 }
756
757 if (dispatchEvent == EVENT_HIT) {
758 dispatchEvent = EVENT_POWER_BOUNCE_HIT;
759 }
760
761 if (dispatchEvent == EVENT_ZERO_DAMAGE) {
762 dispatchEvent = EVENT_POWER_BOUNCE_HIT;
763 }
764
765 if (dispatchEvent == EVENT_IMMUNE) {
766 dispatchEvent = EVENT_POWER_BOUNCE_HIT;
767 }
768
769 if (dispatchEvent == EVENT_DEATH) {
770 dispatchEvent = EVENT_POWER_BOUNCE_DEATH;
771 }
772 }
773
774 // try generating fall trigger events
776 && (battleStatus->curAttackElement & (DAMAGE_TYPE_POW | DAMAGE_TYPE_JUMP))
778 ) {
779 if (dispatchEvent == EVENT_HIT) {
780 dispatchEvent = EVENT_FALL_TRIGGER;
781 }
782
783 if (dispatchEvent == EVENT_IMMUNE) {
784 dispatchEvent = EVENT_FALL_TRIGGER;
785 }
786
787 wasSpecialHit = TRUE;
788 }
789
790 // try generating flip trigger events
794 ) {
795 if (dispatchEvent == EVENT_HIT) {
796 dispatchEvent = EVENT_FLIP_TRIGGER;
797 }
798
799 if (dispatchEvent == EVENT_IMMUNE) {
800 dispatchEvent = EVENT_FLIP_TRIGGER;
801 }
802
803 if (!(target->flags & ACTOR_FLAG_FLIPPED)) {
804 wasSpecialHit = TRUE;
805 }
806 }
807 }
808
809 // try generating flip trigger events
813 ) {
814 if (dispatchEvent == EVENT_HIT_COMBO) {
815 dispatchEvent = EVENT_FLIP_TRIGGER;
816 }
817
818 if (dispatchEvent == EVENT_ZERO_DAMAGE) {
819 dispatchEvent = EVENT_FLIP_TRIGGER;
820 }
821
822 if (!(target->flags & ACTOR_FLAG_FLIPPED)) {
823 wasSpecialHit = TRUE;
824 }
825 }
826
827 // try generating shell crack events
831 ) {
832 if (dispatchEvent == EVENT_HIT) {
833 dispatchEvent = EVENT_SHELL_CRACK_HIT;
834 }
835
836 if (dispatchEvent == EVENT_IMMUNE) {
837 dispatchEvent = EVENT_SHELL_CRACK_HIT;
838 }
839 wasSpecialHit = TRUE;
840 }
841
842 // try generating burn events
845 ) {
846 if (dispatchEvent == EVENT_HIT) {
847 dispatchEvent = EVENT_BURN_HIT;
848 }
849
850 if (dispatchEvent == EVENT_DEATH) {
851 dispatchEvent = EVENT_BURN_DEATH;
852 }
853
854 isFireDamage = TRUE;
855 }
856
857 // try inflicting status effects
859 && battleStatus->lastAttackDamage >= 0
860 && dispatchEvent != EVENT_DEATH
861 && dispatchEvent != EVENT_SPIN_SMASH_DEATH
862 && dispatchEvent != EVENT_EXPLODE_TRIGGER
863 && !(targetPart->targetFlags & ACTOR_PART_TARGET_NO_DAMAGE)
864 ) {
865 #define INFLICT_STATUS(STATUS_TYPE) \
866 if ((battleStatus->curAttackStatus & STATUS_FLAG_##STATUS_TYPE) && \
867 try_inflict_status(target, STATUS_KEY_##STATUS_TYPE, STATUS_TURN_MOD_##STATUS_TYPE)) { \
868 wasSpecialHit = TRUE; \
869 wasStatusInflicted = TRUE; \
870 } \
871
872 INFLICT_STATUS(SHRINK);
873 INFLICT_STATUS(POISON);
874 INFLICT_STATUS(STONE);
875 INFLICT_STATUS(SLEEP);
876 INFLICT_STATUS(STOP);
877 INFLICT_STATUS(STATIC);
878 INFLICT_STATUS(FEAR);
879 INFLICT_STATUS(PARALYZE);
880 INFLICT_STATUS(DIZZY);
881
882 #undef INFLICT_STATUS
883
884 if (wasStatusInflicted) {
885 if (dispatchEvent == EVENT_ZERO_DAMAGE) {
886 dispatchEvent = EVENT_HIT_COMBO;
887 }
888
889 if (dispatchEvent == EVENT_IMMUNE) {
890 dispatchEvent = EVENT_HIT;
891 }
892 }
893 }
894
895 battleStatus->wasStatusInflicted = wasStatusInflicted;
896 dispatch_event_actor(target, dispatchEvent);
897
898 if (!(target->flags & ACTOR_FLAG_NO_DMG_POPUP)) {
899 if (battleStatus->lastAttackDamage == 0) {
900 if (!wasSpecialHit && !wasStatusInflicted) {
901 show_immune_bonk(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 3);
902 }
903 } else if (!partImmuneToElement) {
905 show_next_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 0);
906 } else {
907 show_primary_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 0);
908 }
909
910 if (!(targetPart->targetFlags & ACTOR_PART_TARGET_NO_DAMAGE)) {
911 show_damage_fx(target, state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage);
912 }
913 }
914 }
915
918 if (player->actorTypeData1[5]) {
920 }
921
922 if (battleStatus->lastAttackDamage > 0) {
924 }
925
926 if (battleStatus->lastAttackDamage > 0 || ((battleStatus->curAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS) && wasSpecialHit)) {
927 if (!(battleStatus->curAttackElement & DAMAGE_TYPE_MULTI_BOUNCE)) {
928 show_action_rating(ACTION_RATING_NICE, target, state->goalPos.x, state->goalPos.y, state->goalPos.z);
929 } else {
931 }
932 }
933 }
934 }
935
936 if (missedAllOrNothing) {
937 show_action_rating(ACTION_RATING_MISS, target, state->goalPos.x, state->goalPos.y, state->goalPos.z);
938 }
939
941 func_80266970(target);
942 }
943
944 if ((battleStatus->lastAttackDamage > 0 || wasSpecialHit) && !partImmuneToElement) {
945 set_actor_flash_mode(target, 1);
946
947 if (isFireDamage) {
949 } else if (isShockDamage) {
951 } else if (isIceDamage) {
953 } else {
955 }
956 }
957
958 if (battleStatus->lastAttackDamage < 1 && !wasSpecialHit && !canBeShocked || targetPart->flags & ACTOR_PART_FLAG_DAMAGE_IMMUNE) {
960 }
961
962 if (battleStatus->curAttackStatus & STATUS_FLAG_SLEEP && wasStatusInflicted) {
964 evt->varTable[0] = state->goalPos.x;
965 evt->varTable[1] = state->goalPos.y;
966 evt->varTable[2] = state->goalPos.z;
968 }
969
970 if (battleStatus->curAttackStatus & STATUS_FLAG_DIZZY && wasStatusInflicted) {
972 evt->varTable[0] = state->goalPos.x;
973 evt->varTable[1] = state->goalPos.y;
974 evt->varTable[2] = state->goalPos.z;
976 }
977
978 if (battleStatus->curAttackStatus & STATUS_FLAG_PARALYZE && wasStatusInflicted) {
980 evt->varTable[0] = state->goalPos.x;
981 evt->varTable[1] = state->goalPos.y;
982 evt->varTable[2] = state->goalPos.z;
984 }
985
986 if (battleStatus->curAttackStatus & STATUS_FLAG_POISON && wasStatusInflicted) {
988 evt->varTable[0] = state->goalPos.x;
989 evt->varTable[1] = state->goalPos.y;
990 evt->varTable[2] = state->goalPos.z;
992 }
993
994 if (battleStatus->curAttackStatus & STATUS_FLAG_STOP && wasStatusInflicted) {
996 evt->varTable[0] = state->goalPos.x;
997 evt->varTable[1] = state->goalPos.y;
998 evt->varTable[2] = state->goalPos.z;
1000 }
1001
1002 if (battleStatus->curAttackStatus & STATUS_FLAG_FROZEN && wasStatusInflicted) {
1004 evt->varTable[0] = state->goalPos.x;
1005 evt->varTable[1] = state->goalPos.y;
1006 evt->varTable[2] = state->goalPos.z;
1007 evt->varTablePtr[3] = target;
1009 }
1010
1011 if (battleStatus->curAttackStatus & STATUS_FLAG_SHRINK && wasStatusInflicted) {
1013 evt->varTable[0] = state->goalPos.x;
1014 evt->varTable[1] = state->goalPos.y;
1015 evt->varTable[2] = state->goalPos.z;
1016 evt->varTablePtr[3] = target;
1018 }
1019
1020 if (battleStatus->curAttackElement & DAMAGE_TYPE_SMASH && target->actorType == ACTOR_TYPE_GOOMNUT_TREE) {
1022 }
1023
1024 show_actor_health_bar(target);
1025
1027 if (hitResult == HIT_RESULT_HIT) {
1028 hitResult = HIT_RESULT_NICE;
1029 }
1030 if (hitResult == HIT_RESULT_NO_DAMAGE) {
1031 hitResult = HIT_RESULT_NICE_NO_DAMAGE;
1032 }
1033 }
1034
1036 && (player->staticStatus != STATUS_KEY_STATIC)
1040 ) {
1042 apply_shock_effect(player);
1044 return HIT_RESULT_BACKFIRE;
1045 }
1046
1047 return hitResult;
1048}
s16 lastDamageTaken
struct ActorBlueprint * actorBlueprint
s32 elementalImmunities
s32 actorTypeData1[6]
EvtScript EVS_PlayStopHitFX
Definition dmg_player.c:109
#define INFLICT_STATUS(STATUS_TYPE)
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 rand_int
@ ACTION_RATING_NICE_SUPER_COMBO
'Nice' but becomes 'Super' if nice hits > 2
Definition enums.h:1984
@ ACTION_RATING_MISS
clears nice hits
Definition enums.h:1980
@ ACTION_RATING_NICE
sets nice hits = 1
Definition enums.h:1979
@ BS_FLAGS1_TUTORIAL_BATTLE
Definition enums.h:3594
@ BS_FLAGS1_NO_RATING
Definition enums.h:3577
@ BS_FLAGS1_FORCE_IMMUNE_HIT
Definition enums.h:3580
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3575
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3571
@ ACTOR_EVENT_FLAG_STAR_ROD_ENCHANTED
Actor glows and listens for Star Beam and Peach Beam events.
Definition enums.h:3386
@ ACTOR_EVENT_FLAG_GROUNDABLE
Actor can be knocked down from flight; triggered by jump attacks.
Definition enums.h:3382
@ ACTOR_EVENT_FLAG_FIRE_EXPLODE
Fire attacks trigger an explosion, used only by bullet/bombshell bills.
Definition enums.h:3378
@ ACTOR_EVENT_FLAG_POWER_BOUNCE
Actor listens for Power Bounce events.
Definition enums.h:3387
@ ACTOR_EVENT_FLAG_ELECTRIFIED
Player takes shock damage upon contact.
Definition enums.h:3375
@ ACTOR_EVENT_FLAG_EXTREME_DEFENSE
Actor has 127 extra defense during damage calculation, unaffected by IGNORE_DEFENSE.
Definition enums.h:3381
@ ACTOR_EVENT_FLAG_EXPLODE_ON_CONTACT
Attacks that contact will trigger an explosion.
Definition enums.h:3383
@ ACTOR_EVENT_FLAG_FIREY
Player takes burn damage upon contact.
Definition enums.h:3371
@ ACTOR_EVENT_FLAG_ALT_SPIKY
Additional spiky quality associated with Pokeys and Spinies.
Definition enums.h:3388
@ ACTOR_EVENT_FLAG_FLIPABLE
Actor can be flipped; triggered by jump and quake attacks.
Definition enums.h:3380
@ ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION
Blast and fire attacks trigger an explosion.
Definition enums.h:3377
@ ACTOR_EVENT_FLAG_ENCHANTED
Actor glows and listens for the Star Beam event.
Definition enums.h:3385
@ ACTOR_PART_TARGET_NO_DAMAGE
Definition enums.h:1877
@ RUSH_FLAG_MEGA
Definition enums.h:5331
@ RUSH_FLAG_POWER
Definition enums.h:5332
@ BS_FLAGS2_IS_FIRST_STRIKE
Definition enums.h:3618
@ BS_FLAGS2_HAS_DRAINED_HP
Definition enums.h:3620
@ BS_FLAGS2_HAS_RUSH
Definition enums.h:3621
@ STATUS_KEY_PARALYZE
Definition enums.h:2201
@ STATUS_KEY_FROZEN
Definition enums.h:2203
@ STATUS_KEY_FEAR
Definition enums.h:2199
@ STATUS_KEY_SLEEP
Definition enums.h:2202
@ STATUS_KEY_STOP
Definition enums.h:2204
@ STATUS_KEY_SHRINK
Definition enums.h:2206
@ STATUS_KEY_DIZZY
Definition enums.h:2200
@ HIT_RESULT_NO_DAMAGE
Definition enums.h:1952
@ HIT_RESULT_NICE_NO_DAMAGE
Definition enums.h:1953
@ HIT_RESULT_NICE
Definition enums.h:1951
@ SUPPRESS_EVENT_ALT_SPIKY
Definition enums.h:2905
@ SUPPRESS_EVENT_SHOCK_CONTACT
Definition enums.h:2903
@ SUPPRESS_EVENT_BURN_CONTACT
Definition enums.h:2904
@ STATUS_FLAG_STOP
Definition enums.h:2821
@ STATUS_FLAG_FROZEN
Definition enums.h:2814
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
@ STATUS_FLAG_PARALYZE
Definition enums.h:2816
@ STATUS_FLAG_DIZZY
Definition enums.h:2818
@ STATUS_FLAG_SLEEP
Definition enums.h:2812
@ STATUS_FLAG_POISON
Definition enums.h:2817
@ ABILITY_BERSERKER
Definition enums.h:457
@ ABILITY_ATTACK_FX
Definition enums.h:451
@ ABILITY_P_DOWN_D_UP
Definition enums.h:473
@ ABILITY_MEGA_HP_DRAIN
Definition enums.h:472
@ ABILITY_ZAP_TAP
Definition enums.h:455
@ ABILITY_P_UP_D_DOWN
Definition enums.h:470
@ ABILITY_FIRE_SHIELD
Definition enums.h:443
@ ABILITY_ICE_POWER
Definition enums.h:449
@ ABILITY_ALL_OR_NOTHING
Definition enums.h:446
@ ABILITY_HP_DRAIN
Definition enums.h:445
@ SOUND_DAMAGE_STARS
Definition enums.h:950
@ SOUND_INFLICT_STATUS
Definition enums.h:1355
@ SOUND_HIT_PLAYER_ICE
Definition enums.h:721
@ SOUND_FLOWERS_LAUGH
Definition enums.h:1389
@ SOUND_HIT_PLAYER_SHOCK
Definition enums.h:1194
@ SOUND_SLIDE_WHISTLE_OUT
Definition enums.h:715
@ SOUND_HIT_PLAYER_FIRE
Definition enums.h:720
@ SOUND_HIT_WHACKA
Definition enums.h:1412
@ SOUND_SMACK_TREE
Definition enums.h:787
@ SOUND_HIT_SHOCK
Definition enums.h:1195
@ SOUND_PLANTS_BELL
Definition enums.h:727
@ SOUND_HIT_ICE
Definition enums.h:726
@ SOUND_HIT_FIRE
Definition enums.h:725
@ SOUND_LIFE_SHROOM_CHIME
Definition enums.h:1186
@ SOUND_YOSHI
Definition enums.h:1411
@ SOUND_INFLICT_SLEEP
Definition enums.h:1354
@ ACTOR_FLAG_NO_DMG_POPUP
Hide damage popup.
Definition enums.h:3341
@ ACTOR_FLAG_FLIPPED
Actor has been flipped over.
Definition enums.h:3330
@ EVENT_SCARE_AWAY
Definition enums.h:2174
@ EVENT_BURN_HIT
Definition enums.h:2136
@ EVENT_POWER_BOUNCE_DEATH
Definition enums.h:2161
@ EVENT_FALL_TRIGGER
Definition enums.h:2134
@ EVENT_SPIN_SMASH_HIT
Definition enums.h:2133
@ EVENT_EXPLODE_TRIGGER
Definition enums.h:2155
@ EVENT_SPIN_SMASH_DEATH
Definition enums.h:2154
@ EVENT_SHELL_CRACK_HIT
Definition enums.h:2139
@ EVENT_POWER_BOUNCE_HIT
Definition enums.h:2142
@ EVENT_FLIP_TRIGGER
Definition enums.h:2135
@ EVENT_BURN_TAUNT
Definition enums.h:2149
@ ACTOR_PART_FLAG_DAMAGE_IMMUNE
electrified Plays extra hurt SFX?
Definition enums.h:3358
@ DAMAGE_TYPE_SPIN_SMASH
Definition enums.h:2876
@ DAMAGE_TYPE_POW
Definition enums.h:2861
@ DAMAGE_TYPE_MULTI_BOUNCE
Definition enums.h:2874
@ DAMAGE_TYPE_ICE
Definition enums.h:2854
@ DAMAGE_TYPE_SHELL_CRACK
Definition enums.h:2868
@ DAMAGE_TYPE_STATUS_ALWAYS_HITS
Definition enums.h:2880
@ DAMAGE_TYPE_THROW
Definition enums.h:2869
@ DAMAGE_TYPE_SMASH
Definition enums.h:2857
@ DAMAGE_TYPE_POWER_BOUNCE
Definition enums.h:2870
@ DAMAGE_TYPE_IGNORE_DEFENSE
Definition enums.h:2877
@ DAMAGE_TYPE_SHOCK
Definition enums.h:2856
@ DAMAGE_TYPE_BLAST
Definition enums.h:2860
@ DAMAGE_TYPE_FIRE
Definition enums.h:2852
@ DAMAGE_TYPE_QUAKE_HAMMER
Definition enums.h:2871
@ DAMAGE_TYPE_FEAR
Definition enums.h:2863
@ DAMAGE_TYPE_MULTIPLE_POPUPS
Definition enums.h:2879
@ DAMAGE_TYPE_WATER
Definition enums.h:2853
void show_primary_damage_popup(f32 x, f32 y, f32 z, s32 attack, s32 a)
Definition 190B20.c:2269
s32 is_ability_active(s32 arg0)
Definition inventory.c:1725
void show_immune_bonk(f32 x, f32 y, f32 z, s32, s32, s32)
s32 count_power_plus(s32)
Definition 190B20.c:939
void show_actor_health_bar(Actor *)
Definition 190B20.c:2505
void clear_part_pal_adjustment(ActorPart *)
Definition 190B20.c:2618
s32 get_defense(Actor *actor, s32 *defenseTable, s32 elementFlags)
Definition 190B20.c:2219
void func_80266970(Actor *)
Definition 190B20.c:2439
void apply_shock_effect(Actor *)
void show_action_rating(s32, Actor *, f32, f32, f32)
Definition 190B20.c:2360
void sfx_play_sound(s32 soundID)
Definition sfx.c:517

◆ dispatch_damage_tick_event_player()

b32 dispatch_damage_tick_event_player ( s32 damageAmount,
s32 event )

Definition at line 1122 of file dmg_player.c.

1122 {
1123 BattleStatus* battleStatus = &gBattleStatus;
1124
1125 battleStatus->curAttackElement = ELEMENT_END;
1126 battleStatus->curDamageSource = DMG_SRC_DEFAULT;
1127 return dispatch_damage_event_player(damageAmount, event, FALSE);
1128}
@ ELEMENT_END
Definition enums.h:2114
@ DMG_SRC_DEFAULT
Definition enums.h:1988

Referenced by btl_state_update_begin_player_turn().

Variable Documentation

◆ EVS_PlaySleepHitFX

EvtScript EVS_PlaySleepHitFX
Initial value:
= {
Call(PlaySleepHitFX)
}
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define Return
Kills the current EVT thread.
Definition macros.h:217

Definition at line 85 of file dmg_player.c.

85 {
86 Call(PlaySleepHitFX)
87 Return
88 End
89};

Referenced by calc_enemy_damage_target(), calc_item_damage_enemy(), calc_partner_damage_enemy(), and calc_player_damage_enemy().

◆ EVS_PlayDizzyHitFX

EvtScript EVS_PlayDizzyHitFX
Initial value:
= {
Call(PlayDizzyHitFX)
}

Definition at line 91 of file dmg_player.c.

91 {
92 Call(PlayDizzyHitFX)
93 Return
94 End
95};

Referenced by calc_enemy_damage_target(), calc_item_damage_enemy(), calc_partner_damage_enemy(), and calc_player_damage_enemy().

◆ EVS_PlayParalyzeHitFX

EvtScript EVS_PlayParalyzeHitFX
Initial value:
= {
Call(PlayParalyzeHitFX)
}

Definition at line 97 of file dmg_player.c.

97 {
98 Call(PlayParalyzeHitFX)
99 Return
100 End
101};

Referenced by calc_enemy_damage_target(), calc_item_damage_enemy(), calc_partner_damage_enemy(), and calc_player_damage_enemy().

◆ EVS_PlayPoisonHitFX

EvtScript EVS_PlayPoisonHitFX
Initial value:
= {
Call(PlayPoisonHitFX)
}

Definition at line 103 of file dmg_player.c.

103 {
104 Call(PlayPoisonHitFX)
105 Return
106 End
107};

Referenced by calc_enemy_damage_target(), calc_item_damage_enemy(), calc_partner_damage_enemy(), and calc_player_damage_enemy().

◆ EVS_PlayStopHitFX

EvtScript EVS_PlayStopHitFX
Initial value:
= {
Call(PlayStopHitFX)
}

Definition at line 109 of file dmg_player.c.

109 {
110 Call(PlayStopHitFX)
111 Return
112 End
113};

Referenced by calc_enemy_damage_target(), calc_item_damage_enemy(), calc_partner_damage_enemy(), and calc_player_damage_enemy().

◆ EVS_PlayFreezeHitFX

EvtScript EVS_PlayFreezeHitFX
Initial value:
= {
Call(PlayFreezeHitSnowflakeFX)
Wait(8)
Call(PlayFreezeHitSnowflakeFX)
Wait(15)
Call(PlayFreezeHitParticleFX)
}
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254

Definition at line 115 of file dmg_player.c.

115 {
116 Call(PlayFreezeHitSnowflakeFX)
117 Wait(8)
118 Call(PlayFreezeHitSnowflakeFX)
119 Wait(15)
120 Call(PlayFreezeHitParticleFX)
121 Return
122 End
123};

Referenced by calc_enemy_damage_target(), calc_item_damage_enemy(), calc_partner_damage_enemy(), and calc_player_damage_enemy().

◆ EVS_PlayShrinkHitFX

EvtScript EVS_PlayShrinkHitFX
Initial value:
= {
Call(PlayShrinkHitFX)
}

Definition at line 125 of file dmg_player.c.

125 {
126 Call(PlayShrinkHitFX)
127 Return
128 End
129};

Referenced by calc_enemy_damage_target(), calc_item_damage_enemy(), calc_partner_damage_enemy(), and calc_player_damage_enemy().