Initial Modpack Upload
This commit is contained in:
1 parent
268b0650aa
commit
3d8b956ee4
1429 files changed
+820128
No files matched your search
@@ -0,0 +1,103 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var abilities_exports = {};
|
||||
__export(abilities_exports, {
|
||||
Abilities: () => Abilities
|
||||
});
|
||||
module.exports = __toCommonJS(abilities_exports);
|
||||
const Abilities = {
|
||||
neutralizinggas: {
|
||||
inherit: true,
|
||||
// Ability suppression implemented in sim/pokemon.ts:Pokemon#ignoringAbility
|
||||
onPreStart(pokemon) {
|
||||
this.add("-ability", pokemon, "Neutralizing Gas");
|
||||
pokemon.abilityState.ending = false;
|
||||
for (const target of this.getAllActive()) {
|
||||
if (target.hasItem("Ability Shield")) {
|
||||
this.add("-block", target, "item: Ability Shield");
|
||||
continue;
|
||||
}
|
||||
if (target.illusion) {
|
||||
this.singleEvent("End", this.dex.abilities.get("Illusion"), target.abilityState, target, pokemon, "neutralizinggas");
|
||||
}
|
||||
if (target.volatiles["slowstart"]) {
|
||||
delete target.volatiles["slowstart"];
|
||||
this.add("-end", target, "Slow Start", "[silent]");
|
||||
}
|
||||
if (target.m.innate) {
|
||||
if (!this.dex.abilities.get(target.m.innate.slice(8)).isPermanent) {
|
||||
target.removeVolatile(target.m.innate);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onEnd(source) {
|
||||
this.add("-end", source, "ability: Neutralizing Gas");
|
||||
if (source.abilityState.ending)
|
||||
return;
|
||||
source.abilityState.ending = true;
|
||||
const sortedActive = this.getAllActive();
|
||||
this.speedSort(sortedActive);
|
||||
for (const pokemon of sortedActive) {
|
||||
if (pokemon !== source) {
|
||||
this.singleEvent("Start", pokemon.getAbility(), pokemon.abilityState, pokemon);
|
||||
}
|
||||
if (pokemon.m.innate) {
|
||||
if (!pokemon.volatiles[pokemon.m.innate])
|
||||
pokemon.addVolatile(pokemon.m.innate, pokemon);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
trace: {
|
||||
inherit: true,
|
||||
onUpdate(pokemon) {
|
||||
if (!pokemon.isStarted || this.effectState.gaveUp)
|
||||
return;
|
||||
const isAbility = pokemon.ability === "trace";
|
||||
const additionalBannedAbilities = [
|
||||
// Zen Mode included here for compatability with Gen 5-6
|
||||
"noability",
|
||||
"flowergift",
|
||||
"forecast",
|
||||
"hungerswitch",
|
||||
"illusion",
|
||||
"imposter",
|
||||
"neutralizinggas",
|
||||
"powerofalchemy",
|
||||
"receiver",
|
||||
"trace",
|
||||
"zenmode"
|
||||
];
|
||||
const possibleTargets = pokemon.adjacentFoes().filter((target2) => !target2.getAbility().isPermanent && !additionalBannedAbilities.includes(target2.ability));
|
||||
if (!possibleTargets.length)
|
||||
return;
|
||||
const target = this.sample(possibleTargets);
|
||||
const ability = target.getAbility();
|
||||
this.add("-ability", pokemon, ability, "[from] ability: Trace", "[of] " + target);
|
||||
if (isAbility) {
|
||||
pokemon.setAbility(ability);
|
||||
} else {
|
||||
pokemon.removeVolatile("ability:trace");
|
||||
pokemon.addVolatile("ability:" + ability.id, pokemon);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=abilities.js.map
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../../../../data/mods/partnersincrime/abilities.ts"],
|
||||
"sourcesContent": ["export const Abilities: {[k: string]: ModdedAbilityData} = {\r\n\tneutralizinggas: {\r\n\t\tinherit: true,\r\n\t\t// Ability suppression implemented in sim/pokemon.ts:Pokemon#ignoringAbility\r\n\t\tonPreStart(pokemon) {\r\n\t\t\tthis.add('-ability', pokemon, 'Neutralizing Gas');\r\n\t\t\tpokemon.abilityState.ending = false;\r\n\t\t\t// Remove setter's innates before the ability starts\r\n\t\t\tfor (const target of this.getAllActive()) {\r\n\t\t\t\tif (target.hasItem('Ability Shield')) {\r\n\t\t\t\t\tthis.add('-block', target, 'item: Ability Shield');\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif (target.illusion) {\r\n\t\t\t\t\tthis.singleEvent('End', this.dex.abilities.get('Illusion'), target.abilityState, target, pokemon, 'neutralizinggas');\r\n\t\t\t\t}\r\n\t\t\t\tif (target.volatiles['slowstart']) {\r\n\t\t\t\t\tdelete target.volatiles['slowstart'];\r\n\t\t\t\t\tthis.add('-end', target, 'Slow Start', '[silent]');\r\n\t\t\t\t}\r\n\t\t\t\tif (target.m.innate) {\r\n\t\t\t\t\tif (!this.dex.abilities.get(target.m.innate.slice(8)).isPermanent) {\r\n\t\t\t\t\t\ttarget.removeVolatile(target.m.innate);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tonEnd(source) {\r\n\t\t\tthis.add('-end', source, 'ability: Neutralizing Gas');\r\n\r\n\t\t\t// FIXME this happens before the pokemon switches out, should be the opposite order.\r\n\t\t\t// Not an easy fix since we cant use a supported event. Would need some kind of special event that\r\n\t\t\t// gathers events to run after the switch and then runs them when the ability is no longer accessible.\r\n\t\t\t// (If you're tackling this, do note extreme weathers have the same issue)\r\n\r\n\t\t\t// Mark this pokemon's ability as ending so Pokemon#ignoringAbility skips it\r\n\t\t\tif (source.abilityState.ending) return;\r\n\t\t\tsource.abilityState.ending = true;\r\n\t\t\tconst sortedActive = this.getAllActive();\r\n\t\t\tthis.speedSort(sortedActive);\r\n\t\t\tfor (const pokemon of sortedActive) {\r\n\t\t\t\tif (pokemon !== source) {\r\n\t\t\t\t\t// Will be suppressed by Pokemon#ignoringAbility if needed\r\n\t\t\t\t\tthis.singleEvent('Start', pokemon.getAbility(), pokemon.abilityState, pokemon);\r\n\t\t\t\t}\r\n\t\t\t\tif (pokemon.m.innate) {\r\n\t\t\t\t\tif (!pokemon.volatiles[pokemon.m.innate]) pokemon.addVolatile(pokemon.m.innate, pokemon);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\ttrace: {\r\n\t\tinherit: true,\r\n\t\tonUpdate(pokemon) {\r\n\t\t\tif (!pokemon.isStarted || this.effectState.gaveUp) return;\r\n\t\t\tconst isAbility = pokemon.ability === 'trace';\r\n\r\n\t\t\tconst additionalBannedAbilities = [\r\n\t\t\t\t// Zen Mode included here for compatability with Gen 5-6\r\n\t\t\t\t'noability', 'flowergift', 'forecast', 'hungerswitch', 'illusion', 'imposter', 'neutralizinggas', 'powerofalchemy', 'receiver', 'trace', 'zenmode',\r\n\t\t\t];\r\n\t\t\tconst possibleTargets = pokemon.adjacentFoes().filter(target => (\r\n\t\t\t\t!target.getAbility().isPermanent && !additionalBannedAbilities.includes(target.ability)\r\n\t\t\t));\r\n\t\t\tif (!possibleTargets.length) return;\r\n\r\n\t\t\tconst target = this.sample(possibleTargets);\r\n\t\t\tconst ability = target.getAbility();\r\n\t\t\tthis.add('-ability', pokemon, ability, '[from] ability: Trace', '[of] ' + target);\r\n\t\t\tif (isAbility) {\r\n\t\t\t\tpokemon.setAbility(ability);\r\n\t\t\t} else {\r\n\t\t\t\tpokemon.removeVolatile('ability:trace');\r\n\t\t\t\tpokemon.addVolatile('ability:' + ability.id, pokemon);\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n};\r\n"],
|
||||
"mappings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,QACxF;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EACA,OAAO;AAAA,IACN,SAAS;AAAA,IACT,SAAS,SAAS;AACjB,UAAI,CAAC,QAAQ,aAAa,KAAK,YAAY;AAAQ;AACnD,YAAM,YAAY,QAAQ,YAAY;AAEtC,YAAM,4BAA4B;AAAA;AAAA,QAEjC;AAAA,QAAa;AAAA,QAAc;AAAA,QAAY;AAAA,QAAgB;AAAA,QAAY;AAAA,QAAY;AAAA,QAAmB;AAAA,QAAkB;AAAA,QAAY;AAAA,QAAS;AAAA,MAC1I;AACA,YAAM,kBAAkB,QAAQ,aAAa,EAAE,OAAO,CAAAA,YACrD,CAACA,QAAO,WAAW,EAAE,eAAe,CAAC,0BAA0B,SAASA,QAAO,OAAO,CACtF;AACD,UAAI,CAAC,gBAAgB;AAAQ;AAE7B,YAAM,SAAS,KAAK,OAAO,eAAe;AAC1C,YAAM,UAAU,OAAO,WAAW;AAClC,WAAK,IAAI,YAAY,SAAS,SAAS,yBAAyB,UAAU,MAAM;AAChF,UAAI,WAAW;AACd,gBAAQ,WAAW,OAAO;AAAA,MAC3B,OAAO;AACN,gBAAQ,eAAe,eAAe;AACtC,gBAAQ,YAAY,aAAa,QAAQ,IAAI,OAAO;AAAA,MACrD;AAAA,IACD;AAAA,EACD;AACD;",
|
||||
"names": ["target"]
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var items_exports = {};
|
||||
__export(items_exports, {
|
||||
Items: () => Items
|
||||
});
|
||||
module.exports = __toCommonJS(items_exports);
|
||||
const Items = {
|
||||
leppaberry: {
|
||||
inherit: true,
|
||||
onEat(pokemon) {
|
||||
const moveSlot = pokemon.moveSlots.find((move) => move.pp === 0) || pokemon.moveSlots.find((move) => move.pp < move.maxpp);
|
||||
if (!moveSlot)
|
||||
return;
|
||||
moveSlot.pp += 10;
|
||||
if (moveSlot.pp > moveSlot.maxpp)
|
||||
moveSlot.pp = moveSlot.maxpp;
|
||||
if (!pokemon.m.curMoves.includes(moveSlot.id) && pokemon.m.trackPP.get(moveSlot.id)) {
|
||||
pokemon.m.trackPP.set(moveSlot.id, moveSlot.maxpp - moveSlot.pp);
|
||||
}
|
||||
this.add("-activate", pokemon, "item: Leppa Berry", moveSlot.move, "[consumed]");
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=items.js.map
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../../../../data/mods/partnersincrime/items.ts"],
|
||||
"sourcesContent": ["export const Items: {[k: string]: ModdedItemData} = {\r\n\tleppaberry: {\r\n\t\tinherit: true,\r\n\t\tonEat(pokemon) {\r\n\t\t\tconst moveSlot = pokemon.moveSlots.find(move => move.pp === 0) ||\r\n\t\t\t\tpokemon.moveSlots.find(move => move.pp < move.maxpp);\r\n\t\t\tif (!moveSlot) return;\r\n\t\t\tmoveSlot.pp += 10;\r\n\t\t\tif (moveSlot.pp > moveSlot.maxpp) moveSlot.pp = moveSlot.maxpp;\r\n\t\t\tif (!pokemon.m.curMoves.includes(moveSlot.id) && pokemon.m.trackPP.get(moveSlot.id)) {\r\n\t\t\t\tpokemon.m.trackPP.set(moveSlot.id, moveSlot.maxpp - moveSlot.pp);\r\n\t\t\t}\r\n\t\t\tthis.add('-activate', pokemon, 'item: Leppa Berry', moveSlot.move, '[consumed]');\r\n\t\t},\r\n\t},\r\n};\r\n"],
|
||||
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,QAAuC;AAAA,EACnD,YAAY;AAAA,IACX,SAAS;AAAA,IACT,MAAM,SAAS;AACd,YAAM,WAAW,QAAQ,UAAU,KAAK,UAAQ,KAAK,OAAO,CAAC,KAC5D,QAAQ,UAAU,KAAK,UAAQ,KAAK,KAAK,KAAK,KAAK;AACpD,UAAI,CAAC;AAAU;AACf,eAAS,MAAM;AACf,UAAI,SAAS,KAAK,SAAS;AAAO,iBAAS,KAAK,SAAS;AACzD,UAAI,CAAC,QAAQ,EAAE,SAAS,SAAS,SAAS,EAAE,KAAK,QAAQ,EAAE,QAAQ,IAAI,SAAS,EAAE,GAAG;AACpF,gBAAQ,EAAE,QAAQ,IAAI,SAAS,IAAI,SAAS,QAAQ,SAAS,EAAE;AAAA,MAChE;AACA,WAAK,IAAI,aAAa,SAAS,qBAAqB,SAAS,MAAM,YAAY;AAAA,IAChF;AAAA,EACD;AACD;",
|
||||
"names": []
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var moves_exports = {};
|
||||
__export(moves_exports, {
|
||||
Moves: () => Moves
|
||||
});
|
||||
module.exports = __toCommonJS(moves_exports);
|
||||
const Moves = {
|
||||
gastroacid: {
|
||||
inherit: true,
|
||||
condition: {
|
||||
// Ability suppression implemented in Pokemon.ignoringAbility() within sim/pokemon.js
|
||||
onStart(pokemon) {
|
||||
if (pokemon.hasItem("Ability Shield"))
|
||||
return false;
|
||||
this.add("-endability", pokemon);
|
||||
this.singleEvent("End", pokemon.getAbility(), pokemon.abilityState, pokemon, pokemon, "gastroacid");
|
||||
const keys = Object.keys(pokemon.volatiles).filter((x) => x.startsWith("ability:"));
|
||||
if (keys.length) {
|
||||
for (const abil of keys) {
|
||||
pokemon.removeVolatile(abil);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
grudge: {
|
||||
inherit: true,
|
||||
condition: {
|
||||
onStart(pokemon) {
|
||||
this.add("-singlemove", pokemon, "Grudge");
|
||||
},
|
||||
onFaint(target, source, effect) {
|
||||
if (!source || source.fainted || !effect)
|
||||
return;
|
||||
if (effect.effectType === "Move" && !effect.flags["futuremove"] && source.lastMove) {
|
||||
let move = source.lastMove;
|
||||
if (move.isMax && move.baseMove)
|
||||
move = this.dex.moves.get(move.baseMove);
|
||||
for (const moveSlot of source.moveSlots) {
|
||||
if (moveSlot.id === move.id) {
|
||||
moveSlot.pp = 0;
|
||||
if (!source.m.curMoves.includes(moveSlot.id) && source.m.trackPP.get(moveSlot.id)) {
|
||||
source.m.trackPP.set(moveSlot.id, moveSlot.maxpp - moveSlot.pp);
|
||||
}
|
||||
this.add("-activate", source, "move: Grudge", move.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onBeforeMovePriority: 100,
|
||||
onBeforeMove(pokemon) {
|
||||
this.debug("removing Grudge before attack");
|
||||
pokemon.removeVolatile("grudge");
|
||||
}
|
||||
}
|
||||
},
|
||||
lunardance: {
|
||||
inherit: true,
|
||||
condition: {
|
||||
onSwap(target) {
|
||||
if (!target.fainted && (target.hp < target.maxhp || target.status || target.moveSlots.some((moveSlot) => moveSlot.pp < moveSlot.maxpp))) {
|
||||
target.heal(target.maxhp);
|
||||
target.clearStatus();
|
||||
for (const moveSlot of target.moveSlots) {
|
||||
moveSlot.pp = moveSlot.maxpp;
|
||||
}
|
||||
for (const key of target.m.trackPP.keys()) {
|
||||
target.m.trackPP.set(key, 0);
|
||||
}
|
||||
this.add("-heal", target, target.getHealth, "[from] move: Lunar Dance");
|
||||
target.side.removeSlotCondition(target, "lunardance");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mimic: {
|
||||
inherit: true,
|
||||
onHit(target, source) {
|
||||
const move = target.lastMove;
|
||||
if (source.transformed || !move || move.flags["failmimic"] || source.moves.includes(move.id)) {
|
||||
return false;
|
||||
}
|
||||
if (move.isZ || move.isMax)
|
||||
return false;
|
||||
const mimicIndex = source.moves.indexOf("mimic");
|
||||
if (mimicIndex < 0)
|
||||
return false;
|
||||
if (!source.m.curMoves.includes("mimic"))
|
||||
return false;
|
||||
const mimickedMove = {
|
||||
move: move.name,
|
||||
id: move.id,
|
||||
pp: move.pp,
|
||||
maxpp: move.pp,
|
||||
target: move.target,
|
||||
disabled: false,
|
||||
used: false,
|
||||
virtual: true
|
||||
};
|
||||
source.moveSlots[mimicIndex] = mimickedMove;
|
||||
source.m.curMoves[mimicIndex] = mimickedMove.id;
|
||||
this.add("-start", source, "Mimic", move.name);
|
||||
}
|
||||
},
|
||||
sketch: {
|
||||
inherit: true,
|
||||
onHit(target, source) {
|
||||
const disallowedMoves = ["chatter", "sketch", "struggle"];
|
||||
const move = target.lastMove;
|
||||
if (source.transformed || !move || source.moves.includes(move.id))
|
||||
return false;
|
||||
if (disallowedMoves.includes(move.id) || move.isZ || move.isMax)
|
||||
return false;
|
||||
const sketchIndex = source.moves.indexOf("sketch");
|
||||
if (sketchIndex < 0)
|
||||
return false;
|
||||
if (!source.m.curMoves.includes("sketch"))
|
||||
return false;
|
||||
const sketchedMove = {
|
||||
move: move.name,
|
||||
id: move.id,
|
||||
pp: move.pp,
|
||||
maxpp: move.pp,
|
||||
target: move.target,
|
||||
disabled: false,
|
||||
used: false
|
||||
};
|
||||
source.moveSlots[sketchIndex] = sketchedMove;
|
||||
source.baseMoveSlots[sketchIndex] = sketchedMove;
|
||||
source.m.curMoves[sketchIndex] = sketchedMove.id;
|
||||
this.add("-activate", source, "move: Sketch", move.name);
|
||||
}
|
||||
},
|
||||
skillswap: {
|
||||
inherit: true,
|
||||
onHit(target, source, move) {
|
||||
const targetAbility = target.getAbility();
|
||||
const sourceAbility = source.getAbility();
|
||||
const ally = source.side.active.find((mon) => mon && mon !== source && !mon.fainted);
|
||||
const foeAlly = target.side.active.find((mon) => mon && mon !== target && !mon.fainted);
|
||||
if (target.isAlly(source)) {
|
||||
this.add("-activate", source, "move: Skill Swap", "", "", "[of] " + target);
|
||||
} else {
|
||||
this.add("-activate", source, "move: Skill Swap", targetAbility, sourceAbility, "[of] " + target);
|
||||
}
|
||||
this.singleEvent("End", sourceAbility, source.abilityState, source);
|
||||
if (ally?.m.innate) {
|
||||
ally.removeVolatile(ally.m.innate);
|
||||
delete ally.m.innate;
|
||||
}
|
||||
this.singleEvent("End", targetAbility, target.abilityState, target);
|
||||
if (foeAlly?.m.innate) {
|
||||
foeAlly.removeVolatile(foeAlly.m.innate);
|
||||
delete foeAlly.m.innate;
|
||||
}
|
||||
source.ability = targetAbility.id;
|
||||
source.abilityState = { id: this.toID(source.ability), target: source };
|
||||
if (source.m.innate && source.m.innate.endsWith(targetAbility.id)) {
|
||||
source.removeVolatile(source.m.innate);
|
||||
delete source.m.innate;
|
||||
}
|
||||
if (ally && ally.ability !== targetAbility.id) {
|
||||
if (!source.m.innate) {
|
||||
source.m.innate = "ability:" + ally.getAbility().id;
|
||||
source.addVolatile(source.m.innate);
|
||||
}
|
||||
ally.m.innate = "ability:" + targetAbility.id;
|
||||
ally.addVolatile(ally.m.innate);
|
||||
}
|
||||
target.ability = sourceAbility.id;
|
||||
target.abilityState = { id: this.toID(target.ability), target };
|
||||
if (target.m.innate && target.m.innate.endsWith(sourceAbility.id)) {
|
||||
target.removeVolatile(target.m.innate);
|
||||
delete target.m.innate;
|
||||
}
|
||||
if (foeAlly && foeAlly.ability !== sourceAbility.id) {
|
||||
if (!target.m.innate) {
|
||||
target.m.innate = "ability:" + foeAlly.getAbility().id;
|
||||
target.addVolatile(target.m.innate);
|
||||
}
|
||||
foeAlly.m.innate = "ability:" + sourceAbility.id;
|
||||
foeAlly.addVolatile(foeAlly.m.innate);
|
||||
}
|
||||
if (!target.isAlly(source))
|
||||
target.volatileStaleness = "external";
|
||||
this.singleEvent("Start", targetAbility, source.abilityState, source);
|
||||
this.singleEvent("Start", sourceAbility, target.abilityState, target);
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=moves.js.map
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../../../../data/mods/partnersincrime/moves.ts"],
|
||||
"sourcesContent": ["export const Moves: {[k: string]: ModdedMoveData} = {\r\n\tgastroacid: {\r\n\t\tinherit: true,\r\n\t\tcondition: {\r\n\t\t\t// Ability suppression implemented in Pokemon.ignoringAbility() within sim/pokemon.js\r\n\t\t\tonStart(pokemon) {\r\n\t\t\t\tif (pokemon.hasItem('Ability Shield')) return false;\r\n\t\t\t\tthis.add('-endability', pokemon);\r\n\t\t\t\tthis.singleEvent('End', pokemon.getAbility(), pokemon.abilityState, pokemon, pokemon, 'gastroacid');\r\n\t\t\t\tconst keys = Object.keys(pokemon.volatiles).filter(x => x.startsWith(\"ability:\"));\r\n\t\t\t\tif (keys.length) {\r\n\t\t\t\t\tfor (const abil of keys) {\r\n\t\t\t\t\t\tpokemon.removeVolatile(abil);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t},\r\n\t},\r\n\tgrudge: {\r\n\t\tinherit: true,\r\n\t\tcondition: {\r\n\t\t\tonStart(pokemon) {\r\n\t\t\t\tthis.add('-singlemove', pokemon, 'Grudge');\r\n\t\t\t},\r\n\t\t\tonFaint(target, source, effect) {\r\n\t\t\t\tif (!source || source.fainted || !effect) return;\r\n\t\t\t\tif (effect.effectType === 'Move' && !effect.flags['futuremove'] && source.lastMove) {\r\n\t\t\t\t\tlet move: Move = source.lastMove;\r\n\t\t\t\t\tif (move.isMax && move.baseMove) move = this.dex.moves.get(move.baseMove);\r\n\r\n\t\t\t\t\tfor (const moveSlot of source.moveSlots) {\r\n\t\t\t\t\t\tif (moveSlot.id === move.id) {\r\n\t\t\t\t\t\t\tmoveSlot.pp = 0;\r\n\t\t\t\t\t\t\tif (!source.m.curMoves.includes(moveSlot.id) && source.m.trackPP.get(moveSlot.id)) {\r\n\t\t\t\t source.m.trackPP.set(moveSlot.id, moveSlot.maxpp - moveSlot.pp);\r\n\t\t\t\t }\r\n\t\t\t\t\t\t\tthis.add('-activate', source, 'move: Grudge', move.name);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonBeforeMovePriority: 100,\r\n\t\t\tonBeforeMove(pokemon) {\r\n\t\t\t\tthis.debug('removing Grudge before attack');\r\n\t\t\t\tpokemon.removeVolatile('grudge');\r\n\t\t\t},\r\n\t\t},\r\n\t},\r\n\tlunardance: {\r\n\t\tinherit: true,\r\n\t\tcondition: {\r\n\t\t\tonSwap(target) {\r\n\t\t\t\tif (\r\n\t\t\t\t\t!target.fainted && (\r\n\t\t\t\t\t\ttarget.hp < target.maxhp ||\r\n\t\t\t\t\t\ttarget.status ||\r\n\t\t\t\t\t\ttarget.moveSlots.some(moveSlot => moveSlot.pp < moveSlot.maxpp)\r\n\t\t\t\t\t)\r\n\t\t\t\t) {\r\n\t\t\t\t\ttarget.heal(target.maxhp);\r\n\t\t\t\t\ttarget.clearStatus();\r\n\t\t\t\t\tfor (const moveSlot of target.moveSlots) {\r\n\t\t\t\t\t\tmoveSlot.pp = moveSlot.maxpp;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfor (const key of target.m.trackPP.keys()) {\r\n\t\t\t\t\t\ttarget.m.trackPP.set(key, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.add('-heal', target, target.getHealth, '[from] move: Lunar Dance');\r\n\t\t\t\t\ttarget.side.removeSlotCondition(target, 'lunardance');\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t},\r\n\t},\r\n\tmimic: {\r\n\t\tinherit: true,\r\n\t\tonHit(target, source) {\r\n\t\t\tconst move = target.lastMove;\r\n\t\t\tif (source.transformed || !move || move.flags['failmimic'] || source.moves.includes(move.id)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif (move.isZ || move.isMax) return false;\r\n\t\t\tconst mimicIndex = source.moves.indexOf('mimic');\r\n\t\t\tif (mimicIndex < 0) return false;\r\n\t\t\tif (!source.m.curMoves.includes('mimic')) return false;\r\n\r\n\t\t\tconst mimickedMove = {\r\n\t\t\t\tmove: move.name,\r\n\t\t\t\tid: move.id,\r\n\t\t\t\tpp: move.pp,\r\n\t\t\t\tmaxpp: move.pp,\r\n\t\t\t\ttarget: move.target,\r\n\t\t\t\tdisabled: false,\r\n\t\t\t\tused: false,\r\n\t\t\t\tvirtual: true,\r\n\t\t\t};\r\n\t\t\tsource.moveSlots[mimicIndex] = mimickedMove;\r\n\t\t\tsource.m.curMoves[mimicIndex] = mimickedMove.id;\r\n\t\t\tthis.add('-start', source, 'Mimic', move.name);\r\n\t\t},\r\n\t},\r\n\tsketch: {\r\n\t\tinherit: true,\r\n\t\tonHit(target, source) {\r\n\t\t\tconst disallowedMoves = ['chatter', 'sketch', 'struggle'];\r\n\t\t\tconst move = target.lastMove;\r\n\t\t\tif (source.transformed || !move || source.moves.includes(move.id)) return false;\r\n\t\t\tif (disallowedMoves.includes(move.id) || move.isZ || move.isMax) return false;\r\n\t\t\tconst sketchIndex = source.moves.indexOf('sketch');\r\n\t\t\tif (sketchIndex < 0) return false;\r\n\t\t\tif (!source.m.curMoves.includes('sketch')) return false;\r\n\t\t\tconst sketchedMove = {\r\n\t\t\t\tmove: move.name,\r\n\t\t\t\tid: move.id,\r\n\t\t\t\tpp: move.pp,\r\n\t\t\t\tmaxpp: move.pp,\r\n\t\t\t\ttarget: move.target,\r\n\t\t\t\tdisabled: false,\r\n\t\t\t\tused: false,\r\n\t\t\t};\r\n\t\t\tsource.moveSlots[sketchIndex] = sketchedMove;\r\n\t\t\tsource.baseMoveSlots[sketchIndex] = sketchedMove;\r\n\t\t\tsource.m.curMoves[sketchIndex] = sketchedMove.id;\r\n\t\t\tthis.add('-activate', source, 'move: Sketch', move.name);\r\n\t\t},\r\n\t},\r\n\tskillswap: {\r\n\t\tinherit: true,\r\n\t\tonHit(target, source, move) {\r\n\t\t\tconst targetAbility = target.getAbility();\r\n\t\t\tconst sourceAbility = source.getAbility();\r\n\t\t\tconst ally = source.side.active.find(mon => mon && mon !== source && !mon.fainted);\r\n\t\t\tconst foeAlly = target.side.active.find(mon => mLine truncated
|
||||
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,QAAuC;AAAA,EACnD,YAAY;AAAA,IACX,SAAS;AAAA,IACT,WAAW;AAAA;AAAA,MAEV,QAAQ,SAAS;AAChB,YAAI,QAAQ,QAAQ,gBAAgB;AAAG,iBAAO;AAC9C,aAAK,IAAI,eAAe,OAAO;AAC/B,aAAK,YAAY,OAAO,QAAQ,WAAW,GAAG,QAAQ,cAAc,SAAS,SAAS,YAAY;AAClG,cAAM,OAAO,OAAO,KAAK,QAAQ,SAAS,EAAE,OAAO,OAAK,EAAE,WAAW,UAAU,CAAC;AAChF,YAAI,KAAK,QAAQ;AAChB,qBAAW,QAA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AO,oBAAoB;AACvD,WAAK,YAAY,SAAS,eAAe,OAAO,cAAc,MAAM;AACpE,WAAK,YAAY,SAAS,eAAe,OAAO,cAAc,MAAM;AAAA,IACrE;AAAA,EACD;AACD;",
|
||||
"names": []
|
||||
}
|
||||
@@ -0,0 +1,420 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var scripts_exports = {};
|
||||
__export(scripts_exports, {
|
||||
Scripts: () => Scripts
|
||||
});
|
||||
module.exports = __toCommonJS(scripts_exports);
|
||||
const Scripts = {
|
||||
gen: 9,
|
||||
inherit: "gen9",
|
||||
nextTurn() {
|
||||
this.turn++;
|
||||
this.lastSuccessfulMoveThisTurn = null;
|
||||
for (const side of this.sides) {
|
||||
for (const pokemon of side.active) {
|
||||
pokemon.moveSlots = pokemon.moveSlots.filter((move) => pokemon.m.curMoves.includes(move.id));
|
||||
pokemon.m.curMoves = this.dex.deepClone(pokemon.moves);
|
||||
const ally = side.active.find((mon) => mon && mon !== pokemon && !mon.fainted);
|
||||
let allyMoves = ally ? this.dex.deepClone(ally.moveSlots) : [];
|
||||
if (ally) {
|
||||
allyMoves = allyMoves.filter((move) => !pokemon.moves.includes(move.id) && ally.m.curMoves.includes(move.id));
|
||||
for (const aMove of allyMoves) {
|
||||
aMove.pp = this.clampIntRange(aMove.maxpp - (pokemon.m.trackPP.get(aMove.id) || 0), 0);
|
||||
}
|
||||
}
|
||||
pokemon.moveSlots = pokemon.moveSlots.concat(allyMoves);
|
||||
}
|
||||
}
|
||||
const dynamaxEnding = [];
|
||||
for (const pokemon of this.getAllActive()) {
|
||||
if (pokemon.volatiles["dynamax"]?.turns === 3) {
|
||||
dynamaxEnding.push(pokemon);
|
||||
}
|
||||
}
|
||||
if (dynamaxEnding.length > 1) {
|
||||
this.updateSpeed();
|
||||
this.speedSort(dynamaxEnding);
|
||||
}
|
||||
for (const pokemon of dynamaxEnding) {
|
||||
pokemon.removeVolatile("dynamax");
|
||||
}
|
||||
if (this.gen === 1) {
|
||||
for (const pokemon of this.getAllActive()) {
|
||||
if (pokemon.volatiles["partialtrappinglock"]) {
|
||||
const target = pokemon.volatiles["partialtrappinglock"].locked;
|
||||
if (target.hp <= 0 || !target.volatiles["partiallytrapped"]) {
|
||||
delete pokemon.volatiles["partialtrappinglock"];
|
||||
}
|
||||
}
|
||||
if (pokemon.volatiles["partiallytrapped"]) {
|
||||
const source = pokemon.volatiles["partiallytrapped"].source;
|
||||
if (source.hp <= 0 || !source.volatiles["partialtrappinglock"]) {
|
||||
delete pokemon.volatiles["partiallytrapped"];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const trappedBySide = [];
|
||||
const stalenessBySide = [];
|
||||
for (const side of this.sides) {
|
||||
let sideTrapped = true;
|
||||
let sideStaleness;
|
||||
for (const pokemon of side.active) {
|
||||
if (!pokemon)
|
||||
continue;
|
||||
pokemon.moveThisTurn = "";
|
||||
pokemon.newlySwitched = false;
|
||||
pokemon.moveLastTurnResult = pokemon.moveThisTurnResult;
|
||||
pokemon.moveThisTurnResult = void 0;
|
||||
if (this.turn !== 1) {
|
||||
pokemon.usedItemThisTurn = false;
|
||||
pokemon.statsRaisedThisTurn = false;
|
||||
pokemon.statsLoweredThisTurn = false;
|
||||
pokemon.hurtThisTurn = null;
|
||||
}
|
||||
pokemon.maybeDisabled = false;
|
||||
for (const moveSlot of pokemon.moveSlots) {
|
||||
moveSlot.disabled = false;
|
||||
moveSlot.disabledSource = "";
|
||||
}
|
||||
this.runEvent("DisableMove", pokemon);
|
||||
for (const moveSlot of pokemon.moveSlots) {
|
||||
this.singleEvent("DisableMove", this.dex.getActiveMove(moveSlot.id), null, pokemon);
|
||||
}
|
||||
if (pokemon.getLastAttackedBy() && this.gen >= 7)
|
||||
pokemon.knownType = true;
|
||||
for (let i = pokemon.attackedBy.length - 1; i >= 0; i--) {
|
||||
const attack = pokemon.attackedBy[i];
|
||||
if (attack.source.isActive) {
|
||||
attack.thisTurn = false;
|
||||
} else {
|
||||
pokemon.attackedBy.splice(pokemon.attackedBy.indexOf(attack), 1);
|
||||
}
|
||||
}
|
||||
if (this.gen >= 7) {
|
||||
const seenPokemon = pokemon.illusion || pokemon;
|
||||
const realTypeString = seenPokemon.getTypes(true).join("/");
|
||||
if (realTypeString !== seenPokemon.apparentType) {
|
||||
this.add("-start", pokemon, "typechange", realTypeString, "[silent]");
|
||||
seenPokemon.apparentType = realTypeString;
|
||||
if (pokemon.addedType) {
|
||||
this.add("-start", pokemon, "typeadd", pokemon.addedType, "[silent]");
|
||||
}
|
||||
}
|
||||
}
|
||||
pokemon.trapped = pokemon.maybeTrapped = false;
|
||||
this.runEvent("TrapPokemon", pokemon);
|
||||
if (!pokemon.knownType || this.dex.getImmunity("trapped", pokemon)) {
|
||||
this.runEvent("MaybeTrapPokemon", pokemon);
|
||||
}
|
||||
if (this.gen > 2) {
|
||||
for (const source of pokemon.foes()) {
|
||||
const species = (source.illusion || source).species;
|
||||
if (!species.abilities)
|
||||
continue;
|
||||
for (const abilitySlot in species.abilities) {
|
||||
const abilityName = species.abilities[abilitySlot];
|
||||
if (abilityName === source.ability) {
|
||||
continue;
|
||||
}
|
||||
const ruleTable = this.ruleTable;
|
||||
if ((ruleTable.has("+hackmons") || !ruleTable.has("obtainableabilities")) && !this.format.team) {
|
||||
continue;
|
||||
} else if (abilitySlot === "H" && species.unreleasedHidden) {
|
||||
continue;
|
||||
}
|
||||
const ability = this.dex.abilities.get(abilityName);
|
||||
if (ruleTable.has("-ability:" + ability.id))
|
||||
continue;
|
||||
if (pokemon.knownType && !this.dex.getImmunity("trapped", pokemon))
|
||||
continue;
|
||||
this.singleEvent("FoeMaybeTrapPokemon", ability, {}, pokemon, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pokemon.fainted)
|
||||
continue;
|
||||
sideTrapped = sideTrapped && pokemon.trapped;
|
||||
const staleness = pokemon.volatileStaleness || pokemon.staleness;
|
||||
if (staleness)
|
||||
sideStaleness = sideStaleness === "external" ? sideStaleness : staleness;
|
||||
pokemon.activeTurns++;
|
||||
}
|
||||
trappedBySide.push(sideTrapped);
|
||||
stalenessBySide.push(sideStaleness);
|
||||
side.faintedLastTurn = side.faintedThisTurn;
|
||||
side.faintedThisTurn = null;
|
||||
}
|
||||
if (this.maybeTriggerEndlessBattleClause(trappedBySide, stalenessBySide))
|
||||
return;
|
||||
if (this.gameType === "triples" && this.sides.every((side) => side.pokemonLeft === 1)) {
|
||||
const actives = this.getAllActive();
|
||||
if (actives.length > 1 && !actives[0].isAdjacent(actives[1])) {
|
||||
this.swapPosition(actives[0], 1, "[silent]");
|
||||
this.swapPosition(actives[1], 1, "[silent]");
|
||||
this.add("-center");
|
||||
}
|
||||
}
|
||||
this.add("turn", this.turn);
|
||||
if (this.gameType === "multi") {
|
||||
for (const side of this.sides) {
|
||||
if (side.canDynamaxNow()) {
|
||||
if (this.turn === 1) {
|
||||
this.addSplit(side.id, ["-candynamax", side.id]);
|
||||
} else {
|
||||
this.add("-candynamax", side.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.gen === 2)
|
||||
this.quickClawRoll = this.randomChance(60, 256);
|
||||
if (this.gen === 3)
|
||||
this.quickClawRoll = this.randomChance(1, 5);
|
||||
if (this.ruleTable.has("crazyhouserule")) {
|
||||
for (const side of this.sides) {
|
||||
let buf = `raw|${side.name}'s team:<br />`;
|
||||
for (const pokemon of side.pokemon) {
|
||||
if (!buf.endsWith("<br />"))
|
||||
buf += "/</span>​";
|
||||
if (pokemon.fainted) {
|
||||
buf += `<span style="white-space:nowrap;"><span style="opacity:.3"><psicon pokemon="${pokemon.species.id}" /></span>`;
|
||||
} else {
|
||||
buf += `<span style="white-space:nowrap"><psicon pokemon="${pokemon.species.id}" />`;
|
||||
}
|
||||
}
|
||||
this.add(`${buf}</span>`);
|
||||
}
|
||||
}
|
||||
this.makeRequest("move");
|
||||
},
|
||||
actions: {
|
||||
runSwitch(pokemon) {
|
||||
this.battle.runEvent("Swap", pokemon);
|
||||
if (this.battle.gen >= 5) {
|
||||
this.battle.runEvent("SwitchIn", pokemon);
|
||||
}
|
||||
this.battle.runEvent("EntryHazard", pokemon);
|
||||
if (this.battle.gen <= 4) {
|
||||
this.battle.runEvent("SwitchIn", pokemon);
|
||||
}
|
||||
const ally = pokemon.side.active.find((mon) => mon && mon !== pokemon && !mon.fainted);
|
||||
if (this.battle.gen <= 2 && !pokemon.side.faintedThisTurn && pokemon.draggedIn !== this.battle.turn) {
|
||||
this.battle.runEvent("AfterSwitchInSelf", pokemon);
|
||||
}
|
||||
if (!pokemon.hp)
|
||||
return false;
|
||||
pokemon.isStarted = true;
|
||||
if (!pokemon.fainted) {
|
||||
this.battle.singleEvent("Start", pokemon.getAbility(), pokemon.abilityState, pokemon);
|
||||
let status;
|
||||
if (pokemon.m.startVolatile && pokemon.m.innate) {
|
||||
status = this.battle.dex.conditions.get(pokemon.m.innate);
|
||||
this.battle.singleEvent("Start", status, pokemon.volatiles[status.id], pokemon);
|
||||
pokemon.m.startVolatile = false;
|
||||
}
|
||||
if (ally && ally.m.startVolatile && ally.m.innate) {
|
||||
status = this.battle.dex.conditions.get(ally.m.innate);
|
||||
this.battle.singleEvent("Start", status, ally.volatiles[status.id], ally);
|
||||
ally.m.startVolatile = false;
|
||||
}
|
||||
this.battle.singleEvent("Start", pokemon.getItem(), pokemon.itemState, pokemon);
|
||||
}
|
||||
if (this.battle.gen === 4) {
|
||||
for (const foeActive of pokemon.foes()) {
|
||||
foeActive.removeVolatile("substitutebroken");
|
||||
}
|
||||
}
|
||||
pokemon.draggedIn = null;
|
||||
return true;
|
||||
}
|
||||
},
|
||||
pokemon: {
|
||||
setAbility(ability, source, isFromFormeChange) {
|
||||
if (!this.hp)
|
||||
return false;
|
||||
const BAD_ABILITIES = ["trace", "imposter", "neutralizinggas", "illusion", "wanderingspirit"];
|
||||
if (typeof ability === "string")
|
||||
ability = this.battle.dex.abilities.get(ability);
|
||||
const oldAbility = this.ability;
|
||||
if (!isFromFormeChange) {
|
||||
if (ability.isPermanent || this.getAbility().isPermanent)
|
||||
return false;
|
||||
}
|
||||
if (!this.battle.runEvent("SetAbility", this, source, this.battle.effect, ability))
|
||||
return false;
|
||||
this.battle.singleEvent("End", this.battle.dex.abilities.get(oldAbility), this.abilityState, this, source);
|
||||
const ally = this.side.active.find((mon) => mon && mon !== this && !mon.fainted);
|
||||
if (ally?.m.innate) {
|
||||
ally.removeVolatile(ally.m.innate);
|
||||
delete ally.m.innate;
|
||||
}
|
||||
if (this.battle.effect && this.battle.effect.effectType === "Move" && !isFromFormeChange) {
|
||||
this.battle.add("-endability", this, this.battle.dex.abilities.get(oldAbility), "[from] move: " + this.battle.dex.moves.get(this.battle.effect.id));
|
||||
}
|
||||
this.ability = ability.id;
|
||||
this.abilityState = { id: ability.id, target: this };
|
||||
if (ability.id && this.battle.gen > 3) {
|
||||
this.battle.singleEvent("Start", ability, this.abilityState, this, source);
|
||||
if (ally && ally.ability !== this.ability) {
|
||||
if (!this.m.innate) {
|
||||
this.m.innate = "ability:" + ally.getAbility().id;
|
||||
this.addVolatile(this.m.innate);
|
||||
}
|
||||
if (!BAD_ABILITIES.includes(ability.id)) {
|
||||
ally.m.innate = "ability:" + ability.id;
|
||||
ally.addVolatile(ally.m.innate);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.m.innate && this.m.innate.endsWith(ability.id)) {
|
||||
this.removeVolatile(this.m.innate);
|
||||
delete this.m.innate;
|
||||
}
|
||||
this.abilityOrder = this.battle.abilityOrder++;
|
||||
return oldAbility;
|
||||
},
|
||||
hasAbility(ability) {
|
||||
if (this.ignoringAbility())
|
||||
return false;
|
||||
const ownAbility = this.ability;
|
||||
const ally = this.side.active.find((mon) => mon && mon !== this && !mon.fainted);
|
||||
const allyAbility = ally ? ally.ability : "";
|
||||
if (!Array.isArray(ability)) {
|
||||
if (ownAbility === this.battle.toID(ability) || allyAbility === this.battle.toID(ability))
|
||||
return true;
|
||||
} else {
|
||||
if (ability.map(this.battle.toID).includes(ownAbility) || ability.map(this.battle.toID).includes(allyAbility)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
transformInto(pokemon, effect) {
|
||||
const species = pokemon.species;
|
||||
if (pokemon.fainted || pokemon.illusion || pokemon.volatiles["substitute"] && this.battle.gen >= 5 || pokemon.transformed && this.battle.gen >= 2 || this.transformed && this.battle.gen >= 5 || species.name === "Eternatus-Eternamax") {
|
||||
return false;
|
||||
}
|
||||
if (this.battle.dex.currentMod === "gen1stadium" && (species.name === "Ditto" || this.species.name === "Ditto" && pokemon.moves.includes("transform"))) {
|
||||
return false;
|
||||
}
|
||||
if (!this.setSpecies(species, effect, true))
|
||||
return false;
|
||||
this.transformed = true;
|
||||
this.weighthg = pokemon.weighthg;
|
||||
const types = pokemon.getTypes(true);
|
||||
this.setType(pokemon.volatiles["roost"] ? pokemon.volatiles["roost"].typeWas : types, true);
|
||||
this.addedType = pokemon.addedType;
|
||||
this.knownType = this.isAlly(pokemon) && pokemon.knownType;
|
||||
this.apparentType = pokemon.apparentType;
|
||||
let statName;
|
||||
for (statName in this.storedStats) {
|
||||
this.storedStats[statName] = pokemon.storedStats[statName];
|
||||
if (this.modifiedStats)
|
||||
this.modifiedStats[statName] = pokemon.modifiedStats[statName];
|
||||
}
|
||||
this.moveSlots = [];
|
||||
this.set.ivs = this.battle.gen >= 5 ? this.set.ivs : pokemon.set.ivs;
|
||||
this.hpType = this.battle.gen >= 5 ? this.hpType : pokemon.hpType;
|
||||
this.hpPower = this.battle.gen >= 5 ? this.hpPower : pokemon.hpPower;
|
||||
for (const moveSlot of pokemon.moveSlots) {
|
||||
let moveName = moveSlot.move;
|
||||
if (!pokemon.m.curMoves.includes(moveSlot.id))
|
||||
continue;
|
||||
if (moveSlot.id === "hiddenpower") {
|
||||
moveName = "Hidden Power " + this.hpType;
|
||||
}
|
||||
this.moveSlots.push({
|
||||
move: moveName,
|
||||
id: moveSlot.id,
|
||||
pp: moveSlot.maxpp === 1 ? 1 : 5,
|
||||
maxpp: this.battle.gen >= 5 ? moveSlot.maxpp === 1 ? 1 : 5 : moveSlot.maxpp,
|
||||
target: moveSlot.target,
|
||||
disabled: false,
|
||||
used: false,
|
||||
virtual: true
|
||||
});
|
||||
}
|
||||
this.m.curMoves = pokemon.m.curMoves;
|
||||
let boostName;
|
||||
for (boostName in pokemon.boosts) {
|
||||
this.boosts[boostName] = pokemon.boosts[boostName];
|
||||
}
|
||||
if (this.battle.gen >= 6) {
|
||||
const volatilesToCopy = ["focusenergy", "gmaxchistrike", "laserfocus"];
|
||||
for (const volatile of volatilesToCopy) {
|
||||
if (pokemon.volatiles[volatile]) {
|
||||
this.addVolatile(volatile);
|
||||
if (volatile === "gmaxchistrike")
|
||||
this.volatiles[volatile].layers = pokemon.volatiles[volatile].layers;
|
||||
} else {
|
||||
this.removeVolatile(volatile);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (effect) {
|
||||
this.battle.add("-transform", this, pokemon, "[from] " + effect.fullname);
|
||||
} else {
|
||||
this.battle.add("-transform", this, pokemon);
|
||||
}
|
||||
if (this.battle.gen > 2)
|
||||
this.setAbility(pokemon.ability, this, true);
|
||||
if (this.battle.gen === 4) {
|
||||
if (this.species.num === 487) {
|
||||
if (this.species.name === "Giratina" && this.item === "griseousorb") {
|
||||
this.formeChange("Giratina-Origin");
|
||||
} else if (this.species.name === "Giratina-Origin" && this.item !== "griseousorb") {
|
||||
this.formeChange("Giratina");
|
||||
}
|
||||
}
|
||||
if (this.species.num === 493) {
|
||||
const item = this.getItem();
|
||||
const targetForme = item?.onPlate ? "Arceus-" + item.onPlate : "Arceus";
|
||||
if (this.species.name !== targetForme) {
|
||||
this.formeChange(targetForme);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
deductPP(move, amount, target) {
|
||||
const gen = this.battle.gen;
|
||||
move = this.battle.dex.moves.get(move);
|
||||
const ppData = this.getMoveData(move);
|
||||
if (!ppData)
|
||||
return 0;
|
||||
ppData.used = true;
|
||||
if (!ppData.pp && gen > 1)
|
||||
return 0;
|
||||
if (!amount)
|
||||
amount = 1;
|
||||
ppData.pp -= amount;
|
||||
if (ppData.pp < 0 && gen > 1) {
|
||||
amount += ppData.pp;
|
||||
ppData.pp = 0;
|
||||
}
|
||||
if (!this.m.curMoves.includes(move.id)) {
|
||||
this.m.trackPP.set(move.id, (this.m.trackPP.get(move.id) || 0) + amount);
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=scripts.js.map
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../../../../data/mods/partnersincrime/scripts.ts"],
|
||||
"sourcesContent": ["export const Scripts: ModdedBattleScriptsData = {\r\n\tgen: 9,\r\n\tinherit: 'gen9',\r\n\tnextTurn() {\r\n\t\tthis.turn++;\r\n\t\tthis.lastSuccessfulMoveThisTurn = null;\r\n\r\n\t\t// Partners in Crime moveSlot updating\r\n\t\t// Must be highest priority so imprison doesn't lag behind.\r\n\t\tfor (const side of this.sides) {\r\n\t\t\tfor (const pokemon of side.active) {\r\n\t\t\t\tpokemon.moveSlots = pokemon.moveSlots.filter(move => pokemon.m.curMoves.includes(move.id));\r\n\t\t\t\tpokemon.m.curMoves = this.dex.deepClone(pokemon.moves);\r\n\t\t\t\tconst ally = side.active.find(mon => mon && mon !== pokemon && !mon.fainted);\r\n\t\t\t\tlet allyMoves = ally ? this.dex.deepClone(ally.moveSlots) : [];\r\n\t\t\t\tif (ally) {\r\n\t\t\t\t\t// @ts-ignore\r\n\t\t\t\t\tallyMoves = allyMoves.filter(move => !pokemon.moves.includes(move.id) && ally.m.curMoves.includes(move.id));\r\n\t\t\t\t\tfor (const aMove of allyMoves) {\r\n\t\t\t\t\t\taMove.pp = this.clampIntRange(aMove.maxpp - (pokemon.m.trackPP.get(aMove.id) || 0), 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tpokemon.moveSlots = pokemon.moveSlots.concat(allyMoves);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst dynamaxEnding: Pokemon[] = [];\r\n\t\tfor (const pokemon of this.getAllActive()) {\r\n\t\t\tif (pokemon.volatiles['dynamax']?.turns === 3) {\r\n\t\t\t\tdynamaxEnding.push(pokemon);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (dynamaxEnding.length > 1) {\r\n\t\t\tthis.updateSpeed();\r\n\t\t\tthis.speedSort(dynamaxEnding);\r\n\t\t}\r\n\t\tfor (const pokemon of dynamaxEnding) {\r\n\t\t\tpokemon.removeVolatile('dynamax');\r\n\t\t}\r\n\r\n\t\t// Gen 1 partial trapping ends when either Pokemon or a switch in faints to residual damage\r\n\t\tif (this.gen === 1) {\r\n\t\t\tfor (const pokemon of this.getAllActive()) {\r\n\t\t\t\tif (pokemon.volatiles['partialtrappinglock']) {\r\n\t\t\t\t\tconst target = pokemon.volatiles['partialtrappinglock'].locked;\r\n\t\t\t\t\tif (target.hp <= 0 || !target.volatiles['partiallytrapped']) {\r\n\t\t\t\t\t\tdelete pokemon.volatiles['partialtrappinglock'];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (pokemon.volatiles['partiallytrapped']) {\r\n\t\t\t\t\tconst source = pokemon.volatiles['partiallytrapped'].source;\r\n\t\t\t\t\tif (source.hp <= 0 || !source.volatiles['partialtrappinglock']) {\r\n\t\t\t\t\t\tdelete pokemon.volatiles['partiallytrapped'];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst trappedBySide: boolean[] = [];\r\n\t\tconst stalenessBySide: ('internal' | 'external' | undefined)[] = [];\r\n\t\tfor (const side of this.sides) {\r\n\t\t\tlet sideTrapped = true;\r\n\t\t\tlet sideStaleness: 'internal' | 'external' | undefined;\r\n\t\t\tfor (const pokemon of side.active) {\r\n\t\t\t\tif (!pokemon) continue;\r\n\t\t\t\tpokemon.moveThisTurn = '';\r\n\t\t\t\tpokemon.newlySwitched = false;\r\n\t\t\t\tpokemon.moveLastTurnResult = pokemon.moveThisTurnResult;\r\n\t\t\t\tpokemon.moveThisTurnResult = undefined;\r\n\t\t\t\tif (this.turn !== 1) {\r\n\t\t\t\t\tpokemon.usedItemThisTurn = false;\r\n\t\t\t\t\tpokemon.statsRaisedThisTurn = false;\r\n\t\t\t\t\tpokemon.statsLoweredThisTurn = false;\r\n\t\t\t\t\t// It shouldn't be possible in a normal battle for a Pokemon to be damaged before turn 1's move selection\r\n\t\t\t\t\t// However, this could be potentially relevant in certain OMs\r\n\t\t\t\t\tpokemon.hurtThisTurn = null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tpokemon.maybeDisabled = false;\r\n\t\t\t\tfor (const moveSlot of pokemon.moveSlots) {\r\n\t\t\t\t\tmoveSlot.disabled = false;\r\n\t\t\t\t\tmoveSlot.disabledSource = '';\r\n\t\t\t\t}\r\n\t\t\t\tthis.runEvent('DisableMove', pokemon);\r\n\t\t\t\tfor (const moveSlot of pokemon.moveSlots) {\r\n\t\t\t\t\tthis.singleEvent('DisableMove', this.dex.getActiveMove(moveSlot.id), null, pokemon);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If it was an illusion, it's not any more\r\n\t\t\t\tif (pokemon.getLastAttackedBy() && this.gen >= 7) pokemon.knownType = true;\r\n\r\n\t\t\t\tfor (let i = pokemon.attackedBy.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tconst attack = pokemon.attackedBy[i];\r\n\t\t\t\t\tif (attack.source.isActive) {\r\n\t\t\t\t\t\tattack.thisTurn = false;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpokemon.attackedBy.splice(pokemon.attackedBy.indexOf(attack), 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.gen >= 7) {\r\n\t\t\t\t\t// In Gen 7, the real type of every Pokemon is visible to all players via the bottom screen while making choices\r\n\t\t\t\t\tconst seenPokemon = pokemon.illusion || pokemon;\r\n\t\t\t\t\tconst realTypeString = seenPokemon.getTypes(true).join('/');\r\n\t\t\t\t\tif (realTypeString !== seenPokemon.apparentType) {\r\n\t\t\t\t\t\tthis.add('-start', pokemon, 'typechange', realTypeString, '[silent]');\r\n\t\t\t\t\t\tseenPokemon.apparentType = realTypeString;\r\n\t\t\t\t\t\tif (pokemon.addedType) {\r\n\t\t\t\t\t\t\t// The typechange message removes the added type, so put it back\r\n\t\t\t\t\t\t\tthis.add('-start', pokemon, 'typeadd', pokemon.addedType, '[silent]');\r\n\Line truncated
|
||||
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,UAAmC;AAAA,EAC/C,KAAK;AAAA,EACL,SAAS;AAAA,EACT,WAAW;AACV,SAAK;AACL,SAAK,6BAA6B;AAIlC,eAAW,QAAQ,KAAK,OAAO;AAC9B,iBAAW,WAAW,KAAK,QAAQ;AAClC,gBAAQ,YAAY,QAAQ,UAAU,OAAO,UAAQ,QAAQ,EAAE,SAAS,SAAS,KAAK,EAAE,CAAC;AACzF,gBAAQ,EAAE,WAAW,KAAK,IAAI,UAAU,QAAQ,KAAK;AACrD,cAAM,OAAO,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