Skip to content

Commit

Permalink
Random Battles minor bug fixes (#10252)
Browse files Browse the repository at this point in the history
  • Loading branch information
livid-washed authored Apr 17, 2024
1 parent 353afcb commit e9e2efd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions data/mods/gen5/random-teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -909,8 +909,8 @@ export class RandomGen5Teams extends RandomGen6Teams {
evs.hp -= 4;
}

// Minimize confusion damage
if ((counter.get('Physical') || 0) <= 1 && moves.has('foulplay') && !moves.has('transform')) {
// 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('transform')) {
evs.atk = 0;
ivs.atk = hasHiddenPower ? (ivs.atk || 31) - 28 : 0;
}
Expand Down
6 changes: 3 additions & 3 deletions data/mods/gen6/random-teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {toID} from '../../../sim/dex';

// Moves that restore HP:
const RECOVERY_MOVES = [
'healorder', 'milkdrink', 'moonlight', 'morningsun', 'recover', 'roost', 'slackoff', 'softboiled', 'synthesis',
'healorder', 'milkdrink', 'moonlight', 'morningsun', 'recover', 'recycle', 'roost', 'slackoff', 'softboiled', 'synthesis',
];
// Moves that boost Attack:
const PHYSICAL_SETUP = [
Expand Down Expand Up @@ -911,9 +911,9 @@ export class RandomGen6Teams extends RandomGen7Teams {

const level = this.getLevel(species);

// Minimize confusion damage
// Minimize confusion damage, including if Foul Play is its only physical attack
if (
(counter.get('Physical') || 0) <= 1 && moves.has('foulplay') &&
(!counter.get('Physical') || (counter.get('Physical') <= 1 && moves.has('foulplay'))) &&
!moves.has('copycat') && !moves.has('transform')
) {
evs.atk = 0;
Expand Down
6 changes: 3 additions & 3 deletions data/mods/gen7/random-teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ export class RandomGen7Teams extends RandomGen8Teams {
if (species.id === 'druddigon' && role === 'Bulky Support') return 'Rough Skin';
if (species.id === 'zebstrika') return moves.has('wildcharge') ? 'Sap Sipper' : 'Lightning Rod';
if (species.id === 'stoutland' || species.id === 'pangoro' && !counter.get('ironfist')) return 'Scrappy';
if (species.baseSpecies === 'sawsbuck' && moves.has('headbutt')) return 'Serene Grace';
if (species.baseSpecies === 'Sawsbuck' && moves.has('headbutt')) return 'Serene Grace';
if (species.id === 'octillery') return 'Sniper';
if (species.id === 'kommoo' && role === 'Z-Move user') return 'Soundproof';
if (species.id === 'stunfisk') return 'Static';
Expand Down Expand Up @@ -1203,9 +1203,9 @@ export class RandomGen7Teams extends RandomGen8Teams {

const level = this.getLevel(species);

// Minimize confusion damage
// Minimize confusion damage, including if Foul Play is its only physical attack
if (
(counter.get('Physical') || 0) <= 1 && moves.has('foulplay') &&
(!counter.get('Physical') || (counter.get('Physical') <= 1 && moves.has('foulplay'))) &&
!moves.has('copycat') && !moves.has('transform')
) {
evs.atk = 0;
Expand Down

0 comments on commit e9e2efd

Please sign in to comment.