Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Once again, Battle Configs #2055

Merged
merged 11 commits into from
May 7, 2022
Merged
8 changes: 8 additions & 0 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,9 @@ BattleScript_GrowthDoMoveAnim::
waitanimation
setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPATK, 0
.if B_GROWTH_UNDER_SUN >= GEN_5
jumpifweatheraffected BS_ATTACKER, B_WEATHER_SUN, BattleScript_GrowthAtk2
.endif
setstatchanger STAT_ATK, 1, FALSE
goto BattleScript_GrowthAtk
BattleScript_GrowthAtk2:
Expand All @@ -1918,7 +1920,9 @@ BattleScript_GrowthAtk:
printfromtable gStatUpStringIds
waitmessage B_WAIT_TIME_LONG
BattleScript_GrowthTrySpAtk::
.if B_GROWTH_UNDER_SUN >= GEN_5
jumpifweatheraffected BS_ATTACKER, B_WEATHER_SUN, BattleScript_GrowthSpAtk2
.endif
setstatchanger STAT_SPATK, 1, FALSE
goto BattleScript_GrowthSpAtk
BattleScript_GrowthSpAtk2:
Expand Down Expand Up @@ -4337,7 +4341,11 @@ BattleScript_NightmareWorked::
BattleScript_EffectMinimize::
attackcanceler
setminimize
.if B_MINIMIZE_EVASION >= GEN_5
setstatchanger STAT_EVASION, 2, FALSE
.else
setstatchanger STAT_EVASION, 1, FALSE
.endif
goto BattleScript_EffectStatUpAfterAtkCanceler

BattleScript_EffectCurse::
Expand Down
8 changes: 7 additions & 1 deletion include/constants/battle_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@

// Damage settings
#define B_BURN_DAMAGE GEN_7 // In Gen7+, burn damage is 1/16th of max HP instead of 1/8th.
#define B_BURN_FACADE_DMG GEN_7 // In Gen6+, burn's effect of lowering the Attack stat no longer applies to Facade.
#define B_BINDING_DAMAGE GEN_7 // In Gen6+, binding damage is 1/8 of max HP instead of 1/16. (With Binding Band, 1/6 and 1/8 respectively.)
#define B_PSYWAVE_DMG GEN_7 // Psywave's damage formula. See Cmd_psywavedamageeffect.
#define B_PAYBACK_SWITCH_BOOST GEN_7 // In Gen5+, if the opponent switches out, Payback's damage will no longer be doubled.
Expand Down Expand Up @@ -151,16 +152,18 @@
#define B_SPEED_BUFFING_RAPID_SPIN GEN_8 // In Gen8, Rapid Spin raises the user's Speed by 1 stage.
#define B_RECOIL_IF_MISS_DMG GEN_7 // In Gen5+, Jump Kick and High Jump Kick will always do half of the user's max HP when missing.
#define B_UPDATED_CONVERSION GEN_7 // In Gen6+, Conversion changes the user's type to match their first move's. Before, it would choose a move at random.
#define B_PP_REDUCED_BY_SPITE GEN_7 // In Gen4+, Spite reduces the foe's last move's PP by 4, instead of 2 to 5.
#define B_MINIMIZE_EVASION GEN_7 // In Gen5+, Minimize raises evasion by 2 stages instead of 1.

// Move accuracy settings
#define B_TOXIC_NEVER_MISS GEN_7 // In Gen6+, if Toxic is used by a Poison-type Pokémon, it will never miss.
#define B_MINIMIZE_DMG_ACC GEN_7 // In Gen6+, moves that causes double damage to minimized Pokémon will also skip accuracy checks.
#define B_BLIZZARD_HAIL GEN_7 // In Gen4+, Blizzard bypasses accuracy checks if it's hailing.
#define B_SHEER_COLD_ACC GEN_7 // In Gen7+, Sheer Cold's base chance of hitting is reduced to 20% if the user isn't Ice-typed.

// Other move settings
#define B_SOUND_SUBSTITUTE GEN_7 // In Gen6+, sound moves bypass Substitute.
#define B_INCINERATE_GEMS GEN_7 // In Gen6+, Incinerate can destroy Gems.
#define B_PP_REDUCED_BY_SPITE GEN_7 // In Gen4+, Spite reduces the foe's last move's PP by 4, instead of 2 to 5.
#define B_CAN_SPITE_FAIL GEN_7 // In Gen4+, Spite can no longer fail if the foe's last move only has 1 remaining PP.
#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_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.
Expand All @@ -169,6 +172,8 @@
#define B_BRICK_BREAK GEN_7 // In Gen4+, you can destroy your own side's screens. In Gen 5+, screens are not removed if the target is immune.
#define B_WISH_HP_SOURCE GEN_7 // In Gen5+, Wish heals half of the user's max HP instead of the target's.
#define B_RAMPAGE_CANCELLING GEN_7 // In Gen5+, a failed Thrash, etc, will cancel except on its last turn.
#define B_ROOTED_GROUNDING GEN_7 // In Gen4+, Ingrain causes the affected Pokémon to become grounded.
#define B_GROWTH_UNDER_SUN GEN_7 // In Gen5+, Growth's effects are doubled when under the effects of the sun.

// Ability settings
#define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters.
Expand All @@ -181,6 +186,7 @@
#define B_SYNCHRONIZE_NATURE GEN_8 // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same ability, as opposed to 50% previously.
#define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if a Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned.
#define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities.
#define B_OBLIVIOUS_TAUNT GEN_7 // In Gen6+, Pokémon with Oblivious can't be taunted.

// Item settings
#define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn.
Expand Down
9 changes: 8 additions & 1 deletion src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -10728,6 +10728,10 @@ static void Cmd_tryKO(void)
else
{
u16 odds = gBattleMoves[gCurrentMove].accuracy + (gBattleMons[gBattlerAttacker].level - gBattleMons[gBattlerTarget].level);
#if B_SHEER_COLD_ACC >= GEN_7
AsparagusEduardo marked this conversation as resolved.
Show resolved Hide resolved
if (gCurrentMove == MOVE_SHEER_COLD && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE))
odds -= 10;
#endif
if (Random() % 100 + 1 < odds && gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level)
lands = TRUE;
}
Expand Down Expand Up @@ -12297,13 +12301,16 @@ static void Cmd_jumpifnodamage(void)

static void Cmd_settaunt(void)
{
#if B_OBLIVIOUS_TAUNT >= GEN_6
if (GetBattlerAbility(gBattlerTarget) == ABILITY_OBLIVIOUS)
{
gBattlescriptCurrInstr = BattleScript_NotAffectedAbilityPopUp;
gLastUsedAbility = ABILITY_OBLIVIOUS;
RecordAbilityBattle(gBattlerTarget, ABILITY_OBLIVIOUS);
}
else if (gDisableStructs[gBattlerTarget].tauntTimer == 0)
else
#endif
if (gDisableStructs[gBattlerTarget].tauntTimer == 0)
{
#if B_TAUNT_TURNS >= GEN_5
u8 turns = 4;
Expand Down
5 changes: 4 additions & 1 deletion src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -7736,8 +7736,10 @@ bool32 IsBattlerGrounded(u8 battlerId)
return TRUE;
else if (gFieldStatuses & STATUS_FIELD_GRAVITY)
return TRUE;
#if B_ROOTED_GROUNDING >= GEN_4
else if (gStatuses3[battlerId] & STATUS3_ROOTED)
return TRUE;
#endif
else if (gStatuses3[battlerId] & STATUS3_SMACKED_DOWN)
return TRUE;

Expand Down Expand Up @@ -8869,7 +8871,8 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move

// check burn
if (gBattleMons[battlerAtk].status1 & STATUS1_BURN && IS_MOVE_PHYSICAL(move)
&& gBattleMoves[move].effect != EFFECT_FACADE && abilityAtk != ABILITY_GUTS)
&& (gBattleMoves[move].effect != EFFECT_FACADE || B_BURN_FACADE_DMG < GEN_6)
&& abilityAtk != ABILITY_GUTS)
dmg = ApplyModifier(UQ_4_12(0.5), dmg);

// check sunny/rain weather
Expand Down
36 changes: 36 additions & 0 deletions src/data/text/move_descriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ static const u8 sFlyDescription[] = _(

static const u8 sBindDescription[] = _(
"Binds and squeezes the foe\n"
#if B_BINDING_TURNS >= GEN_5
"for 4 or 5 turns.");
#else
"for 2 to 5 turns.");
#endif

static const u8 sSlamDescription[] = _(
"Slams the foe with a long\n"
Expand Down Expand Up @@ -139,7 +143,11 @@ static const u8 sBodySlamDescription[] = _(

static const u8 sWrapDescription[] = _(
"Wraps and squeezes the foe\n"
#if B_BINDING_TURNS >= GEN_5
"4 or 5 times with vines, etc.");
#else
"2 to 5 times with vines, etc.");
#endif

static const u8 sTakeDownDescription[] = _(
"A reckless charge attack\n"
Expand Down Expand Up @@ -331,7 +339,11 @@ static const u8 sDragonRageDescription[] = _(

static const u8 sFireSpinDescription[] = _(
"Traps the foe in a ring of\n"
#if B_BINDING_TURNS >= GEN_5
"fire for 4 or 5 turns.");
#else
"fire for 2 to 5 turns.");
#endif

static const u8 sThunderShockDescription[] = _(
"An electrical attack that\n"
Expand Down Expand Up @@ -511,7 +523,11 @@ static const u8 sWaterfallDescription[] = _(

static const u8 sClampDescription[] = _(
"Traps and squeezes the\n"
#if B_BINDING_TURNS >= GEN_5
"foe for 4 or 5 turns.");
#else
"foe for 2 to 5 turns.");
#endif

static const u8 sSwiftDescription[] = _(
"Sprays star-shaped rays\n"
Expand Down Expand Up @@ -999,7 +1015,11 @@ static const u8 sRockSmashDescription[] = _(

static const u8 sWhirlpoolDescription[] = _(
"Traps and hurts the foe in\n"
#if B_BINDING_TURNS >= GEN_5
"a whirlpool for 4 or 5 turns.");
#else
"a whirlpool for 2 to 5 turns.");
#endif

static const u8 sBeatUpDescription[] = _(
"Summons party Pokémon to\n"
Expand Down Expand Up @@ -1311,7 +1331,11 @@ static const u8 sSkyUppercutDescription[] = _(

static const u8 sSandTombDescription[] = _(
"Traps and hurts the foe in\n"
#if B_BINDING_TURNS >= GEN_5
"quicksand for 4 or 5 turns.");
#else
"quicksand for 2 to 5 turns.");
#endif

static const u8 sSheerColdDescription[] = _(
"A chilling attack that\n"
Expand Down Expand Up @@ -1815,7 +1839,11 @@ static const u8 sSpacialRendDescription[] = _(

static const u8 sMagmaStormDescription[] = _(
"Traps the foe in a vortex\n"
#if B_BINDING_TURNS >= GEN_5
"of fire for 4 or 5 turns.");
#else
"of fire for 2 to 5 turns.");
#endif

static const u8 sDarkVoidDescription[] = _(
"Drags the foe into total\n"
Expand Down Expand Up @@ -2367,7 +2395,11 @@ static const u8 sNuzzleDescription[] = _(

static const u8 sInfestationDescription[] = _(
"The foe is infested and\n"
#if B_BINDING_TURNS >= GEN_5
"attacked for 4 or 5 turns.");
#else
"attacked for 2 to 5 turns.");
#endif

static const u8 sPowerUpPunchDescription[] = _(
"A hard punch that raises\n"
Expand Down Expand Up @@ -2912,7 +2944,11 @@ static const u8 sSurgingStrikesDescription[] = _(

static const u8 sThunderCageDescription[] = _(
"Traps the foe in a cage of\n"
#if B_BINDING_TURNS >= GEN_5
"electricity for 4 or 5 turns.");
#else
"electricity for 2 to 5 turns.");
#endif

static const u8 sDragonEnergyDescription[] = _(
"The higher the user's HP\n"
Expand Down