Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivaD173 committed Dec 15, 2024
2 parents 0c428dd + e717e55 commit ffbf4f2
Show file tree
Hide file tree
Showing 12 changed files with 167 additions and 134 deletions.
45 changes: 17 additions & 28 deletions config/formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1001,20 +1001,18 @@ export const Formats: import('../sim/dex-formats').FormatList = [
}
},
onSwitchIn(pokemon) {
// @ts-ignore
const originalFormeSecies = this.dex.species.get(pokemon.species.originalSpecies);
if (originalFormeSecies.exists && pokemon.m.originalSpecies !== originalFormeSecies.baseSpecies) {
const originalFormeSpecies = this.dex.species.get((pokemon.species as any).originalSpecies);
if (originalFormeSpecies.exists && pokemon.m.originalSpecies !== originalFormeSpecies.baseSpecies) {
// Place volatiles on the Pokémon to show its mega-evolved condition and details
this.add('-start', pokemon, originalFormeSecies.requiredItem || originalFormeSecies.requiredMove, '[silent]');
this.add('-start', pokemon, originalFormeSpecies.requiredItem || originalFormeSpecies.requiredMove, '[silent]');
const oSpecies = this.dex.species.get(pokemon.m.originalSpecies);
if (oSpecies.types.length !== pokemon.species.types.length || oSpecies.types[1] !== pokemon.species.types[1]) {
this.add('-start', pokemon, 'typechange', pokemon.species.types.join('/'), '[silent]');
}
}
},
onSwitchOut(pokemon) {
// @ts-ignore
const oMegaSpecies = this.dex.species.get(pokemon.species.originalSpecies);
const oMegaSpecies = this.dex.species.get((pokemon.species as any).originalSpecies);
if (oMegaSpecies.exists && pokemon.m.originalSpecies !== oMegaSpecies.baseSpecies) {
this.add('-end', pokemon, oMegaSpecies.requiredItem || oMegaSpecies.requiredMove, '[silent]');
}
Expand Down Expand Up @@ -1255,8 +1253,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [
if (pokemon.pokeball.includes('0')) {
const donor = pokemon.pokeball.split('0')[1];
pokemon.m.donor = this.toID(donor);
// @ts-ignore
pokemon.pokeball = this.toID(pokemon.pokeball.split('0')[0]);
(pokemon as any).pokeball = this.toID(pokemon.pokeball.split('0')[0]);
}
}
},
Expand Down Expand Up @@ -1317,20 +1314,18 @@ export const Formats: import('../sim/dex-formats').FormatList = [
}
},
onSwitchIn(pokemon) {
// @ts-ignore
const originalFormeSecies = this.dex.species.get(pokemon.species.originalSpecies);
if (originalFormeSecies.exists && pokemon.m.originalSpecies !== originalFormeSecies.baseSpecies) {
const originalFormeSpecies = this.dex.species.get((pokemon.species as any).originalSpecies);
if (originalFormeSpecies.exists && pokemon.m.originalSpecies !== originalFormeSpecies.baseSpecies) {
// Place volatiles on the Pokémon to show its mega-evolved condition and details
this.add('-start', pokemon, originalFormeSecies.requiredItem || originalFormeSecies.requiredMove, '[silent]');
this.add('-start', pokemon, originalFormeSpecies.requiredItem || originalFormeSpecies.requiredMove, '[silent]');
const oSpecies = this.dex.species.get(pokemon.m.originalSpecies);
if (oSpecies.types.length !== pokemon.species.types.length || oSpecies.types[1] !== pokemon.species.types[1]) {
this.add('-start', pokemon, 'typechange', pokemon.species.types.join('/'), '[silent]');
}
}
},
onSwitchOut(pokemon) {
// @ts-ignore
const oMegaSpecies = this.dex.species.get(pokemon.species.originalSpecies);
const oMegaSpecies = this.dex.species.get((pokemon.species as any).originalSpecies);
if (oMegaSpecies.exists && pokemon.m.originalSpecies !== oMegaSpecies.baseSpecies) {
this.add('-end', pokemon, oMegaSpecies.requiredItem || oMegaSpecies.requiredMove, '[silent]');
}
Expand Down Expand Up @@ -1586,15 +1581,12 @@ export const Formats: import('../sim/dex-formats').FormatList = [
}
},
checkCanLearn(move, species, lsetData, set) {
// @ts-ignore
if (!set.sp?.exists || !set.crossSpecies?.exists) {
if (!(set as any).sp?.exists || !(set as any).crossSpecies?.exists) {
return this.checkCanLearn(move, species, lsetData, set);
}
// @ts-ignore
const problem = this.checkCanLearn(move, set.sp);
const problem = this.checkCanLearn(move, (set as any).sp);
if (!problem) return null;
// @ts-ignore
if (this.checkCanLearn(move, set.crossSpecies)) return problem;
if (this.checkCanLearn(move, (set as any).crossSpecies)) return problem;
return null;
},
validateSet(set, teamHas) {
Expand Down Expand Up @@ -1637,10 +1629,8 @@ export const Formats: import('../sim/dex-formats').FormatList = [
set.species = crossSpecies.name;
}

// @ts-ignore
set.sp = species;
// @ts-ignore
set.crossSpecies = crossSpecies;
(set as any).sp = species;
(set as any).crossSpecies = crossSpecies;
problems = this.validateSet(set, teamHas);
set.name = crossSpecies.name;
set.species = species.name;
Expand Down Expand Up @@ -2748,10 +2738,9 @@ export const Formats: import('../sim/dex-formats').FormatList = [
'Battle Bond', 'Moody', 'Shadow Tag', 'Berserk Gene', 'King\'s Rock', 'Quick Claw', 'Razor Fang', 'Acupressure', 'Last Respects',
],
unbanlist: [
'Appletun', 'Aurorus', 'Avalugg-Base', 'Banette-Base', 'Cacturne', 'Celebi', 'Cetitan', 'Chandelure', 'Cryogonal', 'Dipplin', 'Garbodor',
'Golem-Alola', 'Guzzlord', 'Jolteon', 'Jumpluff', 'Lokix', 'Luvdisc', 'Magmortar', 'Mawile-Base', 'Milotic', 'Morpeko', 'Pachirisu',
'Perrserker', 'Primarina', 'Pupitar', 'Pyukumuku', 'Ribombee', 'Roserade', 'Rotom-Frost', 'Scovillain', 'Walrein', 'Wo-Chien', 'Wugtrio',
'Yanmega', 'Zoroark-Base',
'Appletun', 'Aurorus', 'Avalugg-Base', 'Banette-Base', 'Cacturne', 'Carracosta', 'Celebi', 'Cetitan', 'Chandelure', 'Cryogonal', 'Dipplin',
'Garbodor', 'Golem-Alola', 'Guzzlord', 'Jumpluff', 'Lokix', 'Luvdisc', 'Magmortar', 'Mawile-Base', 'Milotic', 'Morpeko', 'Pachirisu', 'Perrserker',
'Primarina', 'Pupitar', 'Pyukumuku', 'Ribombee', 'Roserade', 'Rotom-Frost', 'Scovillain', 'Walrein', 'Wo-Chien', 'Wugtrio', 'Yanmega', 'Zoroark-Base',
],
// Stupid hardcode
onValidateSet(set, format, setHas, teamHas) {
Expand Down
4 changes: 2 additions & 2 deletions data/mods/gen9ssb/abilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,13 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa
flags: {breakable: 1},
},

// Breadstycks
// Breadey
painfulexit: {
shortDesc: "When this Pokemon switches out, foes lose 25% HP.",
name: "Painful Exit",
onBeforeSwitchOutPriority: -1,
onBeforeSwitchOut(pokemon) {
this.add(`c:|${getName('Breadstycks')}|Just kidding!! Take this KNUCKLE SANDWICH`);
this.add(`c:|${getName('Breadey')}|Just kidding!! Take this KNUCKLE SANDWICH`);
for (const foe of pokemon.foes()) {
if (!foe || foe.fainted || !foe.hp) continue;
this.add(`-anim`, pokemon, "Tackle", foe);
Expand Down
14 changes: 7 additions & 7 deletions data/mods/gen9ssb/conditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,20 +476,20 @@ export const Conditions: {[id: IDEntry]: ModdedConditionData & {innateName?: str
this.add(`c:|${getName('Blitz')}|https://www.youtube.com/watch?v=lPGipwoJiOM`);
},
},
breadstycks: {
breadey: {
noCopy: true,
onStart(pokemon) {
this.add(`c:|${getName('Breadstycks')}|I loeuf you <3`);
this.add(`c:|${getName('Breadey')}|I loeuf you <3`);
},
// onSwitchOut implemented in ability instead
onFaint() {
this.add(`c:|${getName('Breadstycks')}|Oh, ma vie... c'est 'pitable'...`);
this.add(`c:|${getName('Breadey')}|Oh, ma vie... c'est 'pitable'...`);
},
onFoeFaint(target, source, effect) {
if (source === this.effectState.target && effect?.name === 'Painful Exit') {
this.add(`c:|${getName('Breadstycks')}|Ashes to ashes, crust to crust.`);
this.add(`c:|${getName('Breadey')}|Ashes to ashes, crust to crust.`);
} else {
this.add(`c:|${getName('Breadstycks')}|Ope, someone's swallowing fishes.`);
this.add(`c:|${getName('Breadey')}|Ope, someone's swallowing fishes.`);
}
},
innateName: "Well-Baked Body",
Expand Down Expand Up @@ -1731,7 +1731,7 @@ export const Conditions: {[id: IDEntry]: ModdedConditionData & {innateName?: str
case 'beowulf':
message = 'BEE';
break;
case 'breadstycks':
case 'breadey':
message = 'BREADBOWL';
break;
case 'clerica':
Expand Down Expand Up @@ -2041,7 +2041,7 @@ export const Conditions: {[id: IDEntry]: ModdedConditionData & {innateName?: str
onStart(pokemon) {
this.add(`c:|${getName('RSB')}|Time to take a bite out of crime!`);
const dog = (this.toID(enemyStaff(pokemon)));
if (dog === 'rsb' || dog === 'shiloh' || dog === 'valerian' || dog === 'breadstycks' || dog === 'yuki') {
if (dog === 'rsb' || dog === 'shiloh' || dog === 'valerian' || dog === 'breadey' || dog === 'yuki') {
this.add(`c:|${getName('RSB')}|DOGGO!`);
}
},
Expand Down
2 changes: 1 addition & 1 deletion data/mods/gen9ssb/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = {
type: "Water",
},

// Breadstycks
// Breadey
bakersdouzeoff: {
accuracy: true,
basePower: 0,
Expand Down
2 changes: 1 addition & 1 deletion data/mods/gen9ssb/pokedex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable
abilities: {0: "Blitz of Ruin"},
},

// Breadstycks
// Breadey
dachsbun: {
inherit: true,
abilities: {0: "Painful Exit"},
Expand Down
2 changes: 1 addition & 1 deletion data/mods/gen9ssb/random-teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export const ssbSets: SSBSets = {
signatureMove: 'Geyser Blast',
evs: {def: 4, spa: 252, spe: 252}, nature: 'Modest', teraType: 'Water', shiny: true,
},
Breadstycks: {
Breadey: {
species: 'Dachsbun', ability: 'Painful Exit', item: 'Leftovers', gender: '',
moves: ['Protect', 'Rest', 'Play Rough'],
signatureMove: 'Baker\'s Douze Off',
Expand Down
57 changes: 25 additions & 32 deletions data/mods/mixandmega/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ export const Scripts: ModdedBattleScriptsData = {
'adamantcrystal', 'griseouscore', 'lustrousglobe', 'wellspringmask',
'cornerstonemask', 'hearthflamemask', 'vilevial',
].includes(item.id) && item.forcedForme !== pokemon.species.name) {
// @ts-ignore
const rawSpecies = this.actions.getMixedSpecies(pokemon.m.originalSpecies, item.forcedForme!, pokemon);
const rawSpecies = (this.actions as any).getMixedSpecies(pokemon.m.originalSpecies, item.forcedForme!, pokemon);
const species = pokemon.setSpecies(rawSpecies);
if (!species) continue;
pokemon.baseSpecies = rawSpecies;
Expand Down Expand Up @@ -111,11 +110,9 @@ export const Scripts: ModdedBattleScriptsData = {
let rawSpecies: Species | null = null;
const item = pokemon.getItem();
if (item.id === 'rustedsword') {
// @ts-ignore
rawSpecies = this.actions.getMixedSpecies(pokemon.m.originalSpecies, 'Zacian-Crowned', pokemon);
rawSpecies = (this.actions as any).getMixedSpecies(pokemon.m.originalSpecies, 'Zacian-Crowned', pokemon);
} else if (item.id === 'rustedshield') {
// @ts-ignore
rawSpecies = this.actions.getMixedSpecies(pokemon.m.originalSpecies, 'Zamazenta-Crowned', pokemon);
rawSpecies = (this.actions as any).getMixedSpecies(pokemon.m.originalSpecies, 'Zamazenta-Crowned', pokemon);
}
if (!rawSpecies) continue;
const species = pokemon.setSpecies(rawSpecies);
Expand Down Expand Up @@ -411,22 +408,20 @@ export const Scripts: ModdedBattleScriptsData = {
runMegaEvo(pokemon) {
if (pokemon.species.isMega) return false;

// @ts-ignore
const species: Species = this.getMixedSpecies(pokemon.m.originalSpecies, pokemon.canMegaEvo, pokemon);
const species: Species = (this as any).getMixedSpecies(pokemon.m.originalSpecies, pokemon.canMegaEvo, pokemon);

// Do we have a proper sprite for it?
/* Do we have a proper sprite for it? Code for when megas actually exist
if (this.dex.species.get(pokemon.canMegaEvo!).baseSpecies === pokemon.m.originalSpecies) {
pokemon.formeChange(species, pokemon.getItem(), true);
} else {
const oSpecies = this.dex.species.get(pokemon.m.originalSpecies);
// @ts-ignore
const oMegaSpecies = this.dex.species.get(species.originalSpecies);
pokemon.formeChange(species, pokemon.getItem(), true);
this.battle.add('-start', pokemon, oMegaSpecies.requiredItem, '[silent]');
if (oSpecies.types.length !== pokemon.species.types.length || oSpecies.types[1] !== pokemon.species.types[1]) {
this.battle.add('-start', pokemon, 'typechange', pokemon.species.types.join('/'), '[silent]');
}
} else { */
const oSpecies = this.dex.species.get(pokemon.m.originalSpecies);
const oMegaSpecies = this.dex.species.get((species as any).originalSpecies);
pokemon.formeChange(species, pokemon.getItem(), true);
this.battle.add('-start', pokemon, oMegaSpecies.requiredItem, '[silent]');
if (oSpecies.types.length !== pokemon.species.types.length || oSpecies.types[1] !== pokemon.species.types[1]) {
this.battle.add('-start', pokemon, 'typechange', pokemon.species.types.join('/'), '[silent]');
}
// }

pokemon.canMegaEvo = null;
return true;
Expand Down Expand Up @@ -456,12 +451,10 @@ export const Scripts: ModdedBattleScriptsData = {
pokemon.formeChange(pokemon.species.id + tera, pokemon.getItem(), true);
} else {
if (pokemon.getItem().name.endsWith('Mask')) {
// @ts-ignore
const species: Species = this.getMixedSpecies(pokemon.m.originalSpecies,
const species: Species = (this as any).getMixedSpecies(pokemon.m.originalSpecies,
pokemon.getItem().forcedForme! + '-Tera', pokemon);
const oSpecies = this.dex.species.get(pokemon.m.originalSpecies);
// @ts-ignore
const originalTeraSpecies = this.dex.species.get(species.originalSpecies);
const originalTeraSpecies = this.dex.species.get((species as any).originalSpecies);
pokemon.formeChange(species, pokemon.getItem(), true);
this.battle.add('-start', pokemon, originalTeraSpecies.requiredItem, '[silent]');
if (oSpecies.types.length !== pokemon.species.types.length || oSpecies.types[1] !== pokemon.species.types[1]) {
Expand All @@ -477,11 +470,10 @@ export const Scripts: ModdedBattleScriptsData = {
getMixedSpecies(originalForme, megaForme, pokemon) {
const originalSpecies = this.dex.species.get(originalForme);
const megaSpecies = this.dex.species.get(megaForme);
if (originalSpecies.baseSpecies === megaSpecies.baseSpecies) return megaSpecies;
// @ts-ignore
const deltas = this.getFormeChangeDeltas(megaSpecies, pokemon);
// @ts-ignore
const species = this.mutateOriginalSpecies(originalSpecies, deltas);
// Uncomment if actual megas ever exist again
// if (originalSpecies.baseSpecies === megaSpecies.baseSpecies) return megaSpecies;
const deltas = (this as any).getFormeChangeDeltas(megaSpecies, pokemon);
const species = (this as any).mutateOriginalSpecies(originalSpecies, deltas);
return species;
},
getFormeChangeDeltas(formeChangeSpecies, pokemon) {
Expand All @@ -490,6 +482,7 @@ export const Scripts: ModdedBattleScriptsData = {
ability: string,
baseStats: SparseStatsTable,
weighthg: number,
heightm: number,
originalSpecies: string,
requiredItem: string | undefined,
type?: string,
Expand All @@ -498,6 +491,7 @@ export const Scripts: ModdedBattleScriptsData = {
ability: formeChangeSpecies.abilities['0'],
baseStats: {},
weighthg: formeChangeSpecies.weighthg - baseSpecies.weighthg,
heightm: ((formeChangeSpecies.heightm * 10) - (baseSpecies.heightm * 10)) / 10,
originalSpecies: formeChangeSpecies.name,
requiredItem: formeChangeSpecies.requiredItem,
};
Expand All @@ -508,7 +502,7 @@ export const Scripts: ModdedBattleScriptsData = {
if (formeChangeSpecies.types.length > baseSpecies.types.length) {
deltas.type = formeChangeSpecies.types[1];
} else if (formeChangeSpecies.types.length < baseSpecies.types.length) {
deltas.type = 'mono';
deltas.type = this.battle.ruleTable.has('mixandmegaoldaggronite') ? 'mono' : baseSpecies.types[0];
} else if (formeChangeSpecies.types[1] !== baseSpecies.types[1]) {
deltas.type = formeChangeSpecies.types[1];
}
Expand Down Expand Up @@ -539,12 +533,11 @@ export const Scripts: ModdedBattleScriptsData = {
baseStats[statName] = this.battle.clampIntRange(baseStats[statName] + deltas.baseStats[statName], 1, 255);
}
species.weighthg = Math.max(1, species.weighthg + deltas.weighthg);
species.heightm = Math.max(0.1, ((species.heightm * 10) + (deltas.heightm * 10)) / 10);
species.originalSpecies = deltas.originalSpecies;
species.requiredItem = deltas.requiredItem;
switch (deltas.formeType) {
case 'Mega': species.isMega = true; break;
case 'Primal': species.isPrimal = true; break;
}
if (deltas.formeType === 'Mega') species.isMega = true;
if (deltas.formeType === 'Primal') species.isPrimal = true;
return species;
},
},
Expand Down
Loading

0 comments on commit ffbf4f2

Please sign in to comment.