@pkmn/sim 0.5.20 → 0.5.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/config/formats.js +149 -126
- package/build/config/formats.js.map +1 -1
- package/build/data/abilities.js +1 -3
- package/build/data/abilities.js.map +1 -1
- package/build/data/aliases.js +4 -4
- package/build/data/aliases.js.map +1 -1
- package/build/data/conditions.js +5 -2
- package/build/data/conditions.js.map +1 -1
- package/build/data/formats-data.js +20 -17
- package/build/data/formats-data.js.map +1 -1
- package/build/data/learnsets.js +29 -0
- package/build/data/learnsets.js.map +1 -1
- package/build/data/mods/gen1/conditions.js +7 -0
- package/build/data/mods/gen1/conditions.js.map +1 -1
- package/build/data/mods/gen1/formats-data.js +2 -2
- package/build/data/mods/gen1/formats-data.js.map +1 -1
- package/build/data/mods/gen1/moves.js +2 -3
- package/build/data/mods/gen1/moves.js.map +1 -1
- package/build/data/mods/gen1/scripts.js +4 -2
- package/build/data/mods/gen1/scripts.js.map +1 -1
- package/build/data/mods/gen2/conditions.js +3 -0
- package/build/data/mods/gen2/conditions.js.map +1 -1
- package/build/data/mods/gen2/learnsets.js +2 -2
- package/build/data/mods/gen2/learnsets.js.map +1 -1
- package/build/data/mods/gen2/scripts.js +16 -0
- package/build/data/mods/gen2/scripts.js.map +1 -1
- package/build/data/mods/gen3/conditions.js +3 -0
- package/build/data/mods/gen3/conditions.js.map +1 -1
- package/build/data/mods/gen3/formats-data.js +3 -3
- package/build/data/mods/gen3/formats-data.js.map +1 -1
- package/build/data/mods/gen4/abilities.js +1 -1
- package/build/data/mods/gen4/abilities.js.map +1 -1
- package/build/data/mods/gen4/conditions.js +3 -0
- package/build/data/mods/gen4/conditions.js.map +1 -1
- package/build/data/mods/gen4/formats-data.js +1 -1
- package/build/data/mods/gen4/formats-data.js.map +1 -1
- package/build/data/mods/gen4/moves.js +9 -2
- package/build/data/mods/gen4/moves.js.map +1 -1
- package/build/data/mods/gen5/moves.js +4 -7
- package/build/data/mods/gen5/moves.js.map +1 -1
- package/build/data/mods/gen5/pokedex.js +24 -0
- package/build/data/mods/gen5/pokedex.js.map +1 -1
- package/build/data/mods/gen6/formats-data.js +65 -65
- package/build/data/mods/gen6/formats-data.js.map +1 -1
- package/build/data/mods/gen6/learnsets.js +0 -75
- package/build/data/mods/gen6/learnsets.js.map +1 -1
- package/build/data/mods/gen7/abilities.js +8 -0
- package/build/data/mods/gen7/abilities.js.map +1 -1
- package/build/data/mods/gen7/moves.js +2 -2
- package/build/data/mods/gen7/moves.js.map +1 -1
- package/build/data/moves.js +8 -3
- package/build/data/moves.js.map +1 -1
- package/build/data/pokedex.js +12 -0
- package/build/data/pokedex.js.map +1 -1
- package/build/data/rulesets.js +175 -0
- package/build/data/rulesets.js.map +1 -1
- package/build/data/tags.js +2 -2
- package/build/data/tags.js.map +1 -1
- package/build/sim/battle-stream.js +3 -0
- package/build/sim/battle-stream.js.map +1 -1
- package/build/sim/exported-global-types.d.ts +2 -0
- package/build/sim/global-types.d.ts +2 -0
- package/build/sim/pokemon.d.ts +1 -0
- package/build/sim/pokemon.js +9 -2
- package/build/sim/pokemon.js.map +1 -1
- package/build/sim/side.js +21 -0
- package/build/sim/side.js.map +1 -1
- package/config/formats.ts +152 -130
- package/data/abilities.ts +1 -3
- package/data/aliases.ts +4 -4
- package/data/conditions.ts +6 -2
- package/data/formats-data.ts +20 -17
- package/data/learnsets.ts +29 -0
- package/data/mods/gen1/conditions.ts +8 -0
- package/data/mods/gen1/formats-data.ts +2 -2
- package/data/mods/gen1/moves.ts +3 -2
- package/data/mods/gen1/scripts.ts +3 -2
- package/data/mods/gen2/conditions.ts +4 -0
- package/data/mods/gen2/learnsets.ts +2 -2
- package/data/mods/gen2/scripts.ts +16 -0
- package/data/mods/gen3/conditions.ts +4 -0
- package/data/mods/gen3/formats-data.ts +3 -3
- package/data/mods/gen4/abilities.ts +1 -1
- package/data/mods/gen4/conditions.ts +4 -0
- package/data/mods/gen4/formats-data.ts +1 -1
- package/data/mods/gen4/moves.ts +9 -2
- package/data/mods/gen5/moves.ts +4 -7
- package/data/mods/gen5/pokedex.ts +24 -0
- package/data/mods/gen6/formats-data.ts +65 -65
- package/data/mods/gen6/learnsets.ts +0 -75
- package/data/mods/gen7/abilities.ts +8 -0
- package/data/mods/gen7/moves.ts +2 -2
- package/data/moves.ts +8 -3
- package/data/pokedex.ts +12 -0
- package/data/rulesets.ts +155 -0
- package/data/tags.ts +2 -2
- package/package.json +2 -2
- package/sim/battle-stream.ts +3 -0
- package/sim/exported-global-types.ts +2 -0
- package/sim/global-types.ts +2 -0
- package/sim/pokemon.ts +9 -2
- package/sim/side.ts +20 -0
package/build/data/rulesets.js
CHANGED
|
@@ -405,6 +405,30 @@ exports.Rulesets = {
|
|
|
405
405
|
}
|
|
406
406
|
},
|
|
407
407
|
},
|
|
408
|
+
forceselect: {
|
|
409
|
+
effectType: 'ValidatorRule',
|
|
410
|
+
name: 'Force Select',
|
|
411
|
+
desc: `Forces a Pokemon to be on the team and selected at Team Preview. Usage: Force Select = [Pokemon], e.g. "Force Select = Magikarp"`,
|
|
412
|
+
hasValue: true,
|
|
413
|
+
onValidateRule(value) {
|
|
414
|
+
if (!this.dex.species.get(value).exists)
|
|
415
|
+
throw new Error(`Misspelled Pokemon "${value}"`);
|
|
416
|
+
},
|
|
417
|
+
onValidateTeam(team) {
|
|
418
|
+
let hasSelection = false;
|
|
419
|
+
const species = this.dex.species.get(this.ruleTable.valueRules.get('forceselect'));
|
|
420
|
+
for (const set of team) {
|
|
421
|
+
if (species.name === set.species) {
|
|
422
|
+
hasSelection = true;
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
if (!hasSelection) {
|
|
427
|
+
return [`Your team must contain ${species.name}.`];
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
// hardcoded in sim/side
|
|
431
|
+
},
|
|
408
432
|
evlimits: {
|
|
409
433
|
effectType: 'ValidatorRule',
|
|
410
434
|
name: 'EV Limits',
|
|
@@ -1288,6 +1312,21 @@ exports.Rulesets = {
|
|
|
1288
1312
|
}
|
|
1289
1313
|
},
|
|
1290
1314
|
},
|
|
1315
|
+
gemsclause: {
|
|
1316
|
+
effectType: 'ValidatorRule',
|
|
1317
|
+
name: 'Gems Clause',
|
|
1318
|
+
desc: "Bans all Gems",
|
|
1319
|
+
onValidateSet(set) {
|
|
1320
|
+
if (!set.item)
|
|
1321
|
+
return;
|
|
1322
|
+
const item = this.dex.items.get(set.item);
|
|
1323
|
+
if (item.isGem) {
|
|
1324
|
+
if (this.ruleTable.has(`+item:${item.id}`))
|
|
1325
|
+
return;
|
|
1326
|
+
return [`${item.name} is banned due to Gems Clause.`];
|
|
1327
|
+
}
|
|
1328
|
+
},
|
|
1329
|
+
},
|
|
1291
1330
|
'sketchgen8moves': {
|
|
1292
1331
|
effectType: 'ValidatorRule',
|
|
1293
1332
|
name: 'Sketch Gen 8 Moves',
|
|
@@ -1611,6 +1650,12 @@ exports.Rulesets = {
|
|
|
1611
1650
|
desc: "Prevents Pok\u00e9mon from having moves that would only be obtainable in Pok\u00e9mon Crystal.",
|
|
1612
1651
|
// Implemented in mods/gen2/rulesets.ts
|
|
1613
1652
|
},
|
|
1653
|
+
aptclause: {
|
|
1654
|
+
effectType: 'ValidatorRule',
|
|
1655
|
+
name: 'APT Clause',
|
|
1656
|
+
desc: "Bans the combination of Agility and partial trapping moves like Wrap.",
|
|
1657
|
+
banlist: ['Agility + Wrap', 'Agility + Fire Spin', 'Agility + Bind', 'Agility + Clamp'],
|
|
1658
|
+
},
|
|
1614
1659
|
nintendocup1997movelegality: {
|
|
1615
1660
|
effectType: 'ValidatorRule',
|
|
1616
1661
|
name: "Nintendo Cup 1997 Move Legality",
|
|
@@ -1860,5 +1905,135 @@ exports.Rulesets = {
|
|
|
1860
1905
|
}
|
|
1861
1906
|
},
|
|
1862
1907
|
},
|
|
1908
|
+
reevolutionmod: {
|
|
1909
|
+
effectType: "Rule",
|
|
1910
|
+
name: "Re-Evolution Mod",
|
|
1911
|
+
desc: "Pokémon gain the stat changes they would gain from evolving again.",
|
|
1912
|
+
ruleset: ['Overflow Stat Mod'],
|
|
1913
|
+
onBegin() {
|
|
1914
|
+
this.add('rule', 'Re-Evolution Mod: Pok\u00e9mon gain the boosts they would gain from evolving again');
|
|
1915
|
+
},
|
|
1916
|
+
onModifySpecies(species, target) {
|
|
1917
|
+
const newSpecies = this.dex.deepClone(species);
|
|
1918
|
+
if (!newSpecies.prevo)
|
|
1919
|
+
return;
|
|
1920
|
+
const prevoSpecies = this.dex.species.get(newSpecies.prevo);
|
|
1921
|
+
let statid;
|
|
1922
|
+
newSpecies.bst = 0;
|
|
1923
|
+
for (statid in prevoSpecies.baseStats) {
|
|
1924
|
+
const change = newSpecies.baseStats[statid] - prevoSpecies.baseStats[statid];
|
|
1925
|
+
newSpecies.baseStats[statid] = this.clampIntRange(newSpecies.baseStats[statid] + change, 1, 255);
|
|
1926
|
+
newSpecies.bst += newSpecies.baseStats[statid];
|
|
1927
|
+
}
|
|
1928
|
+
return newSpecies;
|
|
1929
|
+
},
|
|
1930
|
+
},
|
|
1931
|
+
brokenrecordmod: {
|
|
1932
|
+
effectType: "Rule",
|
|
1933
|
+
name: "Broken Record Mod",
|
|
1934
|
+
desc: `Pokémon can hold a TR to use that move in battle.`,
|
|
1935
|
+
onValidateSet(set) {
|
|
1936
|
+
if (!set.item)
|
|
1937
|
+
return;
|
|
1938
|
+
const item = this.dex.items.get(set.item);
|
|
1939
|
+
if (!/^tr\d\d/i.test(item.name))
|
|
1940
|
+
return;
|
|
1941
|
+
const moveName = item.desc.split('move ')[1].split('.')[0];
|
|
1942
|
+
if (set.moves.map(this.toID).includes(this.toID(moveName))) {
|
|
1943
|
+
return [
|
|
1944
|
+
`${set.species} can't run ${item.name} (${moveName}) as its item because it already has that move in its moveset.`,
|
|
1945
|
+
];
|
|
1946
|
+
}
|
|
1947
|
+
},
|
|
1948
|
+
onValidateTeam(team) {
|
|
1949
|
+
const trs = new Set();
|
|
1950
|
+
for (const set of team) {
|
|
1951
|
+
if (!set.item)
|
|
1952
|
+
continue;
|
|
1953
|
+
const item = this.dex.items.get(set.item).name;
|
|
1954
|
+
if (!/^tr\d\d/i.test(item))
|
|
1955
|
+
continue;
|
|
1956
|
+
if (trs.has(item)) {
|
|
1957
|
+
return [`Your team already has a Pok\u00e9mon with ${item}.`];
|
|
1958
|
+
}
|
|
1959
|
+
trs.add(item);
|
|
1960
|
+
}
|
|
1961
|
+
},
|
|
1962
|
+
onTakeItem(item) {
|
|
1963
|
+
return !/^tr\d\d/i.test(item.name);
|
|
1964
|
+
},
|
|
1965
|
+
onModifyMove(move) {
|
|
1966
|
+
if (move.id === 'knockoff') {
|
|
1967
|
+
move.onBasePower = function (basePower, source, target, m) {
|
|
1968
|
+
const item = target.getItem();
|
|
1969
|
+
if (!this.singleEvent('TakeItem', item, target.itemState, target, target, m, item))
|
|
1970
|
+
return;
|
|
1971
|
+
// Very hardcode but I'd prefer to not make a mod for one damage calculation change
|
|
1972
|
+
if (item.id && !/^tr\d\d/i.test(item.id)) {
|
|
1973
|
+
return this.chainModify(1.5);
|
|
1974
|
+
}
|
|
1975
|
+
};
|
|
1976
|
+
}
|
|
1977
|
+
else if (move.id === 'fling') {
|
|
1978
|
+
move.onPrepareHit = function (target, source, m) {
|
|
1979
|
+
if (source.ignoringItem())
|
|
1980
|
+
return false;
|
|
1981
|
+
const item = source.getItem();
|
|
1982
|
+
if (!this.singleEvent('TakeItem', item, source.itemState, source, source, m, item))
|
|
1983
|
+
return false;
|
|
1984
|
+
if (!item.fling)
|
|
1985
|
+
return false;
|
|
1986
|
+
if (/^tr\d\d/i.test(item.id))
|
|
1987
|
+
return false;
|
|
1988
|
+
m.basePower = item.fling.basePower;
|
|
1989
|
+
if (item.isBerry) {
|
|
1990
|
+
m.onHit = function (foe) {
|
|
1991
|
+
if (this.singleEvent('Eat', item, null, foe, null, null)) {
|
|
1992
|
+
this.runEvent('EatItem', foe, null, null, item);
|
|
1993
|
+
if (item.id === 'leppaberry')
|
|
1994
|
+
foe.staleness = 'external';
|
|
1995
|
+
}
|
|
1996
|
+
if (item.onEat)
|
|
1997
|
+
foe.ateBerry = true;
|
|
1998
|
+
};
|
|
1999
|
+
}
|
|
2000
|
+
else if (item.fling.effect) {
|
|
2001
|
+
m.onHit = item.fling.effect;
|
|
2002
|
+
}
|
|
2003
|
+
else {
|
|
2004
|
+
if (!m.secondaries)
|
|
2005
|
+
m.secondaries = [];
|
|
2006
|
+
if (item.fling.status) {
|
|
2007
|
+
m.secondaries.push({ status: item.fling.status });
|
|
2008
|
+
}
|
|
2009
|
+
else if (item.fling.volatileStatus) {
|
|
2010
|
+
m.secondaries.push({ volatileStatus: item.fling.volatileStatus });
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
source.addVolatile('fling');
|
|
2014
|
+
};
|
|
2015
|
+
}
|
|
2016
|
+
},
|
|
2017
|
+
onBegin() {
|
|
2018
|
+
for (const pokemon of this.getAllPokemon()) {
|
|
2019
|
+
const item = pokemon.getItem();
|
|
2020
|
+
if (/^tr\d\d/i.test(item.name)) {
|
|
2021
|
+
const move = this.dex.moves.get(item.desc.split('move ')[1].split('.')[0]);
|
|
2022
|
+
pokemon.moveSlots = pokemon.baseMoveSlots = [
|
|
2023
|
+
...pokemon.baseMoveSlots, {
|
|
2024
|
+
id: move.id,
|
|
2025
|
+
move: move.name,
|
|
2026
|
+
pp: move.pp * 8 / 5,
|
|
2027
|
+
maxpp: move.pp * 8 / 5,
|
|
2028
|
+
target: move.target,
|
|
2029
|
+
disabled: false,
|
|
2030
|
+
disabledSource: '',
|
|
2031
|
+
used: false,
|
|
2032
|
+
},
|
|
2033
|
+
];
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
},
|
|
2037
|
+
},
|
|
1863
2038
|
};
|
|
1864
2039
|
//# sourceMappingURL=rulesets.js.map
|