Skip to content

Commit dcae14c

Browse files
committed
1 parent 8bc75b1 commit dcae14c

File tree

457 files changed

+16212
-15958
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

457 files changed

+16212
-15958
lines changed

client/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
"build"
1616
],
1717
"dependencies": {
18-
"@pkmn/data": "^0.9.30",
18+
"@pkmn/data": "^0.9.31",
1919
"@pkmn/protocol": "^0.6.31"
2020
},
2121
"devDependencies": {
22-
"@pkmn/dex": "^0.9.30"
22+
"@pkmn/dex": "^0.9.31"
2323
},
2424
"scripts": {
2525
"lint": "eslint --cache src",

client/src/handler.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,9 @@ export class Handler implements Protocol.Handler {
491491
'|-item|'(args: Args['|-item|'], kwArgs: KWArgs['|-item|']): void {
492492
let poke = this.battle.getPokemon(args[1])!;
493493
const item = this.battle.get('items', args[2]);
494-
const fromEffect = this.battle.get('conditions', kwArgs.from);
494+
const fromEffect = kwArgs.from?.startsWith('ability')
495+
? this.battle.get('abilities', kwArgs.from.substr(8).trim())
496+
: this.battle.get('conditions', kwArgs.from);
495497
const ofPoke = this.battle.getPokemon(kwArgs.of);
496498

497499
if (!poke) {

data/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pkmn/data",
3-
"version": "0.9.30",
3+
"version": "0.9.31",
44
"description": "A forked implementation of the Pokémon Showdown client's data layer",
55
"repository": "github:pkmn/ps",
66
"license": "MIT",
@@ -16,12 +16,12 @@
1616
"build"
1717
],
1818
"dependencies": {
19-
"@pkmn/dex-types": "^0.9.30"
19+
"@pkmn/dex-types": "^0.9.31"
2020
},
2121
"devDependencies": {
22-
"@pkmn/dex": "^0.9.30",
23-
"@pkmn/mods": "^0.9.30",
24-
"@pkmn/sim": "^0.9.30",
22+
"@pkmn/dex": "^0.9.31",
23+
"@pkmn/mods": "^0.9.31",
24+
"@pkmn/sim": "^0.9.31",
2525
"@smogon/calc": "^0.10.0"
2626
},
2727
"scripts": {

dex/data/aliases.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@
8989
"gen6ag": "[Gen 6] Anything Goes",
9090
"crossevo": "[Gen 9] Cross Evolution",
9191
"mayhem": "[Gen 9] Random Battle Mayhem",
92-
"omotm": "[Gen 9] Alphabet Cup",
93-
"lcotm": "[Gen 9] 1-2 Switch",
92+
"omotm": "[Gen 9] Frantic Fusions",
93+
"lcotm": "[Gen 9] Cross Evolution",
9494
"fabio": "Ampharos-Mega",
9595
"maero": "Aerodactyl-Mega",
9696
"megabunny": "Lopunny-Mega",

dex/data/formats-data.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7152,7 +7152,7 @@
71527152
"tier": "Illegal",
71537153
"natDexTier": "RU"
71547154
},
7155-
"torkoal": {"tier": "PU", "doublesTier": "DOU", "natDexTier": "RU"},
7155+
"torkoal": {"tier": "ZU", "doublesTier": "DOU", "natDexTier": "RU"},
71567156
"spoink": {"tier": "LC"},
71577157
"grumpig": {"tier": "ZU", "doublesTier": "(DUU)", "natDexTier": "RU"},
71587158
"spinda": {"isNonstandard": "Past", "tier": "Illegal", "natDexTier": "RU"},

dex/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pkmn/dex",
3-
"version": "0.9.30",
3+
"version": "0.9.31",
44
"description": "A unification of Pokémon Showdown's client's and server's data layers",
55
"repository": "github:pkmn/ps",
66
"license": "MIT",
@@ -16,7 +16,7 @@
1616
"build"
1717
],
1818
"dependencies": {
19-
"@pkmn/dex-types": "^0.9.30"
19+
"@pkmn/dex-types": "^0.9.31"
2020
},
2121
"scripts": {
2222
"lint": "eslint --cache *.ts",

dex/types/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pkmn/dex-types",
3-
"version": "0.9.30",
3+
"version": "0.9.31",
44
"types": "index.d.ts",
55
"description": "Common Pokémon Showdown Dex types shared by @pkmn/dex and @pkmn/sim",
66
"repository": "github:pkmn/ps",

img/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pkmn/img",
3-
"version": "0.2.35",
3+
"version": "0.2.36",
44
"description": "Logic for displaying Pokémon Showdown's sprite/icon resources",
55
"repository": "github:pkmn/ps",
66
"license": "MIT",

img/src/data/data.json

+1-1
Large diffs are not rendered by default.

import

+9-11
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const IMPORTS = {
9797
'Side', 'SpreadMoveTargets', 'SpreadMoveDamage', 'ZMoveOptions',
9898
],
9999
'sim/battle-queue.ts': ['Pokemon', 'ID', 'Move', 'Effect'],
100-
'sim/battle-stream.ts': ['AnyObject', 'ModdedDex'],
100+
'sim/battle-stream.ts': ['ModdedDex'],
101101
'sim/battle.ts': [
102102
'Effect', 'Format', 'ID', 'PlayerOptions', 'AnyObject', 'ActiveMove', 'SideID', 'StatsTable',
103103
'SparseBoostsTable', 'SpreadMoveDamage', 'Move', 'PokemonSet', 'GameType', 'ModdedDex',
@@ -125,12 +125,12 @@ const IMPORTS = {
125125
'sim/field.ts': ['Effect', 'Condition', 'Pokemon', 'Battle', 'Side', 'AnyObject', 'ID'],
126126
'sim/pokemon.ts': [
127127
'ActiveMove', 'Ability', 'Condition', 'Item', 'Species', 'SparseBoostsTable', 'Side', 'SideID',
128-
'AnyObject', 'DynamaxOptions', 'Move', 'StatIDExceptHP', 'Effect', 'StatsExceptHPTable', 'ID',
128+
'AnyObject', 'Move', 'StatIDExceptHP', 'Effect', 'StatsExceptHPTable', 'ID',
129129
'BoostsTable', 'StatsTable', 'GenderName', 'PokemonSet', 'Battle', 'PokemonSlot',
130130
],
131131
'sim/side.ts': [
132132
'AnyObject', 'Effect', 'ActiveMove', 'Condition', 'PokemonSet', 'Battle',
133-
'Move', 'SideID', 'ID',
133+
'StatsExceptHPTable', 'MoveTarget', 'Move', 'SideID', 'ID',
134134
],
135135
'sim/state.ts': [
136136
'AnyObject', 'Condition', 'Ability', 'Item', 'Move', 'Species', 'ActiveMove',
@@ -396,8 +396,8 @@ const REWRITES = {
396396
'sim/battle-stream.ts': {
397397
'\t\tvoid this._listen();': undefined,
398398
'\tasync _listen() {': '\tasync start() {',
399-
"import {Battle, extractChannelMessages} from './battle';":
400-
"import {Battle, extractChannelMessages} from './battle';\nimport {Dex} from './dex';",
399+
"import { Battle, extractChannelMessages } from './battle';":
400+
"import { Battle, extractChannelMessages } from './battle';\nimport {Dex} from './dex';",
401401
'\tbattle: Battle | null;': '\tbattle: Battle | null;\n\tdex: ModdedDex;',
402402
'\t\t\tthis.battle = new Battle(options);':
403403
'\t\t\tthis.battle = new Battle(options, this.dex);',
@@ -553,10 +553,10 @@ const RANDOMS_FILES = {
553553
};
554554

555555
const INLINE_REQUIRE = /^(.*)require\(.*\)(\.matchups)?;.*$/;
556-
const RANDOM_SETS = /^(\trandomSets:.*=) require\('\.\/sets\.json'\);(.*)/;
556+
const RANDOM_SETS = /^(\t(?:override )?randomSets:.*=) require\('\.\/sets\.json'\);(.*)/;
557557
const RANDOM_DOUBLES_SETS =
558558
/^(\trandomDoublesSets:.*=) require\('\.\/doubles-sets\.json'\);(.*)/;
559-
const RANDOM_DATA = /^(\trandomData:.*=) require\('\.\/data\.json'\);(.*)/;
559+
const RANDOM_DATA = /^(\t(?:override )?randomData:.*=) require\('\.\/data\.json'\);(.*)/;
560560
const RANDOM_POTD = /potd/i;
561561

562562
const DATA = {
@@ -771,9 +771,7 @@ const changes = async (where, last, now, repo) => ({
771771
} else if (line === '\t\t ) ? this.format.team + \'Team\' : \'\';') {
772772
return '\t\t) ? this.format.team + \'Team\' : \'\';';
773773
}
774-
return (line
775-
.replace('values().next().value', 'values().next().value!')
776-
.replace(/Dex\./g, 'this.dex.'));
774+
return line.replace(/Dex\./g, 'this.dex.');
777775
});
778776

779777
let dataJson = '';
@@ -959,7 +957,7 @@ const changes = async (where, last, now, repo) => ({
959957
fs.writeFileSync(path.resolve(sim, 'sim/global-types.ts'), types);
960958
const exported = [];
961959
for (const line of types.split('\n')) {
962-
exported.push(/^(type|interface|namespace)/.test(line) ? `export ${line}` : line);
960+
exported.push(/^(type|interface|declare|namespace)/.test(line) ? `export ${line}` : line);
963961
}
964962
fs.writeFileSync(path.resolve(sim, 'sim/exported-global-types.ts'), exported.join('\n'));
965963

integration/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
"dependencies": {
66
"@pkmn/client": "file:../client",
77
"@pkmn/data": "file:../data",
8-
"@pkmn/eslint-config": "^9.6.0",
8+
"@pkmn/eslint-config": "^9.7.0",
99
"@pkmn/img": "file:../img",
1010
"@pkmn/protocol": "file:../protocol",
1111
"@pkmn/randoms": "file:../randoms",
1212
"@pkmn/sets": "file:../sets",
1313
"@pkmn/sim": "file:../sim",
1414
"@pkmn/view": "file:../view",
1515
"cssnano": "^7.0.6",
16-
"eslint": "^9.20.0",
16+
"eslint": "^9.21.0",
1717
"eslint-plugin-import": "^2.31.0",
1818
"eslint-plugin-jest": "^28.11.0",
1919
"jest": "^29.7.0",
2020
"minimist": "^1.2.8",
2121
"parcel": "^2.13.3",
2222
"source-map-support": "^0.5.21",
23-
"typescript-eslint": "^8.24.0",
24-
"typescript": "^5.7.3"
23+
"typescript-eslint": "^8.26.0",
24+
"typescript": "^5.8.2"
2525
},
2626
"alias": {
2727
"process": false,

mods/eslint.config.mjs

+2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ export default [...pkmn, {
1818
rules: {
1919
"@stylistic/indent": ["error", "tab", {flatTernaryExpressions: true}],
2020
"@stylistic/no-mixed-spaces-and-tabs": "off",
21+
"@stylistic/object-curly-spacing": "off",
2122
"@stylistic/operator-linebreak": "off",
2223
"@stylistic/quotes": "off",
2324
"@typescript-eslint/no-base-to-string": "off",
2425
"@typescript-eslint/no-unused-vars": "off",
2526
"@typescript-eslint/prefer-optional-chain": "off",
27+
"@typescript-eslint/restrict-template-expressions": "off",
2628
"max-len": "off",
2729
}
2830
}];

mods/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pkmn/mods",
3-
"version": "0.9.30",
3+
"version": "0.9.31",
44
"description": "Support for non-standard mods to @pkmn/sim and @pkmn/dex",
55
"repository": "github:pkmn/ps",
66
"author": "Guangcong Luo <[email protected]> (http://guangcongluo.com)",
@@ -114,11 +114,11 @@
114114
"build"
115115
],
116116
"dependencies": {
117-
"@pkmn/dex-types": "^0.9.30"
117+
"@pkmn/dex-types": "^0.9.31"
118118
},
119119
"devDependencies": {
120-
"@pkmn/dex": "^0.9.30",
121-
"@pkmn/sim": "^0.9.30"
120+
"@pkmn/dex": "^0.9.31",
121+
"@pkmn/sim": "^0.9.31"
122122
},
123123
"scripts": {
124124
"lint": "eslint --cache src",

mods/src/gen1jpn/moves.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const Moves: ModdedMoveDataTable = {
6767
// Add here counter damage
6868
const lastAttackedBy = target.getLastAttackedBy();
6969
if (!lastAttackedBy) {
70-
target.attackedBy.push({source: source, move: move.id, damage: uncappedDamage, thisTurn: true, slot: source.getSlot()});
70+
target.attackedBy.push({ source, move: move.id, damage: uncappedDamage, thisTurn: true, slot: source.getSlot() });
7171
} else {
7272
lastAttackedBy.move = move.id;
7373
lastAttackedBy.damage = uncappedDamage;

mods/src/gen1jpn/rulesets.ts

+30-30
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,40 @@ export const Rulesets: ModdedFormatDataTable = {
2424
'Flareon + Tackle + Growl', 'Flareon + Focus Energy + Ember',
2525
],
2626
onValidateSet(set) {
27-
const rgb97Legality: {[speciesid: string]: {[moveid: string]: 'illegal' | number}} = {
28-
charizard: {fly: 'illegal'},
27+
const rgb97Legality: { [speciesid: string]: { [moveid: string]: 'illegal' | number } } = {
28+
charizard: { fly: 'illegal' },
2929
butterfree: {
3030
confusion: 12, poisonpowder: 15, stunspore: 16, sleeppowder: 17, supersonic: 21,
3131
psybeam: 34, flash: 'illegal', gust: 'illegal',
3232
},
33-
fearow: {payday: 'illegal'},
34-
pikachu: {quickattack: 16, tailwhip: 'illegal', slam: 'illegal', lightscreen: 'illegal'},
35-
raichu: {quickattack: 16, tailwhip: 'illegal', slam: 'illegal', lightscreen: 'illegal'},
36-
nidoranf: {doublekick: 43},
37-
nidorina: {doublekick: 43},
38-
nidoqueen: {doublekick: 43},
39-
nidoranm: {doublekick: 43},
40-
nidorino: {doublekick: 43},
41-
nidoking: {doublekick: 43},
42-
venonat: {poisonpowder: 24, supersonic: 'illegal', confusion: 'illegal'},
43-
venomoth: {poisonpowder: 24, supersonic: 'illegal'},
44-
diglett: {cut: 'illegal'},
45-
dugtrio: {cut: 'illegal'},
46-
psyduck: {amnesia: 'illegal'},
47-
golduck: {amnesia: 'illegal'},
48-
mankey: {lowkick: 'illegal', screech: 'illegal'},
49-
primeape: {lowkick: 'illegal', screech: 'illegal'},
50-
kadabra: {kinesis: 'illegal'},
51-
alakazam: {kinesis: 'illegal'},
52-
rapidash: {payday: 'illegal'},
53-
cubone: {tailwhip: 'illegal', headbutt: 'illegal'},
54-
marowak: {tailwhip: 'illegal', headbutt: 'illegal'},
55-
chansey: {tailwhip: 'illegal'},
56-
tangela: {absorb: 29, growth: 49, vinewhip: 'illegal'},
57-
scyther: {wingattack: 'illegal'},
58-
pinsir: {bind: 'illegal'},
59-
magikarp: {dragonrage: 'illegal'},
60-
eevee: {quickattack: 27, tailwhip: 31, bite: 37, growl: 'illegal', focusenergy: 'illegal'},
33+
fearow: { payday: 'illegal' },
34+
pikachu: { quickattack: 16, tailwhip: 'illegal', slam: 'illegal', lightscreen: 'illegal' },
35+
raichu: { quickattack: 16, tailwhip: 'illegal', slam: 'illegal', lightscreen: 'illegal' },
36+
nidoranf: { doublekick: 43 },
37+
nidorina: { doublekick: 43 },
38+
nidoqueen: { doublekick: 43 },
39+
nidoranm: { doublekick: 43 },
40+
nidorino: { doublekick: 43 },
41+
nidoking: { doublekick: 43 },
42+
venonat: { poisonpowder: 24, supersonic: 'illegal', confusion: 'illegal' },
43+
venomoth: { poisonpowder: 24, supersonic: 'illegal' },
44+
diglett: { cut: 'illegal' },
45+
dugtrio: { cut: 'illegal' },
46+
psyduck: { amnesia: 'illegal' },
47+
golduck: { amnesia: 'illegal' },
48+
mankey: { lowkick: 'illegal', screech: 'illegal' },
49+
primeape: { lowkick: 'illegal', screech: 'illegal' },
50+
kadabra: { kinesis: 'illegal' },
51+
alakazam: { kinesis: 'illegal' },
52+
rapidash: { payday: 'illegal' },
53+
cubone: { tailwhip: 'illegal', headbutt: 'illegal' },
54+
marowak: { tailwhip: 'illegal', headbutt: 'illegal' },
55+
chansey: { tailwhip: 'illegal' },
56+
tangela: { absorb: 29, growth: 49, vinewhip: 'illegal' },
57+
scyther: { wingattack: 'illegal' },
58+
pinsir: { bind: 'illegal' },
59+
magikarp: { dragonrage: 'illegal' },
60+
eevee: { quickattack: 27, tailwhip: 31, bite: 37, growl: 'illegal', focusenergy: 'illegal' },
6161
vaporeon: {
6262
quickattack: 27, tailwhip: 31, watergun: 31, bite: 37, acidarmor: 42, haze: 44, mist: 48, hydropump: 54,
6363
growl: 'illegal', focusenergy: 'illegal', aurorabeam: 'illegal',

mods/src/gen1stadium/conditions.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const Conditions: ModdedConditionDataTable = {
3939
effectType: 'Status',
4040
onStart(target, source, sourceEffect) {
4141
if (sourceEffect && sourceEffect.effectType === 'Move') {
42-
this.add('-status', target, 'slp', '[from] move: ' + sourceEffect.name);
42+
this.add('-status', target, 'slp', `[from] move: ${sourceEffect.name}`);
4343
} else {
4444
this.add('-status', target, 'slp');
4545
}
@@ -110,7 +110,7 @@ export const Conditions: ModdedConditionDataTable = {
110110
duration: 2,
111111
onBeforeMovePriority: 1,
112112
onStart(target, source, effect) {
113-
this.add('-activate', target, 'move: ' + effect, '[of] ' + source);
113+
this.add('-activate', target, `move: ${effect}`, `[of] ${source}`);
114114
},
115115
onBeforeMove(pokemon) {
116116
if (this.effectState.source && (!this.effectState.source.isActive || this.effectState.source.hp <= 0)) {

mods/src/gen1stadium/moves.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const Moves: ModdedMoveDataTable = {
6161
pokemon.removeVolatile('bide');
6262
return false;
6363
}
64-
this.actions.moveHit(target, pokemon, move, {damage: this.effectState.totalDamage * 2} as ActiveMove);
64+
this.actions.moveHit(target, pokemon, move, { damage: this.effectState.totalDamage * 2 } as ActiveMove);
6565
pokemon.removeVolatile('bide');
6666
return false;
6767
}
@@ -169,7 +169,7 @@ export const Moves: ModdedMoveDataTable = {
169169
onLockMove: 'rage',
170170
onHit(target, source, move) {
171171
if (target.boosts.atk < 6 && (move.category !== 'Status' || move.id === 'disable')) {
172-
this.boost({atk: 1});
172+
this.boost({ atk: 1 });
173173
}
174174
},
175175
},
@@ -272,7 +272,7 @@ export const Moves: ModdedMoveDataTable = {
272272
// Add here counter damage
273273
const lastAttackedBy = target.getLastAttackedBy();
274274
if (!lastAttackedBy) {
275-
target.attackedBy.push({source: source, move: move.id, damage: damage, slot: source.getSlot(), thisTurn: true});
275+
target.attackedBy.push({ source, move: move.id, damage, slot: source.getSlot(), thisTurn: true });
276276
} else {
277277
lastAttackedBy.move = move.id;
278278
lastAttackedBy.damage = damage;
@@ -289,7 +289,7 @@ export const Moves: ModdedMoveDataTable = {
289289
},
290290
struggle: {
291291
inherit: true,
292-
ignoreImmunity: {'Normal': true},
292+
ignoreImmunity: { 'Normal': true },
293293
},
294294
wrap: {
295295
inherit: true,

0 commit comments

Comments
 (0)