Skip to content

Commit

Permalink
Remove move secondaries / update ability flags
Browse files Browse the repository at this point in the history
  • Loading branch information
WarriorGallade committed Feb 21, 2024
1 parent 6092617 commit f916c9e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 38 deletions.
2 changes: 1 addition & 1 deletion data/mods/gen9ssb/abilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const Abilities: {[k: string]: ModdedAbilityData} = {
return null;
}
},
flags: {},
flags: {breakable: 1},
},

// aQrator
Expand Down
65 changes: 28 additions & 37 deletions data/mods/gen9ssb/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,43 +162,34 @@ export const Moves: {[k: string]: ModdedMoveData} = {
this.add('-anim', source, 'Recycle', target);
},
flags: {snatch: 1},
secondaries: [
{
chance: 100,
onHit(pokemon) {
if (pokemon.item || !pokemon.lastItem) return false;
const item = pokemon.lastItem;
pokemon.lastItem = '';
this.add('-item', pokemon, this.dex.items.get(item), '[from] move: Extra Course');
pokemon.setItem(item);
},
}, {
chance: 100,
onHit(pokemon) {
let stats: BoostID[] = [];
const boost: SparseBoostsTable = {};
let statPlus: BoostID;
for (statPlus in pokemon.boosts) {
if (statPlus === 'accuracy' || statPlus === 'evasion') continue;
if (pokemon.boosts[statPlus] < 6) {
stats.push(statPlus);
}
}
let randomStat: BoostID | undefined = stats.length ? this.sample(stats) : undefined;
if (randomStat) boost[randomStat] = 1;
stats = [];
for (statPlus in pokemon.boosts) {
if (statPlus === 'accuracy' || statPlus === 'evasion') continue;
if (pokemon.boosts[statPlus] < 6 && statPlus !== randomStat) {
stats.push(statPlus);
}
}
randomStat = stats.length ? this.sample(stats) : undefined;
if (randomStat) boost[randomStat] = 1;
this.boost(boost, pokemon, pokemon);
},
},
],
onHit(pokemon) {
if (pokemon.item || !pokemon.lastItem) return false;
const item = pokemon.lastItem;
pokemon.lastItem = '';
this.add('-item', pokemon, this.dex.items.get(item), '[from] move: Extra Course');
pokemon.setItem(item);
let stats: BoostID[] = [];
const boost: SparseBoostsTable = {};
let statPlus: BoostID;
for (statPlus in pokemon.boosts) {
if (statPlus === 'accuracy' || statPlus === 'evasion') continue;
if (pokemon.boosts[statPlus] < 6) {
stats.push(statPlus);
}
}
let randomStat: BoostID | undefined = stats.length ? this.sample(stats) : undefined;
if (randomStat) boost[randomStat] = 1;
stats = [];
for (statPlus in pokemon.boosts) {
if (statPlus === 'accuracy' || statPlus === 'evasion') continue;
if (pokemon.boosts[statPlus] < 6 && statPlus !== randomStat) {
stats.push(statPlus);
}
}
randomStat = stats.length ? this.sample(stats) : undefined;
if (randomStat) boost[randomStat] = 1;
this.boost(boost, pokemon, pokemon);
},
target: "self",
type: "Normal",
},
Expand Down

0 comments on commit f916c9e

Please sign in to comment.