Implemented Guard Dog's effect

This commit is contained in:
LOuroboros 2022-12-12 20:30:25 -03:00
parent a56cfd1aa7
commit a3e58b05c1
2 changed files with 18 additions and 6 deletions

View File

@ -2967,6 +2967,7 @@ BattleScript_EffectHitEscape:
jumpifmovehadnoeffect BattleScript_MoveEnd
seteffectwithchance
tryfaintmon BS_TARGET
jumpifability BS_TARGET, ABILITY_GUARD_DOG, BattleScript_MoveEnd
moveendto MOVEEND_ATTACKER_VISIBLE
moveendfrom MOVEEND_TARGET_VISIBLE
jumpifbattleend BattleScript_HitEscapeEnd
@ -8421,6 +8422,7 @@ BattleScript_IntimidateLoop:
jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_IntimidatePrevented
jumpifability BS_TARGET, ABILITY_OBLIVIOUS, BattleScript_IntimidatePrevented
.endif
jumpifability BS_TARGET, ABILITY_GUARD_DOG, BattleScript_IntimidateInReverse
BattleScript_IntimidateEffect:
copybyte sBATTLER, gBattlerTarget
statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, NULL
@ -8447,6 +8449,14 @@ BattleScript_IntimidatePrevented:
call BattleScript_TryAdrenalineOrb
goto BattleScript_IntimidateLoopIncrement
BattleScript_IntimidateInReverse:
copybyte sBATTLER, gBattlerTarget
call BattleScript_AbilityPopUp
pause B_WAIT_TIME_SHORT
modifybattlerstatstage BS_TARGET, STAT_ATK, INCREASE, 1, BattleScript_IntimidateLoopIncrement, ANIM_ON
call BattleScript_TryAdrenalineOrb
goto BattleScript_IntimidateLoopIncrement
BattleScript_DroughtActivates::
pause B_WAIT_TIME_SHORT
call BattleScript_AbilityPopUp

View File

@ -5760,7 +5760,8 @@ static void Cmd_moveend(void)
if (gCurrentMove != MOVE_DRAGON_TAIL
&& gCurrentMove != MOVE_CIRCLE_THROW
&& IsBattlerAlive(gBattlerAttacker)
&& !TestSheerForceFlag(gBattlerAttacker, gCurrentMove))
&& !TestSheerForceFlag(gBattlerAttacker, gCurrentMove)
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_GUARD_DOG)
{
// Since we check if battler was damaged, we don't need to check move result.
// In fact, doing so actually prevents multi-target moves from activating red card properly
@ -9135,9 +9136,10 @@ static void Cmd_various(void)
break;
case VARIOUS_TRY_HIT_SWITCH_TARGET:
if (IsBattlerAlive(gBattlerAttacker)
&& IsBattlerAlive(gBattlerTarget)
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& TARGET_TURN_DAMAGED)
&& IsBattlerAlive(gBattlerTarget)
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& TARGET_TURN_DAMAGED
&& GetBattlerAbility(gBattlerTarget) != ABILITY_GUARD_DOG)
{
gBattleScripting.switchCase = B_SWITCH_HIT;
gBattlescriptCurrInstr = BattleScript_ForceRandomSwitch;
@ -11236,8 +11238,8 @@ static void Cmd_forcerandomswitch(void)
}
else
{
// In normal wild doubles, Roar will always fail if the user's level is less than the target's.
if (gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level)
// In normal wild doubles, Roar will always fail if the user's level is less than the target's or if the target's ability is Guard Dog.
if (gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level && GetBattlerAbility(gBattlerTarget) != ABILITY_GUARD_DOG)
gBattlescriptCurrInstr = BattleScript_RoarSuccessEndBattle;
else
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);