pokemon-showdown/data/mods/stadium/statuses.ts
Guangcong Luo e0f6453b60 Refactor data definitions
- `Modded[Effect]Data` are now correctly defined: they must either have
  `inherit: true` and be partial, or not have `inherit: true` and be a
	complete `[Effect]Data` entry

- `id` is no longer allowed; instead, it's calculated directly from
  `toID(name)`. The one exception, Hidden Power, gets a `realMove`
	property to track this (it's still used to set `.id`, though;
	TODO: really fix it properly).

- `num` is still required in `data/pokedex.ts` (dex number),
  `data/moves.ts` (move index number, for Metronome), and
	`data/items.ts` (minisprite sprite-sheet location). It's still not
	required for mod-only items and moves.

- `num` is no longer allowed for PureEffects (in `statuses.ts`) where
  it's always been meaningless.

- `color` and `heightm`, being completely flavor, are still not
  required for `pokedex.ts` in mods. They're still required in the base
	pokedex.
2020-04-30 21:39:29 -07:00

132 lines
3.5 KiB
TypeScript

export const BattleStatuses: {[k: string]: ModdedPureEffectData} = {
brn: {
name: 'brn',
effectType: 'Status',
onStart(target) {
this.add('-status', target, 'brn');
},
onAfterMoveSelfPriority: 2,
onAfterMoveSelf(pokemon) {
this.damage(this.dex.clampIntRange(Math.floor(pokemon.maxhp / 16), 1));
},
onAfterSwitchInSelf(pokemon) {
this.damage(this.dex.clampIntRange(Math.floor(pokemon.maxhp / 16), 1));
},
},
par: {
name: 'par',
effectType: 'Status',
onStart(target) {
this.add('-status', target, 'par');
},
onBeforeMovePriority: 2,
onBeforeMove(pokemon) {
if (this.randomChance(63, 256)) {
this.add('cant', pokemon, 'par');
pokemon.removeVolatile('bide');
pokemon.removeVolatile('lockedmovee');
pokemon.removeVolatile('twoturnmove');
pokemon.removeVolatile('fly');
pokemon.removeVolatile('dig');
pokemon.removeVolatile('solarbeam');
pokemon.removeVolatile('skullbash');
pokemon.removeVolatile('partialtrappinglock');
return false;
}
},
},
slp: {
name: 'slp',
effectType: 'Status',
onStart(target, source, sourceEffect) {
if (sourceEffect && sourceEffect.effectType === 'Move') {
this.add('-status', target, 'slp', '[from] move: ' + sourceEffect.name);
} else {
this.add('-status', target, 'slp');
}
// 1-3 turns
this.effectData.startTime = this.random(1, 4);
this.effectData.time = this.effectData.startTime;
},
onBeforeMovePriority: 2,
onBeforeMove(pokemon, target, move) {
pokemon.statusData.time--;
this.add('cant', pokemon, 'slp');
pokemon.lastMove = null;
return false;
},
onAfterMoveSelf(pokemon) {
if (pokemon.statusData.time <= 0) pokemon.cureStatus();
},
},
frz: {
name: 'frz',
effectType: 'Status',
onStart(target) {
this.add('-status', target, 'frz');
},
onBeforeMovePriority: 2,
onBeforeMove(pokemon, target, move) {
this.add('cant', pokemon, 'frz');
pokemon.lastMove = null;
return false;
},
onHit(target, source, move) {
if (move.type === 'Fire' && move.category !== 'Status') {
target.cureStatus();
}
},
},
psn: {
name: 'psn',
effectType: 'Status',
onStart(target) {
this.add('-status', target, 'psn');
},
onAfterMoveSelfPriority: 2,
onAfterMoveSelf(pokemon) {
this.damage(this.dex.clampIntRange(Math.floor(pokemon.maxhp / 16), 1));
},
onAfterSwitchInSelf(pokemon) {
this.damage(this.dex.clampIntRange(Math.floor(pokemon.maxhp / 16), 1));
},
},
tox: {
name: 'tox',
effectType: 'Status',
onStart(target) {
this.add('-status', target, 'tox');
},
onAfterMoveSelfPriority: 2,
onAfterMoveSelf(pokemon) {
this.damage(this.dex.clampIntRange(Math.floor(pokemon.maxhp / 16), 1));
},
onAfterSwitchInSelf(pokemon) {
// Regular poison status and damage after a switchout -> switchin.
pokemon.setStatus('psn');
pokemon.addVolatile('residualdmg');
pokemon.volatiles['residualdmg'].counter = 1;
this.damage(this.dex.clampIntRange(Math.floor(pokemon.maxhp / 16), 1));
},
},
partiallytrapped: {
name: 'partiallytrapped',
duration: 2,
onBeforeMovePriority: 1,
onStart(target, source, effect) {
this.add('-activate', target, 'move: ' + effect, '[of] ' + source);
},
onBeforeMove(pokemon) {
if (this.effectData.source && (!this.effectData.source.isActive || this.effectData.source.hp <= 0)) {
pokemon.removeVolatile('partiallytrapped');
return;
}
this.add('cant', pokemon, 'partiallytrapped');
return false;
},
onEnd(pokemon) {
this.add('-end', pokemon, this.effectData.sourceEffect, '[partiallytrapped]');
},
},
};