diff --git a/include/dungeon_8041AD0.h b/include/dungeon_8041AD0.h index 2417b11f1..b982792b0 100644 --- a/include/dungeon_8041AD0.h +++ b/include/dungeon_8041AD0.h @@ -9,7 +9,7 @@ s32 sub_80416E0(PixelPos *pos, u32 param_2, bool8 param_3); void sub_804178C(u8 param_1); u32 EntityGetStatusSprites(Entity *entity); void sub_8041888(u8 param_1); -void EntityUpdateStatusSprites(Entity *entity); +void UpdateStatusIconFlags(Entity *entity); void sub_8041AD0(Entity *pokemon); void sub_8041AE0(Entity *pokemon); void sub_8041AF4(Entity *pokemon); @@ -37,7 +37,7 @@ void sub_8041BD0(Entity *pokemon, u8 r1); void sub_8041BE8(Entity *pokemon); void sub_8041BF8(Entity *pokemon); void sub_8041C08(Entity *pokemon); -void sub_8041C1C(Entity *pokemon); +void PlayParalysisEffect(Entity *pokemon); void nullsub_69(Entity *pokemon, Entity *target); void sub_8041C34(Entity *pokemon); void nullsub_70(Entity *pokemon); @@ -50,8 +50,8 @@ void nullsub_72(Entity *pokemon); void nullsub_73(Entity *pokemon); void sub_8041C94(Entity *pokemon); void sub_8041CA8(Entity *pokemon); -void sub_8041CB8(Entity *pokemon); -void sub_8041CCC(Entity *pokemon); +void PlaySpeedUpEffect(Entity *pokemon); +void PlaySpeedDownEffect(Entity *pokemon); void sub_8041CDC(Entity *pokemon); void sub_8041CEC(Entity *pokemon); void nullsub_74(Entity *pokemon); @@ -102,10 +102,10 @@ void PlayOffensiveStatMultiplierUpEffect(Entity *pokemon, struct StatIndex stat) void PlayOffensiveStatMultiplierDownEffect(Entity *pokemon, struct StatIndex stat); void PlayDefensiveStatMultiplierUpEffect(Entity *pokemon, struct StatIndex stat); void PlayDefensiveStatMultiplierDownEffect(Entity *pokemon, struct StatIndex stat); -void sub_8042040(Entity *pokemon, struct StatIndex stat); -void sub_8042060(Entity *pokemon, u32 r1); +void PlayHitChanceUpEffect(Entity *pokemon, struct StatIndex stat); +void PlayHitChanceDownEffect(Entity *pokemon, u32 r1); void sub_8042080(Entity *pokemon, u32 r1); -void sub_80420A0(Entity *pokemon); +void PlayCringeExclamationPointEffect(Entity *pokemon); void nullsub_91(Entity *pokemon); void sub_80420B8(Entity *pokemon); void sub_80420C8(Entity *pokemon); diff --git a/include/dungeon_logic.h b/include/dungeon_logic.h index 1c302746a..48d0e69ce 100644 --- a/include/dungeon_logic.h +++ b/include/dungeon_logic.h @@ -40,7 +40,7 @@ bool8 ShouldMonsterRunAwayAndShowEffect(Entity *pokemon, bool8 showRunAwayEffect void CheckRunAwayVisualFlag(Entity *pokemon, bool8 showRunAwayEffect); u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ignoreInvisible, bool8 checkPetrified); u8 GetTreatmentBetweenMonstersIgnoreStatus(Entity * pokemon, Entity * target); -bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage); +bool8 SafeguardIsActive(Entity * pokemon, Entity * target, bool8 displayMessage); bool8 IsProtectedFromStatDrops(Entity * pokemon, Entity * target, bool8 displayMessage); bool8 sub_80717A4(Entity *pokemon, u16 moveID); bool8 AbilityIsActive(Entity *pokemon, u8 ability); diff --git a/include/move_orb_effects_1.h b/include/move_orb_effects_1.h index 5435a6481..61fdbf36f 100644 --- a/include/move_orb_effects_1.h +++ b/include/move_orb_effects_1.h @@ -28,20 +28,20 @@ void IngrainedStatusTarget(Entity * pokemon, Entity * target); void WrapTarget(Entity * pokemon, Entity * target); void sub_8076CB4(s32 param_1); void PetrifiedStatusTarget(Entity * pokemon, Entity * target); -void LowerOffensiveStat(Entity * user, Entity * target, struct StatIndex stat, s32 decrement, u8 param_5, bool8 displayMessage); -void LowerDefensiveStat(Entity * user, Entity * target, struct StatIndex stat, s32 nStages, bool8 checkProtected, bool8 logMsgProtected); -void BoostOffensiveStat(Entity * user, Entity * target, struct StatIndex stat, s32 increment); -void BoostDefensiveStat(Entity * user, Entity * target, struct StatIndex stat, s32 increment); +void LowerOffensiveStat(Entity *user, Entity *target, struct StatIndex stat, s32 nStages, bool8 checkProtected, bool8 logMsgProtected); +void LowerDefensiveStat(Entity *user, Entity *target, struct StatIndex stat, s32 nStages, bool8 checkProtected, bool8 logMsgProtected); +void BoostOffensiveStat(Entity *user, Entity *target, struct StatIndex stat, s32 nStages); +void BoostDefensiveStat(Entity *user, Entity *target, struct StatIndex stat, s32 nStages); u8 GetFlashFireStatus(Entity *pokemon); void ActivateFlashFire(Entity * pokemon, Entity *target); void ApplyOffensiveStatMultiplier(Entity *user, Entity *target, struct StatIndex stat, s24_8 multiplier, bool8 displayMessage); void ApplyDefensiveStatMultiplier(Entity *user, Entity *target, struct StatIndex stat, s24_8 multiplier, bool8 displayMessage); void BoostHitChanceStat(Entity *user, Entity *target, struct StatIndex stat); void LowerHitChanceStat(Entity *user, Entity *target, struct StatIndex stat, bool8 displayMessage); -void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage); -void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage); -void RaiseMovementSpeedTarget(Entity * pokemon, Entity * target, s32 turns, bool8 diplayMessage); -void LowerMovementSpeedTarget(Entity * pokemon, Entity * target, s32 levels, bool8 displayMessage); +void TryInflictCringeStatus(Entity *user ,Entity *target, bool8 displayMessage); +void TryInflictParalysisStatus(Entity *user, Entity *target, bool8 displayMessage); +void BoostSpeed(Entity *user, Entity *target, s32 turns, bool8 displayMessage); +void LowerSpeed(Entity *user, Entity *target, s32 nStages, bool8 displayMessage); #endif diff --git a/src/dungeon_8041AD0.c b/src/dungeon_8041AD0.c index 11faa80b3..a5a5eda5b 100644 --- a/src/dungeon_8041AD0.c +++ b/src/dungeon_8041AD0.c @@ -358,12 +358,12 @@ void sub_8041888(u8 param_1) { entityInfo->unk14C = 1; } - EntityUpdateStatusSprites(entity); + UpdateStatusIconFlags(entity); } } } -void EntityUpdateStatusSprites(Entity *entity) +void UpdateStatusIconFlags(Entity *entity) { bool32 flag; s32 HP; @@ -563,7 +563,7 @@ void sub_8041C08(Entity *pokemon) sub_804151C(pokemon, 423, 1); } -void sub_8041C1C(Entity *pokemon) +void PlayParalysisEffect(Entity *pokemon) { sub_804151C(pokemon, 423, 1); } @@ -623,12 +623,12 @@ void sub_8041CA8(Entity *pokemon) sub_804151C(pokemon, 7, 1); } -void sub_8041CB8(Entity *pokemon) +void PlaySpeedUpEffect(Entity *pokemon) { sub_804151C(pokemon, 0x18b, 1); } -void sub_8041CCC(Entity *pokemon) +void PlaySpeedDownEffect(Entity *pokemon) { sub_804151C(pokemon, 0xC5 << 1, 1); } @@ -936,7 +936,7 @@ void PlayDefensiveStatMultiplierDownEffect(Entity *pokemon, struct StatIndex sta } } -void sub_8042040(Entity *pokemon, struct StatIndex stat) +void PlayHitChanceUpEffect(Entity *pokemon, struct StatIndex stat) { if(stat.id == STAT_INDEX_ACCURACY) { @@ -948,7 +948,7 @@ void sub_8042040(Entity *pokemon, struct StatIndex stat) } } -void sub_8042060(Entity *pokemon, u32 r1) +void PlayHitChanceDownEffect(Entity *pokemon, u32 r1) { if(r1 == 0) { @@ -972,7 +972,7 @@ void sub_8042080(Entity *pokemon, u32 r1) } } -void sub_80420A0(Entity *pokemon) +void PlayCringeExclamationPointEffect(Entity *pokemon) { sub_804151C(pokemon, 0x143, 1); } diff --git a/src/dungeon_damage.c b/src/dungeon_damage.c index 7adb015d0..32b9a700d 100644 --- a/src/dungeon_damage.c +++ b/src/dungeon_damage.c @@ -532,7 +532,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_800DBBC(); sub_806A390(target); sub_806CCB4(target, sub_806CEBC(target)); - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C); sub_806F63C(target); @@ -589,7 +589,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_800DBBC(); sub_806A390(target); sub_806CCB4(target, sub_806CEBC(target)); - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], teamMember, 0); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD484); @@ -643,7 +643,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_800DBBC(); sub_806A390(target); sub_806CCB4(target, sub_806CEBC(target)); - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C); sub_806F63C(target); diff --git a/src/dungeon_item_action.c b/src/dungeon_item_action.c index 69b59f756..d37f0ffe7 100644 --- a/src/dungeon_item_action.c +++ b/src/dungeon_item_action.c @@ -420,7 +420,7 @@ static void AllureSeedItemAction(Entity *pokemon, Entity *target) static void QuickSeedItemAction(Entity *pokemon, Entity *target) { - RaiseMovementSpeedTarget(pokemon, target, 0, TRUE); + BoostSpeed(pokemon, target, 0, TRUE); } static void EyedropSeedItemAction(Entity *pokemon, Entity *target) @@ -938,7 +938,7 @@ static void GrimyFoodItemAction(Entity *pokemon, Entity * target) BurnedStatusTarget(pokemon, target, 1, TRUE); break; case 3: - ParalyzeStatusTarget(pokemon, target, TRUE); + TryInflictParalysisStatus(pokemon, target, TRUE); break; case 4: LowerOffensiveStat(pokemon, target, gStatIndexAtkDef, 3, TRUE, TRUE); diff --git a/src/dungeon_logic.c b/src/dungeon_logic.c index cc04102d7..1d1025ddb 100644 --- a/src/dungeon_logic.c +++ b/src/dungeon_logic.c @@ -1201,7 +1201,7 @@ u8 GetTreatmentBetweenMonstersIgnoreStatus(Entity *monster1, Entity *monster2) return TREATMENT_TREAT_AS_ALLY; } -bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage) +bool8 SafeguardIsActive(Entity * pokemon, Entity * target, bool8 displayMessage) { if (GetEntInfo(target)->reflectClassStatus.status == STATUS_SAFEGUARD) { if (displayMessage) { diff --git a/src/dungeon_misc.c b/src/dungeon_misc.c index 7eeaef094..8609c75cf 100644 --- a/src/dungeon_misc.c +++ b/src/dungeon_misc.c @@ -1478,7 +1478,7 @@ void sub_806A6E8(Entity *entity) } if (gDungeon->unk644.itemHoldersIdentified) { - EntityUpdateStatusSprites(entity); + UpdateStatusIconFlags(entity); } } else { diff --git a/src/dungeon_mon_spawn.c b/src/dungeon_mon_spawn.c index 8ff960de4..5c2547a64 100644 --- a/src/dungeon_mon_spawn.c +++ b/src/dungeon_mon_spawn.c @@ -685,7 +685,7 @@ void UpdateEntitySpecies(Entity *entity, s32 _species) entInfo->HP = entInfo->maxHPStat; entInfo->shopkeeper = 0; sub_80429E8(entity); - EntityUpdateStatusSprites(entity); + UpdateStatusIconFlags(entity); } static void InitEntityFromSpawnInfo(bool8 a0, Entity *entity, struct MonSpawnInfo *monSpawnInfo, DungeonPos *pos) diff --git a/src/dungeon_move_util.c b/src/dungeon_move_util.c index ddca6fd44..cd31e7665 100644 --- a/src/dungeon_move_util.c +++ b/src/dungeon_move_util.c @@ -241,11 +241,11 @@ void TriggerTargetAbilityEffect(Entity *attacker) } if (entInfo->abilityEffectFlags & ABILITY_FLAG_STATIC) { LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF0C); // Static caused paralysis! - ParalyzeStatusTarget(attacker, attacker, TRUE); + TryInflictParalysisStatus(attacker, attacker, TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_PRLZ) { LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF30); // Effect Spore scattered spores - ParalyzeStatusTarget(attacker, attacker, TRUE); + TryInflictParalysisStatus(attacker, attacker, TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_POISON_POINT) { LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF4C); // Poison Point struck! diff --git a/src/dungeon_turn_effects.c b/src/dungeon_turn_effects.c index 8acbab2f6..e9b75643d 100644 --- a/src/dungeon_turn_effects.c +++ b/src/dungeon_turn_effects.c @@ -190,7 +190,7 @@ void ApplyEndOfTurnEffects(Entity *entity) entityInfo->speedBoostFrames++; if (entityInfo->speedBoostFrames >= gSpeedBoostActivationFrame) { entityInfo->speedBoostFrames = 0; - RaiseMovementSpeedTarget(entity, entity, 0x7F, FALSE); + BoostSpeed(entity, entity, 0x7F, FALSE); } } diff --git a/src/move_orb_actions_1.c b/src/move_orb_actions_1.c index 1cf60d7bb..8304d440e 100644 --- a/src/move_orb_actions_1.c +++ b/src/move_orb_actions_1.c @@ -173,7 +173,7 @@ bool8 BubbleMoveAction(Entity *pokemon, Entity *target, Move * move, s32 itemId) if (HandleDamagingMove(pokemon, target, move, IntToF248(1), itemId) != 0) { flag = TRUE; if (sub_805727C(pokemon,target, gBubbleSecondaryChance)) { - LowerMovementSpeedTarget(pokemon, target, 1, FALSE); + LowerSpeed(pokemon, target, 1, FALSE); } } return flag; @@ -293,7 +293,7 @@ bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId) bool8 StringShotMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId) { - LowerMovementSpeedTarget(pokemon, target, 1, TRUE); + LowerSpeed(pokemon, target, 1, TRUE); return TRUE; } @@ -313,7 +313,7 @@ bool8 SnoreMoveAction(Entity *pokemon, Entity *target, Move * move, s32 itemId) if (HandleDamagingMove(pokemon,target,move,IntToF248(1),itemId) != 0) { flag = TRUE; if (sub_805727C(pokemon,target,gSnoreSecondaryChance)) { - CringeStatusTarget(pokemon,target,FALSE); + TryInflictCringeStatus(pokemon,target,FALSE); } } } @@ -337,7 +337,7 @@ bool8 RockSlideMoveAction(Entity *pokemon, Entity *target, Move * move, s32 item if (HandleDamagingMove(pokemon, target, move, IntToF248(1), itemId) != 0) { flag = TRUE; if (sub_805727C(pokemon,target,gRockSlideSecondaryChance)) { - CringeStatusTarget(pokemon,target,FALSE); + TryInflictCringeStatus(pokemon,target,FALSE); } } return flag; @@ -623,7 +623,7 @@ bool8 BasicRaiseDefenseMoveAction(Entity *pokemon, Entity *target, Move *move, s bool8 DisableMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId) { - ParalyzeStatusTarget(pokemon, target, TRUE); + TryInflictParalysisStatus(pokemon, target, TRUE); return TRUE; } @@ -695,7 +695,7 @@ bool8 BiteMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId) flag = TRUE; if(sub_805727C(pokemon, target, gBiteSecondaryChance)) { - CringeStatusTarget(pokemon, target, FALSE); + TryInflictCringeStatus(pokemon, target, FALSE); } } return flag; @@ -710,7 +710,7 @@ bool8 ThunderMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId) flag = TRUE; if(sub_805727C(pokemon, target, gThunderSecondaryChance)) { - ParalyzeStatusTarget(pokemon, target, FALSE); + TryInflictParalysisStatus(pokemon, target, FALSE); } } return flag; @@ -758,7 +758,7 @@ bool8 sub_8058580(Entity *pokemon, Entity *target, Move *move, s32 itemId) flag = TRUE; if(sub_805727C(pokemon, target, gConstrictBubblebeamSecondaryChance)) { - LowerMovementSpeedTarget(pokemon, target, 1, FALSE); + LowerSpeed(pokemon, target, 1, FALSE); } } return flag; @@ -788,7 +788,7 @@ bool8 RockTombMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId flag = TRUE; if(sub_805727C(pokemon, target, 0)) { - LowerMovementSpeedTarget(pokemon, target, 1, FALSE); + LowerSpeed(pokemon, target, 1, FALSE); } } return flag; @@ -935,7 +935,7 @@ bool8 AncientPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 it if(RollSecondaryEffect(pokemon, gAncientPowerSecondaryChance)) { entityInfo = GetEntInfo(pokemon); - RaiseMovementSpeedTarget(pokemon, pokemon, 0, TRUE); + BoostSpeed(pokemon, pokemon, 0, TRUE); BoostOffensiveStat(pokemon, pokemon, gStatIndexAtkDef, 1); BoostOffensiveStat(pokemon, pokemon, gStatIndexSpecial, 1); BoostDefensiveStat(pokemon, pokemon, gStatIndexAtkDef, 1); @@ -954,7 +954,7 @@ bool8 SynthesisMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemI bool8 AgilityMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId) { - RaiseMovementSpeedTarget(pokemon, target, 0, TRUE); + BoostSpeed(pokemon, target, 0, TRUE); return TRUE; } diff --git a/src/move_orb_actions_2.c b/src/move_orb_actions_2.c index 6d2315941..50e7ecfdf 100644 --- a/src/move_orb_actions_2.c +++ b/src/move_orb_actions_2.c @@ -51,7 +51,7 @@ bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemI if (HandleDamagingMove(pokemon, target, move, gSkyAttackModifier, itemId) != 0) { flag = TRUE; if(sub_805727C(pokemon, target, gSkyAttackSecondaryChance)) - CringeStatusTarget(pokemon, target, FALSE); + TryInflictCringeStatus(pokemon, target, FALSE); } sub_8079764(pokemon); } @@ -104,7 +104,7 @@ bool8 EndureMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId) bool8 ScaryFaceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId) { - LowerMovementSpeedTarget(pokemon, target, 1, TRUE); + LowerSpeed(pokemon, target, 1, TRUE); return TRUE; } @@ -295,7 +295,7 @@ bool8 LickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId) flag = TRUE; if(sub_805727C(pokemon, target, gLickSecondaryChance)) { - ParalyzeStatusTarget(pokemon, target, FALSE); + TryInflictParalysisStatus(pokemon, target, FALSE); } } return flag; @@ -309,7 +309,7 @@ bool8 SelfDestructMoveAction(Entity *pokemon, Entity *target, Move *move, s32 it bool8 StunSporeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId) { - ParalyzeStatusTarget(pokemon, target, TRUE); + TryInflictParalysisStatus(pokemon, target, TRUE); return TRUE; } @@ -328,7 +328,7 @@ bool8 ThunderboltMoveAction(Entity *pokemon, Entity *target, Move *move, s32 ite flag = TRUE; if(sub_805727C(pokemon, target, gThunderboltSecondaryChance)) { - ParalyzeStatusTarget(pokemon, target, FALSE); + TryInflictParalysisStatus(pokemon, target, FALSE); } } return flag; @@ -373,7 +373,7 @@ bool8 ExtrasensoryMoveAction(Entity *pokemon, Entity *target, Move *move, s32 it flag = TRUE; if(sub_805727C(pokemon, target, gExtrasensorySecondaryChance)) { - CringeStatusTarget(pokemon, target, FALSE); + TryInflictCringeStatus(pokemon, target, FALSE); } } return flag; @@ -496,7 +496,7 @@ bool8 HeadbuttMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId flag = TRUE; if(sub_805727C(pokemon, target, gHeadbuttSecondaryChance)) { - CringeStatusTarget(pokemon, target, FALSE); + TryInflictCringeStatus(pokemon, target, FALSE); } } return flag; @@ -702,7 +702,7 @@ bool8 TwisterMoveAction(Entity * pokemon,Entity * target,Move * move,s32 itemId) { flag = TRUE; if(sub_805727C(pokemon,target,gTwisterSecondaryChance) != 0) { - CringeStatusTarget(pokemon,target,FALSE); + TryInflictCringeStatus(pokemon,target,FALSE); } } return flag; @@ -880,7 +880,7 @@ bool8 ThundershockMoveAction(Entity *pokemon, Entity *target, Move *move, s32 it flag = TRUE; if(sub_805727C(pokemon, target, gThundershockSecondaryChance)) { - ParalyzeStatusTarget(pokemon, target, FALSE); + TryInflictParalysisStatus(pokemon, target, FALSE); } } return flag; @@ -888,7 +888,7 @@ bool8 ThundershockMoveAction(Entity *pokemon, Entity *target, Move *move, s32 it bool8 ThunderWaveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId) { - ParalyzeStatusTarget(pokemon, target, TRUE); + TryInflictParalysisStatus(pokemon, target, TRUE); return TRUE; } @@ -901,7 +901,7 @@ bool8 ZapCannonMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemI flag = TRUE; if(sub_805727C(pokemon, target, 0)) { - ParalyzeStatusTarget(pokemon, target, FALSE); + TryInflictParalysisStatus(pokemon, target, FALSE); } } return flag; diff --git a/src/move_orb_actions_3.c b/src/move_orb_actions_3.c index ad64ffc33..34ca970b0 100644 --- a/src/move_orb_actions_3.c +++ b/src/move_orb_actions_3.c @@ -104,7 +104,7 @@ bool8 BounceMoveAction(Entity * pokemon,Entity * target,Move * move,s32 itemId) if (HandleDamagingMove(pokemon, target, move, gBounceModifier, itemId) != 0) { flag = TRUE; if (sub_805727C(pokemon, target, gBounceSecondaryChance) != 0) { - ParalyzeStatusTarget(pokemon, target, FALSE); + TryInflictParalysisStatus(pokemon, target, FALSE); } } sub_8079764(pokemon); @@ -159,7 +159,7 @@ bool8 TriAttackMoveAction(Entity * pokemon, Entity * target, Move *move, s32 ite { case 0: default: - ParalyzeStatusTarget(pokemon, target, FALSE); + TryInflictParalysisStatus(pokemon, target, FALSE); break; case 1: BurnedStatusTarget(pokemon, target, 0, FALSE); @@ -355,7 +355,7 @@ bool8 FakeOutMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId) flag = TRUE; if(sub_805727C(pokemon, target, gFakeOutSecondaryChance)) { - CringeStatusTarget(pokemon, target, FALSE); + TryInflictCringeStatus(pokemon, target, FALSE); } } return flag; @@ -706,7 +706,7 @@ bool8 SecretPowerMoveAction(Entity * pokemon, Entity * target, Move *move, s32 i SleepStatusTarget(pokemon,target,CalculateStatusTurns(target,gSleepTurnRange,TRUE),FALSE); break; case 2: - LowerMovementSpeedTarget(pokemon,target,1,FALSE); + LowerSpeed(pokemon,target,1,FALSE); break; case 3: LowerOffensiveStat(pokemon,target,gStatIndexAtkDef,1,1,FALSE); @@ -721,11 +721,11 @@ bool8 SecretPowerMoveAction(Entity * pokemon, Entity * target, Move *move, s32 i ConfuseStatusTarget(pokemon,target,FALSE); break; case 7: - CringeStatusTarget(pokemon,target,FALSE); + TryInflictCringeStatus(pokemon,target,FALSE); break; case 8: default: - ParalyzeStatusTarget(pokemon,target,FALSE); + TryInflictParalysisStatus(pokemon,target,FALSE); break; } } @@ -898,7 +898,7 @@ bool8 EruptionMoveAction(Entity * pokemon, Entity * target, Move *move, s32 item bool8 GlareMoveAction(Entity * pokemon,Entity * target,Move *move,s32 itemId) { - ParalyzeStatusTarget(pokemon,target, TRUE); + TryInflictParalysisStatus(pokemon,target, TRUE); return TRUE; } diff --git a/src/move_orb_actions_4.c b/src/move_orb_actions_4.c index 0182f8a2a..fd6bb7750 100644 --- a/src/move_orb_actions_4.c +++ b/src/move_orb_actions_4.c @@ -306,7 +306,7 @@ bool8 DragonRageMoveAction(Entity * pokemon, Entity * target, Move *move, s32 it bool8 DragonDanceMoveAction( Entity * pokemon, Entity * target, Move *move, s32 itemId) { BoostOffensiveStat(pokemon, target, gStatIndexAtkDef, 1); - RaiseMovementSpeedTarget(pokemon, target, 0, TRUE); + BoostSpeed(pokemon, target, 0, TRUE); return TRUE; } @@ -602,7 +602,7 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 itemId bool8 SlowDownMoveAction(Entity *pokemon, Entity *target, Move *move, s32 itemId) { - LowerMovementSpeedTarget(pokemon, target, 1, TRUE); + LowerSpeed(pokemon, target, 1, TRUE); return TRUE; } diff --git a/src/move_orb_effects_1.c b/src/move_orb_effects_1.c index 5fd6d9d6b..19866d248 100644 --- a/src/move_orb_effects_1.c +++ b/src/move_orb_effects_1.c @@ -60,7 +60,7 @@ u8 sub_8075BF4(Entity * pokemon, s32 sleepClassStatusTurns) uVar4 = 1; else if(entityInfo->sleepClassStatus.status == STATUS_NIGHTMARE) uVar4 = 2; - EntityUpdateStatusSprites(pokemon); + UpdateStatusIconFlags(pokemon); } return uVar4; } @@ -100,7 +100,7 @@ bool8 CannotSleep(Entity * pokemon, Entity * target, u8 param_3, bool8 displayMe { if ((!EntityIsValid(target)) || ((SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0), param_3 != 0 && - (HasSafeguardStatus(pokemon,target,displayMessage))))) { + (SafeguardIsActive(pokemon,target,displayMessage))))) { return TRUE; } else if (IQSkillIsEnabled(target, IQ_NONSLEEPER)) { @@ -163,7 +163,7 @@ void NightmareStatusTarget(Entity * pokemon, Entity * target, s32 turns) { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB3D0); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -200,7 +200,7 @@ void NappingStatusTarget(Entity * pokemon, Entity * target, s32 turns) { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB388); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -231,7 +231,7 @@ void YawnedStatusTarget(Entity * pokemon, Entity * target, s32 turns) else TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB3E0); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } void SleeplessStatusTarget(Entity * pokemon, Entity * target) @@ -266,7 +266,7 @@ void SleeplessStatusTarget(Entity * pokemon, Entity * target) { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB43C); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } void PausedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, s32 turns, bool8 displayMessage) @@ -277,7 +277,7 @@ void PausedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, s32 turns return; } entityInfo = GetEntInfo(target); - if ((param_3 != 0) && (HasSafeguardStatus(pokemon,target,displayMessage))) { + if ((param_3 != 0) && (SafeguardIsActive(pokemon,target,displayMessage))) { return; } SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); @@ -301,7 +301,7 @@ void PausedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, s32 turns TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB4F0); } } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) @@ -311,7 +311,7 @@ void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessa if (EntityIsValid(target)) { entityInfo = GetEntInfo(target); - if (!HasSafeguardStatus(pokemon,target,displayMessage)) { + if (!SafeguardIsActive(pokemon,target,displayMessage)) { if (AbilityIsActive(target,ABILITY_OBLIVIOUS)) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (displayMessage) { @@ -330,7 +330,7 @@ void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessa else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB52C); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -350,7 +350,7 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis return; } - if (!HasSafeguardStatus(pokemon,target,displayMessage)) { + if (!SafeguardIsActive(pokemon,target,displayMessage)) { entityInfo = GetEntInfo(target); SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); if (AbilityIsActive(target, ABILITY_WATER_VEIL)) { @@ -388,7 +388,7 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB564); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); if (!AbilityIsActive(target, ABILITY_SYNCHRONIZE)) { return; @@ -437,7 +437,7 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag return; } - if (!HasSafeguardStatus(pokemon,target,displayMessage)) { + if (!SafeguardIsActive(pokemon,target,displayMessage)) { entityInfo = GetEntInfo(target); SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); if (HasHeldItem(target, ITEM_PECHA_SCARF)) { @@ -506,7 +506,7 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag } } } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -526,7 +526,7 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM return; } - if (!HasSafeguardStatus(pokemon,target,displayMessage)) { + if (!SafeguardIsActive(pokemon,target,displayMessage)) { entityInfo = GetEntInfo(target); SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); if (HasHeldItem(target, ITEM_PECHA_SCARF)) { @@ -588,7 +588,7 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM } } } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -607,7 +607,7 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); entityInfo = GetEntInfo(target); - if ((entityInfo->frozenClassStatus.status != STATUS_FROZEN) && !HasSafeguardStatus(pokemon,target,displayMessage)) { + if ((entityInfo->frozenClassStatus.status != STATUS_FROZEN) && !SafeguardIsActive(pokemon,target,displayMessage)) { if (AbilityIsActive(target, ABILITY_MAGMA_ARMOR)) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FCDE0); @@ -636,7 +636,7 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) entityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gFreezeTurnRange,TRUE) + 1; entityInfo->frozenClassStatus.damageCountdown = 0; TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB610); - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -649,7 +649,7 @@ void SqueezedStatusTarget(Entity * pokemon, Entity * target, s32 param_3, bool32 s32 param_3_s32 = (s16) param_3; bool8 displayMessage_u8 = displayMessage; - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage_u8))) { + if ((EntityIsValid(target)) && (!SafeguardIsActive(pokemon,target,displayMessage_u8))) { entityInfo = GetEntInfo(target); if (entityInfo->frozenClassStatus.status == STATUS_WRAP || entityInfo->frozenClassStatus.status == STATUS_WRAPPED) { sub_8076CB4(entityInfo->unk9C); @@ -671,7 +671,7 @@ void SqueezedStatusTarget(Entity * pokemon, Entity * target, s32 param_3, bool32 else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB64C); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -679,7 +679,7 @@ void ImmobilizedStatusTarget(Entity * pokemon, Entity * target) { EntityInfo *entityInfo; - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { + if ((EntityIsValid(target)) && (!SafeguardIsActive(pokemon,target,TRUE))) { entityInfo = GetEntInfo(target); if (entityInfo->frozenClassStatus.status == STATUS_WRAP || entityInfo->frozenClassStatus.status == STATUS_WRAPPED) { sub_8076CB4(entityInfo->unk9C); @@ -700,7 +700,7 @@ void ImmobilizedStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB688); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -724,7 +724,7 @@ void IngrainedStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB6C0); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -735,7 +735,7 @@ void WrapTarget(Entity *pokemon, Entity *target) if (!EntityIsValid(target)) return; - if (HasSafeguardStatus(pokemon, target, TRUE)) + if (SafeguardIsActive(pokemon, target, TRUE)) return; pokemonEntityData = GetEntInfo(pokemon); @@ -778,7 +778,7 @@ void WrapTarget(Entity *pokemon, Entity *target) } } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } void sub_8076CB4(s32 param_1) @@ -798,7 +798,7 @@ void sub_8076CB4(s32 param_1) } entityInfo->unk9C = 0; } - EntityUpdateStatusSprites(entity); + UpdateStatusIconFlags(entity); } } } @@ -810,7 +810,7 @@ void PetrifiedStatusTarget(Entity * pokemon, Entity * target) Entity * entity; s32 index; - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { + if ((EntityIsValid(target)) && (!SafeguardIsActive(pokemon,target,TRUE))) { sub_8041C08(target); targetEntityInfo = GetEntInfo(target); if ((u8)(targetEntityInfo->frozenClassStatus.status - 3U) < 2) { @@ -847,11 +847,11 @@ void PetrifiedStatusTarget(Entity * pokemon, Entity * target) } } } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } -void LowerOffensiveStat(Entity * user, Entity * target, struct StatIndex stat, s32 nStages, u8 checkProtected, bool8 logMsgProtected) +void LowerOffensiveStat(Entity *user, Entity *target, struct StatIndex stat, s32 nStages, bool8 checkProtected, bool8 logMsgProtected) { EntityInfo *entityInfo; s32 newStage; @@ -907,10 +907,10 @@ void LowerOffensiveStat(Entity * user, Entity * target, struct StatIndex stat, s TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FC274); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } -void LowerDefensiveStat(Entity * user, Entity * target, struct StatIndex stat, s32 nStages, bool8 checkProtected, bool8 logMsgProtected) +void LowerDefensiveStat(Entity *user, Entity *target, struct StatIndex stat, s32 nStages, bool8 checkProtected, bool8 logMsgProtected) { EntityInfo *entityInfo; s32 newStage; @@ -954,10 +954,10 @@ void LowerDefensiveStat(Entity * user, Entity * target, struct StatIndex stat, s TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FC248); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } -void BoostOffensiveStat(Entity * user, Entity * target, struct StatIndex stat, s32 nStages) +void BoostOffensiveStat(Entity *user, Entity *target, struct StatIndex stat, s32 nStages) { EntityInfo *entityInfo; s32 newStage; @@ -995,10 +995,10 @@ void BoostOffensiveStat(Entity * user, Entity * target, struct StatIndex stat, s else { TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FC270); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } -void BoostDefensiveStat(Entity * user, Entity * target, struct StatIndex stat, s32 nStages) +void BoostDefensiveStat(Entity *user, Entity *target, struct StatIndex stat, s32 nStages) { EntityInfo *entityInfo; s32 newStage; @@ -1036,7 +1036,7 @@ void BoostDefensiveStat(Entity * user, Entity * target, struct StatIndex stat, s else { TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FC21C); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } u8 GetFlashFireStatus(Entity *defender) @@ -1068,7 +1068,7 @@ void ActivateFlashFire(Entity * pokemon, Entity *target) entityInfo->flashFireBoost = flashFireBoost; sub_8041C58(target); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -1136,7 +1136,7 @@ void ApplyOffensiveStatMultiplier(Entity *user, Entity *target, struct StatIndex else { TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FC184); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } void ApplyDefensiveStatMultiplier(Entity *user, Entity *target, struct StatIndex stat, s24_8 multiplier, bool8 displayMessage) @@ -1187,7 +1187,7 @@ void ApplyDefensiveStatMultiplier(Entity *user, Entity *target, struct StatIndex else { TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FC180); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } void BoostHitChanceStat(Entity *user, Entity *target, struct StatIndex stat) @@ -1199,7 +1199,7 @@ void BoostHitChanceStat(Entity *user, Entity *target, struct StatIndex stat) entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - sub_8042040(target,stat); + PlayHitChanceUpEffect(target,stat); if (stat.id != STAT_INDEX_ACCURACY) { strcpy(gFormatBuffer_Items[0],gUnknown_80FC090); } @@ -1214,7 +1214,7 @@ void BoostHitChanceStat(Entity *user, Entity *target, struct StatIndex stat) else { TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FC218); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } void LowerHitChanceStat(Entity *user, Entity *target, struct StatIndex stat, bool8 displayMessage) @@ -1244,7 +1244,7 @@ void LowerHitChanceStat(Entity *user, Entity *target, struct StatIndex stat, boo entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - sub_8042060(target,stat.id); + PlayHitChanceDownEffect(target,stat.id); if (entityInfo->hitChanceStages[stat.id] != 0) { entityInfo->hitChanceStages[stat.id]--; TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FC1A4); @@ -1252,17 +1252,17 @@ void LowerHitChanceStat(Entity *user, Entity *target, struct StatIndex stat, boo else { TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FC1F0); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } -void CringeStatusTarget(Entity *user ,Entity *target, bool8 displayMessage) +void TryInflictCringeStatus(Entity *user ,Entity *target, bool8 displayMessage) { EntityInfo *entityInfo; if (!EntityIsValid(target)) return; - if (HasSafeguardStatus(user, target, displayMessage)) + if (SafeguardIsActive(user, target, displayMessage)) return; if (AbilityIsActive(target, ABILITY_INNER_FOCUS)){ @@ -1277,16 +1277,16 @@ void CringeStatusTarget(Entity *user ,Entity *target, bool8 displayMessage) if (entityInfo->cringeClassStatus.status != STATUS_CRINGE) { entityInfo->cringeClassStatus.status = STATUS_CRINGE; entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target, gCringeTurnRange, TRUE) + 1; - sub_80420A0(target); + PlayCringeExclamationPointEffect(target); TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FB2E0); } else { TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FB300); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } -void ParalyzeStatusTarget(Entity *user, Entity *target, bool8 displayMessage) +void TryInflictParalysisStatus(Entity *user, Entity *target, bool8 displayMessage) { EntityInfo *entityInfo; bool8 alreadyParalyzed; @@ -1294,7 +1294,7 @@ void ParalyzeStatusTarget(Entity *user, Entity *target, bool8 displayMessage) if (!EntityIsValid(target)) return; - if (HasSafeguardStatus(user, target, displayMessage)) + if (SafeguardIsActive(user, target, displayMessage)) return; if (AbilityIsActive(target, ABILITY_LIMBER)) { @@ -1315,7 +1315,7 @@ void ParalyzeStatusTarget(Entity *user, Entity *target, bool8 displayMessage) entityInfo->burnClassStatus.badlyPoisonedDamageCount = 0; alreadyParalyzed = FALSE; TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FB2AC); - sub_8041C1C(target); + PlayParalysisEffect(target); CalcSpeedStage(target); } else { @@ -1336,102 +1336,98 @@ void ParalyzeStatusTarget(Entity *user, Entity *target, bool8 displayMessage) TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FF01C); } if (GetTreatmentBetweenMonstersIgnoreStatus(target,mapMonster) == TREATMENT_TREAT_AS_ENEMY) { - ParalyzeStatusTarget(user, mapMonster, displayMessage); + TryInflictParalysisStatus(user, mapMonster, displayMessage); } } } } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } -void RaiseMovementSpeedTarget(Entity * pokemon, Entity * target, s32 turns, bool8 displayMessage) +void BoostSpeed(Entity *user, Entity *target, s32 turns, bool8 displayMessage) { - s32 movSpeed; - s32 index; - s32 movSpeed_1; - EntityInfo *entityInfo; + s32 speedBefore; + s32 i; + s32 speedAfter; + EntityInfo *entityInfo; - if (!EntityIsValid(target)) { - return; - } - if (turns == 0) { - turns = CalculateStatusTurns(target,gSpeedRaiseTurnRange,FALSE) + 1; - } - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - movSpeed = CalcSpeedStage(target); - if (movSpeed == MAX_SPEED_STAGE) { - if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC2B8); - } - else { - for(index = 0; index < NUM_SPEED_COUNTERS; index++) - { - if(entityInfo->speedUpCounters[index] == 0) - { - entityInfo->speedUpCounters[index] = turns; - break; - } - } - movSpeed_1 = CalcSpeedStage(target); - if (movSpeed == movSpeed_1) { - TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC298); - } - else - { - sub_8041CB8(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA124[movSpeed_1]); - entityInfo->speedStageChanged = TRUE; - entityInfo->attacking = FALSE; - } - } - EntityUpdateStatusSprites(target); -} + if (!EntityIsValid(target)) + return; -void LowerMovementSpeedTarget(Entity * pokemon, Entity * target, s32 levels, bool8 displayMessage) -{ - s32 movSpeed; - s32 counter; - s32 index; - s32 movSpeed_1; - EntityInfo *entityInfo; + if (turns == 0) { + turns = CalculateStatusTurns(target,gSpeedRaiseTurnRange,FALSE) + 1; + } - if (!EntityIsValid(target)) { - return; - } - if (HasSafeguardStatus(pokemon,target,displayMessage)) { - return; - } - entityInfo = GetEntInfo(target); - SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - movSpeed = CalcSpeedStage(target); - if (movSpeed == 0) { - if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC2D8); - } - else { - for(counter = 0; counter < levels; counter++) - { - for(index = 0; index < NUM_SPEED_COUNTERS; index++) - { - if (entityInfo->speedDownCounters[index]== 0) { - entityInfo->speedDownCounters[index] = CalculateStatusTurns(target,gSpeedLowerTurnRange,TRUE) + 1; + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + speedBefore = CalcSpeedStage(target); + if (speedBefore == MAX_SPEED_STAGE) { + if (displayMessage) + TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FC2B8); + } + else { + for (i = 0; i < NUM_SPEED_COUNTERS; i++) { + if (entityInfo->speedUpCounters[i] == 0) { + entityInfo->speedUpCounters[i] = turns; break; } } + + speedAfter = CalcSpeedStage(target); + if (speedBefore == speedAfter) { + TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FC298); + } + else { + PlaySpeedUpEffect(target); + TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FA124[speedAfter]); + entityInfo->speedStageChanged = TRUE; + entityInfo->attacking = FALSE; + } } - movSpeed_1 = CalcSpeedStage(target); - if (movSpeed == movSpeed_1) { - if (displayMessage) - TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC298); - } - else - { - sub_8041CCC(target); - TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA124[movSpeed_1]); - } - } - EntityUpdateStatusSprites(target); + + UpdateStatusIconFlags(target); } +void LowerSpeed(Entity *user, Entity *target, s32 nStages, bool8 displayMessage) +{ + s32 speedBefore; + s32 speedAfter; + EntityInfo *entityInfo; + + if (!EntityIsValid(target)) + return; + + if (SafeguardIsActive(user,target,displayMessage)) + return; + + entityInfo = GetEntInfo(target); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + speedBefore = CalcSpeedStage(target); + if (speedBefore == 0) { + if (displayMessage) + TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FC2D8); + } + else { + s32 counter, i; + for (counter = 0; counter < nStages; counter++) { + for (i = 0; i < NUM_SPEED_COUNTERS; i++) { + if (entityInfo->speedDownCounters[i]== 0) { + entityInfo->speedDownCounters[i] = CalculateStatusTurns(target,gSpeedLowerTurnRange,TRUE) + 1; + break; + } + } + } + speedAfter = CalcSpeedStage(target); + if (speedBefore == speedAfter) { + if (displayMessage) + TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FC298); + } + else { + PlaySpeedDownEffect(target); + TryDisplayDungeonLoggableMessage3(user,target,gUnknown_80FA124[speedAfter]); + } + } + + UpdateStatusIconFlags(target); +} diff --git a/src/move_orb_effects_2.c b/src/move_orb_effects_2.c index 4005887a4..5ff7d68cd 100644 --- a/src/move_orb_effects_2.c +++ b/src/move_orb_effects_2.c @@ -40,7 +40,7 @@ void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage return; } - if (HasSafeguardStatus(pokemon,target,displayMessage)) { + if (SafeguardIsActive(pokemon,target,displayMessage)) { return; } @@ -67,7 +67,7 @@ void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB27C); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -76,7 +76,7 @@ void CowerStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) { EntityInfo *entityInfo; - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) { + if ((EntityIsValid(target)) && (!SafeguardIsActive(pokemon,target,displayMessage))) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->cringeClassStatus.status != STATUS_COWERING) { @@ -88,7 +88,7 @@ void CowerStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB960); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -132,7 +132,7 @@ void HealTargetHP(Entity *pokemon, Entity *target, s32 param_3, s32 param_4, boo } maxHPStat = entityInfo->maxHPStat - maxHPStat; HP = entityInfo->HP - HP; - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); gFormatArgs[0] = HP; gFormatArgs[1] = maxHPStat; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); @@ -186,7 +186,7 @@ void HandleScannerOrb(Entity* pokemon, Entity* target) TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAEA0); // Item locations became evident UpdateCamera(0); UpdateMinimap(); - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -211,7 +211,7 @@ void HandleStairsOrb(Entity* pokemon, Entity* target) TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAEC8); UpdateCamera(0); UpdateMinimap(); - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -231,7 +231,7 @@ void HandleRadarOrb(Entity* pokemon, Entity* target) TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAFAC); UpdateCamera(0); UpdateMinimap(); - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -250,7 +250,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,gPtrCantLeechSeedSelfMessage); } else { - if (HasSafeguardStatus(pokemon,target,displayMessage)) { + if (SafeguardIsActive(pokemon,target,displayMessage)) { return; } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); @@ -284,7 +284,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) } } TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAE58); - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -308,7 +308,7 @@ void sub_8078084(Entity * pokemon) if(entityInfo2->leechSeedClassStatus.unk4 == entityInfo->dungeonSpriteId) { entityInfo2->leechSeedClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -350,7 +350,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) } } TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBB4C); - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -370,7 +370,7 @@ void SureShotStatusTarget(Entity *pokemon, Entity * target, s32 turns) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB764); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -378,7 +378,7 @@ void WhifferStatusTarget(Entity *pokemon, Entity * target, s32 turns) { EntityInfo *entityInfo; - if (EntityIsValid(target) && !HasSafeguardStatus(pokemon, target, TRUE)) { + if (EntityIsValid(target) && !SafeguardIsActive(pokemon, target, TRUE)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->sureShotClassStatus.status != STATUS_WHIFFER) { @@ -390,7 +390,7 @@ void WhifferStatusTarget(Entity *pokemon, Entity * target, s32 turns) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB7A0); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -410,7 +410,7 @@ void FixedDamageStatusTarget(Entity *pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB8E4); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -430,7 +430,7 @@ void FocusEnergyStatusTarget(Entity *pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB924); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -443,7 +443,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, bool8 param_3) ActionContainer action; s32 index; - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { + if ((EntityIsValid(target)) && (!SafeguardIsActive(pokemon, target, TRUE))) { targetEntityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (targetEntityInfo->curseClassStatus.status == STATUS_DECOY) { @@ -488,7 +488,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, bool8 param_3) } } } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -504,7 +504,7 @@ void CurseStatusTarget(Entity *pokemon, Entity * target) pokemonEntityData = GetEntInfo(pokemon); targetEntityInfo = GetEntInfo(target); if (MonsterIsType(pokemon, TYPE_GHOST)) { - if (HasSafeguardStatus(pokemon,target, TRUE)) { + if (SafeguardIsActive(pokemon,target, TRUE)) { return; } EndCurseClassStatus(pokemon,target,STATUS_CURSED); @@ -525,9 +525,9 @@ void CurseStatusTarget(Entity *pokemon, Entity * target) else { BoostOffensiveStat(pokemon,pokemon,gStatIndexAtkDef,1); BoostDefensiveStat(pokemon,pokemon,gStatIndexAtkDef,1); - LowerMovementSpeedTarget(pokemon,pokemon,1,TRUE); + LowerSpeed(pokemon,pokemon,1,TRUE); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -560,7 +560,7 @@ void SnatchStatusTarget(Entity * pokemon, Entity * target) gDungeon->unk17B3C = targetEntityInfo->dungeonSpriteId; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB01C); - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -568,7 +568,7 @@ void TauntStatusTarget(Entity * pokemon, Entity * target) { EntityInfo *entityInfo; - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { + if ((EntityIsValid(target)) && (!SafeguardIsActive(pokemon,target,TRUE))) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->cringeClassStatus.status != STATUS_TAUNTED) { @@ -580,7 +580,7 @@ void TauntStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBA14); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -601,7 +601,7 @@ void HandleStockpile(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBA60); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -624,7 +624,7 @@ void InvisibleStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBAA0); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -632,7 +632,7 @@ void PerishSongTarget(Entity * pokemon, Entity * target) { EntityInfo * entityInfo; - if (EntityIsValid(target) && !HasSafeguardStatus(pokemon, target, TRUE)) { + if (EntityIsValid(target) && !SafeguardIsActive(pokemon, target, TRUE)) { nullsub_82(target); entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); @@ -643,7 +643,7 @@ void PerishSongTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBB28); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -654,7 +654,7 @@ void EncoreStatusTarget(Entity *pokemon,Entity *target) EntityInfo *EntityInfo; EntityInfo = GetEntInfo(target); - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { + if ((EntityIsValid(target)) && (!SafeguardIsActive(pokemon,target,TRUE))) { for(index = 0; index < MAX_MON_MOVES; index++) { movePtr = &EntityInfo->moves.moves[index]; @@ -675,7 +675,7 @@ void EncoreStatusTarget(Entity *pokemon,Entity *target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBBB8); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -719,7 +719,7 @@ void sub_8078A58(Entity *pokemon, Entity *target, s32 param_3, s32 param_4) TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FBE40); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } void sub_8078B5C(Entity *pokemon, Entity *target, u32 bellyIncrement, s32 maxBellyIncrement, bool8 displayMessage) @@ -807,14 +807,14 @@ void sub_8078B5C(Entity *pokemon, Entity *target, u32 bellyIncrement, s32 maxBel } } } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } void MuzzleTarget(Entity *pokemon, Entity *target) { EntityInfo *entityInfo; - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { + if ((EntityIsValid(target)) && (!SafeguardIsActive(pokemon, target, TRUE))) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->muzzled.muzzled != TRUE) { @@ -827,7 +827,7 @@ void MuzzleTarget(Entity *pokemon, Entity *target) { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBF84); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -882,7 +882,7 @@ void TransformStatusTarget(Entity * pokemon, Entity * target) sub_806CCB4(target, sub_806CEBC(target)); CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[1], entityInfo->apparentID); TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FBEC0); - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -909,7 +909,7 @@ void MobileStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBF50); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -926,7 +926,7 @@ void ExposeStatusTarget(Entity * pokemon, Entity * target, s16 param_3) flag = FALSE; flag2 = FALSE; - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { + if ((EntityIsValid(target)) && (!SafeguardIsActive(pokemon,target,TRUE))) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->hitChanceStages[1] > 10) { @@ -954,19 +954,19 @@ void ExposeStatusTarget(Entity * pokemon, Entity * target, s16 param_3) entityInfo->exposed = TRUE; TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBF9C); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } void IdentityItemHolders(Entity *pokemon, Entity *target) { - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { + if ((EntityIsValid(target)) && (!SafeguardIsActive(pokemon, target, TRUE))) { UNUSED EntityInfo *entityInfo = GetEntInfo(target); if (!gDungeon->unk644.itemHoldersIdentified) { nullsub_89(target); gDungeon->unk644.itemHoldersIdentified = TRUE; - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC028); } else @@ -980,7 +980,7 @@ void BlindTarget(Entity *pokemon, Entity *target) { EntityInfo *entityInfo; - if ((EntityIsValid(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { + if ((EntityIsValid(target)) && (!SafeguardIsActive(pokemon, target, TRUE))) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->blinkerClassStatus.status != STATUS_BLINKER) { @@ -996,7 +996,7 @@ void BlindTarget(Entity *pokemon, Entity *target) { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB810); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -1006,7 +1006,7 @@ void CrossEyeVisionTarget(Entity *pokemon, Entity *target) if (EntityIsValid(target)) { - if(!HasSafeguardStatus(pokemon, target, TRUE)) + if(!SafeguardIsActive(pokemon, target, TRUE)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); @@ -1023,7 +1023,7 @@ void CrossEyeVisionTarget(Entity *pokemon, Entity *target) { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB85C); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -1049,7 +1049,7 @@ void RestoreVisionTarget(Entity *pokemon, Entity *target) { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB89C); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -1091,7 +1091,7 @@ void RestorePPTarget(Entity * pokemon,Entity * target, s32 param_3) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FDBF0); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -1121,7 +1121,7 @@ void RaiseAtkStatTarget(Entity * pokemon, Entity *target, s32 increment) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC360); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -1151,7 +1151,7 @@ void RaiseSpAtkStatTarget(Entity * pokemon, Entity *target, s32 increment) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC3B4); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -1181,7 +1181,7 @@ void RaiseDefStatTarget(Entity * pokemon, Entity *target, s32 increment) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC3FC); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -1211,7 +1211,7 @@ void RaiseSpDefStatTarget(Entity * pokemon, Entity *target, s32 increment) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC454); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -1229,7 +1229,7 @@ void LongTossStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD22C); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } void PierceStatusTarget(Entity * pokemon, Entity * target) @@ -1246,5 +1246,5 @@ void PierceStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FD27C); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } diff --git a/src/move_orb_effects_3.c b/src/move_orb_effects_3.c index ff197f926..88a4fa367 100644 --- a/src/move_orb_effects_3.c +++ b/src/move_orb_effects_3.c @@ -75,7 +75,7 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * } sub_8041BD0(target,uVar5); TryDisplayDungeonLoggableMessage3(pokemon,target,message); - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); // TODO: this could probably be cleaner.. for (index = 0, iVar8 = 0xc7ff; index < 400; index++) { @@ -105,6 +105,6 @@ void sub_8079764(Entity * pokemon) entityInfo->unk14A = 0; entityInfo->unkFF = 0; } - EntityUpdateStatusSprites(pokemon); + UpdateStatusIconFlags(pokemon); } } diff --git a/src/move_orb_effects_4.c b/src/move_orb_effects_4.c index 8fa1da254..00d47eecd 100644 --- a/src/move_orb_effects_4.c +++ b/src/move_orb_effects_4.c @@ -45,7 +45,7 @@ void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus) } entityInfo->reflectClassStatus.status = newStatus; TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB0E0); - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -66,7 +66,7 @@ void SafeguardStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB074); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -86,7 +86,7 @@ void MistStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB0C4); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -106,7 +106,7 @@ void WishStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAE3C); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -126,7 +126,7 @@ void MagicCoatStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FAF8C); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -146,7 +146,7 @@ void LightScreenStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB160); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -166,7 +166,7 @@ void ReflectStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB1A8); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -187,7 +187,7 @@ void ProtectStatusTarget(Entity * pokemon, Entity * target) SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FB9D8); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -207,7 +207,7 @@ void MirrorCoatStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBAE4); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -227,7 +227,7 @@ void EndureStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBC14); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -247,7 +247,7 @@ void MirrorMoveStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBC5C); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -272,7 +272,7 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBCA4); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } @@ -293,7 +293,7 @@ void VitalThrowStatusTarget(Entity * pokemon, Entity * target) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBCF0); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -343,7 +343,7 @@ void sub_8079E34(Entity * pokemon, Entity * target, bool8 param_3) else { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FBD3C); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } diff --git a/src/move_orb_effects_5.c b/src/move_orb_effects_5.c index 6a4942275..5dc8277b6 100644 --- a/src/move_orb_effects_5.c +++ b/src/move_orb_effects_5.c @@ -105,7 +105,7 @@ void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4) else if (param_4 == 0) { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_81004E8); } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -128,7 +128,7 @@ void sub_807A0CC(Entity * pokemon, Entity * target) move->moveFlags2 &= ~(MOVE_FLAG_EXISTS); } } - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); }; } @@ -178,7 +178,7 @@ void EndSleepClassStatus(Entity * pokemon, Entity * target, bool8 param_3, bool8 break; } entityInfo->sleepClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); if (isAsleep) { sub_806CE68(target,8); } @@ -210,7 +210,7 @@ void EndBurnClassStatus(Entity * pokemon, Entity * target) } entityInfo->burnClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } void EndFrozenClassStatus(Entity * pokemon, Entity *target) @@ -249,7 +249,7 @@ void EndFrozenClassStatus(Entity * pokemon, Entity *target) break; } entityInfo->frozenClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); if (isFrozen) { sub_8042A74(target); } @@ -291,7 +291,7 @@ void EndCringeClassStatus(Entity * pokemon, Entity *target) break; } entityInfo->cringeClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); CalcSpeedStage(target); } @@ -350,7 +350,7 @@ void EndReflectClassStatus(Entity * pokemon, Entity *target) break; } entityInfo->reflectClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } void EndCurseClassStatus(Entity * pokemon, Entity * target, u8 curseClassStatus) @@ -389,7 +389,7 @@ void EndCurseClassStatus(Entity * pokemon, Entity * target, u8 curseClassStatus) break; } entityInfo->curseClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -413,7 +413,7 @@ void EndLeechSeedClassStatus(Entity * pokemon, Entity * target) } entityInfo->leechSeedClassStatus.status = STATUS_NONE; entityInfo->leechSeedClassStatus.unk8 = 0xff; - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } @@ -444,7 +444,7 @@ void SendMoveEndMessage(Entity * pokemon, Entity * target) break; } entityInfo->sureShotClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } void SendTransformEndMessage(Entity * pokemon, Entity *target) @@ -479,7 +479,7 @@ void SendTransformEndMessage(Entity * pokemon, Entity *target) break; } entityInfo->invisibleClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); if (isInvisible) { sub_807EC28(TRUE); } @@ -509,7 +509,7 @@ void SendEyesightEndMessage(Entity * pokemon,Entity * target) break; } entityInfo->blinkerClassStatus.status = STATUS_NONE; - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); if (entityInfo->isTeamLeader) { DungeonRunFrameActions(0x31); UpdateTrapsVisibility(); @@ -535,7 +535,7 @@ void SendMuzzledEndMessage(Entity * pokemon, Entity * target) break; } entityInfo->muzzled.muzzled = FALSE; - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } bool8 TrySendImmobilizeSleepEndMsg(Entity * pokemon, Entity * target) @@ -562,7 +562,7 @@ void WakeUpPokemon(Entity * pokemon) entityInfo->sleepClassStatus.status = STATUS_NONE; entityInfo->sleepClassStatus.turns = 0; sub_806A898(pokemon, 1, 1); - EntityUpdateStatusSprites(pokemon); + UpdateStatusIconFlags(pokemon); } void SendThawedMessage(Entity *pokemon, Entity *target) @@ -577,7 +577,7 @@ void SendThawedMessage(Entity *pokemon, Entity *target) entityInfo->frozenClassStatus.damageCountdown = 0; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FA8BC); // $m0 thawed out! - EntityUpdateStatusSprites(target); + UpdateStatusIconFlags(target); } } } diff --git a/src/trap.c b/src/trap.c index ca17b8152..3b6e7fcf2 100644 --- a/src/trap.c +++ b/src/trap.c @@ -493,7 +493,7 @@ void HandleSlumberTrap(Entity *pokemon, Entity *target) void HandleSlowTrap(Entity *pokemon, Entity *target) { if(target != NULL) - LowerMovementSpeedTarget(pokemon, target, 1, TRUE); + LowerSpeed(pokemon, target, 1, TRUE); } void HandlePoisonTrap(Entity *pokemon, Entity *target) @@ -713,7 +713,7 @@ void HandleSealTrap(Entity *param_1,Entity *param_2) bool8 flag = FALSE; - if (param_2 != NULL && !HasSafeguardStatus(param_1, param_2, TRUE)) { + if (param_2 != NULL && !SafeguardIsActive(param_1, param_2, TRUE)) { info = GetEntInfo(param_2); counter = 0; for(i = 0; i < MAX_MON_MOVES;i++)