diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index 26edfaf07..af66eb6fd 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -4,6 +4,7 @@ #include "code_804267C.h" #include "code_806CD90.h" #include "code_8041AD0.h" +#include "type_chart.h" #include "constants/direction.h" #include "constants/status.h" #include "constants/type.h" @@ -826,16 +827,16 @@ void sub_80420E8(Entity *pokemon, struct DamageStruct *dmgStruct) switch(typeEffectiveness) { default: - case 0: + case EFFECTIVENESS_IMMUNE: arg = 8; break; - case 1: + case EFFECTIVENESS_RESIST: arg = 9; break; - case 2: + case EFFECTIVENESS_NEUTRAL: arg = 10; break; - case 3: + case EFFECTIVENESS_SUPER: arg = 11; break; } diff --git a/src/code_806CD90.c b/src/code_806CD90.c index cf45e15c9..b0f6898ed 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -33,6 +33,7 @@ #include "move_effects_target.h" #include "dungeon_pokemon_attributes.h" #include "code_8041AD0.h" +#include "type_chart.h" extern u8 gUnknown_202F221; extern u8 gUnknown_202DFE8[]; @@ -578,13 +579,13 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_80522F4(attacker, target, gUnknown_80F9614); } switch (dmgStruct->typeEffectiveness) { - case 0: + case EFFECTIVENESS_IMMUNE: sub_80522F4(attacker, target, gUnknown_80F9630); break; - case 1: + case EFFECTIVENESS_RESIST: sub_80522F4(attacker, target, gUnknown_80F9654); break; - case 3: + case EFFECTIVENESS_SUPER: sub_80522F4(attacker, target, gUnknown_80F9670); break; } @@ -628,7 +629,6 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc // Needed to match - the line can be safely removed dmgStruct++;dmgStruct--; - // targetData->unkA0 += dmgStruct->dmg; if (targetData->unkA0 > 999) @@ -667,7 +667,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc unkBool = FALSE; if (unkBool) { EntityInfo *info = GetEntInfo(target); - info->action.direction = (GetDirectionTowardsPosition(&target->pos, &attacker->pos) & 7); + info->action.direction = (GetDirectionTowardsPosition(&target->pos, &attacker->pos) & DIRECTION_MASK); } TargetTileInFront(target); }