diff --git a/src/battle-animations-moves.ts b/src/battle-animations-moves.ts index 7f40e23d2..06078e0d9 100644 --- a/src/battle-animations-moves.ts +++ b/src/battle-animations-moves.ts @@ -30650,7 +30650,10 @@ BattleMoveAnims['flatter'] = {anim: BattleMoveAnims['attract'].anim}; BattleMoveAnims['armthrust'] = {anim: BattleMoveAnims['smellingsalts'].anim}; -BattleMoveAnims['phantomforce'] = {anim: BattleMoveAnims['shadowforce'].anim, prepareAnim: BattleMoveAnims['shadowforce'].prepareAnim}; +BattleMoveAnims['phantomforce'] = { + anim: BattleMoveAnims['shadowforce'].anim, + prepareAnim: BattleMoveAnims['shadowforce'].prepareAnim, +}; BattleMoveAnims['shadowstrike'] = {anim: BattleMoveAnims['shadowforce'].anim}; BattleMoveAnims['smackdown'] = {anim: BattleMoveAnims['rockblast'].anim}; diff --git a/src/battle-animations.ts b/src/battle-animations.ts index 0308f82aa..cd1ba5fdf 100644 --- a/src/battle-animations.ts +++ b/src/battle-animations.ts @@ -569,7 +569,8 @@ class BattleScene { } getDetailsText(pokemon: Pokemon) { - let name = pokemon.side && pokemon.side.n && (this.battle.ignoreOpponent || this.battle.ignoreNicks) ? pokemon.species : pokemon.name; + let name = pokemon.side && pokemon.side.n && + (this.battle.ignoreOpponent || this.battle.ignoreNicks) ? pokemon.species : pokemon.name; if (name !== pokemon.species) { name += ' (' + pokemon.species + ')'; } @@ -759,15 +760,15 @@ class BattleScene { weatherLeft() { if (this.battle.gen < 7 && this.battle.hardcoreMode) return ''; if (this.battle.weatherMinTimeLeft !== 0) { - return ' (' + this.battle.weatherMinTimeLeft + ' or ' + this.battle.weatherTimeLeft + ' turns)'; + return ` (${this.battle.weatherMinTimeLeft} or ${this.battle.weatherTimeLeft} turns)`; } if (this.battle.weatherTimeLeft !== 0) { - return ' (' + this.battle.weatherTimeLeft + ' turn' + (this.battle.weatherTimeLeft === 1 ? '' : 's') + ')'; + return ` (${this.battle.weatherTimeLeft} turn${this.battle.weatherTimeLeft === 1 ? '' : 's'})`; } return ''; } upkeepWeather() { - const isIntense = (this.curWeather === 'desolateland' || this.curWeather === 'primordialsea' || this.curWeather === 'deltastream'); + const isIntense = ['desolateland', 'primordialsea', 'deltastream'].includes(this.curWeather); this.$weather.animate({ opacity: 1.0, }, 300).animate({ @@ -2326,21 +2327,24 @@ class PokemonSprite extends Sprite { getStatbarHTML(pokemon: Pokemon) { let buf = '
';
- buf += (pokemon.level === 100 ? '' : ' L' + pokemon.level + '');
+ if (gender) {
+ buf += `
`;
+ }
+ buf += (pokemon.level === 100 ? `` : ` L${pokemon.level}`);
let symbol = '';
if (pokemon.species.indexOf('-Mega') >= 0) symbol = 'mega';
else if (pokemon.species === 'Kyogre-Primal') symbol = 'alpha';
else if (pokemon.species === 'Groudon-Primal') symbol = 'omega';
if (symbol) {
- buf += ' The user thaws out if it is frozen.
'; + if (move.flags.defrost) { + text += `The user thaws out if it is frozen.
`; } - if (!('protect' in move.flags) && move.target !== 'self' && move.target !== 'allySide') { - text += 'Not blocked by Protect (and Detect, King\'s Shield, Spiky Shield)
'; + if (!move.flags.protect && !['self', 'allySide'].includes(move.target)) { + text += `Not blocked by Protect (and Detect, King's Shield, Spiky Shield)
`; } - if ('authentic' in move.flags) { - text += 'Bypasses Substitute (but does not break it)
'; + if (move.flags.authentic) { + text += `Bypasses Substitute (but does not break it)
`; } - if (!('reflectable' in move.flags) && move.target !== 'self' && move.target !== 'allySide' && move.category === 'Status') { - text += '✓ Not bounceable (can\'t be bounced by Magic Coat/Bounce)
'; + if (!move.flags.reflectable && !['self', 'allySide'].includes(move.target) && move.category === 'Status') { + text += `✓ Not bounceable (can't be bounced by Magic Coat/Bounce)
`; } - if ('contact' in move.flags) { - text += '✓ Contact (triggers Iron Barbs, Spiky Shield, etc)
'; + if (move.flags.contact) { + text += `✓ Contact (triggers Iron Barbs, Spiky Shield, etc)
`; } - if ('sound' in move.flags) { - text += '✓ Sound (doesn\'t affect Soundproof pokemon)
'; + if (move.flags.sound) { + text += `✓ Sound (doesn't affect Soundproof pokemon)
`; } - if ('powder' in move.flags) { - text += '✓ Powder (doesn\'t affect Grass, Overcoat, Safety Goggles)
'; + if (move.flags.powder) { + text += `✓ Powder (doesn't affect Grass, Overcoat, Safety Goggles)
`; } - if ('punch' in move.flags && ability === 'ironfist') { - text += '✓ Fist (boosted by Iron Fist)
'; + if (move.flags.punch && ability === 'ironfist') { + text += `✓ Fist (boosted by Iron Fist)
`; } - if ('pulse' in move.flags && ability === 'megalauncher') { - text += '✓ Pulse (boosted by Mega Launcher)
'; + if (move.flags.pulse && ability === 'megalauncher') { + text += `✓ Pulse (boosted by Mega Launcher)
`; } - if ('bite' in move.flags && ability === 'strongjaw') { - text += '✓ Bite (boosted by Strong Jaw)
'; + if (move.flags.bite && ability === 'strongjaw') { + text += `✓ Bite (boosted by Strong Jaw)
`; } if ((move.recoil || move.hasCustomRecoil) && ability === 'reckless') { - text += '✓ Recoil (boosted by Reckless)
'; + text += `✓ Recoil (boosted by Reckless)
`; } - if ('bullet' in move.flags) { - text += '✓ Bullet-like (doesn\'t affect Bulletproof pokemon)
'; + if (move.flags.bullet) { + text += `✓ Bullet-like (doesn't affect Bulletproof pokemon)
`; } } return text; @@ -1039,7 +1042,8 @@ class BattleTooltips { let baseSpe = pokemon.getTemplate().baseStats['spe']; let tier = this.battle.tier; let gen = this.battle.gen; - let isRandomBattle = tier.includes('Random Battle') || (tier.includes('Random') && tier.includes('Battle') && gen >= 6); + let isRandomBattle = tier.includes('Random Battle') || + (tier.includes('Random') && tier.includes('Battle') && gen >= 6); let minNature = (isRandomBattle || gen < 3) ? 1 : 0.9; let maxNature = (isRandomBattle || gen < 3) ? 1 : 1.1; @@ -1099,7 +1103,9 @@ class BattleTooltips { } } // Other abilities that change the move type. - const noTypeOverride = ['judgment', 'multiattack', 'naturalgift', 'revelationdance', 'struggle', 'technoblast', 'weatherball']; + const noTypeOverride = [ + 'judgment', 'multiattack', 'naturalgift', 'revelationdance', 'struggle', 'technoblast', 'weatherball', + ]; const allowTypeOverride = !noTypeOverride.includes(move.id); if (allowTypeOverride && move.flags['sound'] && value.abilityModify(0, 'Liquid Voice')) { @@ -1382,7 +1388,9 @@ class BattleTooltips { value.abilityModify(1.25, "Rivalry"); } } - const noTypeOverride = ['judgment', 'multiattack', 'naturalgift', 'revelationdance', 'struggle', 'technoblast', 'weatherball']; + const noTypeOverride = [ + 'judgment', 'multiattack', 'naturalgift', 'revelationdance', 'struggle', 'technoblast', 'weatherball', + ]; if (move.category !== 'Status' && !noTypeOverride.includes(move.id)) { if (move.type === 'Normal') { value.abilityModify(this.battle.gen > 6 ? 1.2 : 1.3, "Aerilate"); @@ -1839,7 +1847,9 @@ class BattleStatGuesser { } else if (itemid === 'salacberry') { isFast = true; } - if (hasMove['agility'] || hasMove['shellsmash'] || hasMove['autotomize'] || hasMove['shiftgear'] || hasMove['rockpolish']) { + const ultrafast = hasMove['agility'] || hasMove['shellsmash'] || + hasMove['autotomize'] || hasMove['shiftgear'] || hasMove['rockpolish']; + if (ultrafast) { moveCount['Ultrafast'] = 2; } moveCount['Fast'] = isFast ? 1 : 0; @@ -1943,7 +1953,9 @@ class BattleStatGuesser { let hasMove = this.hasMove; let moveCount = this.moveCount; - let evs: StatsTable & {plusStat?: StatName | '', minusStat?: StatName | ''} = {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0}; + let evs: StatsTable & {plusStat?: StatName | '', minusStat?: StatName | ''} = { + hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, + }; let plusStat: StatName | '' = ''; let minusStat: StatName | '' = ''; @@ -2161,12 +2173,12 @@ class BattleStatGuesser { if (stat === 'hp') { if (baseStat === 1) return 1; - if (!this.supportsEVs) return Math.floor(Math.floor(2 * baseStat + iv + 100) * level / 100 + 10) + (this.supportsAVs ? ev : 0); - return Math.floor(Math.floor(2 * baseStat + iv + Math.floor(ev / 4) + 100) * level / 100 + 10); + if (!this.supportsEVs) return ~~(~~(2 * baseStat + iv + 100) * level / 100 + 10) + (this.supportsAVs ? ev : 0); + return ~~(~~(2 * baseStat + iv + ~~(ev / 4) + 100) * level / 100 + 10); } - let val = Math.floor(Math.floor(2 * baseStat + iv + Math.floor(ev / 4)) * level / 100 + 5); + let val = ~~(~~(2 * baseStat + iv + ~~(ev / 4)) * level / 100 + 5); if (!this.supportsEVs) { - val = Math.floor(Math.floor(2 * baseStat + iv) * level / 100 + 5); + val = ~~(~~(2 * baseStat + iv) * level / 100 + 5); } if (natureOverride) { val *= natureOverride; @@ -2176,10 +2188,10 @@ class BattleStatGuesser { val *= 0.9; } if (!this.supportsEVs) { - let friendshipValue = Math.floor((70 / 255 / 10 + 1) * 100); - val = Math.floor(val) * friendshipValue / 100 + (this.supportsAVs ? ev : 0); + let friendshipValue = ~~((70 / 255 / 10 + 1) * 100); + val = ~~(val) * friendshipValue / 100 + (this.supportsAVs ? ev : 0); } - return Math.floor(val); + return ~~(val); } } diff --git a/src/battle.ts b/src/battle.ts index 4a34fe5fe..03fed43c7 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -366,20 +366,28 @@ class Pokemon implements PokemonDetails, PokemonHealth { if (this.boosts[boostStat] < -6) this.boosts[boostStat] = -6; if (boostStat === 'accuracy' || boostStat === 'evasion') { if (this.boosts[boostStat] > 0) { - let goodBoostTable = ['1×', '1.33×', '1.67×', '2×', '2.33×', '2.67×', '3×']; + let goodBoostTable = [ + '1×', '1.33×', '1.67×', '2×', '2.33×', '2.67×', '3×', + ]; // let goodBoostTable = ['Normal', '+1', '+2', '+3', '+4', '+5', '+6']; return '' + goodBoostTable[this.boosts[boostStat]] + ' ' + boostStatTable[boostStat]; } - let badBoostTable = ['1×', '0.75×', '0.6×', '0.5×', '0.43×', '0.38×', '0.33×']; + let badBoostTable = [ + '1×', '0.75×', '0.6×', '0.5×', '0.43×', '0.38×', '0.33×', + ]; // let badBoostTable = ['Normal', '−1', '−2', '−3', '−4', '−5', '−6']; return '' + badBoostTable[-this.boosts[boostStat]] + ' ' + boostStatTable[boostStat]; } if (this.boosts[boostStat] > 0) { - let goodBoostTable = ['1×', '1.5×', '2×', '2.5×', '3×', '3.5×', '4×']; + let goodBoostTable = [ + '1×', '1.5×', '2×', '2.5×', '3×', '3.5×', '4×', + ]; // let goodBoostTable = ['Normal', '+1', '+2', '+3', '+4', '+5', '+6']; return '' + goodBoostTable[this.boosts[boostStat]] + ' ' + boostStatTable[boostStat]; } - let badBoostTable = ['1×', '0.67×', '0.5×', '0.4×', '0.33×', '0.29×', '0.25×']; + let badBoostTable = [ + '1×', '0.67×', '0.5×', '0.4×', '0.33×', '0.29×', '0.25×', + ]; // let badBoostTable = ['Normal', '−1', '−2', '−3', '−4', '−5', '−6']; return '' + badBoostTable[-this.boosts[boostStat]] + ' ' + boostStatTable[boostStat]; } @@ -1411,19 +1419,33 @@ class Battle { runMinor(args: Args, kwArgs: KWArgs, nextArgs?: Args, nextKwargs?: KWArgs) { if (nextArgs && nextKwargs) { - if (args[2] === 'Sturdy' && args[0] === '-activate') args[2] = 'ability: Sturdy'; - if (args[0] === '-crit' || args[0] === '-supereffective' || args[0] === '-resisted' || args[2] === 'ability: Sturdy') kwArgs.then = '.'; + if (args[2] === 'Sturdy' && args[0] === '-activate') { + args[2] = 'ability: Sturdy'; + } + if (['-crit', '-supereffective', '-resisted'].includes(args[0]) || args[2] === 'ability: Sturdy') { + kwArgs.then = '.'; + } if (args[0] === '-damage' && !kwArgs.from && args[1] !== nextArgs[1] && ( - nextArgs[0] === '-crit' || - nextArgs[0] === '-supereffective' || - nextArgs[0] === '-resisted' || + ['-crit', '-supereffective', '-resisted'].includes(nextArgs[0]) || (nextArgs[0] === '-damage' && !nextKwargs.from) - )) kwArgs.then = '.'; - if (args[0] === '-damage' && nextArgs[0] === '-damage' && kwArgs.from && kwArgs.from === nextKwargs.from) kwArgs.then = '.'; - if (args[0] === '-ability' && (args[2] === 'Intimidate' || args[3] === 'boost')) kwArgs.then = '.'; - if (args[0] === '-unboost' && nextArgs[0] === '-unboost') kwArgs.then = '.'; - if (args[0] === '-boost' && nextArgs[0] === '-boost') kwArgs.then = '.'; - if (args[0] === '-damage' && kwArgs.from === 'Leech Seed' && nextArgs[0] === '-heal' && nextKwargs.silent) kwArgs.then = '.'; + )) { + kwArgs.then = '.'; + } + if (args[0] === '-damage' && nextArgs[0] === '-damage' && kwArgs.from && kwArgs.from === nextKwargs.from) { + kwArgs.then = '.'; + } + if (args[0] === '-ability' && (args[2] === 'Intimidate' || args[3] === 'boost')) { + kwArgs.then = '.'; + } + if (args[0] === '-unboost' && nextArgs[0] === '-unboost') { + kwArgs.then = '.'; + } + if (args[0] === '-boost' && nextArgs[0] === '-boost') { + kwArgs.then = '.'; + } + if (args[0] === '-damage' && kwArgs.from === 'Leech Seed' && nextArgs[0] === '-heal' && nextKwargs.silent) { + kwArgs.then = '.'; + } if (args[0] === 'detailschange' && nextArgs[0] === '-mega') { if (this.scene.closeMessagebar()) { this.activityStep--; @@ -2678,7 +2700,7 @@ class Battle { if (['electricterrain', 'grassyterrain', 'mistyterrain', 'psychicterrain'].includes(effect.id)) { for (let i = this.pseudoWeather.length - 1; i >= 0; i--) { let pwName = this.pseudoWeather[i][0]; - if (pwName === 'Electric Terrain' || pwName === 'Grassy Terrain' || pwName === 'Misty Terrain' || pwName === 'Psychic Terrain') { + if (['Electric Terrain', 'Grassy Terrain', 'Misty Terrain', 'Psychic Terrain'].includes(pwName)) { this.pseudoWeather.splice(i, 1); continue; } diff --git a/src/panel-mainmenu.tsx b/src/panel-mainmenu.tsx index 09c766f67..9147199a6 100644 --- a/src/panel-mainmenu.tsx +++ b/src/panel-mainmenu.tsx @@ -63,12 +63,17 @@ class MainMenuPanel extends PSRoomPanel {Pokémon Showdown is offline due to a DDoS attack!
:Pokémon Showdown is offline due to technical difficulties!
}-
(We'll be back up in a few hours.)
Welcome to the test client! You can test client changes here!
—Zarel on Sep 25, 2015
Welcome to the test client! You can test client changes here!
+—Zarel on Sep 25, 2015
+- {' '} + {}
:- {' '} - {' '} + {} + {}
} {isSelf &&- {' '} + {}
}