232 {
237 s32 actorClass;
240 s32 hitResult;
241 s32 one = TRUE;
242 s32 statusInflicted = FALSE;
243 s32 statusInflicted2 = FALSE;
244 s32 isFire = FALSE;
245 s32 isWater = FALSE;
246 s32 isIce = FALSE;
247 s32 isElectric = FALSE;
248 s32 madeElectricContact = FALSE;
249 s32 isPlayer;
250 s32 defense;
251 s32 event;
252 s32 damage;
254
257
261
263 if (target == NULL) {
265 }
266
268 ASSERT(targetPart != NULL);
269
272
273 switch (actorClass) {
276 break;
279 break;
281 break;
282 }
283
284
285
288 }
289
292 ) {
294 }
295
302 }
303
304
305
309 ) {
313 }
314 }
318 }
321 isFire = TRUE;
322 }
325 isElectric = TRUE;
326 }
329 isWater = TRUE;
330 }
333 isIce = TRUE;
334 }
335
341 {
342 madeElectricContact = TRUE;
344 }
345
346
347
348
350
351
352
354
357
361 defense += 2;
362 } else {
363 defense += 1;
364 }
365 }
366
368 defense += 1;
369 }
370 }
371 }
372
373
374
376
377 switch (actorClass) {
380 break;
383 break;
384 }
385
387
390 }
391
393 if (damage > 0) {
394 damage /= 2;
395 }
396 }
397
398 if (damage > 99) {
399 damage = 99;
400 }
401 if (damage < 1) {
402 defense = 0;
403 }
404
406 damage -= defense;
407
408
409
411 if (isPlayer) {
414 damage--;
415 }
416 }
417
421
422 if (target->
curHP <= 5) {
424 damage /= 2;
425 }
426 }
427 }
428
429
430
431 switch (actorClass) {
433
437 ) {
438 s32 blocked;
439
442 } else {
444 }
445
446 if (blocked) {
447 damage--;
452 break;
453 }
455 }
456 break;
461 damage = 0;
465 break;
466 }
468 }
469 }
470 break;
471 }
472
475 }
476
477
478
480 if (damage < 1) {
485 } else {
488 if (target->
curHP < 1) {
490 }
491 }
493 } else {
500 ) {
502 target->
curHP -= damage;
503 }
504
505 if (target->
curHP < 1) {
508 }
509 }
513
517 }
518 }
519
523 }
526 }
529 }
532 }
533
536 }
537
541 ) {
544 }
547 }
548 }
549
553 ) {
556 }
559 }
560 }
561
564 ) {
567 }
570 }
571 isFire = TRUE;
572 }
573
577 }
580 }
583 }
586 }
589 }
590 }
591
592
593
602 {
604 statusInflicted = one;
605 statusInflicted2 = one;
606 }
608 statusInflicted = one;
609 statusInflicted2 = one;
610 }
612 statusInflicted = one;
613 statusInflicted2 = one;
614 }
616 statusInflicted = one;
617 statusInflicted2 = one;
618 }
620 statusInflicted = one;
621 statusInflicted2 = one;
622 }
624 statusInflicted = one;
625 statusInflicted2 = one;
626 }
628 statusInflicted = one;
629 statusInflicted2 = one;
630 }
632 statusInflicted = one;
633 statusInflicted2 = one;
634 }
636 statusInflicted = one;
637 statusInflicted2 = one;
638 }
639
642 statusInflicted = one;
643 statusInflicted2 = one;
644 }
646 statusInflicted = one;
647 statusInflicted2 = one;
648 }
649
651 statusInflicted = one;
652 statusInflicted2 = one;
653 }
654
655 if (statusInflicted) {
658 }
661 }
662 }
663 }
664
665
666
668
669 switch (actorClass) {
672 break;
675 break;
678 break;
679 }
680
685 {
687 }
688
690 switch (actorClass) {
694 if (!statusInflicted2 && !statusInflicted) {
695
697 }
701 } else {
704 break;
705 }
706 break;
709 if (!statusInflicted2 && !statusInflicted) {
711 }
715 } else {
718 }
719 break;
720 }
721 }
722
724 u32 hitSound;
725
727
730 }
731
732 if (isFire) {
734 } else if (!isElectric) {
736 } else {
738 }
739
741 }
742
745 }
746
749 script->varTable[0] = state->
goalPos.
x;
750 script->varTable[1] = state->
goalPos.
y;
751 script->varTable[2] = state->
goalPos.
z;
753 }
756 script->varTable[0] = state->
goalPos.
x;
757 script->varTable[1] = state->
goalPos.
y;
758 script->varTable[2] = state->
goalPos.
z;
760 }
763 script->varTable[0] = state->
goalPos.
x;
764 script->varTable[1] = state->
goalPos.
y;
765 script->varTable[2] = state->
goalPos.
z;
767 }
770 script->varTable[0] = state->
goalPos.
x;
771 script->varTable[1] = state->
goalPos.
y;
772 script->varTable[2] = state->
goalPos.
z;
774 }
777 script->varTable[0] = state->
goalPos.
x;
778 script->varTable[1] = state->
goalPos.
y;
779 script->varTable[2] = state->
goalPos.
z;
781 }
784 script->varTable[0] = state->
goalPos.
x;
785 script->varTable[1] = state->
goalPos.
y;
786 script->varTable[2] = state->
goalPos.
z;
787 script->varTablePtr[3] = target;
789 }
792 script->varTable[0] = state->
goalPos.
x;
793 script->varTable[1] = state->
goalPos.
y;
794 script->varTable[2] = state->
goalPos.
z;
795 script->varTablePtr[3] = target;
797 }
798
801 }
802
804
811 {
816 }
817
818 return hitResult;
819}
s32 dispatch_damage_event_actor_1(Actor *actor, s32 damageAmount, s32 event)
void play_hit_sound(Actor *actor, f32 x, f32 y, f32 z, u32 hitSound)
s32 has_enchanted_part(Actor *actor)
s32 check_block_input(s32 buttonMask)
@ ACTION_RATING_NICE
sets nice hits = 1
@ BS_FLAGS1_TUTORIAL_BATTLE
@ BS_FLAGS1_PLAYER_DEFENDING
@ BS_FLAGS1_TRIGGER_EVENTS
@ ACTOR_EVENT_FLAG_ELECTRIFIED
Player takes shock damage upon contact.
@ 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_EXPLODE_ON_IGNITION
Blast and fire attacks trigger an explosion.
@ BS_FLAGS2_IS_FIRST_STRIKE
@ STATUS_TURN_MOD_PARALYZE
@ SUPPRESS_EVENT_SHOCK_CONTACT
@ ABILITY_HEALTHY_HEALTHY
@ ACTOR_FLAG_FLYING
Quake Hammer can't hit.
@ ACTOR_FLAG_NO_DMG_POPUP
Hide damage popup.
@ ACTOR_FLAG_NO_DMG_APPLY
Damage is not applied to actor HP.
@ ACTOR_PART_FLAG_DAMAGE_IMMUNE
electrified Plays extra hurt SFX?
@ DAMAGE_TYPE_STATUS_ALWAYS_HITS
@ DAMAGE_TYPE_UNBLOCKABLE
@ DAMAGE_TYPE_IGNORE_DEFENSE
@ DAMAGE_TYPE_MULTIPLE_POPUPS
void show_primary_damage_popup(f32 x, f32 y, f32 z, s32 attack, s32 a)
s32 is_ability_active(s32 arg0)
void show_immune_bonk(f32 x, f32 y, f32 z, s32, s32, s32)
void show_actor_health_bar(Actor *)
void clear_part_pal_adjustment(ActorPart *)
void set_actor_flash_mode(Actor *actor, s32 arg1)
void show_damage_fx(Actor *actor, f32 x, f32 y, f32 z, s32 damage)
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)
s32 try_inflict_status(Actor *, s32, s32)
s32 inflict_partner_ko(Actor *target, s32 statusTypeKey, s32 duration)
EvtScript EVS_PlayStopHitFX
EvtScript EVS_PlayFreezeHitFX
EvtScript EVS_PlayShrinkHitFX
EvtScript EVS_PlayParalyzeHitFX
EvtScript EVS_PlayPoisonHitFX
EvtScript EVS_PlaySleepHitFX
EvtScript EVS_PlayDizzyHitFX
s32 curAttackEventSuppression