From 15342e5f94cac291547d8246d06a66647ffa5d17 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Wed, 27 Nov 2024 11:38:06 -0600 Subject: [PATCH] Synced some symbol names with Sky --- asm/code_807E5AC.s | 10 ++++---- include/constants/dungeon.h | 2 +- include/dungeon_pokemon_attributes.h | 4 ++-- src/code_8042B34.c | 2 +- src/code_8048480.c | 8 +++---- src/code_805D8C8_1.c | 4 ++-- src/code_8069E0C.c | 34 ++++++++++++++-------------- src/code_806CD90.c | 30 ++++++++++++------------ src/code_806E8B0.c | 20 ++++++++-------- src/code_80718D8.c | 10 ++++---- src/code_8073CF0.c | 10 ++++---- src/code_8077274_1.c | 2 +- src/code_807CD9C.c | 26 ++++++++++----------- src/code_807E1A0.c | 4 ++-- src/code_808417C.c | 4 ++-- src/dungeon_action.c | 6 ++--- src/dungeon_ai_attack.c | 2 +- src/dungeon_ai_movement.c | 8 +++---- src/dungeon_ai_targeting.c | 14 ++++++------ src/dungeon_capabilities.c | 2 +- src/dungeon_move.c | 18 +++++++-------- src/dungeon_pokemon_attributes.c | 6 ++--- src/move_actions.c | 22 +++++++++--------- src/move_effects_target.c | 28 +++++++++++------------ src/status.c | 14 ++++++------ src/status_actions.c | 6 ++--- src/status_checks_1.c | 4 ++-- src/type_effectiveness.c | 30 ++++++++++++------------ 28 files changed, 165 insertions(+), 165 deletions(-) diff --git a/asm/code_807E5AC.s b/asm/code_807E5AC.s index f8426f4b8..91304f75e 100644 --- a/asm/code_807E5AC.s +++ b/asm/code_807E5AC.s @@ -347,7 +347,7 @@ _0807E90E: bl CalcSpeedStage adds r0, r5, 0 movs r1, 0x25 - bl HasAbility + bl AbilityIsActive lsls r0, 24 cmp r0, 0 beq _0807E958 @@ -414,7 +414,7 @@ _0807E9A4: bhi _0807E9FE adds r0, r5, 0 movs r1, 0x25 - bl HasAbility + bl AbilityIsActive lsls r0, 24 cmp r0, 0 beq _0807E9D4 @@ -1034,7 +1034,7 @@ _0807EEA0: adds r1, r5, 0 movs r2, 0x3 adds r3, r6, 0 - bl WarpTarget + bl WarpTarget b _0807EE72 _0807EEAE: movs r6, 0 @@ -1741,7 +1741,7 @@ sub_807F43C: mov r8, r1 mov r0, r8 movs r1, 0xE - bl HasAbility + bl AbilityIsActive lsls r0, 24 cmp r0, 0 beq _0807F470 @@ -2301,7 +2301,7 @@ _0807F8BE: mov r1, r8 movs r2, 0 movs r3, 0 - bl WarpTarget + bl WarpTarget b _0807F8FA .align 2, 0 _0807F8D0: .4byte gAdjacentTileOffsets diff --git a/include/constants/dungeon.h b/include/constants/dungeon.h index 34b160728..c43042b25 100644 --- a/include/constants/dungeon.h +++ b/include/constants/dungeon.h @@ -108,7 +108,7 @@ enum DungeonID NUM_DUNGEONS }; -static inline bool8 IsClientOrTeamBase(s32 joinedDungeon) +static inline bool8 IsExperienceLocked(s32 joinedDungeon) { if (joinedDungeon == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON || joinedDungeon == DUNGEON_RESCUE_TEAM_BASE) return TRUE; diff --git a/include/dungeon_pokemon_attributes.h b/include/dungeon_pokemon_attributes.h index e2aca1773..018d2201c 100644 --- a/include/dungeon_pokemon_attributes.h +++ b/include/dungeon_pokemon_attributes.h @@ -6,10 +6,10 @@ bool8 HasSafeguardStatus(Entity * param_1, Entity * param_2, bool8 displayMessage); bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage); bool8 sub_80717A4(Entity *pokemon, u16 moveID); -bool8 HasAbility(Entity *pokemon, u8 ability); +bool8 AbilityIsActive(Entity *pokemon, u8 ability); bool8 MonsterIsType(Entity *pokemon, u8 type); bool8 CanSeeInvisibleMonsters(Entity *pokemon); -bool8 HasTactic(Entity *pokemon, u8 tactic); +bool8 IsTacticSet(Entity *pokemon, u8 tactic); bool8 IQSkillIsEnabled(Entity *pokemon, u8 IQSkill); void LoadIQSkills(Entity *pokemon); bool8 CanSeeTeammate(Entity * pokemon); diff --git a/src/code_8042B34.c b/src/code_8042B34.c index 756944284..c7836fcce 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -1010,7 +1010,7 @@ void sub_8043D60(void) if (monInfo->shopkeeper == TRUE) unk = FALSE; - if (IsClientOrTeamBase(monInfo->joinedAt.id)) + if (IsExperienceLocked(monInfo->joinedAt.id)) unk = FALSE; if (monInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) unk = FALSE; diff --git a/src/code_8048480.c b/src/code_8048480.c index 97651a482..b44d141ab 100644 --- a/src/code_8048480.c +++ b/src/code_8048480.c @@ -746,7 +746,7 @@ void HandleGummiItemAction(Entity *pokemon, Entity *target, u8 gummiIndex) gUnknown_810A808[targetInfo->types[0]][gummiIndex] + gUnknown_810A808[targetInfo->types[1]][gummiIndex],0,1); if (!targetInfo->isNotTeamMember) { - if (!IsClientOrTeamBase(targetInfo->joinedAt.id)) { + if (!IsExperienceLocked(targetInfo->joinedAt.id)) { baseIQ = targetInfo->IQ; targetInfo->IQ += gummiBoost; currIQ = baseIQ + gummiBoost; @@ -834,7 +834,7 @@ bool8 sub_8048950(Entity *param_1,Item *item) if (entityInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { flag = FALSE; } - if (IsClientOrTeamBase(entityInfo->joinedAt.id)) { + if (IsExperienceLocked(entityInfo->joinedAt.id)) { flag = FALSE; } entityInfo->unk157 = flag; @@ -896,7 +896,7 @@ bool8 sub_8048A68(Entity *param_1,Item *item) if (pEVar6->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { flag = FALSE; } - if (IsClientOrTeamBase(pEVar6->joinedAt.id)) { + if (IsExperienceLocked(pEVar6->joinedAt.id)) { flag = FALSE; } if (pEVar6->isTeamLeader) { @@ -959,7 +959,7 @@ bool32 sub_8048B9C(Entity *entity,Item *param_2) { flag = FALSE; } - if(IsClientOrTeamBase(entity1Info->joinedAt.id)) + if(IsExperienceLocked(entity1Info->joinedAt.id)) { flag = FALSE; } diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index c501b3ca9..1fb12e6c4 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -1541,7 +1541,7 @@ bool8 sub_805EC4C(Entity *a0, u8 a1) tileMonsterInfo = GetEntInfo(tileMonster); if (tileMonsterInfo->isNotTeamMember && (tileMonsterInfo->shopkeeper != 1 && tileMonsterInfo->shopkeeper != 2) - && !IsClientOrTeamBase(tileMonsterInfo->joinedAt.id) + && !IsExperienceLocked(tileMonsterInfo->joinedAt.id) && tileMonsterInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET) { return FALSE; } @@ -3468,7 +3468,7 @@ void sub_806145C(struct UnkFieldTeamMenuStruct *a0) } } - if (IsClientOrTeamBase(monInfo->joinedAt.id)) { + if (IsExperienceLocked(monInfo->joinedAt.id)) { sub_8044FF0(0x19); sub_8044FF0(0x3B); sub_8044FF0(0x1A); diff --git a/src/code_8069E0C.c b/src/code_8069E0C.c index 24e484b26..fb26c414f 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -108,7 +108,7 @@ void sub_8069E0C(Entity *pokemon) EntityInfo *entityInfo; entityInfo = GetEntInfo(pokemon); - if (HasAbility(pokemon, ABILITY_FORECAST)) { + if (AbilityIsActive(pokemon, ABILITY_FORECAST)) { entityInfo->types[0] = gUnknown_80F520C[GetApparentWeather(pokemon)].unk0; entityInfo->types[1] = TYPE_NONE; } @@ -134,16 +134,16 @@ void TriggerWeatherAbilities(void) { entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { - if (HasAbility(entity, ABILITY_DRIZZLE)) { + if (AbilityIsActive(entity, ABILITY_DRIZZLE)) { gDungeon->weather.naturalWeather[WEATHER_RAIN] = 1; } - else if (HasAbility(entity, ABILITY_SAND_STREAM)) { + else if (AbilityIsActive(entity, ABILITY_SAND_STREAM)) { gDungeon->weather.naturalWeather[WEATHER_SANDSTORM] = 1; } - else if (HasAbility(entity, ABILITY_DROUGHT)) { + else if (AbilityIsActive(entity, ABILITY_DROUGHT)) { gDungeon->weather.naturalWeather[WEATHER_SUNNY] = 1; } - if ((HasAbility(entity, ABILITY_AIR_LOCK)) || (HasAbility(entity, ABILITY_CLOUD_NINE))) { + if ((AbilityIsActive(entity, ABILITY_AIR_LOCK)) || (AbilityIsActive(entity, ABILITY_CLOUD_NINE))) { gDungeon->weather.nullifyWeather = TRUE; } } @@ -154,7 +154,7 @@ void TriggerWeatherAbilities(void) s32 GetMonsterApparentID(Entity *pokemon, s16 id) { if (id == MONSTER_CASTFORM || IS_CASTFORM_FORM_MONSTER(id)) { - if (HasAbility(pokemon, ABILITY_FORECAST)) + if (AbilityIsActive(pokemon, ABILITY_FORECAST)) return gUnknown_80F520C[GetApparentWeather(pokemon)].unk2; return MONSTER_CASTFORM; } @@ -219,7 +219,7 @@ void sub_8069F9C(Entity *pokemon, Entity *target, Move *move) if (targetInfo->unk15A != 0) { targetInfo->unk15A = 0; - if (HasAbility(target, ABILITY_COLOR_CHANGE)) { + if (AbilityIsActive(target, ABILITY_COLOR_CHANGE)) { u8 type = GetMoveTypeForMonster(pokemon,move); if (move->id == MOVE_WEATHER_BALL) { u32 weather = GetApparentWeather(pokemon); @@ -266,7 +266,7 @@ void sub_806A120(Entity * pokemon, Entity * target, Move* move) void sub_806A1B0(Entity *pokemon) { - if ((EntityExists(pokemon)) && (HasAbility(pokemon, ABILITY_TRUANT))) { + if ((EntityExists(pokemon)) && (AbilityIsActive(pokemon, ABILITY_TRUANT))) { PausedStatusTarget(pokemon,pokemon,0,1,0); } } @@ -832,37 +832,37 @@ void EndAbilityImmuneStatus(Entity *attacker, Entity *target) { EntityInfo *targetInfo = GetEntInfo(target); - if (HasAbility(target, ABILITY_LIMBER) && targetInfo->burnClassStatus.status == STATUS_PARALYSIS) { + if (AbilityIsActive(target, ABILITY_LIMBER) && targetInfo->burnClassStatus.status == STATUS_PARALYSIS) { EndBurnClassStatus(attacker, target); } - if (HasAbility(target, ABILITY_OWN_TEMPO) && targetInfo->cringeClassStatus.status == STATUS_CONFUSED) { + if (AbilityIsActive(target, ABILITY_OWN_TEMPO) && targetInfo->cringeClassStatus.status == STATUS_CONFUSED) { EndCringeClassStatus(attacker, target); } - if (HasAbility(target, ABILITY_WATER_VEIL) && targetInfo->burnClassStatus.status == STATUS_BURN) { + if (AbilityIsActive(target, ABILITY_WATER_VEIL) && targetInfo->burnClassStatus.status == STATUS_BURN) { EndBurnClassStatus(attacker, target); } - if (HasAbility(target, ABILITY_OBLIVIOUS) && targetInfo->cringeClassStatus.status == STATUS_INFATUATED) { + if (AbilityIsActive(target, ABILITY_OBLIVIOUS) && targetInfo->cringeClassStatus.status == STATUS_INFATUATED) { EndCringeClassStatus(attacker, target); } - if ((HasAbility(target, ABILITY_INSOMNIA) || HasAbility(target, ABILITY_VITAL_SPIRIT)) + if ((AbilityIsActive(target, ABILITY_INSOMNIA) || AbilityIsActive(target, ABILITY_VITAL_SPIRIT)) && (IsSleeping(target) || targetInfo->sleepClassStatus.status == STATUS_YAWNING)) { EndSleepClassStatus(attacker, target, FALSE, TRUE); } - if (HasAbility(target, ABILITY_MAGMA_ARMOR) && targetInfo->frozenClassStatus.status == STATUS_FROZEN) { + if (AbilityIsActive(target, ABILITY_MAGMA_ARMOR) && targetInfo->frozenClassStatus.status == STATUS_FROZEN) { EndFrozenClassStatus(attacker, target); } - if (HasAbility(target, ABILITY_IMMUNITY) && ENTITY_POISONED(targetInfo)) { + if (AbilityIsActive(target, ABILITY_IMMUNITY) && ENTITY_POISONED(targetInfo)) { EndBurnClassStatus(attacker, target); } - if (HasAbility(target, ABILITY_FORECAST)) { + if (AbilityIsActive(target, ABILITY_FORECAST)) { targetInfo->isColorChanged = FALSE; if (targetInfo->reflectClassStatus.status == STATUS_CONVERSION2) { EndReflectClassStatus(attacker, target); @@ -2265,7 +2265,7 @@ void sub_806C51C(Entity *entity) if (!entInfo->isNotTeamMember || entInfo->curseClassStatus.status == STATUS_DECOY) { var_34 = 1; } - if (IsClientOrTeamBase(entInfo->joinedAt.id) || entInfo->monsterBehavior == 1) { + if (IsExperienceLocked(entInfo->joinedAt.id) || entInfo->monsterBehavior == 1) { var_34 = 1; } diff --git a/src/code_806CD90.c b/src/code_806CD90.c index 8ec947ca3..66ee0f002 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -379,7 +379,7 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * returnDmg += 4; } - if (HasAbility(target, ABILITY_ROUGH_SKIN)) + if (AbilityIsActive(target, ABILITY_ROUGH_SKIN)) returnDmg += 2; if (returnDmg) { @@ -407,37 +407,37 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * bool32 isPhysical = IsTypePhysical(dmgStruct->type); EntityInfo *attackerInfo = GetEntInfo(attacker); - if (HasAbility(target, ABILITY_ARENA_TRAP) + if (AbilityIsActive(target, ABILITY_ARENA_TRAP) && !MonsterIsType(attacker, TYPE_FLYING) - && !HasAbility(attacker, ABILITY_LEVITATE) + && !AbilityIsActive(attacker, ABILITY_LEVITATE) && DungeonRandInt(100) < gUnknown_80F4E10) { attackerInfo->abilityEffectFlags |= ABILITY_FLAG_ARENA_TRAP; } - if (HasAbility(target, ABILITY_SHADOW_TAG) + if (AbilityIsActive(target, ABILITY_SHADOW_TAG) && DungeonRandInt(100) < gUnknown_80F4E12) { attackerInfo->abilityEffectFlags |= ABILITY_FLAG_SHADOW_TAG; } - if (HasAbility(target, ABILITY_MAGNET_PULL) + if (AbilityIsActive(target, ABILITY_MAGNET_PULL) && MonsterIsType(attacker, TYPE_STEEL) && DungeonRandInt(100) < gUnknown_80F4E14) { attackerInfo->abilityEffectFlags |= ABILITY_FLAG_MAGNET_PULL; } - if (HasAbility(target, ABILITY_STATIC) + if (AbilityIsActive(target, ABILITY_STATIC) && isPhysical && DungeonRandInt(100) < gUnknown_80F4E16) { attackerInfo->abilityEffectFlags |= ABILITY_FLAG_STATIC; } - if (HasAbility(target, ABILITY_POISON_POINT) + if (AbilityIsActive(target, ABILITY_POISON_POINT) && DungeonRandInt(100) < gUnknown_80F4E18) { attackerInfo->abilityEffectFlags |= ABILITY_FLAG_POISON_POINT; } - if (HasAbility(target, ABILITY_EFFECT_SPORE) + if (AbilityIsActive(target, ABILITY_EFFECT_SPORE) && isPhysical && DungeonRandInt(100) < gUnknown_80F4E1A) { @@ -449,18 +449,18 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * else attackerInfo->abilityEffectFlags |= ABILITY_FLAG_EFFECT_SPORE_SLP; } - if (HasAbility(target, ABILITY_FLAME_BODY) + if (AbilityIsActive(target, ABILITY_FLAME_BODY) && DungeonRandInt(100) < gUnknown_80F4E1C) { attackerInfo->abilityEffectFlags |= ABILITY_FLAG_FLAME_BODY; } - if (HasAbility(target, ABILITY_CUTE_CHARM) + if (AbilityIsActive(target, ABILITY_CUTE_CHARM) && isPhysical && DungeonRandInt(100) < gUnknown_80F4E1E) { attackerInfo->abilityEffectFlags |= ABILITY_FLAG_CUTE_CHARM; } - if (HasAbility(target, ABILITY_STENCH) + if (AbilityIsActive(target, ABILITY_STENCH) && DungeonRandInt(100) < gUnknown_80F4E20) { attackerInfo->abilityEffectFlags |= ABILITY_FLAG_STENCH; @@ -519,7 +519,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc dmgStruct->dmg = gUnknown_80F4F8C; } - if (arg4 != 0x20E && HasAbility(target, ABILITY_STURDY) && dmgStruct->dmg == 9999) { + if (arg4 != 0x20E && AbilityIsActive(target, ABILITY_STURDY) && dmgStruct->dmg == 9999) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FCA90); sub_8042238(attacker, target); @@ -540,12 +540,12 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc WakeUpPokemon(target); } - if ((HasAbility(target, ABILITY_VOLT_ABSORB) && dmgStruct->type == TYPE_ELECTRIC)) { + if ((AbilityIsActive(target, ABILITY_VOLT_ABSORB) && dmgStruct->type == TYPE_ELECTRIC)) { HealTargetHP(attacker, target, dmgStruct->dmg, 0, 0); dmgStruct->tookNoDamage = TRUE; return FALSE; } - else if (HasAbility(target, ABILITY_WATER_ABSORB) && dmgStruct->type == TYPE_WATER) { + else if (AbilityIsActive(target, ABILITY_WATER_ABSORB) && dmgStruct->type == TYPE_WATER) { HealTargetHP(attacker, target, dmgStruct->dmg, 0, 0); dmgStruct->tookNoDamage = TRUE; return FALSE; @@ -739,7 +739,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc if (targetData->isTeamLeader || (targetData->joinedAt.id == DUNGEON_JOIN_LOCATION_PARTNER && gDungeon->unk644.unk18 == 0)) { DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9CEC[r8]); } - else if (IsClientOrTeamBase(targetData->joinedAt.id)) { + else if (IsExperienceLocked(targetData->joinedAt.id)) { DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DAC[r8]); } else if (targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index 71b55a305..0b1ad4249 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -63,7 +63,7 @@ static void ApplyAtkDefStatBoosts(Entity *attacker, Entity *target, u8 moveType, s32 defDivisor = 1; s32 splitIndex = (!IsTypePhysical(moveType)) ? 1 : 0; - if (HasAbility(attacker, ABILITY_GUTS)) { + if (AbilityIsActive(attacker, ABILITY_GUTS)) { EntityInfo *entInfo = GetEntInfo(attacker); bool8 gutsBoost = HasNegativeStatus(attacker); bool8 visFlags_attacker_1 = SetVisualFlags(entInfo,1,gutsBoost); @@ -77,7 +77,7 @@ static void ApplyAtkDefStatBoosts(Entity *attacker, Entity *target, u8 moveType, } } - if ((HasAbility(attacker, ABILITY_HUGE_POWER)) || (HasAbility(attacker, ABILITY_PURE_POWER))) { + if ((AbilityIsActive(attacker, ABILITY_HUGE_POWER)) || (AbilityIsActive(attacker, ABILITY_PURE_POWER))) { EntityInfo *entInfo = GetEntInfo(attacker); bool32 hugePowerBoost = (rand < 33 && splitIndex == 0); bool8 visFlags_attacker_2 = SetVisualFlags(entInfo,0x100,hugePowerBoost); @@ -92,7 +92,7 @@ static void ApplyAtkDefStatBoosts(Entity *attacker, Entity *target, u8 moveType, } } - if ((HasAbility(attacker, ABILITY_HUSTLE)) && (splitIndex == 0)) { + if ((AbilityIsActive(attacker, ABILITY_HUSTLE)) && (splitIndex == 0)) { atkMultiplier *= 3; atkDivisor *= 2; } @@ -104,21 +104,21 @@ static void ApplyAtkDefStatBoosts(Entity *attacker, Entity *target, u8 moveType, isNotEnemy = TRUE; } - if ((HasAbility(attacker, ABILITY_PLUS)) && (splitIndex == 1) && gDungeon->minusIsActive[isNotEnemy]) { + if ((AbilityIsActive(attacker, ABILITY_PLUS)) && (splitIndex == 1) && gDungeon->minusIsActive[isNotEnemy]) { atkMultiplier *= 15; atkDivisor *= 10; } - if ((HasAbility(attacker, ABILITY_MINUS)) && (splitIndex == 1) && gDungeon->plusIsActive[isNotEnemy]) { + if ((AbilityIsActive(attacker, ABILITY_MINUS)) && (splitIndex == 1) && gDungeon->plusIsActive[isNotEnemy]) { atkMultiplier *= 15; atkDivisor *= 10; } - if (HasAbility(target, ABILITY_INTIMIDATE) && (splitIndex == 0)) { + if (AbilityIsActive(target, ABILITY_INTIMIDATE) && (splitIndex == 0)) { atkMultiplier *= 4; atkDivisor *= 5; } - if ((HasAbility(target, ABILITY_MARVEL_SCALE)) && (splitIndex == 0)) { + if ((AbilityIsActive(target, ABILITY_MARVEL_SCALE)) && (splitIndex == 0)) { EntityInfo *targetInfo = GetEntInfo(target); bool8 hasNegStatus_target = HasNegativeStatus(target); bool8 visFlags_target = SetVisualFlags(targetInfo, 8, hasNegStatus_target); @@ -164,7 +164,7 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 if (!attackerInfo->isTeamLeader && FixedPointToInt(attackerInfo->belly) == 0) { SetDamageOne(dmgStruct, moveType); } - else if (moveId == MOVE_REGULAR_ATTACK && HasAbility(target, ABILITY_WONDER_GUARD)) { + else if (moveId == MOVE_REGULAR_ATTACK && AbilityIsActive(target, ABILITY_WONDER_GUARD)) { SetDamageOne(dmgStruct, moveType); } else { @@ -346,7 +346,7 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 } // Check crit - if (!HasAbility(target, ABILITY_BATTLE_ARMOR) && !HasAbility(target, ABILITY_SHELL_ARMOR)) { + if (!AbilityIsActive(target, ABILITY_BATTLE_ARMOR) && !AbilityIsActive(target, ABILITY_SHELL_ARMOR)) { s32 critOdds; if (attackerInfo->isNotTeamMember) { @@ -471,7 +471,7 @@ void sub_806F370(Entity *pokemon, Entity *target, s32 dmg, s32 giveExp, bool8 *t s32 effectiv = gTypeEffectivenessChart[moveType][targetInfo->types[i]]; typeEffectiveness[i] = effectiv; } - if (HasAbility(target, ABILITY_WONDER_GUARD)) { + if (AbilityIsActive(target, ABILITY_WONDER_GUARD)) { if (gUnknown_80F54B4[typeEffectiveness[0]][typeEffectiveness[1]] != EFFECTIVENESS_SUPER) { dmgNew = 0; } diff --git a/src/code_80718D8.c b/src/code_80718D8.c index 0668da04d..a63165289 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -166,7 +166,7 @@ void sub_8071D4C(Entity *pokemon, Entity *target, s32 exp) info = GetEntInfo(target); if (info->level != 100) { - if (!IsClientOrTeamBase(info->joinedAt.id)) { + if (!IsExperienceLocked(info->joinedAt.id)) { newExp = info->exp + exp; if (9999998 < newExp) { newExp = 9999999; @@ -309,7 +309,7 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para atk[1] = info->atk[1]; def[0] = info->def[0]; def[1] = info->def[1]; - if (!IsClientOrTeamBase(info->joinedAt.id)) { + if (!IsExperienceLocked(info->joinedAt.id)) { newLevel = info->level + level; if (99 < newLevel) { newLevel = 100; @@ -441,7 +441,7 @@ void LevelDownTarget(Entity *pokemon, Entity *target, u32 level) { flag = FALSE; info = GetEntInfo(target); - if(!IsClientOrTeamBase(info->joinedAt.id)) + if(!IsExperienceLocked(info->joinedAt.id)) { newLevel = info->level - level; if(newLevel <= 0) @@ -480,7 +480,7 @@ bool8 sub_80723D0(Entity *pokemon, Entity *target, u8 param_3, u8 param_4) exp = info->exp; - if(IsClientOrTeamBase(info->joinedAt.id)) + if(IsExperienceLocked(info->joinedAt.id)) return FALSE; for(level = info->level + 1; level <= 100; level++) @@ -577,7 +577,7 @@ bool8 sub_80725A4(Entity *pokemon, Entity *target) oldLevel = info->level; - if(IsClientOrTeamBase(info->joinedAt.id)) return FALSE; + if(IsExperienceLocked(info->joinedAt.id)) return FALSE; for(level = 1; level < info->level; level++) { diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index 39bb9e81d..39d01a8c5 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -143,7 +143,7 @@ void sub_8073D14(Entity *entity) return; if (entityInfo->shopkeeper == 1) return; - if (IsClientOrTeamBase(entityInfo->joinedAt.id)) + if (IsExperienceLocked(entityInfo->joinedAt.id)) return; if (entityInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) return; @@ -407,13 +407,13 @@ void sub_8074094(Entity *entity) // Abilities check rand = DungeonRandInt(100); - if (HasAbility(entity, ABILITY_SHED_SKIN) && rand < gUnknown_80F4E0C && HasNegativeStatus(entity)) { + if (AbilityIsActive(entity, ABILITY_SHED_SKIN) && rand < gUnknown_80F4E0C && HasNegativeStatus(entity)) { UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; sub_8079F20(entity, entity, 1, 0); } - if (HasAbility(entity, ABILITY_SPEED_BOOST)) { + if (AbilityIsActive(entity, ABILITY_SPEED_BOOST)) { entityInfo->unk113++; if (entityInfo->unk113 >= gUnknown_80F4F30) { entityInfo->unk113 = 0; @@ -541,7 +541,7 @@ void sub_8074094(Entity *entity) entityInfo->leechSeedClassStatus.status = 0; } else { - bool8 dmgUser = HasAbility(entity, ABILITY_LIQUID_OOZE); + bool8 dmgUser = AbilityIsActive(entity, ABILITY_LIQUID_OOZE); sub_80444F4(entity); UseAttack(NULL); if (!EntityExists(entity) || !EntityExists(target) || sub_8044B28()) @@ -646,7 +646,7 @@ void TickStatusHeal(Entity *entity) r4 += gUnknown_80F4FC4; if (entityInfo->reflectClassStatus.status == STATUS_WISH) r4 += gUnknown_80F4FC0; - if (HasAbility(entity, ABILITY_RAIN_DISH) && GetApparentWeather(entity) == WEATHER_RAIN) + if (AbilityIsActive(entity, ABILITY_RAIN_DISH) && GetApparentWeather(entity) == WEATHER_RAIN) r4 += gUnknown_80F4FC2; if (r4 > 500) diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index a4c5d1a1b..a6c15420e 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -964,7 +964,7 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - if(HasAbility(target, ABILITY_FORECAST)) + if(AbilityIsActive(target, ABILITY_FORECAST)) TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsConversion2Message); else { diff --git a/src/code_807CD9C.c b/src/code_807CD9C.c index 2af5b6e00..d5b3358b7 100644 --- a/src/code_807CD9C.c +++ b/src/code_807CD9C.c @@ -99,7 +99,7 @@ void BlowAwayTarget(Entity *pokemon, Entity *target, u32 direction) return; } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (HasAbility(target,ABILITY_SUCTION_CUPS)) { + if (AbilityIsActive(target,ABILITY_SUCTION_CUPS)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCBCC); // {POKEMON_0} is anchored! It can't be knocked flying! return; } @@ -250,7 +250,7 @@ void WarpTarget(Entity *pokemon, Entity *target, u32 param_3, DungeonPos *pos) flag = FALSE; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (HasAbility(target,ABILITY_SUCTION_CUPS)) { + if (AbilityIsActive(target,ABILITY_SUCTION_CUPS)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAE8); return; } @@ -1036,7 +1036,7 @@ void HandlePounceOrbAction(Entity *pokemon, Entity *target, u8 r2) { DungeonPos pos; u32 direction = r2; info = GetEntInfo(target); - if(HasAbility(target, ABILITY_SUCTION_CUPS)) + if(AbilityIsActive(target, ABILITY_SUCTION_CUPS)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FCB98); @@ -1058,19 +1058,19 @@ void HandlePounceOrbAction(Entity *pokemon, Entity *target, u8 r2) { pos.y = target->pos.y + gAdjacentTileOffsets[direction].y; if(pos.x <= 0 || pos.y <= 0 || pos.x > DUNGEON_MAX_SIZE_X - 2 || pos.y > DUNGEON_MAX_SIZE_Y - 2) break; - + tile = GetTile(pos.x, pos.y); if(tile->monster) break; if(!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) break; - + sub_80694C0(target, pos.x, pos.y, 0); - + sub_804535C(target, 0); if(!sub_8045888(target)) continue; sub_803E46C(0x3A); } - + sub_806A5B8(target); if(sub_80706A4(target, &target->pos)) WarpTarget(target, target, 0, 0); @@ -1083,7 +1083,7 @@ void HandlePounceOrbAction(Entity *pokemon, Entity *target, u8 r2) { sub_807EC28(0); } sub_806A5B8(target); - + sub_8075900(target, gDungeon->forceMonsterHouse); } } @@ -1112,7 +1112,7 @@ void HandleDroughtOrbAction(Entity *pokemon, Entity *target) { { tile = GetTileMut(x, y); if((tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) == TERRAIN_TYPE_SECONDARY) - { + { tile->terrainType &= ~(TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); tile->terrainType |= TERRAIN_TYPE_NORMAL; sub_80498A8(x, y); @@ -1179,7 +1179,7 @@ void HandleOneRoomOrb(Entity *pokemon, Entity *target) { if ((tile->terrainType & TERRAIN_TYPE_IN_MONSTER_HOUSE)) { isMonsterHouse = TRUE; } - if ((tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) != TERRAIN_TYPE_SECONDARY) + if ((tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) != TERRAIN_TYPE_SECONDARY) if(((tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) != (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) { if (((x == 1) || (((y == 1 || (x == DUNGEON_MAX_SIZE_X - 2)) || (y == DUNGEON_MAX_SIZE_Y - 2)))) && ((tile->object == NULL && (gDungeon->unk644.unk2C == 0)))) { @@ -1194,7 +1194,7 @@ void HandleOneRoomOrb(Entity *pokemon, Entity *target) { tile->terrainType &= ~(TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); tile->terrainType |= TERRAIN_TYPE_NORMAL; tile->terrainType |= TERRAIN_TYPE_UNK_x400; - } + } } } } @@ -1280,7 +1280,7 @@ void HandleExplosion(Entity *pokemon,Entity *target,DungeonPos *param_3,s32 para uStack_2c = param_6; for (index = 0; index < DUNGEON_MAX_POKEMON; index++) { entity1 = gDungeon->activePokemon[index]; - if ((EntityExists(entity1)) && (HasAbility(entity1, ABILITY_DAMP))) break; + if ((EntityExists(entity1)) && (AbilityIsActive(entity1, ABILITY_DAMP))) break; } if (index != DUNGEON_MAX_POKEMON) { sub_804218C(pokemon,target); @@ -1304,7 +1304,7 @@ void HandleExplosion(Entity *pokemon,Entity *target,DungeonPos *param_3,s32 para pos.y = posPtr->y + param_3->y; if ((0 <= pos.x) && (0 <= pos.y) && (pos.x < DUNGEON_MAX_SIZE_X) && (pos.y < DUNGEON_MAX_SIZE_Y)) { tile = GetTileMut(pos.x,pos.y); - if ((0 < pos.x) && (0 < pos.y && ((pos.x < (DUNGEON_MAX_SIZE_X - 1) && ((pos.y < (DUNGEON_MAX_SIZE_Y - 1) + if ((0 < pos.x) && (0 < pos.y && ((pos.x < (DUNGEON_MAX_SIZE_X - 1) && ((pos.y < (DUNGEON_MAX_SIZE_Y - 1) && (tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY)) == 0))) )) && (tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0) { tile->terrainType &= ~(TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); diff --git a/src/code_807E1A0.c b/src/code_807E1A0.c index bbcf68e87..652d55393 100644 --- a/src/code_807E1A0.c +++ b/src/code_807E1A0.c @@ -73,11 +73,11 @@ void HandleSwitcherOrb(Entity *pokemon,Entity *target) DungeonPos targetPos; - if (HasAbility(pokemon, ABILITY_SUCTION_CUPS)) { + if (AbilityIsActive(pokemon, ABILITY_SUCTION_CUPS)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places } - else if(HasAbility(target, ABILITY_SUCTION_CUPS)) + else if(AbilityIsActive(target, ABILITY_SUCTION_CUPS)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places diff --git a/src/code_808417C.c b/src/code_808417C.c index 11db9facc..776c0abab 100644 --- a/src/code_808417C.c +++ b/src/code_808417C.c @@ -9,13 +9,13 @@ s32 CalculateStatusTurns(Entity *target, s16 *turnRange, bool8 factorCurerSkills) { s32 numTurns; - + numTurns = DungeonRandRange(turnRange[0],turnRange[1]); if (EntityExists(target) && (GetEntityType(target) == ENTITY_MONSTER) && (factorCurerSkills)) { if (IQSkillIsEnabled(target, IQ_SELF_CURER) && (numTurns != 0x7f)) { numTurns /= 2; } - if (HasAbility(target, ABILITY_NATURAL_CURE) && (numTurns != 0x7f) && (4 < numTurns)) { + if (AbilityIsActive(target, ABILITY_NATURAL_CURE) && (numTurns != 0x7f) && (4 < numTurns)) { numTurns = 5; } } diff --git a/src/dungeon_action.c b/src/dungeon_action.c index 4d466d22d..866b1506d 100644 --- a/src/dungeon_action.c +++ b/src/dungeon_action.c @@ -131,14 +131,14 @@ void TrySpawnMonsterAndActivatePlusMinus(void) isNotEnemy = TRUE; } - if (HasAbility(entity, ABILITY_LIGHTNINGROD)) { + if (AbilityIsActive(entity, ABILITY_LIGHTNINGROD)) { gDungeon->lightningRodPokemon = entity; gDungeon->unk17B38 = entityInfo->unk98; } - if (HasAbility(entity, ABILITY_MINUS)) { + if (AbilityIsActive(entity, ABILITY_MINUS)) { gDungeon->minusIsActive[isNotEnemy] = TRUE; } - if (HasAbility(entity, ABILITY_PLUS)) { + if (AbilityIsActive(entity, ABILITY_PLUS)) { gDungeon->plusIsActive[isNotEnemy] = TRUE; } } diff --git a/src/dungeon_ai_attack.c b/src/dungeon_ai_attack.c index dee20d6f4..76cc128a3 100644 --- a/src/dungeon_ai_attack.c +++ b/src/dungeon_ai_attack.c @@ -83,7 +83,7 @@ void ChooseAIMove(Entity *pokemon) s32 maxWeight; if (CannotAttack(pokemon, FALSE) || ShouldMonsterRunAwayAndShowEffect(pokemon, TRUE) || - HasTactic(pokemon, TACTIC_KEEP_YOUR_DISTANCE) || + IsTacticSet(pokemon, TACTIC_KEEP_YOUR_DISTANCE) || (pokemonInfo->cringeClassStatus.status == STATUS_CONFUSED && DungeonRandOutcome(gConfusedAttackChance))) { return; diff --git a/src/dungeon_ai_movement.c b/src/dungeon_ai_movement.c index 64f095c17..4be334eb0 100644 --- a/src/dungeon_ai_movement.c +++ b/src/dungeon_ai_movement.c @@ -49,7 +49,7 @@ void AIMovement(Entity *pokemon, bool8 showRunAwayEffect) pokemonInfo->aiTarget.aiNotNextToTarget = FALSE; pokemonInfo->aiTarget.aiTargetingEnemy = FALSE; pokemonInfo->aiTarget.aiTurningAround = FALSE; - if (HasTactic(pokemon, TACTIC_BE_PATIENT)) + if (IsTacticSet(pokemon, TACTIC_BE_PATIENT)) { u32 maxHPStat = pokemonInfo->maxHPStat; maxHPStat += maxHPStat >> 0x1f; @@ -59,7 +59,7 @@ void AIMovement(Entity *pokemon, bool8 showRunAwayEffect) return; } } - if (HasTactic(pokemon, TACTIC_WAIT_THERE)) + if (IsTacticSet(pokemon, TACTIC_WAIT_THERE)) { pokemonInfo->action.action = ACTION_NOTHING; } @@ -235,7 +235,7 @@ bool8 ChooseTargetPosition(Entity *pokemon) pokemonInfo->aiTarget.aiTargetSpawnGenID = pokemonInfo->aiTarget.aiTarget->spawnGenID; pokemonInfo->aiTarget.aiTargetingEnemy = TRUE; pokemonInfo->moveRandomly = FALSE; - if (HasTactic(pokemon, TACTIC_KEEP_YOUR_DISTANCE) && !CanSeeTeammate(pokemon)) + if (IsTacticSet(pokemon, TACTIC_KEEP_YOUR_DISTANCE) && !CanSeeTeammate(pokemon)) { s32 distanceX = pokemon->pos.x - possibleTargets[targetIndex]->pos.x; if (distanceX < 0) @@ -258,7 +258,7 @@ bool8 ChooseTargetPosition(Entity *pokemon) return TRUE; } } - if (!HasTactic(pokemon, TACTIC_GO_THE_OTHER_WAY)) + if (!IsTacticSet(pokemon, TACTIC_GO_THE_OTHER_WAY)) { do { diff --git a/src/dungeon_ai_targeting.c b/src/dungeon_ai_targeting.c index 87be29dd5..3a14bd9ee 100644 --- a/src/dungeon_ai_targeting.c +++ b/src/dungeon_ai_targeting.c @@ -395,7 +395,7 @@ bool8 IsAtJunction(Entity *pokemon) bool8 ShouldAvoidFirstHit(Entity *pokemon, bool8 forceAvoid) { - if (!HasTactic(pokemon, TACTIC_AVOID_THE_FIRST_HIT)) + if (!IsTacticSet(pokemon, TACTIC_AVOID_THE_FIRST_HIT)) return FALSE; if (!forceAvoid) return FALSE; @@ -419,7 +419,7 @@ bool8 ShouldMonsterRunAway(Entity *pokemon) { return FALSE; } - if (HasAbility(pokemon, ABILITY_RUN_AWAY)) + if (AbilityIsActive(pokemon, ABILITY_RUN_AWAY)) { bool8 runAwayActive = pokemonInfo->HP < pokemonInfo->maxHPStat / 2; if (runAwayActive) @@ -427,8 +427,8 @@ bool8 ShouldMonsterRunAway(Entity *pokemon) return TRUE; } } - if (HasTactic(pokemon, TACTIC_GET_AWAY) || - (HasTactic(pokemon, TACTIC_AVOID_TROUBLE) && pokemonInfo->HP <= pokemonInfo->maxHPStat / 2)) + if (IsTacticSet(pokemon, TACTIC_GET_AWAY) || + (IsTacticSet(pokemon, TACTIC_AVOID_TROUBLE) && pokemonInfo->HP <= pokemonInfo->maxHPStat / 2)) { return TRUE; } @@ -452,7 +452,7 @@ void CheckRunAwayVisualFlag(Entity *pokemon, bool8 showRunAwayEffect) EntityInfo *iVar2; iVar2 = GetEntInfo(pokemon); - if (((!iVar2->isTeamLeader) && HasAbility(pokemon,ABILITY_RUN_AWAY) && + if (((!iVar2->isTeamLeader) && AbilityIsActive(pokemon,ABILITY_RUN_AWAY) && (cVar1 = SetVisualFlags(iVar2,4,iVar2->HP <= iVar2->maxHPStat / 2), showRunAwayEffect)) && (cVar1)) { ShowVisualFlags(pokemon); @@ -534,9 +534,9 @@ u8 sub_807167C(Entity * pokemon, Entity * target) pokemonEntityData = GetEntInfo(pokemon); targetEntityInfo = GetEntInfo(target); if (pokemonEntityData->monsterBehavior != BEHAVIOR_RESCUE_TARGET) { - cannotUseItems = IsClientOrTeamBase(pokemonEntityData->joinedAt.id); + cannotUseItems = IsExperienceLocked(pokemonEntityData->joinedAt.id); if (!cannotUseItems && (pokemonEntityData->shopkeeper == SHOPKEEPER_MODE_NORMAL) && (targetEntityInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET)) { - cannotUseItems = IsClientOrTeamBase(targetEntityInfo->joinedAt.id); + cannotUseItems = IsExperienceLocked(targetEntityInfo->joinedAt.id); if (cannotUseItems || (targetEntityInfo->shopkeeper != SHOPKEEPER_MODE_NORMAL)) { error: return TREATMENT_IGNORE; diff --git a/src/dungeon_capabilities.c b/src/dungeon_capabilities.c index 5f0670208..4441bb516 100644 --- a/src/dungeon_capabilities.c +++ b/src/dungeon_capabilities.c @@ -81,7 +81,7 @@ bool8 CheckVariousConditions(Entity *pokemon) EntityInfo *pokemonInfo = GetEntInfo(pokemon); if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET - || IsClientOrTeamBase(pokemonInfo->joinedAt.id) + || IsExperienceLocked(pokemonInfo->joinedAt.id) || (!pokemonInfo->isTeamLeader && ShouldMonsterRunAway(pokemon)) || CheckVariousStatuses2(pokemon, FALSE) || CheckVariousStatuses(pokemon)) diff --git a/src/dungeon_move.c b/src/dungeon_move.c index a4bb805dc..f9e83322c 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -565,7 +565,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move } if (moveHits) { - if (HasAbility(currTarget, ABILITY_SOUNDPROOF) && IsSoundMove(move)) { + if (AbilityIsActive(currTarget, ABILITY_SOUNDPROOF) && IsSoundMove(move)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], currTarget, 0); TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_8100524); // Soundproof suppressed the sound move! moveHits = FALSE; @@ -646,7 +646,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move targetInfo->unk165 = GetDirectionTowardsPosition(&currTarget->pos, &attacker->pos); } - if (HasAbility(currTarget, ABILITY_PRESSURE) + if (AbilityIsActive(currTarget, ABILITY_PRESSURE) && GetTreatmentBetweenMonsters(attacker, currTarget, TRUE, FALSE) == 1 && move->id != MOVE_REGULAR_ATTACK && move->id != MOVE_STRUGGLE @@ -1690,7 +1690,7 @@ static s32 TryHitTarget(Entity *attacker, Entity *target, Move *move, struct Dam if (AccuracyCalc(attacker, target, move, ACCURACY_2, TRUE)) { // Move hits bool32 isFalseSwipe = (move->id == MOVE_FALSE_SWIPE); - if (HasAbility(target, ABILITY_ILLUMINATE)) { + if (AbilityIsActive(target, ABILITY_ILLUMINATE)) { gDungeon->unk644.unk1E = 999; gDungeon->unk17B34 = target; gDungeon->unk17B40 = target->spawnGenID; @@ -2730,7 +2730,7 @@ static bool8 AccuracyCalc(Entity *attacker, Entity *target, Move *move, s32 accu } statStageAccuracy = attackerInfo->hitChanceStages[0]; - if (HasAbility(attacker, ABILITY_COMPOUNDEYES)) { + if (AbilityIsActive(attacker, ABILITY_COMPOUNDEYES)) { statStageAccuracy += 2; } if (move->id == MOVE_THUNDER) { @@ -2757,10 +2757,10 @@ static bool8 AccuracyCalc(Entity *attacker, Entity *target, Move *move, s32 accu if (targetInfo->exposed) { statStageEvasion = 10; } - if (GetApparentWeather(target) == WEATHER_SANDSTORM && HasAbility(target, ABILITY_SAND_VEIL)) { + if (GetApparentWeather(target) == WEATHER_SANDSTORM && AbilityIsActive(target, ABILITY_SAND_VEIL)) { statStageEvasion += 2; } - if (HasAbility(attacker, ABILITY_HUSTLE)) { + if (AbilityIsActive(attacker, ABILITY_HUSTLE)) { bool32 specialMove = (IsTypePhysical(GetMoveType(move)) == FALSE); if (!specialMove) { statStageEvasion += 2; @@ -3154,7 +3154,7 @@ bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance) return FALSE; if (chance != 0) { - if (HasAbility(pokemon, ABILITY_SERENE_GRACE)) { + if (AbilityIsActive(pokemon, ABILITY_SERENE_GRACE)) { uVar2 = DungeonRandOutcome_2(chance * 2); } else @@ -3167,7 +3167,7 @@ bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance) uVar2 = TRUE; } - if (uVar2 && (pokemon != target) && HasAbility(target, ABILITY_SHIELD_DUST)) + if (uVar2 && (pokemon != target) && AbilityIsActive(target, ABILITY_SHIELD_DUST)) { sub_80429C8(target); return FALSE; @@ -3182,7 +3182,7 @@ bool8 RollSecondaryEffect(Entity *pokemon, s32 chance) return FALSE; if(chance == 0) return TRUE; - if(HasAbility(pokemon, ABILITY_SERENE_GRACE)) + if(AbilityIsActive(pokemon, ABILITY_SERENE_GRACE)) return DungeonRandOutcome_2(chance * 2); else return DungeonRandOutcome_2(chance); diff --git a/src/dungeon_pokemon_attributes.c b/src/dungeon_pokemon_attributes.c index 906272171..1d6018b3e 100644 --- a/src/dungeon_pokemon_attributes.c +++ b/src/dungeon_pokemon_attributes.c @@ -46,7 +46,7 @@ bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage) return TRUE; } else { - if (HasAbility(target, ABILITY_CLEAR_BODY) || HasAbility(target, ABILITY_WHITE_SMOKE)) { + if (AbilityIsActive(target, ABILITY_CLEAR_BODY) || AbilityIsActive(target, ABILITY_WHITE_SMOKE)) { if (displayMessage) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FCEFC); @@ -88,7 +88,7 @@ bool8 sub_80717A4(Entity *pokemon, u16 moveID) } } -bool8 HasAbility(Entity *pokemon, u8 ability) +bool8 AbilityIsActive(Entity *pokemon, u8 ability) { if (!EntityExists(pokemon)) { @@ -137,7 +137,7 @@ bool8 CanSeeInvisibleMonsters(Entity *pokemon) return TRUE; } -bool8 HasTactic(Entity *pokemon, u8 tactic) +bool8 IsTacticSet(Entity *pokemon, u8 tactic) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); if (pokemonInfo->isTeamLeader) diff --git a/src/move_actions.c b/src/move_actions.c index f571ec53f..7b580c565 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -1063,7 +1063,7 @@ bool8 GigaDrainMoveAction(Entity * pokemon, Entity * target, Move * move, u32 pa bool8 flag; EntityInfo *entityInfo; - hasLiquidOoze = HasAbility(target, ABILITY_LIQUID_OOZE); + hasLiquidOoze = AbilityIsActive(target, ABILITY_LIQUID_OOZE); uVar3 = HandleDamagingMove(pokemon,target,move,0x100,param_4); flag = uVar3 != 0 ? TRUE : FALSE; if (flag && RollSecondaryEffect(pokemon, 0)) { @@ -1433,7 +1433,7 @@ bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 param_4) iVar3 = 1; } flag = TRUE; - if ((!HasAbility(pokemon, ABILITY_ROCK_HEAD)) && RollSecondaryEffect(pokemon, 0)) { + if ((!AbilityIsActive(pokemon, ABILITY_ROCK_HEAD)) && RollSecondaryEffect(pokemon, 0)) { sub_806F370(pokemon,pokemon,iVar3,0,0,0,0x1fd,0x14,1,0); } } @@ -1549,7 +1549,7 @@ bool8 FissureMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 uVar5 = sub_806F4A4(target, moveType) != 0 ? TRUE : FALSE; - if (HasAbility(target, ABILITY_LEVITATE)) { + if (AbilityIsActive(target, ABILITY_LEVITATE)) { uVar5 = FALSE; } if (!uVar5) { @@ -1591,7 +1591,7 @@ bool8 AbsorbMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) bool8 flag; flag = FALSE; - hasLiquidOoze = HasAbility(target, ABILITY_LIQUID_OOZE); + hasLiquidOoze = AbilityIsActive(target, ABILITY_LIQUID_OOZE); iVar3 = HandleDamagingMove(pokemon,target,move,0x100,param_4); if (iVar3 != 0) { iVar4 = iVar3 / 2; @@ -1621,7 +1621,7 @@ bool8 SkillSwapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param EntityInfo *pokeEntityData = GetEntInfo(pokemon); EntityInfo *targetEntityInfo = GetEntInfo(target); - if ((HasAbility(target, ABILITY_WONDER_GUARD)) || (HasAbility(pokemon, ABILITY_WONDER_GUARD))) { + if ((AbilityIsActive(target, ABILITY_WONDER_GUARD)) || (AbilityIsActive(pokemon, ABILITY_WONDER_GUARD))) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC8C0); flag = FALSE; } @@ -1708,7 +1708,7 @@ bool8 DoubleEdgeMoveAction(Entity * pokemon,Entity * target,Move * move,u32 para flag = FALSE; if (HandleDamagingMove(pokemon, target, move, 0x100, param_4) != 0) { flag = TRUE; - if ((!HasAbility(pokemon, ABILITY_ROCK_HEAD)) && (RollSecondaryEffect(pokemon,0) != 0)) { + if ((!AbilityIsActive(pokemon, ABILITY_ROCK_HEAD)) && (RollSecondaryEffect(pokemon,0) != 0)) { HP = GetEntInfo(pokemon)->maxHPStat; if (HP < 0) { HP = HP + 7; @@ -2005,7 +2005,7 @@ bool8 ConversionMoveAction(Entity * pokemon,Entity * target,Move * move,u32 para counter = 0; info = GetEntInfo(target); - if (HasAbility(target, ABILITY_FORECAST)) { + if (AbilityIsActive(target, ABILITY_FORECAST)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsTypeSwitchMessage); return FALSE; } @@ -2281,7 +2281,7 @@ bool8 TrickMoveAction(Entity * pokemon,Entity * target, Move *move, u32 param_4) SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); - if (HasAbility(target, ABILITY_STICKY_HOLD)) { + if (AbilityIsActive(target, ABILITY_STICKY_HOLD)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCE4); return FALSE; } @@ -2398,7 +2398,7 @@ bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ entityInfo = GetEntInfo(pokemon); targetEntityInfo = GetEntInfo(target); - if (HasAbility(target, ABILITY_WONDER_GUARD)) { + if (AbilityIsActive(target, ABILITY_WONDER_GUARD)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC854); return FALSE; } @@ -2599,7 +2599,7 @@ bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ targetEntityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); - if (HasAbility(target, ABILITY_STICKY_HOLD)) + if (AbilityIsActive(target, ABILITY_STICKY_HOLD)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCE8); return FALSE; @@ -2889,7 +2889,7 @@ bool32 BeatUpMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param && GetTreatmentBetweenMonsters(pokemon,targetEntity,FALSE,FALSE) == TREATMENT_TREAT_AS_ALLY) { EntityInfo *targetInfo = GetEntInfo(targetEntity); - if (targetInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET && !IsClientOrTeamBase(targetInfo->joinedAt.id)) { + if (targetInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET && !IsExperienceLocked(targetInfo->joinedAt.id)) { WarpTarget(pokemon,targetEntity,2,&target->pos); flag = TRUE; SetExpMultplier(info); diff --git a/src/move_effects_target.c b/src/move_effects_target.c index efa3e59b0..f7f6912ae 100644 --- a/src/move_effects_target.c +++ b/src/move_effects_target.c @@ -177,7 +177,7 @@ u8 sub_8075BF4(Entity * pokemon, s32 sleepClassStatusTurns) if(entityInfo->sleepClassStatus.status != STATUS_NIGHTMARE && entityInfo->sleepClassStatus.status != STATUS_SLEEP) { entityInfo->sleepClassStatus.status = STATUS_SLEEP; - if ((sleepClassStatusTurns != 0x7f) && HasAbility(pokemon, ABILITY_EARLY_BIRD) && + if ((sleepClassStatusTurns != 0x7f) && AbilityIsActive(pokemon, ABILITY_EARLY_BIRD) && (sleepClassStatusTurns = sleepClassStatusTurns / 2, sleepClassStatusTurns < 1)) { sleepClassStatusTurns = 1; } @@ -236,13 +236,13 @@ bool8 CannotSleep(Entity * pokemon, Entity * target, u8 param_3, bool8 displayMe } return TRUE; } - else if (HasAbility(target, ABILITY_INSOMNIA)) { + else if (AbilityIsActive(target, ABILITY_INSOMNIA)) { if (displayMessage) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCD58); } return TRUE; } - else if (HasAbility(target, ABILITY_VITAL_SPIRIT)) { + else if (AbilityIsActive(target, ABILITY_VITAL_SPIRIT)) { if (displayMessage) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCD88); } @@ -269,7 +269,7 @@ void NightmareStatusTarget(Entity * pokemon, Entity * target, s32 turns) sub_8041EC8(target); if (entityInfo->sleepClassStatus.status != STATUS_NIGHTMARE) { entityInfo->sleepClassStatus.turns = turns; - if ((HasAbility(target, ABILITY_EARLY_BIRD)) && (entityInfo->sleepClassStatus.turns >>= 1, entityInfo->sleepClassStatus.turns == 0)) { + if ((AbilityIsActive(target, ABILITY_EARLY_BIRD)) && (entityInfo->sleepClassStatus.turns >>= 1, entityInfo->sleepClassStatus.turns == 0)) { entityInfo->sleepClassStatus.turns = 1; } } @@ -306,7 +306,7 @@ void NappingStatusTarget(Entity * pokemon, Entity * target, s32 turns) sub_8041ED8(target); if (entityInfo->sleepClassStatus.status == STATUS_NONE || entityInfo->sleepClassStatus.status == STATUS_YAWNING) { entityInfo->sleepClassStatus.turns = turns; - if ((HasAbility(target, ABILITY_EARLY_BIRD)) && (entityInfo->sleepClassStatus.turns >>= 1, entityInfo->sleepClassStatus.turns == 0)) { + if ((AbilityIsActive(target, ABILITY_EARLY_BIRD)) && (entityInfo->sleepClassStatus.turns >>= 1, entityInfo->sleepClassStatus.turns == 0)) { entityInfo->sleepClassStatus.turns = 1; } } @@ -439,7 +439,7 @@ void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessa if (EntityExists(target)) { entityInfo = GetEntInfo(target); if (!HasSafeguardStatus(pokemon,target,displayMessage)) { - if (HasAbility(target,ABILITY_OBLIVIOUS)) { + if (AbilityIsActive(target,ABILITY_OBLIVIOUS)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (displayMessage) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC4C); @@ -480,7 +480,7 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis if (!HasSafeguardStatus(pokemon,target,displayMessage)) { entityInfo = GetEntInfo(target); SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); - if (HasAbility(target, ABILITY_WATER_VEIL)) { + if (AbilityIsActive(target, ABILITY_WATER_VEIL)) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCE5C); } @@ -517,7 +517,7 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis } EntityUpdateStatusSprites(target); - if (!HasAbility(target, ABILITY_SYNCHRONIZE)) { + if (!AbilityIsActive(target, ABILITY_SYNCHRONIZE)) { return; } @@ -573,7 +573,7 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag } else { - if (HasAbility(target, ABILITY_IMMUNITY)) { + if (AbilityIsActive(target, ABILITY_IMMUNITY)) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCEB0); } @@ -610,7 +610,7 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB5F8); } - if ((HasAbility(target, ABILITY_SYNCHRONIZE)) && !isNotPoisoned) + if ((AbilityIsActive(target, ABILITY_SYNCHRONIZE)) && !isNotPoisoned) { hasSynchronized = FALSE; @@ -662,7 +662,7 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM } else { - if (HasAbility(target, ABILITY_IMMUNITY)) { + if (AbilityIsActive(target, ABILITY_IMMUNITY)) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCEB0); } @@ -692,7 +692,7 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB5F8); } - if ((HasAbility(target, ABILITY_SYNCHRONIZE)) && !isNotBadlyPoisoned) + if ((AbilityIsActive(target, ABILITY_SYNCHRONIZE)) && !isNotBadlyPoisoned) { hasSynchronized = FALSE; @@ -735,7 +735,7 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) entityInfo = GetEntInfo(target); if ((entityInfo->frozenClassStatus.status != STATUS_FROZEN) && !HasSafeguardStatus(pokemon,target,displayMessage)) { - if (HasAbility(target, ABILITY_MAGMA_ARMOR)) { + if (AbilityIsActive(target, ABILITY_MAGMA_ARMOR)) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCDE0); } @@ -1007,7 +1007,7 @@ void LowerAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 de TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD550); } else { - if ((!HasAbility(target, ABILITY_HYPER_CUTTER)) || (index != STAT_STAGE_ATK)) goto _08076EE4; + if ((!AbilityIsActive(target, ABILITY_HYPER_CUTTER)) || (index != STAT_STAGE_ATK)) goto _08076EE4; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA60); } diff --git a/src/status.c b/src/status.c index e8dc7fc73..e59cb542c 100644 --- a/src/status.c +++ b/src/status.c @@ -183,7 +183,7 @@ extern void sub_80420A0(Entity *); u8 GetFlashFireStatus(Entity *pokemon) { - if (!EntityExists(pokemon) || !HasAbility(pokemon, ABILITY_FLASH_FIRE)) + if (!EntityExists(pokemon) || !AbilityIsActive(pokemon, ABILITY_FLASH_FIRE)) { return FLASH_FIRE_STATUS_NONE; } @@ -248,7 +248,7 @@ void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage return; } - if (HasAbility(target, ABILITY_HYPER_CUTTER) && (statStage == STAT_STAGE_ATK) && F248LessThanInt(param_4, 1)) { + if (AbilityIsActive(target, ABILITY_HYPER_CUTTER) && (statStage == STAT_STAGE_ATK) && F248LessThanInt(param_4, 1)) { if (displayMessage) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA60); @@ -376,7 +376,7 @@ void LowerAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage, strcpy(gFormatBuffer_Items[0],*gUnknown_80FC084); } if (!sub_8071728(pokemon,target,displayMessage)) { - if (HasAbility(target, ABILITY_KEEN_EYE) && (statStage == STAT_STAGE_ACCURACY)){ + if (AbilityIsActive(target, ABILITY_KEEN_EYE) && (statStage == STAT_STAGE_ACCURACY)){ if(displayMessage) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); @@ -406,7 +406,7 @@ void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage) if (EntityExists(target)) { if (!HasSafeguardStatus(pokemon, target, displayMessage)) { - if (HasAbility(target, ABILITY_INNER_FOCUS)){ + if (AbilityIsActive(target, ABILITY_INNER_FOCUS)){ SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if(displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC18); @@ -441,7 +441,7 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag bool8 bVar7; if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) { - if (HasAbility(target, ABILITY_LIMBER)) { + if (AbilityIsActive(target, ABILITY_LIMBER)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (displayMessage) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCBF8); @@ -465,7 +465,7 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag else { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB2CC); } - if ((HasAbility(target, ABILITY_SYNCHRONIZE)) && (!bVar6)) { + if ((AbilityIsActive(target, ABILITY_SYNCHRONIZE)) && (!bVar6)) { bVar7 = FALSE; for(index = 0; index < NUM_DIRECTIONS; index++) @@ -598,7 +598,7 @@ void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage } else { - if (HasAbility(target, ABILITY_OWN_TEMPO)) { + if (AbilityIsActive(target, ABILITY_OWN_TEMPO)) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCDB4); } diff --git a/src/status_actions.c b/src/status_actions.c index 66c1db3bc..7ddf09bae 100644 --- a/src/status_actions.c +++ b/src/status_actions.c @@ -217,7 +217,7 @@ bool8 HandleColorChange(Entity * pokemon, Entity * target) entityInfo = GetEntInfo(target); newType = gDungeonCamouflageTypes[gDungeon->tileset]; - if (HasAbility(target, ABILITY_FORECAST)) { + if (AbilityIsActive(target, ABILITY_FORECAST)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsTypeSwitchMessage); return FALSE; } @@ -507,7 +507,7 @@ bool8 DreamEaterMoveAction(Entity * pokemon, Entity * target, Move *move, s32 pa bool8 flag; flag = FALSE; - hasLiquidOoze = HasAbility(target, ABILITY_LIQUID_OOZE); + hasLiquidOoze = AbilityIsActive(target, ABILITY_LIQUID_OOZE); if (IsSleeping(target)) { iVar3 = HandleDamagingMove(pokemon,target,move,0x100,param_4); if (iVar3 != 0) { @@ -698,7 +698,7 @@ bool8 ThiefAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) targetInfo2 = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); - if (HasAbility(target, ABILITY_STICKY_HOLD)) { + if (AbilityIsActive(target, ABILITY_STICKY_HOLD)) { return TRUE; } else if (HasHeldItem(target, ITEM_ALERT_SPECS)) { diff --git a/src/status_checks_1.c b/src/status_checks_1.c index cd4e9356f..1b361aad2 100644 --- a/src/status_checks_1.c +++ b/src/status_checks_1.c @@ -36,10 +36,10 @@ s32 sub_8070828(Entity *pokemon, bool8 displayMessage) return 0; } else { - if ((HasAbility(pokemon, ABILITY_SWIFT_SWIM)) && (GetApparentWeather(pokemon) == WEATHER_RAIN)) { + if ((AbilityIsActive(pokemon, ABILITY_SWIFT_SWIM)) && (GetApparentWeather(pokemon) == WEATHER_RAIN)) { flag = TRUE; } - if ((HasAbility(pokemon, ABILITY_CHLOROPHYLL)) && (GetApparentWeather(pokemon) == WEATHER_SUNNY)) { + if ((AbilityIsActive(pokemon, ABILITY_CHLOROPHYLL)) && (GetApparentWeather(pokemon) == WEATHER_SUNNY)) { flag = TRUE; } if (displayMessage && SetVisualFlags(GetEntInfo(pokemon), 0x40, flag)) { diff --git a/src/type_effectiveness.c b/src/type_effectiveness.c index 5853109dc..6611b6e87 100644 --- a/src/type_effectiveness.c +++ b/src/type_effectiveness.c @@ -103,7 +103,7 @@ bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, str if ((type == TYPE_NORMAL) || (type == TYPE_FIGHTING)) { normalOrFightingType = TRUE; } - if ((HasAbility(target, ABILITY_WONDER_GUARD)) && (type != TYPE_NONE)) { + if ((AbilityIsActive(target, ABILITY_WONDER_GUARD)) && (type != TYPE_NONE)) { hasWonderGuard = TRUE; } param_5->effectiveness = EFFECTIVENESS_NEUTRAL; @@ -132,7 +132,7 @@ bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, str param_1->lo = temp; } - if (((type == TYPE_FIRE) || (type == TYPE_ICE)) && (HasAbility(target,ABILITY_THICK_FAT))) { + if (((type == TYPE_FIRE) || (type == TYPE_ICE)) && (AbilityIsActive(target,ABILITY_THICK_FAT))) { gDungeon->unk134.unk16D = TRUE; F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); } @@ -144,7 +144,7 @@ bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, str param_5->unkE = 1; bVar4 = FALSE; } - if ((type == TYPE_GROUND) && (HasAbility(target, ABILITY_LEVITATE))) { + if ((type == TYPE_GROUND) && (AbilityIsActive(target, ABILITY_LEVITATE))) { gDungeon->unk134.fill16E[1] = TRUE; FP48_16_FromS32(param_1,0); param_5->effectiveness = EFFECTIVENESS_IMMUNE; @@ -152,7 +152,7 @@ bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, str param_5->unkE = 1; bVar4 = FALSE; } - if ((type == TYPE_WATER) && (HasAbility(pokemon, ABILITY_TORRENT))) { + if ((type == TYPE_WATER) && (AbilityIsActive(pokemon, ABILITY_TORRENT))) { torrentFlag = pokemonInfo->maxHPStat / 4 >= pokemonInfo->HP; torrentVisualFlag = SetVisualFlags(pokemonInfo,0x80,torrentFlag); if (torrentFlag) { @@ -164,7 +164,7 @@ bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, str TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEDA8); } } - if ((type == TYPE_GRASS) && (HasAbility(pokemon, ABILITY_OVERGROW))) { + if ((type == TYPE_GRASS) && (AbilityIsActive(pokemon, ABILITY_OVERGROW))) { overgrowFlag = pokemonInfo->maxHPStat / 4 >= pokemonInfo->HP; overgrowVisualFlag = SetVisualFlags(pokemonInfo,2,overgrowFlag); if (overgrowFlag) { @@ -176,7 +176,7 @@ bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, str TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FED88); } } - if ((type == TYPE_BUG) && (HasAbility(pokemon, ABILITY_SWARM))) { + if ((type == TYPE_BUG) && (AbilityIsActive(pokemon, ABILITY_SWARM))) { swarmFlag = pokemonInfo->maxHPStat / 4 >= pokemonInfo->HP; swarmVisualFlag = SetVisualFlags(pokemonInfo,0x10,swarmFlag); if (swarmFlag) { @@ -188,7 +188,7 @@ bool8 sub_806E100(s48_16 *param_1, Entity *pokemon, Entity *target, u8 type, str TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEDC8); } } - if ((type == TYPE_FIRE) && (HasAbility(pokemon, ABILITY_BLAZE))) { + if ((type == TYPE_FIRE) && (AbilityIsActive(pokemon, ABILITY_BLAZE))) { blazeFlag = pokemonInfo->maxHPStat / 4 >= pokemonInfo->HP; blazeVisualFlag = SetVisualFlags(pokemonInfo,0x20,blazeFlag); if (blazeFlag) { @@ -268,15 +268,15 @@ s32 WeightWeakTypePicker(Entity *user, Entity *target, u8 moveType) { return 0; } - if (moveType == TYPE_ELECTRIC && HasAbility(target, ABILITY_VOLT_ABSORB)) + if (moveType == TYPE_ELECTRIC && AbilityIsActive(target, ABILITY_VOLT_ABSORB)) { return 0; } - if (moveType == TYPE_WATER && HasAbility(target, ABILITY_WATER_ABSORB)) + if (moveType == TYPE_WATER && AbilityIsActive(target, ABILITY_WATER_ABSORB)) { return 0; } - if (moveType == TYPE_GROUND && HasAbility(target, ABILITY_LEVITATE)) + if (moveType == TYPE_GROUND && AbilityIsActive(target, ABILITY_LEVITATE)) { return 1; } @@ -314,11 +314,11 @@ s32 WeightWeakTypePicker(Entity *user, Entity *target, u8 moveType) } } while ((s32)(++targetType) <= (s32)(targetTypes + 1)); breakLoop: - if ((moveType == TYPE_FIRE || moveType == TYPE_ICE) && HasAbility(target, ABILITY_THICK_FAT)) + if ((moveType == TYPE_FIRE || moveType == TYPE_ICE) && AbilityIsActive(target, ABILITY_THICK_FAT)) { return 2; } - if (moveType == TYPE_WATER && HasAbility(user, ABILITY_TORRENT)) + if (moveType == TYPE_WATER && AbilityIsActive(user, ABILITY_TORRENT)) { s32 maxHPStat = userData->maxHPStat; if (maxHPStat < 0) @@ -330,7 +330,7 @@ s32 WeightWeakTypePicker(Entity *user, Entity *target, u8 moveType) weight *= 2; } } - if (moveType == TYPE_GRASS && HasAbility(user, ABILITY_OVERGROW)) + if (moveType == TYPE_GRASS && AbilityIsActive(user, ABILITY_OVERGROW)) { s32 maxHPStat = userData->maxHPStat; if (maxHPStat < 0) @@ -342,7 +342,7 @@ s32 WeightWeakTypePicker(Entity *user, Entity *target, u8 moveType) weight *= 2; } } - if (moveType == TYPE_BUG && HasAbility(user, ABILITY_SWARM)) + if (moveType == TYPE_BUG && AbilityIsActive(user, ABILITY_SWARM)) { s32 maxHPStat = userData->maxHPStat; if (maxHPStat < 0) @@ -354,7 +354,7 @@ s32 WeightWeakTypePicker(Entity *user, Entity *target, u8 moveType) weight *= 2; } } - if (moveType == TYPE_FIRE && HasAbility(user, ABILITY_BLAZE)) + if (moveType == TYPE_FIRE && AbilityIsActive(user, ABILITY_BLAZE)) { s32 maxHPStat = userData->maxHPStat; if (maxHPStat < 0)