diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index c3bf65edb..07d32f843 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -9880,3 +9880,13 @@ BattleScript_SymbiosisActivates:: printstring STRINGID_SYMBIOSISITEMPASS waitmessage B_WAIT_TIME_LONG return + +BattleScript_TargetAbilityStatRaiseRet:: + copybyte gBattlerAbility, gEffectBattler + copybyte gBattlerAttacker, gBattlerTarget + call BattleScript_AbilityPopUp + statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN, BattleScript_TargetAbilityStatRaiseRet_End + setgraphicalstatchangevalues + call BattleScript_StatUp +BattleScript_TargetAbilityStatRaiseRet_End: + return diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 2d6364fb9..69ed9bf14 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -429,6 +429,7 @@ extern const u8 BattleScript_DefDownSpeedUp[]; extern const u8 BattleScript_AffectionBasedStatusHeal[]; extern const u8 BattleScript_AffectionBasedEndurance[]; extern const u8 BattleScript_SymbiosisActivates[]; +extern const u8 BattleScript_TargetAbilityStatRaiseRet[]; // zmoves extern const u8 BattleScript_ZMoveActivateDamaging[]; diff --git a/src/battle_util.c b/src/battle_util.c index d83f8429e..257911cd3 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5159,9 +5159,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && moveType == TYPE_DARK && CompareStat(battler, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) { + gEffectBattler = battler; SET_STATCHANGER(STAT_ATK, 1, FALSE); BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseOnMoveEnd; + gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet; effect++; } break; @@ -5172,9 +5173,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && (moveType == TYPE_DARK || moveType == TYPE_BUG || moveType == TYPE_GHOST) && CompareStat(battler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN)) { + gEffectBattler = battler; SET_STATCHANGER(STAT_SPEED, 1, FALSE); BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseOnMoveEnd; + gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet; effect++; } break; @@ -5185,9 +5187,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && moveType == TYPE_WATER && CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN)) { + gEffectBattler = battler; SET_STATCHANGER(STAT_DEF, 2, FALSE); BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseOnMoveEnd; + gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet; effect++; } break; @@ -5197,9 +5200,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && IsBattlerAlive(battler) && CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN)) { + gEffectBattler = battler; SET_STATCHANGER(STAT_DEF, 1, FALSE); BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseOnMoveEnd; + gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet; effect++; } break; @@ -5214,9 +5218,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && !(TestSheerForceFlag(gBattlerAttacker, gCurrentMove)) && CompareStat(battler, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN)) { + gEffectBattler = battler; SET_STATCHANGER(STAT_SPATK, 1, FALSE); BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseOnMoveEnd; + gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet; effect++; } break; @@ -5554,9 +5559,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && CompareStat(battler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN) && (moveType == TYPE_FIRE || moveType == TYPE_WATER)) { + gEffectBattler = battler; SET_STATCHANGER(STAT_SPEED, 6, FALSE); BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseOnMoveEnd; + gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet; effect++; } break;