Option for setting Payback's damage double damage if the opponent switches out. (#338)

* Option for setting Payback's damage double damage if the opponent switches out.

* Simplified

* Moody moved to ability settings
This commit is contained in:
Eduardo Alvaro Quezada D'Ottone 2020-04-19 18:00:44 -04:00 committed by GitHub
parent dd17360ab0
commit 30900879a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -64,7 +64,7 @@
#define B_FELL_STINGER_STAT_RAISE GEN_6 // Gen6 Atk+2, Gen7 Atk+3.
#define B_SOUND_SUBSTITUTE GEN_6 // Starting from Gen6 sound moves bypass Substitute.
#define B_TOXIC_NEVER_MISS GEN_6 // Starting from Gen6, if Toxic is used by a Poison type, it will never miss.
#define B_MOODY_ACC_EVASION GEN_6 // In Gen8, Moody CANNOT raise Accuray and Evasion any more
#define B_PAYBACK_SWITCH_BOOST GEN_6 // Starting from Gen5, if the opponent switches out, Payback's damage will no longer be doubled.
// Ability settings
#define B_ABILITY_POP_UP GEN_6 // Starting from gen5, the pokemon abilities are displayed in a pop-up, when they activate in battle.
@ -72,6 +72,7 @@
#define B_GALE_WINGS GEN_6 // Gen7 requires full hp.
#define B_STANCE_CHANGE_FAIL GEN_7 // In Gen7, Aegislash's form change does not happen, if the pokemon cannot use a move, because of confusion, paralysis, etc. In gen6, the form change occurs despite not being able to move.
#define B_GHOSTS_ESCAPE GEN_6 // From Gen6 onwards, ghosts can escape even when blocked by abilities such as Shadow Tag.
#define B_MOODY_ACC_EVASION GEN_6 // In Gen8, Moody CANNOT raise Accuray and Evasion any more
// Other
#define B_FAST_INTRO TRUE // If set to TRUE, battle intro texts print at the same time as animation of a pokemon, as opposing to waiting for the animation to end.

View file

@ -5554,7 +5554,8 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
}
break;
case EFFECT_PAYBACK:
if (GetBattlerTurnOrderNum(battlerAtk) > GetBattlerTurnOrderNum(battlerDef) && gDisableStructs[battlerDef].isFirstTurn != 2)
if (GetBattlerTurnOrderNum(battlerAtk) > GetBattlerTurnOrderNum(battlerDef)
&& (gDisableStructs[battlerDef].isFirstTurn != 2 || B_PAYBACK_SWITCH_BOOST < GEN_5))
basePower *= 2;
break;
case EFFECT_ROUND: