Skip to content

Commit

Permalink
Change October 2023 OMotM to Convergence
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisXV committed Oct 3, 2023
1 parent 2c79279 commit 65744c2
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 64 deletions.
127 changes: 64 additions & 63 deletions config/formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -763,55 +763,23 @@ export const Formats: FormatList = [
column: 2,
},
{
name: "[Gen 9] Sharing is Caring",
desc: `All Pokémon on a team share their items.`,
name: "[Gen 9] Convergence",
desc: `Allows all Pokémon that have identical types to share moves and abilities.`,
threads: [
`&bullet; <a href="https://www.smogon.com/forums/threads/3727118/">Sharing is Caring</a>`,
`&bullet; <a href="https://www.smogon.com/forums/threads/3714048/">Convergence</a>`,
],

mod: 'sharingiscaring',
ruleset: ['Standard OMs', 'Evasion Items Clause', 'Sleep Moves Clause', 'Min Source Gen = 9'],
mod: 'gen9',
// searchShow: false,
ruleset: ['Standard OMs', 'Sleep Clause Mod', 'Convergence Legality', '!Obtainable Abilities', 'Min Source Gen = 9'],
banlist: [
'Arceus', 'Calyrex-Ice', 'Calyrex-Shadow', 'Chi-Yu', 'Darkrai', 'Dialga', 'Dialga-Origin', 'Espathra', 'Eternatus', 'Flutter Mane', 'Giratina',
'Giratina-Origin', 'Groudon', 'Iron Bundle', 'Koraidon', 'Kyogre', 'Landorus-Base', 'Magearna', 'Mewtwo', 'Miraidon', 'Palafin', 'Palkia',
'Palkia-Origin', 'Rayquaza', 'Regieleki', 'Shaymin-Sky', 'Spectrier', 'Urshifu-Base', 'Zacian', 'Zacian-Crowned', 'Zamazenta', 'Zamazenta-Crowned',
'Arena Trap', 'Moody', 'Shadow Tag', 'Choice Scarf', 'Focus Band', 'Focus Sash', 'King\'s Rock', 'Quick Claw', 'Razor Fang', 'Baton Pass',
'Last Respects', 'Revival Blessing', 'Shed Tail',
'Arceus', 'Calyrex-Ice', 'Calyrex-Shadow', 'Chi-Yu', 'Chien-Pao', 'Darkrai', 'Dialga', 'Dialga-Origin', 'Dondozo', 'Eternatus', 'Flutter Mane',
'Giratina', 'Giratina-Origin', 'Groudon', 'Inteleon', 'Iron Bundle', 'Iron Hands', 'Koraidon', 'Kyogre', 'Landorus-Base', 'Magearna', 'Manaphy',
'Mewtwo', 'Miraidon', 'Palafin', 'Palkia', 'Palkia-Origin', 'Rayquaza', 'Regieleki', 'Shaymin-Sky', 'Slaking', 'Spectrier', 'Urshifu-Base',
'Zacian', 'Zacian-Crowned', 'Zamazenta', 'Zamazenta-Crowned', 'Arena Trap', 'Comatose', 'Imposter', 'Moody', 'Pure Power', 'Shadow Tag',
'Speed Boost', 'Damp Rock', 'King\'s Rock', 'Razor Fang', 'Baton Pass', 'Extreme Speed', 'Last Respects', 'Quiver Dance', 'Rage Fist', 'Shed Tail',
'Shell Smash', 'Spore', 'Transform',
],
onValidateRule() {
if (this.format.gameType !== 'singles') {
throw new Error(`Sharing is Caring currently does not support ${this.format.gameType} battles.`);
}
},
getSharedItems(pokemon) {
const items = new Set<string>();
for (const ally of pokemon.side.pokemon) {
if (!ally.item) continue;
items.add(ally.item);
}
items.delete(pokemon.item);
return items;
},
onBeforeSwitchIn(pokemon) {
let format = this.format;
if (!format.getSharedItems) format = this.dex.formats.get('gen9sharingiscaring');
for (const item of format.getSharedItems!(pokemon)) {
const effect = 'item:' + item;
pokemon.volatiles[effect] = {id: this.toID(effect), target: pokemon};
if (!pokemon.m.items) pokemon.m.items = [];
if (!pokemon.m.items.includes(effect)) pokemon.m.items.push(effect);
}
},
onSwitchInPriority: 2,
onSwitchIn(pokemon) {
let format = this.format;
if (!format.getSharedItems) format = this.dex.formats.get('gen9sharingiscaring');
for (const item of format.getSharedItems!(pokemon)) {
const effect = 'item:' + item;
delete pokemon.volatiles[effect];
pokemon.addVolatile(effect);
}
},
},
{
name: "[Gen 9] Godly Gift",
Expand Down Expand Up @@ -1261,25 +1229,6 @@ export const Formats: FormatList = [
'Razor Fang', 'Baton Pass', 'Last Respects', 'Shed Tail',
],
},
{
name: "[Gen 9] Convergence",
desc: `Allows all Pok&eacute;mon that have identical types to share moves and abilities.`,
threads: [
`&bullet; <a href="https://www.smogon.com/forums/threads/3714048/">Convergence</a>`,
],

mod: 'gen9',
searchShow: false,
ruleset: ['Standard OMs', 'Sleep Clause Mod', 'Convergence Legality', '!Obtainable Abilities', 'Min Source Gen = 9'],
banlist: [
'Arceus', 'Calyrex-Ice', 'Calyrex-Shadow', 'Chi-Yu', 'Chien-Pao', 'Darkrai', 'Dialga', 'Dialga-Origin', 'Dondozo', 'Eternatus', 'Flutter Mane',
'Giratina', 'Giratina-Origin', 'Groudon', 'Inteleon', 'Iron Bundle', 'Iron Hands', 'Koraidon', 'Kyogre', 'Landorus-Base', 'Magearna', 'Manaphy',
'Mewtwo', 'Miraidon', 'Palafin', 'Palkia', 'Palkia-Origin', 'Rayquaza', 'Regieleki', 'Shaymin-Sky', 'Slaking', 'Spectrier', 'Urshifu-Base',
'Zacian', 'Zacian-Crowned', 'Zamazenta', 'Zamazenta-Crowned', 'Arena Trap', 'Comatose', 'Imposter', 'Moody', 'Pure Power', 'Shadow Tag',
'Speed Boost', 'Damp Rock', 'King\'s Rock', 'Razor Fang', 'Baton Pass', 'Extreme Speed', 'Last Respects', 'Quiver Dance', 'Rage Fist', 'Shed Tail',
'Shell Smash', 'Spore', 'Transform',
],
},
{
name: "[Gen 9] Cross Evolution",
desc: `Give a Pok&eacute;mon a Pok&eacute;mon name of the next evolution stage as a nickname to inherit stat changes, typing, abilities, and moves from the next stage Pok&eacute;mon.`,
Expand Down Expand Up @@ -1811,6 +1760,58 @@ export const Formats: FormatList = [
}
},
},
{
name: "[Gen 9] Sharing is Caring",
desc: `All Pok&eacute;mon on a team share their items.`,
threads: [
`&bullet; <a href="https://www.smogon.com/forums/threads/3727118/">Sharing is Caring</a>`,
],

mod: 'sharingiscaring',
searchShow: false,
ruleset: ['Standard OMs', 'Evasion Items Clause', 'Sleep Moves Clause', 'Min Source Gen = 9'],
banlist: [
'Arceus', 'Calyrex-Ice', 'Calyrex-Shadow', 'Chi-Yu', 'Chien-Pao', 'Darkrai', 'Dialga', 'Dialga-Origin', 'Espathra', 'Eternatus', 'Flutter Mane',
'Giratina', 'Giratina-Origin', 'Groudon', 'Iron Bundle', 'Koraidon', 'Kyogre', 'Landorus-Base', 'Magearna', 'Mewtwo', 'Miraidon', 'Palafin', 'Palkia',
'Palkia-Origin', 'Rayquaza', 'Regieleki', 'Shaymin-Sky', 'Spectrier', 'Urshifu-Base', 'Zacian', 'Zacian-Crowned', 'Zamazenta', 'Zamazenta-Crowned',
'Arena Trap', 'Moody', 'Shadow Tag', 'Choice Scarf', 'Focus Band', 'Focus Sash', 'King\'s Rock', 'Quick Claw', 'Razor Fang', 'Baton Pass',
'Last Respects', 'Revival Blessing', 'Shed Tail',
],
onValidateRule() {
if (this.format.gameType !== 'singles') {
throw new Error(`Sharing is Caring currently does not support ${this.format.gameType} battles.`);
}
},
getSharedItems(pokemon) {
const items = new Set<string>();
for (const ally of pokemon.side.pokemon) {
if (!ally.item) continue;
items.add(ally.item);
}
items.delete(pokemon.item);
return items;
},
onBeforeSwitchIn(pokemon) {
let format = this.format;
if (!format.getSharedItems) format = this.dex.formats.get('gen9sharingiscaring');
for (const item of format.getSharedItems!(pokemon)) {
const effect = 'item:' + item;
pokemon.volatiles[effect] = {id: this.toID(effect), target: pokemon};
if (!pokemon.m.items) pokemon.m.items = [];
if (!pokemon.m.items.includes(effect)) pokemon.m.items.push(effect);
}
},
onSwitchInPriority: 2,
onSwitchIn(pokemon) {
let format = this.format;
if (!format.getSharedItems) format = this.dex.formats.get('gen9sharingiscaring');
for (const item of format.getSharedItems!(pokemon)) {
const effect = 'item:' + item;
delete pokemon.volatiles[effect];
pokemon.addVolatile(effect);
}
},
},
{
name: "[Gen 9] Tera Donation",
desc: `The first Pok&eacute;mon sent out immediately terastallizes. The other Pok&eacute;mon in the party inherit that Tera Type as an additional type.`,
Expand Down
2 changes: 1 addition & 1 deletion data/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const Aliases: {[alias: string]: string} = {
gen6ag: "[Gen 6] Anything Goes",
crossevo: "[Gen 9] Cross Evolution",
mayhem: "[Gen 9] Random Battle Mayhem",
omotm: "[Gen 9] Sharing is Caring",
omotm: "[Gen 9] Convergence",
lcotm: "[Gen 9] Godly Gift",

// mega evos
Expand Down
44 changes: 44 additions & 0 deletions data/mods/sharingiscaring/conditions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
export const Conditions: {[k: string]: ModdedConditionData} = {
choicelock: {
inherit: true,
onBeforeMove(pokemon, target, move) {
const choiceItem = pokemon.getItem().isChoice ||
Object.keys(pokemon.volatiles).some(v => (
v.startsWith('item:') && this.dex.items.get(v.split(':')[1]).isChoice
));
if (!choiceItem) {
pokemon.removeVolatile('choicelock');
return;
}
if (
!pokemon.ignoringItem() && !pokemon.volatiles['dynamax'] &&
move.id !== this.effectState.move && move.id !== 'struggle'
) {
// Fails unless the Choice item is being ignored, and no PP is lost
this.addMove('move', pokemon, move.name);
this.attrLastMove('[still]');
this.debug("Disabled by Choice item lock");
this.add('-fail', pokemon);
return false;
}
},
onDisableMove(pokemon) {
const choiceItem = pokemon.getItem().isChoice ||
Object.keys(pokemon.volatiles).some(v => (
v.startsWith('item:') && this.dex.items.get(v.split(':')[1]).isChoice
));
if (!choiceItem || !pokemon.hasMove(this.effectState.move)) {
pokemon.removeVolatile('choicelock');
return;
}
if (pokemon.ignoringItem() || pokemon.volatiles['dynamax']) {
return;
}
for (const moveSlot of pokemon.moveSlots) {
if (moveSlot.id !== this.effectState.move) {
pokemon.disableMove(moveSlot.id, false, this.effectState.sourceEffect);
}
}
},
},
};
14 changes: 14 additions & 0 deletions data/mods/sharingiscaring/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ export const Scripts: ModdedBattleScriptsData = {
gen: 9,
inherit: 'gen9',
pokemon: {
isGrounded(negateImmunity) {
if ('gravity' in this.battle.field.pseudoWeather) return true;
if ('ingrain' in this.volatiles && this.battle.gen >= 4) return true;
if ('smackdown' in this.volatiles) return true;
const item = (this.ignoringItem() ? '' : this.item);
if (item === 'ironball' || this.volatiles['item:ironball']) return true;
// If a Fire/Flying type uses Burn Up and Roost, it becomes ???/Flying-type, but it's still grounded.
if (!negateImmunity && this.hasType('Flying') && !(this.hasType('???') && 'roost' in this.volatiles)) return false;
if (this.hasAbility('levitate') && !this.battle.suppressingAbility(this)) return null;
if ('magnetrise' in this.volatiles) return false;
if ('telekinesis' in this.volatiles) return false;
if (item === 'airballoon' || this.volatiles['item:airballoon']) return false;
return true;
},
hasItem(item) {
if (this.ignoringItem()) return false;
if (Array.isArray(item)) return item.some(i => this.hasItem(i));
Expand Down

0 comments on commit 65744c2

Please sign in to comment.