Merge pull request #2197 from AsparagusEduardo/BE_explosion

Config for Explosion halving defense
This commit is contained in:
ghoulslash 2022-07-21 16:11:32 -04:00 committed by GitHub
commit 30a494f964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -160,6 +160,7 @@
#define B_ROUGH_SKIN_DMG GEN_7 // In Gen4+, Rough Skin contact damage is 1/8th of max HP instead of 1/16th. This will also affect Iron Barbs.
#define B_KNOCK_OFF_DMG GEN_8 // In Gen6+, Knock Off deals 50% more damage when knocking off an item.
#define B_SPORT_DMG_REDUCTION GEN_7 // In Gen5+, Water/Mud Sport reduce Fire/Electric Damage by 67% instead of 50%.
#define B_EXPLOSION_DEFENSE GEN_7 // In Gen5+, Self-Destruct and Explosion don't halve the targets' defense.
// Type settings
#define B_GHOSTS_ESCAPE GEN_7 // In Gen6+, abilities like Shadow Tag or moves like Mean Look fail on Ghost-type Pokémon. They can also escape any Wild Battle.

View File

@ -8831,6 +8831,12 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType,
usesDefStat = FALSE;
}
#if B_EXPLOSION_DEFENSE <= GEN_4
// Self-destruct / Explosion cut defense in half
if (gBattleMoves[gCurrentMove].effect == EFFECT_EXPLOSION)
defStat /= 2;
#endif
// critical hits ignore positive stat changes
if (isCrit && defStage > DEFAULT_STAT_STAGE)
defStage = DEFAULT_STAT_STAGE;