Skip to content

Commit

Permalink
More bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisXV committed Apr 18, 2024
1 parent fb6e8f4 commit 5fdafa7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 28 deletions.
2 changes: 1 addition & 1 deletion data/mods/gen9ssb/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1823,7 +1823,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
name: "Solidarity",
pp: 15,
priority: 0,
flags: {},
flags: {protect: 1, reflectable: 1},
onTryMove() {
this.attrLastMove('[still]');
},
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 @@ -99,7 +99,7 @@ export const Pokedex: {[k: string]: ModdedSpeciesData} = {
// ausma
hatterene: {
inherit: true,
abilities: {0: "Latte Break"},
abilities: {0: "Cascade"},
},

// AuzBat
Expand Down
60 changes: 34 additions & 26 deletions server/chat-plugins/randombattles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -744,34 +744,42 @@ function SSBSets(target: string) {
if (toID(member) === toID(target)) name = member;
}
let buf = '';
const set = ssbSets[name];
const mutatedSpecies = dex.species.get(set.species);
if (!set.skip) {
buf += Utils.html`<h1><psicon pokemon="${mutatedSpecies.id}">${name}</h1>`;
} else {
buf += `<details><summary><psicon pokemon="${set.species}"><strong>${name.split('-').slice(1).join('-') + ' forme'}</strong></summary>`;
}
buf += generateSSBSet(set, dex, baseDex);
const item = dex.items.get(set.item as string);
if (!set.skip || set.signatureMove !== ssbSets[set.skip].signatureMove) {
const sigMove = baseDex.moves.get(set.signatureMove).exists && !Array.isArray(set.item) &&
typeof item.zMove === 'string' ?
dex.moves.get(item.zMove) : dex.moves.get(set.signatureMove);
buf += generateSSBMoveInfo(sigMove, dex);
const sets: string[] = [];
for (const set in ssbSets) {
if (!set.startsWith(name)) continue;
if (!ssbSets[set].skip && set !== name) continue;
sets.push(set);
}
buf += generateSSBItemInfo(set, dex, baseDex);
buf += generateSSBAbilityInfo(set, dex, baseDex);
buf += generateSSBInnateInfo(name, dex, baseDex);
buf += generateSSBPokemonInfo(set.species, dex, baseDex);
if (!Array.isArray(set.item) && item.megaStone) {
buf += generateSSBPokemonInfo(item.megaStone, dex, baseDex);
// keys and Kennedy have an itemless forme change
} else if (['Rayquaza'].includes(set.species)) {
buf += generateSSBPokemonInfo(`${set.species}-Mega`, dex, baseDex);
} else if (['Cinderace'].includes(set.species)) {
buf += generateSSBPokemonInfo(`${set.species}-Gmax`, dex, baseDex);
for (const setName of sets) {
const set = ssbSets[setName];
const mutatedSpecies = dex.species.get(set.species);
if (!set.skip) {
buf += Utils.html`<h1><psicon pokemon="${mutatedSpecies.id}">${setName}</h1>`;
} else {
buf += `<details><summary><psicon pokemon="${set.species}"><strong>${setName.split('-').slice(1).join('-') + ' forme'}</strong></summary>`;
}
buf += generateSSBSet(set, dex, baseDex);
const item = dex.items.get(set.item as string);
if (!set.skip || set.signatureMove !== ssbSets[set.skip].signatureMove) {
const sigMove = baseDex.moves.get(set.signatureMove).exists && !Array.isArray(set.item) &&
typeof item.zMove === 'string' ?
dex.moves.get(item.zMove) : dex.moves.get(set.signatureMove);
buf += generateSSBMoveInfo(sigMove, dex);
}
buf += generateSSBItemInfo(set, dex, baseDex);
buf += generateSSBAbilityInfo(set, dex, baseDex);
buf += generateSSBInnateInfo(setName, dex, baseDex);
buf += generateSSBPokemonInfo(set.species, dex, baseDex);
if (!Array.isArray(set.item) && item.megaStone) {
buf += generateSSBPokemonInfo(item.megaStone, dex, baseDex);
// keys and Kennedy have an itemless forme change
} else if (['Rayquaza'].includes(set.species)) {
buf += generateSSBPokemonInfo(`${set.species}-Mega`, dex, baseDex);
} else if (['Cinderace'].includes(set.species)) {
buf += generateSSBPokemonInfo(`${set.species}-Gmax`, dex, baseDex);
}
if (set.skip) buf += `</details>`;
}
if (set.skip) buf += `</details>`;
return buf;
}

Expand Down

0 comments on commit 5fdafa7

Please sign in to comment.