diff --git a/config/formats.ts b/config/formats.ts index 77c9497176f7..58a0cf0f7127 100644 --- a/config/formats.ts +++ b/config/formats.ts @@ -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: [ - `• Sharing is Caring`, + `• Convergence`, ], - 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(); - 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", @@ -1261,25 +1229,6 @@ export const Formats: FormatList = [ 'Razor Fang', 'Baton Pass', 'Last Respects', 'Shed Tail', ], }, - { - name: "[Gen 9] Convergence", - desc: `Allows all Pokémon that have identical types to share moves and abilities.`, - threads: [ - `• Convergence`, - ], - - 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émon a Pokémon name of the next evolution stage as a nickname to inherit stat changes, typing, abilities, and moves from the next stage Pokémon.`, @@ -1811,6 +1760,58 @@ export const Formats: FormatList = [ } }, }, + { + name: "[Gen 9] Sharing is Caring", + desc: `All Pokémon on a team share their items.`, + threads: [ + `• Sharing is Caring`, + ], + + 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(); + 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émon sent out immediately terastallizes. The other Pokémon in the party inherit that Tera Type as an additional type.`, diff --git a/data/aliases.ts b/data/aliases.ts index d642e6128b66..d3a71b5ea3bf 100644 --- a/data/aliases.ts +++ b/data/aliases.ts @@ -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 diff --git a/data/mods/sharingiscaring/conditions.ts b/data/mods/sharingiscaring/conditions.ts new file mode 100644 index 000000000000..555778b6ea54 --- /dev/null +++ b/data/mods/sharingiscaring/conditions.ts @@ -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); + } + } + }, + }, +}; diff --git a/data/mods/sharingiscaring/scripts.ts b/data/mods/sharingiscaring/scripts.ts index 185db242adcc..62fe0283c132 100644 --- a/data/mods/sharingiscaring/scripts.ts +++ b/data/mods/sharingiscaring/scripts.ts @@ -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));