9 s8 currentTargetPartS8;
10 u32 currentTargetPart;
15 currentTargetPart = currentTargetPartS8 = battleStatus->
curTargetPart;
55 s32 partImmuneToElement;
56 s32 wasSpecialHit = FALSE;
58 s32 isFireDamage = FALSE;
59 s32 isWaterDamage = FALSE;
60 s32 isShockDamage = FALSE;
61 s32 isIceDamage = FALSE;
70 s32 wasStatusInflicted;
79 wasStatusInflicted = FALSE;
86 if (targetPart == NULL) {
93 state = &player->
state;
95 state = &partner->
state;
104 isShockDamage = TRUE;
108 isWaterDamage = TRUE;
135 partImmuneToElement = TRUE;
137 partImmuneToElement = FALSE;
150 if (attackDamage > 99) {
153 if (attackDamage <= 0) {
157 attackDamage -= temp;
160 if (attackDamage <= 0) {
180 && !partImmuneToElement
183 target->
curHP -= attackDamage;
184 if (target->
curHP <= 0) {
226 wasStatusInflicted = TRUE;
230 wasStatusInflicted = TRUE;
258 wasStatusInflicted = TRUE;
269 wasStatusInflicted = TRUE;
273 wasStatusInflicted = TRUE;
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; \
361 #undef INFLICT_STATUS
363 if (wasStatusInflicted) {
388 wasSpecialHit = TRUE;
391 wasStatusInflicted = TRUE;
431 if (!wasSpecialHit && !wasStatusInflicted) {
434 }
else if (!partImmuneToElement) {
450 }
else if (isShockDamage) {
452 }
else if (isIceDamage) {
465 script->varTable[0] = state->
goalPos.
x;
466 script->varTable[1] = state->
goalPos.
y;
467 script->varTable[2] = state->
goalPos.
z;
472 script->varTable[0] = state->
goalPos.
x;
473 script->varTable[1] = state->
goalPos.
y;
474 script->varTable[2] = state->
goalPos.
z;
479 script->varTable[0] = state->
goalPos.
x;
480 script->varTable[1] = state->
goalPos.
y;
481 script->varTable[2] = state->
goalPos.
z;
486 script->varTable[0] = state->
goalPos.
x;
487 script->varTable[1] = state->
goalPos.
y;
488 script->varTable[2] = state->
goalPos.
z;
493 script->varTable[0] = state->
goalPos.
x;
494 script->varTable[1] = state->
goalPos.
y;
495 script->varTable[2] = state->
goalPos.
z;
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;
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;
532API_CALLABLE(ItemDamageEnemy) {
534 Bytecode* args = script->ptrReadPos;
535 s32 hitResultVarOut = *args++;
578 actor =
get_actor(script->owner1.actorID);
602API_CALLABLE(ItemSpookEnemy) {
604 Bytecode* args = script->ptrReadPos;
605 s32 hitResultVarOut = *args++;
648 actor =
get_actor(script->owner1.actorID);
672API_CALLABLE(ItemAfflictEnemy) {
674 Bytecode* args = script->ptrReadPos;
675 s32 hitResultVarOut = *args++;
717 actor =
get_actor(script->owner1.actorID);
741API_CALLABLE(ItemCheckHit) {
743 Bytecode* args = script->ptrReadPos;
744 s32 hitResultVarOut = *args++;
787 actor =
get_actor(script->owner1.actorID);
struct ActorBlueprint * actorBlueprint
HitResult calc_item_check_hit(void)
HitResult calc_item_damage_enemy(void)
#define INFLICT_STATUS(STATUS_TYPE)
#define sfx_play_sound_at_position
#define ASSERT(condition)
@ 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_ILLUSORY
Player attacks pass through and miss.
@ ACTOR_EVENT_FLAG_SPIKY_TOP
Player takes spike damage from jump attacks.
@ ACTOR_EVENT_FLAG_ENCHANTED
Actor glows and listens for the Star Beam event.
@ ACTOR_PART_TARGET_NO_DAMAGE
@ HIT_RESULT_LANDED_ON_SPIKE
@ 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)
s32 does_script_exist_by_ref(Evt *script)
s32 evt_get_variable(Evt *script, Bytecode var)
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)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
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)
ActorPart * get_actor_part(Actor *actor, s32 partID)
s32 get_defense(Actor *actor, s32 *defenseTable, s32 elementFlags)
Actor * get_actor(s32 actorID)
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
s32 curAttackEventSuppression
struct Actor * playerActor
BattleStatus gBattleStatus