Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------abilities.js---------
- exports.BattleAbilities = {
- "chlorophyll": {
- inherit: true,
- onModifySpe: function (speMod) {
- if (this.isWeather('sunnyday') || this.isWeather('raindance')) {
- return this.chain(speMod, 2);
- }
- }
- },
- "drought": {
- inherit: true,
- onStart: function (source) {
- this.setWeather('raindance');
- }
- },
- "flowergift": {
- inherit: true,
- onUpdate: function (pokemon) {
- if (!pokemon.isActive || pokemon.speciesid !== 'cherrim') return;
- if (this.isWeather('sunnyday') || this.isWeather('raindance')) {
- if (this.effectData.forme !== 'Sunshine') {
- this.effectData.forme = 'Sunshine';
- this.add('-formechange', pokemon, 'Cherrim-Sunshine');
- this.add('-message', pokemon.name + ' transformed! (placeholder)');
- }
- } else {
- if (this.effectData.forme) {
- delete this.effectData.forme;
- this.add('-formechange', pokemon, 'Cherrim');
- this.add('-message', pokemon.name + ' transformed! (placeholder)');
- }
- }
- },
- onAllyModifyAtk: function (atk) {
- if (this.effectData.target.template.speciesid !== 'cherrim') return;
- if (this.isWeather('sunnyday') || this.isWeather('raindance')) {
- return this.chainModify(1.5);
- }
- },
- onAllyModifySpD: function (spd) {
- if (this.effectData.target.template.speciesid !== 'cherrim') return;
- if (this.isWeather('sunnyday') || this.isWeather('raindance')) {
- return this.chainModify(1.5);
- }
- }
- },
- "harvest": {
- inherit: true,
- onResidual: function (pokemon) {
- if (this.isWeather('sunnyday') || this.isWeather('raindance') || this.random(2) === 0) {
- if (pokemon.hp && !pokemon.item && this.getItem(pokemon.lastItem).isBerry) {
- pokemon.setItem(pokemon.lastItem);
- this.add('-item', pokemon, pokemon.getItem(), '[from] ability: Harvest');
- }
- }
- }
- },
- "icebody": {
- inherit: true,
- onWeather: function (target, source, effect) {
- if (effect.id === 'hail' || effect.id === 'raindance') {
- this.heal(target.maxhp / 16);
- }
- }
- },
- "leafguard": {
- inherit: true,
- onSetStatus: function (pokemon) {
- if (this.isWeather('sunnyday') || this.isWeather('raindance')) {
- return false;
- }
- },
- onTryHit: function (target, source, move) {
- if (move && move.id === 'yawn' && (this.isWeather('sunnyday') || this.isWeather('raindance'))) {
- return false;
- }
- }
- },
- "sandforce": {
- inherit: true,
- onBasePower: function (basePower, attacker, defender, move) {
- if (this.isWeather('sandstorm') || this.isWeather('raindance')) {
- if (move.type === 'Rock' || move.type === 'Ground' || move.type === 'Steel') {
- this.debug('Sand Force boost');
- return this.chainModify([0x14CD, 0x1000]); // The Sand Force modifier is slightly higher than the normal 1.3 (0x14CC)
- }
- }
- },
- },
- "sandrush": {
- inherit: true,
- onModifySpe: function (speMod, pokemon) {
- if (this.isWeather('sandstorm') || this.isWeather('raindance')) {
- return this.chain(speMod, 2);
- }
- },
- },
- "sandstream": {
- inherit: true,
- onStart: function (source) {
- this.setWeather('raindance');
- }
- },
- "sandveil": {
- inherit: true,
- onAccuracy: function (accuracy) {
- if (typeof accuracy !== 'number') return;
- if (this.isWeather('sandstorm') || this.isWeather('raindance')) {
- this.debug('Sand Veil - decreasing accuracy');
- return accuracy * 0.8;
- }
- },
- },
- "snowcloak": {
- inherit: true,
- onAccuracy: function (accuracy) {
- if (typeof accuracy !== 'number') return;
- if (this.isWeather('hail') || this.isWeather('raindance')) {
- this.debug('Snow Cloak - decreasing accuracy');
- return accuracy * 0.8;
- }
- }
- },
- "snowwarning": {
- inherit: true,
- onStart: function (source) {
- this.setWeather('raindance');
- }
- },
- "solarpower": {
- inherit: true,
- onModifySpA: function (spa, pokemon) {
- if (this.isWeather('sunnyday') || this.isWeather('raindance')) {
- return this.chainModify(1.5);
- }
- },
- onWeather: function (target, source, effect) {
- if (effect.id === 'sunnyday' || effect.id === 'raindance') {
- this.damage(target.maxhp / 8);
- }
- }
- }
- };
- -------statuses.js---------
- exports.BattleStatuses = {
- raindance: {
- effectType: 'Weather',
- duration: 5,
- onBasePower: function (basePower, attacker, defender, move) {
- if (move.type === 'Water') {
- this.debug('acid rain water supress');
- return this.chainModify(0.75);
- }
- if (move.type === 'Fire') {
- this.debug('acid rain fire suppress');
- return this.chainModify(0.75);
- }
- },
- onModifySpDPriority: 10,
- onModifySpD: function (spd, pokemon) {
- if (pokemon.hasType('Rock') && this.isWeather('RainDance')) {
- return this.modify(spd, 1.5);
- }
- },
- onImmunity: function (type) {
- if (type === 'frz') return false;
- },
- onStart: function (battle, source, effect) {
- if (effect && effect.effectType === 'Ability' && this.gen <= 5) {
- this.effectData.duration = 0;
- this.add('-weather', 'RainDance', '[from] ability: ' + effect, '[of] ' + source);
- } else {
- this.add('-weather', 'RainDance');
- }
- },
- onResidualOrder: 1,
- onResidual: function () {
- this.add('-weather', 'RainDance', '[upkeep]');
- this.eachEvent('Weather');
- },
- onWeather: function (target) {
- if (target.runImmunity('sandstorm') && target.runImmunity('hail')) {
- this.damage(target.maxhp / 8);
- } else if ((!target.runImmunity('sandstorm') && target.runImmunity('hail')) || (target.runImmunity('sandstorm') && !target.runImmunity('hail'))) {
- this.damage(target.maxhp / 16);
- }
- },
- onEnd: function () {
- this.add('-weather', 'none');
- }
- }
- };
- -------moves.js---------
- exports.BattleMovedex = {
- "blizzard": {
- inherit: true,
- onModifyMove: function (move) {
- if (this.isWeather('hail') || this.isWeather('raindance')) move.accuracy = true;
- }
- },
- "growth": {
- inherit: true,
- onModifyMove: function (move) {
- if (this.isWeather('sunnyday') || this.isWeather('raindance')) move.boosts = {atk: 2, spa: 2};
- }
- },
- "hail": {
- inherit: true,
- weather: 'raindance'
- },
- "moonlight": {
- inherit: true,
- onHit: function (pokemon) {
- if (this.isWeather('sunnyday')) this.heal(this.modify(pokemon.maxhp, 0.667));
- else if (this.isWeather(['sandstorm', 'hail'])) this.heal(this.modify(pokemon.maxhp, 0.25));
- else if (this.isWeather('raindance')) this.heal(this.modify(pokemon.maxhp, 0.0833));
- else this.heal(this.modify(pokemon.maxhp, 0.5));
- }
- },
- "morningsun": {
- inherit: true,
- onHit: function (pokemon) {
- if (this.isWeather('sunnyday')) this.heal(this.modify(pokemon.maxhp, 0.667));
- else if (this.isWeather(['sandstorm', 'hail'])) this.heal(this.modify(pokemon.maxhp, 0.25));
- else if (this.isWeather('raindance')) this.heal(this.modify(pokemon.maxhp, 0.0833));
- else this.heal(this.modify(pokemon.maxhp, 0.5));
- }
- },
- "sandstorm": {
- inherit: true,
- weather: 'raindance'
- },
- "solarbeam": {
- inherit: true,
- onTry: function (attacker, defender, move) {
- if (attacker.removeVolatile(move.id)) {
- return;
- }
- this.add('-prepare', attacker, move.name, defender);
- if (this.isWeather('sunnyday') || this.isWeather('raindance') || !this.runEvent('ChargeMove', attacker, defender, move)) {
- this.add('-anim', attacker, move.name, defender);
- return;
- }
- attacker.addVolatile('twoturnmove', defender);
- return null;
- },
- onBasePower: function (basePower, pokemon, target) {
- if (this.isWeather(['sandstorm', 'hail'])) {
- this.debug('weakened by weather');
- return this.chainModify(0.5);
- } else if (this.isWeather('raindance')) {
- this.debug('super-weakened by weather');
- return this.chainModify(0.125);
- }
- }
- },
- "sunnyday": {
- inherit: true,
- weather: 'raindance'
- },
- "synthesis": {
- inherit: true,
- onHit: function (pokemon) {
- if (this.isWeather('sunnyday')) this.heal(this.modify(pokemon.maxhp, 0.667));
- else if (this.isWeather(['sandstorm', 'hail'])) this.heal(this.modify(pokemon.maxhp, 0.25));
- else if (this.isWeather('raindance')) this.heal(this.modify(pokemon.maxhp, 0.0833));
- else this.heal(this.modify(pokemon.maxhp, 0.5));
- }
- },
- "weatherball": {
- inherit: true,
- basePowerCallback: function () {
- if (this.isWeather('raindance')) return 800; //We have 4 weathers active at once.
- else if (this.weather) return 100;
- return 50;
- },
- onModifyMove: function (move) {
- switch (this.effectiveWeather()) {
- case 'sunnyday':
- move.type = 'Fire';
- break;
- case 'raindance':
- move.type = 'Ice'; //Hail is the highest priority weather.
- break;
- case 'sandstorm':
- move.type = 'Rock';
- break;
- case 'hail':
- move.type = 'Ice';
- break;
- }
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement