Spaces:
Running
Running
File size: 5,293 Bytes
5c2ed06 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTable = {
cutecharm: {
inherit: true,
onDamagingHit(damage, target, source, move) {
if (damage && move.flags['contact']) {
if (this.randomChance(1, 3)) {
source.addVolatile('attract', target);
}
}
},
},
effectspore: {
inherit: true,
onDamagingHit(damage, target, source, move) {
if (damage && move.flags['contact'] && !source.status) {
const r = this.random(300);
if (r < 10) {
source.setStatus('slp', target);
} else if (r < 20) {
source.setStatus('par', target);
} else if (r < 30) {
source.setStatus('psn', target);
}
}
},
},
flamebody: {
inherit: true,
onDamagingHit(damage, target, source, move) {
if (damage && move.flags['contact']) {
if (this.randomChance(1, 3)) {
source.trySetStatus('brn', target);
}
}
},
},
flashfire: {
inherit: true,
onTryHit(target, source, move) {
if (target !== source && move.type === 'Fire') {
if (move.id === 'willowisp' && (target.hasType('Fire') || target.status || target.volatiles['substitute'])) {
return;
}
if (target.status === 'frz') {
return;
}
if (!target.addVolatile('flashfire')) {
this.add('-immune', target, '[from] ability: Flash Fire');
}
return null;
}
},
},
forecast: {
inherit: true,
flags: {},
},
hustle: {
inherit: true,
onSourceModifyAccuracy(accuracy, target, source, move) {
const physicalTypes = ['Normal', 'Fighting', 'Flying', 'Poison', 'Ground', 'Rock', 'Bug', 'Ghost', 'Steel'];
if (physicalTypes.includes(move.type) && typeof accuracy === 'number') {
return this.chainModify([3277, 4096]);
}
},
},
intimidate: {
inherit: true,
onStart(pokemon) {
let activated = false;
for (const target of pokemon.adjacentFoes()) {
if (!target.volatiles['substitute']) {
activated = true;
break;
}
}
if (!activated) {
this.hint("In Gen 3, Intimidate does not activate if every target has a Substitute.", false, pokemon.side);
return;
}
this.add('-ability', pokemon, 'Intimidate', 'boost');
for (const target of pokemon.adjacentFoes()) {
if (target.volatiles['substitute']) {
this.add('-immune', target);
} else {
this.boost({ atk: -1 }, target, pokemon, null, true);
}
}
},
},
lightningrod: {
onFoeRedirectTarget(target, source, source2, move) {
// don't count Hidden Power as Electric-type
if (this.dex.moves.get(move.id).type !== 'Electric') return;
if (this.validTarget(this.effectState.target, source, move.target)) {
return this.effectState.target;
}
},
flags: { breakable: 1 },
name: "Lightning Rod",
rating: 0,
num: 32,
},
minus: {
inherit: true,
onModifySpA(spa, pokemon) {
for (const active of this.getAllActive()) {
if (!active.fainted && active.hasAbility('plus')) {
return this.chainModify(1.5);
}
}
},
},
plus: {
inherit: true,
onModifySpA(spa, pokemon) {
for (const active of this.getAllActive()) {
if (!active.fainted && active.hasAbility('minus')) {
return this.chainModify(1.5);
}
}
},
},
poisonpoint: {
inherit: true,
onDamagingHit(damage, target, source, move) {
if (damage && move.flags['contact']) {
if (this.randomChance(1, 3)) {
source.trySetStatus('psn', target);
}
}
},
},
pressure: {
inherit: true,
onStart(pokemon) {
this.addSplit(pokemon.side.id, ['-ability', pokemon, 'Pressure', '[silent]']);
},
},
raindish: {
inherit: true,
onWeather() {},
onResidualOrder: 10,
onResidualSubOrder: 3,
onResidual(pokemon) {
if (['raindance', 'primordialsea'].includes(pokemon.effectiveWeather())) {
this.heal(pokemon.baseMaxhp / 16);
}
},
},
roughskin: {
inherit: true,
onDamagingHit(damage, target, source, move) {
if (damage && move.flags['contact']) {
this.damage(source.baseMaxhp / 16, source, target);
}
},
},
shadowtag: {
inherit: true,
onFoeTrapPokemon(pokemon) {
pokemon.trapped = true;
},
},
static: {
inherit: true,
onDamagingHit(damage, target, source, move) {
if (damage && move.flags['contact']) {
if (this.randomChance(1, 3)) {
source.trySetStatus('par', target);
}
}
},
},
trace: {
inherit: true,
onUpdate() {},
onStart(pokemon) {
const target = pokemon.side.randomFoe();
if (!target || target.fainted) return;
const ability = target.getAbility();
if (pokemon.setAbility(ability)) {
this.add('-ability', pokemon, ability, '[from] ability: Trace', `[of] ${target}`);
}
},
flags: {},
},
truant: {
inherit: true,
onStart() {},
onSwitchIn(pokemon) {
pokemon.truantTurn = this.turn !== 0;
},
onBeforeMove(pokemon) {
if (pokemon.truantTurn) {
this.add('cant', pokemon, 'ability: Truant');
return false;
}
},
onResidualOrder: 27,
onResidual(pokemon) {
pokemon.truantTurn = !pokemon.truantTurn;
},
},
voltabsorb: {
inherit: true,
onTryHit(target, source, move) {
if (target !== source && move.type === 'Electric' && move.id !== 'thunderwave') {
if (!this.heal(target.baseMaxhp / 4)) {
this.add('-immune', target, '[from] ability: Volt Absorb');
}
return null;
}
},
},
};
|