mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-06-02 22:08:36 -05:00
Merge 7a1dfb449c into 6765d8422d
This commit is contained in:
commit
61a8aea9ac
|
|
@ -481,7 +481,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = {
|
|||
},
|
||||
cheekpouch: {
|
||||
onEatItem(item, pokemon) {
|
||||
this.heal(pokemon.baseMaxhp / 3);
|
||||
this.heal(pokemon.baseMaxhp / 3, pokemon, pokemon);
|
||||
},
|
||||
flags: {},
|
||||
name: "Cheek Pouch",
|
||||
|
|
|
|||
|
|
@ -470,6 +470,15 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = {
|
|||
return this.chainModify([5325, 4096]);
|
||||
},
|
||||
},
|
||||
weakenberry: {
|
||||
name: 'weakenberry',
|
||||
duration: 1,
|
||||
onDamagingHit(damage, target, source, move) {
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
this.runEvent('EatItem', target, target, this.effectState.sourceEffect, this.dex.items.get(this.effectState.sourceEffect));
|
||||
delete target.volatiles['weakenberry'];
|
||||
},
|
||||
},
|
||||
|
||||
// weather is implemented here since it's so important to the game
|
||||
|
||||
|
|
|
|||
|
|
@ -362,12 +362,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Steel' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -819,12 +819,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Rock' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -904,13 +904,10 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
type: "Normal",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (
|
||||
move.type === 'Normal' &&
|
||||
(!target.volatiles['substitute'] || move.flags['bypasssub'] || (move.infiltrates && this.gen >= 6))
|
||||
) {
|
||||
if (move.type === 'Normal' && !(target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates)) {
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -1037,12 +1034,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Fighting' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -1116,12 +1113,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Flying' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -1140,12 +1137,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Dark' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -2752,12 +2749,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Dragon' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -3131,12 +3128,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Ghost' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -3155,12 +3152,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Poison' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -4349,12 +4346,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Fire' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -4451,12 +4448,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Water' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -4475,12 +4472,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Psychic' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -5205,12 +5202,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Grass' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -5362,12 +5359,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Fairy' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -5692,12 +5689,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Ground' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -6224,12 +6221,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Bug' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -7495,11 +7492,11 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Electric' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -7771,12 +7768,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
|
|||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Ice' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !move.infiltrates;
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,18 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Steel",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Steel' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
belueberry: {
|
||||
inherit: true,
|
||||
|
|
@ -51,6 +63,18 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Rock",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Rock' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
cheriberry: {
|
||||
inherit: true,
|
||||
|
|
@ -72,6 +96,15 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Normal",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Normal' && !(target.volatiles['substitute'] && !move.flags['bypasssub'])) {
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
chopleberry: {
|
||||
inherit: true,
|
||||
|
|
@ -79,6 +112,18 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Fighting",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Fighting' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
cobaberry: {
|
||||
inherit: true,
|
||||
|
|
@ -86,6 +131,18 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Flying",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Flying' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
colburberry: {
|
||||
inherit: true,
|
||||
|
|
@ -93,6 +150,18 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Dark",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Dark' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
cornnberry: {
|
||||
inherit: true,
|
||||
|
|
@ -185,6 +254,18 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Dragon",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Dragon' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
hondewberry: {
|
||||
inherit: true,
|
||||
|
|
@ -217,6 +298,18 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Ghost",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Ghost' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
kebiaberry: {
|
||||
inherit: true,
|
||||
|
|
@ -224,6 +317,18 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Poison",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Poison' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
kelpsyberry: {
|
||||
inherit: true,
|
||||
|
|
@ -305,6 +410,18 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Fire",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Fire' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
oranberry: {
|
||||
inherit: true,
|
||||
|
|
@ -326,6 +443,18 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Water",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Water' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
payapaberry: {
|
||||
inherit: true,
|
||||
|
|
@ -333,6 +462,18 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Psychic",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Psychic' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
pechaberry: {
|
||||
inherit: true,
|
||||
|
|
@ -411,6 +552,18 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Grass",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Grass' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
rockgem: {
|
||||
inherit: true,
|
||||
|
|
@ -436,6 +589,18 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Ground",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Ground' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
sitrusberry: {
|
||||
inherit: true,
|
||||
|
|
@ -475,6 +640,18 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Bug",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Bug' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
wacanberry: {
|
||||
inherit: true,
|
||||
|
|
@ -482,6 +659,17 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Electric",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Electric' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
watergem: {
|
||||
inherit: true,
|
||||
|
|
@ -514,5 +702,17 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
basePower: 60,
|
||||
type: "Ice",
|
||||
},
|
||||
onSourceModifyDamage(damage, source, target, move) {
|
||||
if (move.type === 'Ice' && target.getMoveHitData(move).typeMod > 0) {
|
||||
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
||||
if (hitSub) return;
|
||||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -98,7 +98,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -113,7 +113,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
) {
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -128,7 +128,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -143,7 +143,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -158,7 +158,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -335,7 +335,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -399,7 +399,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -414,7 +414,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -518,7 +518,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -541,7 +541,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -556,7 +556,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -605,7 +605,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -645,7 +645,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -676,7 +676,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -783,7 +783,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -814,7 +814,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -846,7 +846,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -32,7 +32,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -148,7 +148,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -163,7 +163,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -228,7 +228,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -251,7 +251,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -322,7 +322,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
@ -345,7 +345,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|||
|
||||
if (target.eatItem()) {
|
||||
this.debug('-50% reduction');
|
||||
this.add('-enditem', target, this.effect, '[weaken]');
|
||||
target.addVolatile('weakenberry');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1783,7 +1783,9 @@ export class Pokemon {
|
|||
this.battle.add('-enditem', this, item, '[eat]');
|
||||
|
||||
this.battle.singleEvent('Eat', item, this.itemState, this, source, sourceEffect);
|
||||
this.battle.runEvent('EatItem', this, source, sourceEffect, item);
|
||||
if (!this.volatiles['weakenberry']) {
|
||||
this.battle.runEvent('EatItem', this, source, sourceEffect, item);
|
||||
}
|
||||
|
||||
if (RESTORATIVE_BERRIES.has(item.id)) {
|
||||
switch (this.pendingStaleness) {
|
||||
|
|
|
|||
|
|
@ -30,4 +30,27 @@ describe(`Cheek Pouch`, () => {
|
|||
battle.makeChoices();
|
||||
assert(battle.log.every(line => !line.startsWith('|-heal')));
|
||||
});
|
||||
|
||||
it(`should activate after a damage-reducing Berry is eaten, even if the user was originally at full HP`, () => {
|
||||
battle = common.createBattle([[
|
||||
{ species: 'dedenne', item: 'shucaberry', ability: 'cheekpouch', moves: ['sleeptalk'] },
|
||||
], [
|
||||
{ species: 'pichu', moves: ['earthquake'] },
|
||||
]]);
|
||||
battle.makeChoices();
|
||||
assert.fullHP(battle.p1.active[0]);
|
||||
});
|
||||
|
||||
it(`can activate multiple times if the user eats multiple Berries in a row`, () => {
|
||||
battle = common.createBattle([[
|
||||
{ species: 'darkrai', ability: 'cheekpouch', item: 'sitrusberry', moves: ['fling'] },
|
||||
], [
|
||||
{ species: 'deoxys', ability: 'cheekpouch', level: 27, item: 'colburberry', moves: ['sleeptalk'] },
|
||||
]]);
|
||||
battle.makeChoices();
|
||||
assert.equal(
|
||||
battle.getDebugLog().split('\n').filter(line => line.startsWith('|-heal|p2a: Deoxys') && line.endsWith('[from] ability: Cheek Pouch')).length,
|
||||
2
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user