pokemon-showdown/data/mods/ccapm2/items.ts
2020-10-02 21:08:29 +04:00

342 lines
8.2 KiB
TypeScript

export const Items: {[k: string]: ModdedItemData} = {
aguavberry: {
name: "Aguav Berry",
spritenum: 5,
isBerry: true,
naturalGift: {
basePower: 80,
type: "Dragon",
},
onUpdate(pokemon) {
if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && pokemon.hasAbility('forager'))) {
pokemon.eatItem();
}
},
onTryEatItem(item, pokemon) {
if (!this.runEvent('TryHeal', pokemon)) return false;
},
onEat(pokemon) {
this.heal(pokemon.baseMaxhp * 0.33);
if (pokemon.getNature().minus === 'spd') {
pokemon.addVolatile('confusion');
}
},
num: 162,
gen: 3,
desc: "Restores 33% max HP at 1/4 max HP or less; confuses if -SpD Nature. Single use.",
},
apicotberry: {
name: "Apicot Berry",
spritenum: 10,
isBerry: true,
naturalGift: {
basePower: 100,
type: "Ground",
},
onUpdate(pokemon) {
if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && pokemon.hasAbility('forager'))) {
pokemon.eatItem();
}
},
onEat(pokemon) {
this.boost({spd: 1});
},
num: 205,
gen: 3,
desc: "Raises holder's Sp. Def by 1 stage when at 1/4 max HP or less. Single use.",
},
custapberry: {
name: "Custap Berry",
spritenum: 86,
isBerry: true,
naturalGift: {
basePower: 100,
type: "Ghost",
},
onFractionalPriorityPriority: -2,
onFractionalPriority(priority, pokemon) {
if (
(priority <= 0 && pokemon.hp <= pokemon.maxhp / 4) ||
(pokemon.hp <= pokemon.maxhp / 2 && pokemon.hasAbility('forager'))
) {
if (pokemon.eatItem()) {
this.add('-activate', pokemon, 'item: Custap Berry', '[consumed]');
return 0.1;
}
}
},
onEat() { },
num: 210,
gen: 4,
isNonstandard: "Unobtainable",
desc: "Holder moves first in its priority bracket when at 1/4 max HP or less. Single use.",
},
figyberry: {
name: "Figy Berry",
spritenum: 140,
isBerry: true,
naturalGift: {
basePower: 80,
type: "Bug",
},
onUpdate(pokemon) {
if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && pokemon.hasAbility('forager'))) {
pokemon.eatItem();
}
},
onTryEatItem(item, pokemon) {
if (!this.runEvent('TryHeal', pokemon)) return false;
},
onEat(pokemon) {
this.heal(pokemon.baseMaxhp * 0.33);
if (pokemon.getNature().minus === 'atk') {
pokemon.addVolatile('confusion');
}
},
num: 159,
gen: 3,
desc: "Restores 33% max HP at 1/4 max HP or less; confuses if -Atk Nature. Single use.",
},
ganlonberry: {
name: "Ganlon Berry",
spritenum: 158,
isBerry: true,
naturalGift: {
basePower: 100,
type: "Ice",
},
onUpdate(pokemon) {
if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && pokemon.hasAbility('forager'))) {
pokemon.eatItem();
}
},
onEat(pokemon) {
this.boost({def: 1});
},
num: 202,
gen: 3,
desc: "Raises holder's Defense by 1 stage when at 1/4 max HP or less. Single use.",
},
iapapaberry: {
name: "Iapapa Berry",
spritenum: 217,
isBerry: true,
naturalGift: {
basePower: 80,
type: "Dark",
},
onUpdate(pokemon) {
if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && pokemon.hasAbility('forager'))) {
pokemon.eatItem();
}
},
onTryEatItem(item, pokemon) {
if (!this.runEvent('TryHeal', pokemon)) return false;
},
onEat(pokemon) {
this.heal(pokemon.baseMaxhp * 0.33);
if (pokemon.getNature().minus === 'def') {
pokemon.addVolatile('confusion');
}
},
num: 163,
gen: 3,
desc: "Restores 33% max HP at 1/4 max HP or less; confuses if -Def Nature. Single use.",
},
lansatberry: {
name: "Lansat Berry",
spritenum: 238,
isBerry: true,
naturalGift: {
basePower: 100,
type: "Flying",
},
onUpdate(pokemon) {
if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && pokemon.hasAbility('forager'))) {
pokemon.eatItem();
}
},
onEat(pokemon) {
pokemon.addVolatile('focusenergy');
},
num: 206,
gen: 3,
desc: "Holder gains the Focus Energy effect when at 1/4 max HP or less. Single use.",
},
liechiberry: {
name: "Liechi Berry",
spritenum: 248,
isBerry: true,
naturalGift: {
basePower: 100,
type: "Grass",
},
onUpdate(pokemon) {
if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && pokemon.hasAbility('forager'))) {
pokemon.eatItem();
}
},
onEat(pokemon) {
this.boost({atk: 1});
},
num: 201,
gen: 3,
desc: "Raises holder's Attack by 1 stage when at 1/4 max HP or less. Single use.",
},
magoberry: {
name: "Mago Berry",
spritenum: 274,
isBerry: true,
naturalGift: {
basePower: 80,
type: "Ghost",
},
onUpdate(pokemon) {
if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && pokemon.hasAbility('forager'))) {
pokemon.eatItem();
}
},
onTryEatItem(item, pokemon) {
if (!this.runEvent('TryHeal', pokemon)) return false;
},
onEat(pokemon) {
this.heal(pokemon.baseMaxhp * 0.33);
if (pokemon.getNature().minus === 'spe') {
pokemon.addVolatile('confusion');
}
},
num: 161,
gen: 3,
desc: "Restores 33% max HP at 1/4 max HP or less; confuses if -Spe Nature. Single use.",
},
micleberry: {
name: "Micle Berry",
spritenum: 290,
isBerry: true,
naturalGift: {
basePower: 100,
type: "Rock",
},
onResidual(pokemon) {
if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && pokemon.hasAbility('forager'))) {
pokemon.eatItem();
}
},
onEat(pokemon) {
pokemon.addVolatile('micleberry');
},
condition: {
duration: 2,
onSourceModifyAccuracy(accuracy, target, source) {
this.add('-enditem', source, 'Micle Berry');
source.removeVolatile('micleberry');
if (typeof accuracy === 'number') {
return accuracy * 1.2;
}
},
},
num: 209,
gen: 4,
isNonstandard: "Unobtainable",
desc: "Holder's next move has 1.2x accuracy when at 1/4 max HP or less. Single use.",
},
petayaberry: {
name: "Petaya Berry",
spritenum: 335,
isBerry: true,
naturalGift: {
basePower: 100,
type: "Poison",
},
onUpdate(pokemon) {
if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && pokemon.hasAbility('forager'))) {
pokemon.eatItem();
}
},
onEat(pokemon) {
this.boost({spa: 1});
},
num: 204,
gen: 3,
desc: "Raises holder's Sp. Atk by 1 stage when at 1/4 max HP or less. Single use.",
},
salacberry: {
name: "Salac Berry",
spritenum: 426,
isBerry: true,
naturalGift: {
basePower: 100,
type: "Fighting",
},
onUpdate(pokemon) {
if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && pokemon.hasAbility('forager'))) {
pokemon.eatItem();
}
},
onEat(pokemon) {
this.boost({spe: 1});
},
num: 203,
gen: 3,
desc: "Raises holder's Speed by 1 stage when at 1/4 max HP or less. Single use.",
},
starfberry: {
name: "Starf Berry",
spritenum: 472,
isBerry: true,
naturalGift: {
basePower: 100,
type: "Psychic",
},
onUpdate(pokemon) {
if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && pokemon.hasAbility('forager'))) {
pokemon.eatItem();
}
},
onEat(pokemon) {
const stats: BoostName[] = [];
let stat: BoostName;
for (stat in pokemon.boosts) {
if (stat !== 'accuracy' && stat !== 'evasion' && pokemon.boosts[stat] < 6) {
stats.push(stat);
}
}
if (stats.length) {
const randomStat = this.sample(stats);
const boost: SparseBoostsTable = {};
boost[randomStat] = 2;
this.boost(boost);
}
},
num: 207,
gen: 3,
desc: "Raises a random stat by 2 when at 1/4 max HP or less (not acc/eva). Single use.",
},
wikiberry: {
name: "Wiki Berry",
spritenum: 538,
isBerry: true,
naturalGift: {
basePower: 80,
type: "Rock",
},
onUpdate(pokemon) {
if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && pokemon.hasAbility('forager'))) {
pokemon.eatItem();
}
},
onTryEatItem(item, pokemon) {
if (!this.runEvent('TryHeal', pokemon)) return false;
},
onEat(pokemon) {
this.heal(pokemon.baseMaxhp * 0.33);
if (pokemon.getNature().minus === 'spa') {
pokemon.addVolatile('confusion');
}
},
num: 160,
gen: 3,
desc: "Restores 33% max HP at 1/4 max HP or less; confuses if -SpA Nature. Single use.",
},
};