More Battle configs (#339)

* Fixed naming of King Shield's description variable.

* Config for King Shield lowering attack.

* Config for terrain type attack boost.

* Standarized battle config descriptions.

* Adjusted config logic accounting for GEN_8.

* Changed KING_S_SHIELD back to KINGS_SHIELD

* Missed B_ABILITY_WEATHER.
This commit is contained in:
Eduardo Alvaro Quezada D'Ottone 2020-04-20 08:11:28 -04:00 committed by GitHub
parent 1fdb195bd9
commit 4697a5b687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 36 additions and 34 deletions

View File

@ -53,28 +53,30 @@
#define GEN_8 5
// 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%.
#define B_CRIT_CHANCE GEN_6 // Chances of a critical hit landing. See CalcCritChanceStage.
#define B_CRIT_MULTIPLIER GEN_6 // In Gen6+, critical hits multiply damage by 1.5 instead of 2.
#define B_EXP_CATCH GEN_6 // In Gen6+, Pokémon get experience from catching.
#define B_TRAINER_EXP_MULTIPLIER GEN_6 // In Gen7+, trainer battles no longer give a 1.5 multiplier to exp gain.
#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%.
#define B_TERRAIN_TYPE_BOOST GEN_6 // In Gen8+, speed is boosted by 30% instead of 50%.
// 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.
#define B_TOXIC_NEVER_MISS GEN_6 // Starting from Gen6, if Toxic is used by a Poison type, it will never miss.
#define B_PAYBACK_SWITCH_BOOST GEN_6 // Starting from Gen5, if the opponent switches out, Payback's damage will no longer be doubled.
#define B_FELL_STINGER_STAT_RAISE GEN_6 // In Gen7+, it raises Atk by 3 stages instead of 2 if it causes the target to faint.
#define B_SOUND_SUBSTITUTE GEN_6 // In Gen6+, sound moves bypass Substitute.
#define B_TOXIC_NEVER_MISS GEN_6 // In Gen6+, if Toxic is used by a Poison type, it will never miss.
#define B_PAYBACK_SWITCH_BOOST GEN_6 // In Gen5+, if the opponent switches out, Payback's damage will no longer be doubled.
#define B_KINGS_SHIELD_LOWER_ATK GEN_6 // In Gen7+, it lowers Atk by 1 stage instead of 2 of oponents that hit it.
// 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_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
#define B_ABILITY_POP_UP GEN_6 // In Gen5+, the Pokémon abilities are displayed in a pop-up, when they activate in battle.
#define B_ABILITY_WEATHER GEN_6 // In Gen5+, weather caused by abilities lasts the same amount of turns as induced from a move. Before, they lasted till the battle's end or weather change by a move.
#define B_GALE_WINGS GEN_6 // In Gen7+ requires full HP to trigger.
#define B_STANCE_CHANGE_FAIL GEN_7 // In Gen7+, Aegislash's form change does not happen, if the Pokémon 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 // In Gen6+, 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.
#define B_FAST_INTRO TRUE // If set to TRUE, battle intro texts print at the same time as animation of a Pokémon, as opposing to waiting for the animation to end.
#endif // GUARD_CONSTANTS_BATTLE_CONFIG_H

View File

@ -601,7 +601,7 @@
#define MOVE_MOONBLAST 585
#define MOVE_BOOMBURST 586
#define MOVE_FAIRY_LOCK 587
#define MOVE_KING_S_SHIELD 588
#define MOVE_KINGS_SHIELD 588
#define MOVE_PLAY_NICE 589
#define MOVE_CONFIDE 590
#define MOVE_DIAMOND_STORM 591

View File

@ -4311,7 +4311,7 @@ s8 GetMovePriority(u32 battlerId, u16 move)
priority = gBattleMoves[move].priority;
if (GetBattlerAbility(battlerId) == ABILITY_GALE_WINGS
&& gBattleMoves[move].type == TYPE_FLYING
&& (B_GALE_WINGS == GEN_6 || BATTLER_MAX_HP(battlerId)))
&& (B_GALE_WINGS <= GEN_6 || BATTLER_MAX_HP(battlerId)))
{
priority++;
}

View File

@ -780,7 +780,7 @@ static const u8 sForbiddenMoves[MOVES_COUNT] =
[MOVE_HYPERSPACE_HOLE] = FORBIDDEN_METRONOME,
[MOVE_ICE_BURN] = FORBIDDEN_METRONOME,
[MOVE_INSTRUCT] = FORBIDDEN_METRONOME,
[MOVE_KING_S_SHIELD] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_KINGS_SHIELD] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_LIGHT_OF_RUIN] = FORBIDDEN_METRONOME,
[MOVE_MAT_BLOCK] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_ME_FIRST] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK,
@ -1031,7 +1031,7 @@ static bool32 TryAegiFormChange(void)
gBattleMons[gBattlerAttacker].species = SPECIES_AEGISLASH_BLADE;
break;
case SPECIES_AEGISLASH_BLADE: // Blade -> Shield
if (gCurrentMove != MOVE_KING_S_SHIELD)
if (gCurrentMove != MOVE_KINGS_SHIELD)
return FALSE;
gBattleMons[gBattlerAttacker].species = SPECIES_AEGISLASH;
break;
@ -1467,7 +1467,7 @@ static void Cmd_ppreduce(void)
}
// The chance is 1/N for each stage.
#if B_CRIT_CHANCE == GEN_7
#if B_CRIT_CHANCE >= GEN_7
static const u8 sCriticalHitChance[] = {24, 8, 2, 1, 1};
#elif B_CRIT_CHANCE == GEN_6
static const u8 sCriticalHitChance[] = {16, 8, 2, 1, 1};
@ -3536,7 +3536,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_EXP_MULTIPLIER != GEN_7)
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && B_TRAINER_EXP_MULTIPLIER <= GEN_7)
gBattleMoveDamage = (gBattleMoveDamage * 150) / 100;
if (IsTradedMon(&gPlayerParty[gBattleStruct->expGetterMonId]))
@ -4471,7 +4471,7 @@ static void Cmd_moveend(void)
i = gBattlerAttacker;
gBattlerAttacker = gBattlerTarget;
gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable
gBattleScripting.moveEffect = MOVE_EFFECT_ATK_MINUS_2;
gBattleScripting.moveEffect = (B_KINGS_SHIELD_LOWER_ATK >= GEN_8) ? MOVE_EFFECT_ATK_MINUS_1 : MOVE_EFFECT_ATK_MINUS_2;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_KingsShieldEffect;
effect = 1;
@ -7259,7 +7259,7 @@ static void Cmd_various(void)
{
if (gBattleMons[gBattlerAttacker].statStages[STAT_ATK] >= 11)
SET_STATCHANGER(STAT_ATK, 1, FALSE);
else if (gBattleMons[gBattlerAttacker].statStages[STAT_ATK] <= 9 && B_FELL_STINGER_STAT_RAISE == GEN_7)
else if (gBattleMons[gBattlerAttacker].statStages[STAT_ATK] <= 9 && B_FELL_STINGER_STAT_RAISE >= GEN_7)
SET_STATCHANGER(STAT_ATK, 3, FALSE);
else
SET_STATCHANGER(STAT_ATK, 2, FALSE);
@ -7639,7 +7639,7 @@ static void Cmd_various(void)
break;
}
if (gLastMoves[gBattlerTarget] == 0 || gLastMoves[gBattlerTarget] == 0xFFFF || sMoveEffectsForbiddenToInstruct[i] != FORBIDDEN_INSTRUCT_END
|| gLastMoves[gBattlerTarget] == MOVE_STRUGGLE || gLastMoves[gBattlerTarget] == MOVE_KING_S_SHIELD)
|| gLastMoves[gBattlerTarget] == MOVE_STRUGGLE || gLastMoves[gBattlerTarget] == MOVE_KINGS_SHIELD)
{
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
}
@ -7978,7 +7978,7 @@ static void Cmd_setprotectlike(void)
gProtectStructs[gBattlerAttacker].spikyShielded = 1;
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
}
else if (gCurrentMove == MOVE_KING_S_SHIELD)
else if (gCurrentMove == MOVE_KINGS_SHIELD)
{
gProtectStructs[gBattlerAttacker].kingsShielded = 1;
gBattleCommunication[MULTISTRING_CHOOSER] = 0;

View File

@ -5825,13 +5825,13 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
if (gStatuses3[battlerAtk] & STATUS3_ME_FIRST)
MulModifier(&modifier, UQ_4_12(1.5));
if (gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN && moveType == TYPE_GRASS && IsBattlerGrounded(battlerAtk) && !(gStatuses3[battlerAtk] & STATUS3_SEMI_INVULNERABLE))
MulModifier(&modifier, UQ_4_12(1.5));
MulModifier(&modifier, (B_TERRAIN_TYPE_BOOST >= GEN_8) ? UQ_4_12(1.3) : UQ_4_12(1.5));
if (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN && moveType == TYPE_DRAGON && IsBattlerGrounded(battlerDef) && !(gStatuses3[battlerDef] & STATUS3_SEMI_INVULNERABLE))
MulModifier(&modifier, UQ_4_12(0.5));
if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && moveType == TYPE_ELECTRIC && IsBattlerGrounded(battlerAtk) && !(gStatuses3[battlerAtk] & STATUS3_SEMI_INVULNERABLE))
MulModifier(&modifier, UQ_4_12(1.5));
MulModifier(&modifier, (B_TERRAIN_TYPE_BOOST >= GEN_8) ? UQ_4_12(1.3) : UQ_4_12(1.5));
if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN && moveType == TYPE_PSYCHIC && IsBattlerGrounded(battlerAtk) && !(gStatuses3[battlerAtk] & STATUS3_SEMI_INVULNERABLE))
MulModifier(&modifier, UQ_4_12(1.5));
MulModifier(&modifier, (B_TERRAIN_TYPE_BOOST >= GEN_8) ? UQ_4_12(1.3) : UQ_4_12(1.5));
return ApplyModifier(modifier, basePower);
}

View File

@ -8252,7 +8252,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.split = SPLIT_STATUS,
},
[MOVE_KING_S_SHIELD] =
[MOVE_KINGS_SHIELD] =
{
.effect = EFFECT_PROTECT,
.power = 0,

View File

@ -4693,7 +4693,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] =
.comboMoves = {0}
},
[MOVE_KING_S_SHIELD] =
[MOVE_KINGS_SHIELD] =
{
.effect = CONTEST_EFFECT_AVOID_STARTLE,
.contestCategory = CONTEST_CATEGORY_TOUGH,

View File

@ -3131,7 +3131,7 @@ const u8 *const gMoveDescriptionPointers[MOVES_COUNT - 1] =
[MOVE_MOONBLAST - 1] = sMOONBLASTDescription,
[MOVE_BOOMBURST - 1] = sBOOMBURSTDescription,
[MOVE_FAIRY_LOCK - 1] = sFAIRY_LOCKDescription,
[MOVE_KING_S_SHIELD - 1] = sKINGS_SHIELDDescription,
[MOVE_KINGS_SHIELD - 1] = sKINGS_SHIELDDescription,
[MOVE_PLAY_NICE - 1] = sPLAY_NICEDescription,
[MOVE_CONFIDE - 1] = sCONFIDEDescription,
[MOVE_DIAMOND_STORM - 1] = sDIAMOND_STORMDescription,

View File

@ -588,7 +588,7 @@ const u8 gMoveNames[MOVES_COUNT][MOVE_NAME_LENGTH + 1] =
[MOVE_MOONBLAST] = _("Moonblast"),
[MOVE_BOOMBURST] = _("Boomburst"),
[MOVE_FAIRY_LOCK] = _("Fairy Lock"),
[MOVE_KING_S_SHIELD] = _("Kings Shield"),
[MOVE_KINGS_SHIELD] = _("Kings Shield"),
[MOVE_PLAY_NICE] = _("Play Nice"),
[MOVE_CONFIDE] = _("Confide"),
[MOVE_DIAMOND_STORM] = _("DiamondStorm"),