Implemented Costar's effect

This commit is contained in:
LOuroboros 2022-12-06 05:03:07 -03:00
parent 7a52404fd3
commit aa051dab02
4 changed files with 23 additions and 0 deletions

View File

@ -8451,6 +8451,13 @@ BattleScript_SupremeOverlordActivates::
waitmessage B_WAIT_TIME_LONG
end3
BattleScript_CostarActivates::
pause B_WAIT_TIME_SHORT
call BattleScript_AbilityPopUp
printstring STRINGID_PKMNCOPIEDSTATCHANGES
waitmessage B_WAIT_TIME_LONG
end3
BattleScript_AttackWeakenedByStrongWinds::
pause B_WAIT_TIME_SHORT
printstring STRINGID_ATTACKWEAKENEDBSTRONGWINDS

View File

@ -446,6 +446,7 @@ extern const u8 BattleScript_GoodAsGoldActivates[];
extern const u8 BattleScript_RuinAbilityActivates[];
extern const u8 BattleScript_CudChewActivates[];
extern const u8 BattleScript_SupremeOverlordActivates[];
extern const u8 BattleScript_CostarActivates[];
// zmoves
extern const u8 BattleScript_ZMoveActivateDamaging[];

View File

@ -204,5 +204,6 @@ bool32 CanBeFrozen(u8 battlerId);
bool32 CanBeConfused(u8 battlerId);
bool32 IsBattlerTerrainAffected(u8 battlerId, u32 terrainFlag);
u32 GetBattlerFriendshipScore(u8 battlerId);
u32 CountBattlerStatIncreases(u8 battlerId, bool32 countEvasionAcc);
#endif // GUARD_BATTLE_UTIL_H

View File

@ -4965,6 +4965,20 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
effect++;
}
break;
case ABILITY_COSTAR:
if (!gSpecialStatuses[battler].switchInAbilityDone
&& IsDoubleBattle()
&& IsBattlerAlive(BATTLE_PARTNER(battler))
&& CountBattlerStatIncreases(BATTLE_PARTNER(battler), FALSE))
{
gSpecialStatuses[battler].switchInAbilityDone = TRUE;
for (i = 0; i < NUM_BATTLE_STATS; i++)
gBattleMons[battler].statStages[i] = gBattleMons[BATTLE_PARTNER(battler)].statStages[i];
gBattlerTarget = BATTLE_PARTNER(battler);
BattleScriptPushCursorAndCallback(BattleScript_CostarActivates);
effect++;
}
break;
#if B_WEATHER_FORMS < GEN_5
default:
if (gBattleMons[battler].species == SPECIES_CHERRIM)