Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions play.pokemonshowdown.com/js/client-teambuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1521,8 +1521,8 @@
}
if (this.curTeam.gen >= 6) {
var item = dex.items.get(set.item);
if (item.megaStone && species.baseSpecies === item.megaEvolves) {
species = dex.species.get(item.megaStone);
if (item.megaStone && item.megaEvolves[species.baseSpecies]) {
species = dex.species.get(item.megaEvolves[species.baseSpecies]);
typeTable = typeTable.filter(function (type) {
return species.types.includes(type);
});
Expand Down
6 changes: 2 additions & 4 deletions play.pokemonshowdown.com/src/battle-dex-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,7 @@ export class Item implements Effect {
readonly desc: string;
readonly shortDesc: string;

readonly megaStone: string;
readonly megaEvolves: string;
readonly megaStone: { [megaEvolves: string]: string };
readonly zMove: string | true | null;
readonly zMoveType: TypeName | '';
readonly zMoveFrom: string;
Expand All @@ -1181,8 +1180,7 @@ export class Item implements Effect {
this.desc = data.desc || data.shortDesc || '';
this.shortDesc = data.shortDesc || this.desc;

this.megaStone = data.megaStone || '';
this.megaEvolves = data.megaEvolves || '';
this.megaStone = data.megaStone || null;
this.zMove = data.zMove || null;
this.zMoveType = data.zMoveType || '';
this.zMoveFrom = data.zMoveFrom || '';
Expand Down
2 changes: 1 addition & 1 deletion play.pokemonshowdown.com/src/battle-tooltips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2620,7 +2620,7 @@ export class BattleStatGuesser {
let abilityid = toID(set.ability);

let species = this.dex.species.get(set.species || set.name!);
if (item.megaEvolves === species.name) species = this.dex.species.get(item.megaStone);
if (item.megaStone?.[species.name]) species = this.dex.species.get(item.megaStone[species.name]);
if (!species.exists) return '?';
let stats = species.baseStats;

Expand Down
6 changes: 5 additions & 1 deletion play.pokemonshowdown.com/src/battle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2473,7 +2473,11 @@ export class Battle {
let species = this.dex.species.get(newSpeciesForme);
if (nextArgs) {
if (nextArgs[0] === '-mega') {
species = this.dex.species.get(this.dex.items.get(nextArgs[3]).megaStone);
const item = this.dex.items.get(nextArgs[3]);
if (item.megaStone) {
const index = Object.values(item.megaStone).indexOf(species.name);
if (index >= 0) species = this.dex.species.get(Object.keys(item.megaStone)[index]);
}
} else if (nextArgs[0] === '-primal' && nextArgs.length > 2) {
if (nextArgs[2] === 'Red Orb') species = this.dex.species.get('Groudon-Primal');
if (nextArgs[2] === 'Blue Orb') species = this.dex.species.get('Kyogre-Primal');
Expand Down