Merge pull request #2427 from BuffelSaft/fix-stat-boost-on-hit

Fix abilities that raise target's stat after hit
This commit is contained in:
Eduardo Quezada D'Ottone 2022-11-03 08:50:18 -03:00 committed by GitHub
commit 9ea3ad8938
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 6 deletions

View File

@ -9773,3 +9773,13 @@ BattleScript_SymbiosisActivates::
printstring STRINGID_SYMBIOSISITEMPASS printstring STRINGID_SYMBIOSISITEMPASS
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
return 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

View File

@ -431,6 +431,7 @@ extern const u8 BattleScript_AffectionBasedEndurance[];
extern const u8 BattleScript_SymbiosisActivates[]; extern const u8 BattleScript_SymbiosisActivates[];
extern const u8 BattleScript_MultiHitPrintStrings[]; extern const u8 BattleScript_MultiHitPrintStrings[];
extern const u8 BattleScript_BurnUpRemoveType[]; extern const u8 BattleScript_BurnUpRemoveType[];
extern const u8 BattleScript_TargetAbilityStatRaiseRet[];
// zmoves // zmoves
extern const u8 BattleScript_ZMoveActivateDamaging[]; extern const u8 BattleScript_ZMoveActivateDamaging[];

View File

@ -5241,9 +5241,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
&& moveType == TYPE_DARK && moveType == TYPE_DARK
&& CompareStat(battler, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) && CompareStat(battler, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN))
{ {
gEffectBattler = battler;
SET_STATCHANGER(STAT_ATK, 1, FALSE); SET_STATCHANGER(STAT_ATK, 1, FALSE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseOnMoveEnd; gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet;
effect++; effect++;
} }
break; break;
@ -5254,9 +5255,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
&& (moveType == TYPE_DARK || moveType == TYPE_BUG || moveType == TYPE_GHOST) && (moveType == TYPE_DARK || moveType == TYPE_BUG || moveType == TYPE_GHOST)
&& CompareStat(battler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN)) && CompareStat(battler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN))
{ {
gEffectBattler = battler;
SET_STATCHANGER(STAT_SPEED, 1, FALSE); SET_STATCHANGER(STAT_SPEED, 1, FALSE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseOnMoveEnd; gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet;
effect++; effect++;
} }
break; break;
@ -5267,9 +5269,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
&& moveType == TYPE_WATER && moveType == TYPE_WATER
&& CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN)) && CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN))
{ {
gEffectBattler = battler;
SET_STATCHANGER(STAT_DEF, 2, FALSE); SET_STATCHANGER(STAT_DEF, 2, FALSE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseOnMoveEnd; gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet;
effect++; effect++;
} }
break; break;
@ -5279,9 +5282,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
&& IsBattlerAlive(battler) && IsBattlerAlive(battler)
&& CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN)) && CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN))
{ {
gEffectBattler = battler;
SET_STATCHANGER(STAT_DEF, 1, FALSE); SET_STATCHANGER(STAT_DEF, 1, FALSE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseOnMoveEnd; gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet;
effect++; effect++;
} }
break; break;
@ -5296,9 +5300,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
&& !(TestSheerForceFlag(gBattlerAttacker, gCurrentMove)) && !(TestSheerForceFlag(gBattlerAttacker, gCurrentMove))
&& CompareStat(battler, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN)) && CompareStat(battler, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN))
{ {
gEffectBattler = battler;
SET_STATCHANGER(STAT_SPATK, 1, FALSE); SET_STATCHANGER(STAT_SPATK, 1, FALSE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseOnMoveEnd; gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet;
effect++; effect++;
} }
break; break;
@ -5636,9 +5641,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
&& CompareStat(battler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN) && CompareStat(battler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN)
&& (moveType == TYPE_FIRE || moveType == TYPE_WATER)) && (moveType == TYPE_FIRE || moveType == TYPE_WATER))
{ {
gEffectBattler = battler;
SET_STATCHANGER(STAT_SPEED, 6, FALSE); SET_STATCHANGER(STAT_SPEED, 6, FALSE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseOnMoveEnd; gBattlescriptCurrInstr = BattleScript_TargetAbilityStatRaiseRet;
effect++; effect++;
} }
break; break;