From 08bcb3991275fb94c0f531adc62efbe07e250195 Mon Sep 17 00:00:00 2001 From: livid washed <115855253+livid-washed@users.noreply.github.com> Date: Wed, 26 Nov 2025 14:35:33 +1100 Subject: [PATCH] Random Battles: Don't lower Atk EVs/IVs with Force of the Fallen Mod (#11589) * Random Battles: Don't lower Atk EVs/IVs with Force of the Fallen Mod * Lint --- data/random-battles/gen1/teams.ts | 4 +++- data/random-battles/gen3/teams.ts | 4 +++- data/random-battles/gen4/teams.ts | 4 +++- data/random-battles/gen5/teams.ts | 4 +++- data/random-battles/gen6/teams.ts | 6 ++++-- data/random-battles/gen7/teams.ts | 6 ++++-- data/random-battles/gen8/teams.ts | 7 ++++++- data/random-battles/gen9/teams.ts | 5 ++++- data/random-battles/gen9baby/teams.ts | 2 +- data/random-battles/gen9cap/teams.ts | 5 ++++- data/random-battles/gen9ffa/teams.ts | 2 +- 11 files changed, 36 insertions(+), 13 deletions(-) diff --git a/data/random-battles/gen1/teams.ts b/data/random-battles/gen1/teams.ts index a1e89ae510..51d8db0cab 100644 --- a/data/random-battles/gen1/teams.ts +++ b/data/random-battles/gen1/teams.ts @@ -220,6 +220,8 @@ export class RandomGen1Teams extends RandomGen2Teams { * Random set generation for Gen 1 Random Battles. */ override randomSet(species: string | Species): RandomTeamsTypes.RandomSet { + const ruleTable = this.dex.formats.getRuleTable(this.format); + species = this.dex.species.get(species); if (!species.exists) species = this.dex.species.get('pikachu'); // Because Gen 1. @@ -275,7 +277,7 @@ export class RandomGen1Teams extends RandomGen2Teams { if (move.damageCallback || move.damage) return true; return move.category !== 'Physical'; }); - if (noAttackStatMoves && !moves.has('mimic') && !moves.has('transform')) { + if (noAttackStatMoves && !moves.has('mimic') && !moves.has('transform') && !ruleTable.has('forceofthefallenmod')) { evs.atk = 0; // We don't want to lower the HP DV/IV ivs.atk = 2; diff --git a/data/random-battles/gen3/teams.ts b/data/random-battles/gen3/teams.ts index 55bc7ba0a2..ff59db9377 100644 --- a/data/random-battles/gen3/teams.ts +++ b/data/random-battles/gen3/teams.ts @@ -524,6 +524,8 @@ export class RandomGen3Teams extends RandomGen4Teams { teamDetails: RandomTeamsTypes.TeamDetails = {}, isLead = false ): RandomTeamsTypes.RandomSet { + const ruleTable = this.dex.formats.getRuleTable(this.format); + species = this.dex.species.get(species); const forme = this.getForme(species); const sets = this.randomSets[species.id]["sets"]; @@ -597,7 +599,7 @@ export class RandomGen3Teams extends RandomGen4Teams { } // Minimize confusion damage - if (!counter.get('Physical') && !moves.has('transform')) { + if (!counter.get('Physical') && !moves.has('transform') && !ruleTable.has('forceofthefallenmod')) { evs.atk = 0; ivs.atk = hasHiddenPower ? (ivs.atk || 31) - 28 : 0; } diff --git a/data/random-battles/gen4/teams.ts b/data/random-battles/gen4/teams.ts index f24eb8cc7d..f06f4e7684 100644 --- a/data/random-battles/gen4/teams.ts +++ b/data/random-battles/gen4/teams.ts @@ -662,6 +662,8 @@ export class RandomGen4Teams extends RandomGen5Teams { teamDetails: RandomTeamsTypes.TeamDetails = {}, isLead = false ): RandomTeamsTypes.RandomSet { + const ruleTable = this.dex.formats.getRuleTable(this.format); + species = this.dex.species.get(species); const forme = this.getForme(species); const sets = this.randomSets[species.id]["sets"]; @@ -758,7 +760,7 @@ export class RandomGen4Teams extends RandomGen5Teams { } // Minimize confusion damage - if (!counter.get('Physical') && !moves.has('transform')) { + if (!counter.get('Physical') && !moves.has('transform') && !ruleTable.has('forceofthefallenmod')) { evs.atk = 0; ivs.atk = hasHiddenPower ? (ivs.atk || 31) - 28 : 0; } diff --git a/data/random-battles/gen5/teams.ts b/data/random-battles/gen5/teams.ts index e6391654e9..0994749ddd 100644 --- a/data/random-battles/gen5/teams.ts +++ b/data/random-battles/gen5/teams.ts @@ -711,6 +711,8 @@ export class RandomGen5Teams extends RandomGen6Teams { teamDetails: RandomTeamsTypes.TeamDetails = {}, isLead = false ): RandomTeamsTypes.RandomSet { + const ruleTable = this.dex.formats.getRuleTable(this.format); + species = this.dex.species.get(species); const forme = this.getForme(species); const sets = this.randomSets[species.id]["sets"]; @@ -817,7 +819,7 @@ export class RandomGen5Teams extends RandomGen6Teams { // Minimize confusion damage, including if Foul Play is its only physical attack if ( (!counter.get('Physical') || (counter.get('Physical') <= 1 && (moves.has('foulplay') || moves.has('rapidspin')))) && - !moves.has('transform') + !moves.has('transform') && !ruleTable.has('forceofthefallenmod') ) { evs.atk = 0; ivs.atk = hasHiddenPower ? (ivs.atk || 31) - 28 : 0; diff --git a/data/random-battles/gen6/teams.ts b/data/random-battles/gen6/teams.ts index 88e5fd35e8..0747d1f30f 100644 --- a/data/random-battles/gen6/teams.ts +++ b/data/random-battles/gen6/teams.ts @@ -769,6 +769,8 @@ export class RandomGen6Teams extends RandomGen7Teams { teamDetails: RandomTeamsTypes.TeamDetails = {}, isLead = false ): RandomTeamsTypes.RandomSet { + const ruleTable = this.dex.formats.getRuleTable(this.format); + species = this.dex.species.get(species); const forme = this.getForme(species); const sets = this.randomSets[species.id]["sets"]; @@ -816,7 +818,8 @@ export class RandomGen6Teams extends RandomGen7Teams { // Minimize confusion damage, including if Foul Play is its only physical attack if ( (!counter.get('Physical') || (counter.get('Physical') <= 1 && (moves.has('foulplay') || moves.has('rapidspin')))) && - !moves.has('copycat') && !moves.has('transform') + !moves.has('copycat') && !moves.has('transform') && + !ruleTable.has('forceofthefallenmod') ) { evs.atk = 0; ivs.atk = 0; @@ -1130,7 +1133,6 @@ export class RandomGen6Teams extends RandomGen7Teams { if (teamData.weaknesses[type] >= 3) return this.randomFactoryTeam(side, ++depth); } } - return pokemon; } } diff --git a/data/random-battles/gen7/teams.ts b/data/random-battles/gen7/teams.ts index b358ca7c8d..cc14fb277a 100644 --- a/data/random-battles/gen7/teams.ts +++ b/data/random-battles/gen7/teams.ts @@ -1025,6 +1025,8 @@ export class RandomGen7Teams extends RandomGen8Teams { teamDetails: RandomTeamsTypes.TeamDetails = {}, isLead = false ): RandomTeamsTypes.RandomSet { + const ruleTable = this.dex.formats.getRuleTable(this.format); + species = this.dex.species.get(species); const forme = this.getForme(species); const sets = this.randomSets[species.id]["sets"]; @@ -1083,7 +1085,8 @@ export class RandomGen7Teams extends RandomGen8Teams { // Minimize confusion damage, including if Foul Play is its only physical attack if ( (!counter.get('Physical') || (counter.get('Physical') <= 1 && (moves.has('foulplay') || moves.has('rapidspin')))) && - !moves.has('copycat') && !moves.has('transform') + !moves.has('copycat') && !moves.has('transform') && + !ruleTable.has('forceofthefallenmod') ) { evs.atk = 0; ivs.atk = 0; @@ -1385,7 +1388,6 @@ export class RandomGen7Teams extends RandomGen8Teams { if (pokemon.length < this.maxTeamSize && pokemon.length < 12) { throw new Error(`Could not build a random team for ${this.format} (seed=${seed})`); } - return pokemon; } diff --git a/data/random-battles/gen8/teams.ts b/data/random-battles/gen8/teams.ts index 8035596dc1..06c0cd8d16 100644 --- a/data/random-battles/gen8/teams.ts +++ b/data/random-battles/gen8/teams.ts @@ -2176,6 +2176,8 @@ export class RandomGen8Teams { isDoubles = false, isNoDynamax = false ): RandomTeamsTypes.RandomSet { + const ruleTable = this.dex.formats.getRuleTable(this.format); + species = this.dex.species.get(species); const forme = this.getForme(species); const gmax = species.name.endsWith('-Gmax'); @@ -2413,7 +2415,10 @@ export class RandomGen8Teams { if (move.damageCallback || move.damage) return true; return move.category !== 'Physical' || move.id === 'bodypress'; }); - if (noAttackStatMoves && !moves.has('transform') && (!moves.has('shellsidearm') || !counter.get('Status'))) { + if ( + noAttackStatMoves && !moves.has('transform') && (!moves.has('shellsidearm') || !counter.get('Status')) && + !ruleTable.has('forceofthefallenmod') + ) { evs.atk = 0; ivs.atk = 0; } diff --git a/data/random-battles/gen9/teams.ts b/data/random-battles/gen9/teams.ts index d1f08e0470..3ad938191a 100644 --- a/data/random-battles/gen9/teams.ts +++ b/data/random-battles/gen9/teams.ts @@ -1564,7 +1564,10 @@ export class RandomTeams { ) return false; return move.category !== 'Physical' || move.id === 'bodypress' || move.id === 'foulplay'; }); - if (noAttackStatMoves && !moves.has('transform') && this.format.mod !== 'partnersincrime') { + if ( + noAttackStatMoves && !moves.has('transform') && this.format.mod !== 'partnersincrime' && + !ruleTable.has('forceofthefallenmod') + ) { evs.atk = 0; ivs.atk = 0; } diff --git a/data/random-battles/gen9baby/teams.ts b/data/random-battles/gen9baby/teams.ts index 325787c149..b5d75325fa 100644 --- a/data/random-battles/gen9baby/teams.ts +++ b/data/random-battles/gen9baby/teams.ts @@ -634,7 +634,7 @@ export class RandomBabyTeams extends RandomTeams { return move.category !== 'Physical' || move.id === 'bodypress' || move.id === 'foulplay'; }); - if (noAttackStatMoves) { + if (noAttackStatMoves && !ruleTable.has('forceofthefallenmod')) { evs.atk = 0; ivs.atk = 0; } diff --git a/data/random-battles/gen9cap/teams.ts b/data/random-battles/gen9cap/teams.ts index d75e31634e..6342258be7 100644 --- a/data/random-battles/gen9cap/teams.ts +++ b/data/random-battles/gen9cap/teams.ts @@ -148,7 +148,10 @@ export class RandomCAPTeams extends RandomTeams { ) return false; return move.category !== 'Physical' || move.id === 'bodypress' || move.id === 'foulplay'; }); - if (noAttackStatMoves && !moves.has('transform') && this.format.mod !== 'partnersincrime') { + if ( + noAttackStatMoves && !moves.has('transform') && this.format.mod !== 'partnersincrime' && + !ruleTable.has('forceofthefallenmod') + ) { evs.atk = 0; ivs.atk = 0; } diff --git a/data/random-battles/gen9ffa/teams.ts b/data/random-battles/gen9ffa/teams.ts index 0cdd3f214e..8b96c2bbc7 100644 --- a/data/random-battles/gen9ffa/teams.ts +++ b/data/random-battles/gen9ffa/teams.ts @@ -864,7 +864,7 @@ export class RandomFFATeams extends RandomTeams { return move.category !== 'Physical' || move.id === 'bodypress' || move.id === 'foulplay'; }); - if (noAttackStatMoves) { + if (noAttackStatMoves && !ruleTable.has('forceofthefallenmod')) { evs.atk = 0; ivs.atk = 0; }