Battle config options (#243)

* Option to use pre-GenVI critical hit multiplier.

* Clarified the option that multiplies EXP by 1.5 for trainer battles.

* Fixed code style.

* Option to change Burn damage.

* Option to change to Gen 7 paralysis drop.

* Ordered settings.

* Implemented review suggestions.
This commit is contained in:
Eduardo Alvaro Quezada D'Ottone 2020-02-08 05:51:55 -03:00 committed by GitHub
parent bd8d304c01
commit 90442ffbc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 8 deletions

View file

@ -45,16 +45,25 @@
#define GEN_6 3
#define GEN_7 4
// Calculation settings
#define B_CRIT_CHANCE GEN_6 // Chances of a critical hit landing. See atk04_critcalc.
#define B_CRIT_MULTIPLIER GEN_6 // Starting from gen6, critical hits multiply damage by 1.5 instead of 2.
#define B_EXP_CATCH GEN_6 // Starting from gen6, pokemon get experience from catching.
#define B_TRAINER_EXP_MULTIPLIER GEN_6 // Gen7 no longer gives a 1.5 multiplier to exp gain in trainer battles.
#define B_BURN_DAMAGE GEN_6 // In Gen7, burn damage is 1/16th of max HP instead of 1/8th.
#define B_PARALYSIS_SPEED GEN_6 // In Gen7, speed is decreased by 50% instead of 75%.
// Move settings
#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.
// 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.
#define B_ABILITY_WEATHER GEN_6 // Up to gen5 - weather induced by abilities such as Drought or Drizzle lasted till the battle's end or weather change by a move. From Gen6 onwards, weather caused by abilities lasts the same amount of turns as induced from a move.
#define B_GALE_WINGS GEN_6 // Gen7 requires full hp.
#define B_SOUND_SUBSTITUTE GEN_6 // Starting from gen6 sound moves bypass Substitute.
#define B_EXP_CATCH GEN_6 // Starting from gen6, pokemon get experience from catching.
#define B_ABILITY_POP_UP GEN_6 // Starting from gen5, the pokemon abilities are displayed in a pop-up, when they activate in battle.
#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_TRAINER_BATTLE_MULTIPLIER GEN_6 // Gen7 no longer gives a 1.5 multiplier to exp gain.
// 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.
#endif // GUARD_CONSTANTS_BATTLE_CONFIG_H

View file

@ -4314,7 +4314,7 @@ u32 GetBattlerTotalSpeedStat(u8 battlerId)
// paralysis drop
if (gBattleMons[battlerId].status1 & STATUS1_PARALYSIS && ability != ABILITY_QUICK_FEET)
speed /= 4;
speed /= (B_PARALYSIS_SPEED >= GEN_7 ? 2 : 4);
return speed;
}

View file

@ -3507,7 +3507,7 @@ static void Cmd_getexp(void)
gBattleMoveDamage += gExpShareExp;
if (holdEffect == HOLD_EFFECT_LUCKY_EGG)
gBattleMoveDamage = (gBattleMoveDamage * 150) / 100;
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && B_TRAINER_BATTLE_MULTIPLIER != GEN_7)
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && B_TRAINER_EXP_MULTIPLIER != GEN_7)
gBattleMoveDamage = (gBattleMoveDamage * 150) / 100;
if (IsTradedMon(&gPlayerParty[gBattleStruct->expGetterMonId]))

View file

@ -1519,7 +1519,7 @@ u8 DoBattlerEndTurnEffects(void)
&& gBattleMons[gActiveBattler].hp != 0
&& ability != ABILITY_MAGIC_GUARD)
{
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 8;
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / (B_BURN_DAMAGE >= GEN_7 ? 16 : 8);
if (ability == ABILITY_HEATPROOF)
gBattleMoveDamage /= 2;
if (gBattleMoveDamage == 0)
@ -5859,7 +5859,7 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move
// check crit
if (isCrit)
dmg = ApplyModifier(UQ_4_12(1.5), dmg);
dmg = ApplyModifier((B_CRIT_MULTIPLIER >= GEN_6 ? UQ_4_12(1.5) : UQ_4_12(2.0)), dmg);
// check burn
if (gBattleMons[battlerAtk].status1 & STATUS1_BURN && IS_MOVE_PHYSICAL(move)