Random Battles: Don't lower Atk EVs/IVs with Force of the Fallen Mod (#11589)
Some checks failed
Node.js CI / build (18.x) (push) Has been cancelled

* Random Battles: Don't lower Atk EVs/IVs with Force of the Fallen Mod

* Lint
This commit is contained in:
livid washed 2025-11-26 14:35:33 +11:00 committed by GitHub
parent 526f4f17d5
commit 08bcb39912
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 36 additions and 13 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}