mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-11 23:14:13 -05:00
This commit implements at its full the Stadium format. Stadium is a half-generation between Gen 1 and Gen 2, widely regarded as a Gen 1 game without the major gen 1 bugs. The main changes of this game are: Sleep lasts between 1 and 3 turns. Hyper Beam does recharge after a faint. Critical hits happen way less. Substitute now blocks all status ailments and draining. It allows tradebacks. Partial trapping moves miss and stop their duration upon target switch. Focus Energy actually works. Stat calculations are done properly, burn and para drop are lost if you lose status.
121 lines
3.4 KiB
JavaScript
121 lines
3.4 KiB
JavaScript
exports.BattleStatuses = {
|
|
brn: {
|
|
effectType: 'Status',
|
|
onStart: function (target) {
|
|
this.add('-status', target, 'brn');
|
|
},
|
|
onAfterMoveSelfPriority: 2,
|
|
onAfterMoveSelf: function (pokemon) {
|
|
this.damage(this.clampIntRange(Math.floor(pokemon.maxhp / 16), 1));
|
|
},
|
|
onAfterSwitchInSelf: function (pokemon) {
|
|
this.damage(this.clampIntRange(Math.floor(pokemon.maxhp / 16), 1));
|
|
}
|
|
},
|
|
par: {
|
|
effectType: 'Status',
|
|
onStart: function (target) {
|
|
this.add('-status', target, 'par');
|
|
},
|
|
onBeforeMovePriority: 2,
|
|
onBeforeMove: function (pokemon) {
|
|
if (this.random(256) < 64) {
|
|
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: {
|
|
effectType: 'Status',
|
|
onStart: function (target) {
|
|
this.add('-status', target, 'slp');
|
|
// 1-3 turns
|
|
this.effectData.startTime = this.random(1, 3);
|
|
this.effectData.time = this.effectData.startTime;
|
|
},
|
|
onBeforeMovePriority: 2,
|
|
onBeforeMove: function (pokemon, target, move) {
|
|
pokemon.statusData.time--;
|
|
this.add('cant', pokemon, 'slp');
|
|
pokemon.lastMove = '';
|
|
return false;
|
|
},
|
|
onAfterMoveSelf: function (pokemon) {
|
|
if (pokemon.statusData.time <= 0) pokemon.cureStatus();
|
|
}
|
|
},
|
|
frz: {
|
|
effectType: 'Status',
|
|
onStart: function (target) {
|
|
this.add('-status', target, 'frz');
|
|
},
|
|
onBeforeMovePriority: 2,
|
|
onBeforeMove: function (pokemon, target, move) {
|
|
this.add('cant', pokemon, 'frz');
|
|
pokemon.lastMove = '';
|
|
return false;
|
|
},
|
|
onHit: function (target, source, move) {
|
|
if (move.type === 'Fire' && move.category !== 'Status') {
|
|
target.cureStatus();
|
|
}
|
|
}
|
|
},
|
|
psn: {
|
|
effectType: 'Status',
|
|
onStart: function (target) {
|
|
this.add('-status', target, 'psn');
|
|
},
|
|
onAfterMoveSelfPriority: 2,
|
|
onAfterMoveSelf: function (pokemon) {
|
|
this.damage(this.clampIntRange(Math.floor(pokemon.maxhp / 16), 1));
|
|
},
|
|
onAfterSwitchInSelf: function (pokemon) {
|
|
this.damage(this.clampIntRange(Math.floor(pokemon.maxhp / 16), 1));
|
|
}
|
|
},
|
|
tox: {
|
|
effectType: 'Status',
|
|
onStart: function (target) {
|
|
this.add('-status', target, 'tox');
|
|
},
|
|
onAfterMoveSelfPriority: 2,
|
|
onAfterMoveSelf: function (pokemon) {
|
|
this.damage(this.clampIntRange(Math.floor(pokemon.maxhp / 16), 1));
|
|
},
|
|
onAfterSwitchInSelf: function (pokemon) {
|
|
// Regular poison status and damage after a switchout -> switchin.
|
|
pokemon.setStatus('psn');
|
|
pokemon.addVolatile('residualdmg');
|
|
pokemon.volatiles['residualdmg'].counter = 1;
|
|
this.damage(this.clampIntRange(Math.floor(pokemon.maxhp / 16), 1));
|
|
}
|
|
},
|
|
partiallytrapped: {
|
|
duration: 2,
|
|
onBeforeMovePriority: 1,
|
|
onStart: function (target, source, effect) {
|
|
this.add('-activate', target, 'move: ' + effect, '[of] ' + source);
|
|
},
|
|
onBeforeMove: function (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: function (pokemon) {
|
|
this.add('-end', pokemon, this.effectData.sourceEffect, '[partiallytrapped]');
|
|
}
|
|
}
|
|
};
|