Merge pull request #1744 from AsparagusEduardo/BE_configHiddenPow

Setting for pre-Gen6 Hidden Power Damage.
This commit is contained in:
ghoulslash 2021-10-11 15:13:16 -04:00 committed by GitHub
commit e66820e646
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View file

@ -123,6 +123,7 @@
#define B_CRASH_IF_TARGET_IMMUNE GEN_7 // In Gen4+, The user of Jump Kick or High Jump Kick will "keep going and crash" if it attacks a target that is immune to the move.
#define B_TAILWIND_TIMER GEN_7 // In Gen5+, Tailwind lasts 4 turns instead of 3.
#define B_MEMENTO_FAIL GEN_7 // In Gen4+, Memento fails if there is no target or if the target is protected or behind substitute. But not if Atk/Sp. Atk are at -6.
#define B_HIDDEN_POWER_DMG GEN_7 // In Gen6+, Hidden Power's base power was set to always be 60. Before, it was determined by the mon's IVs.
// Ability settings
#define B_ABILITY_WEATHER GEN_7 // In Gen6+, ability-induced weather lasts 5 turns. Before, it lasted until the battle ended or until it was changed by a move or a different weather-affecting ability.

View file

@ -7658,6 +7658,22 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
basePower *= 2;
#endif
break;
case EFFECT_HIDDEN_POWER:
{
#if B_HIDDEN_POWER_DMG < GEN_6
u8 powerBits;
powerBits = ((gBattleMons[gBattlerAttacker].hpIV & 2) >> 1)
| ((gBattleMons[gBattlerAttacker].attackIV & 2) << 0)
| ((gBattleMons[gBattlerAttacker].defenseIV & 2) << 1)
| ((gBattleMons[gBattlerAttacker].speedIV & 2) << 2)
| ((gBattleMons[gBattlerAttacker].spAttackIV & 2) << 3)
| ((gBattleMons[gBattlerAttacker].spDefenseIV & 2) << 4);
basePower = (40 * powerBits) / 63 + 30;
#endif
break;
}
}
// move-specific base power changes

View file

@ -3753,7 +3753,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_HIDDEN_POWER] =
{
#if B_UPDATED_MOVE_DATA >= GEN_6
#if B_HIDDEN_POWER_DMG >= GEN_6
.power = 60,
#else
.power = 1,