Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- config/formats.js
- ==================================================================
- {
- //★TylerTheDestroyer: this entire game is an easter egg. you try to open it up and hope for something good inside but instead you die.
- name: "Skill Cup",
- desc: ["Skill Cup is a metagame determined purely by each player's skill. Each team is generated using a skill-based algorithm, meaning counterteaming is not possible, and teams aren't required. In Skill Cup tournaments, scouting is allowed, as it takes real skill to be able to deal with such a scenario."],
- section: "Choon-Approved Metagames",
- team: 'randomHC', //Team WIP
- mod: 'skills',
- ruleset: ['HP Percentage Mod', 'Cancel Mod'],
- onBegin: function () {
- this.add('message', "WELCOME TO SKILL CUP, WHERE ONLY THOSE WITH SKILLFUL AMOUNTS OF SKILL CAN WIN THE SKILLFUL MEDALLION OF SKILL");
- this.add('message', "YOUR BODY IS NOT READY FOR THIS AMOUNT OF SKILL");
- var allPokemon = this.p1.pokemon.concat(this.p2.pokemon);
- for (var i = 0, len = allPokemon.length; i < len; i++) {
- var ms = allPokemon[i].moveset;
- for (var j in ms) {
- ms[j].maxpp = NaN;
- ms[j].pp = 1;
- }
- }
- },
- onModifyPokemon: function (pokemon) {
- for (var q in pokemon.side.pokemon) {
- var p = pokemon.side.pokemon[q];
- for (var i in p.baseStats) {
- p.baseStats[i] = p.stats[i] = Math.floor(Math.floor((this.random(32) + 2*this.random(256) + this.random(64) + 100) * p.level/100 + 5)*(.9 + this.random(3)*.1));
- }
- var hprat = p.hp/p.maxhp;
- p.maxhp = Math.floor((this.random(32) + 2 * this.random(256) + this.random(64) + 100) * p.level/100 + 10);
- p.hp = Math.round(hprat * p.maxhp);
- if (!p.hp && hprat) p.hp = 1;
- var typeNum = this.random(10);
- var typeMat = Object.keys(Tools.data.TypeChart);
- var type0 = (typeNum > 0) ? typeMat[this.random(18)] : 'Skillful';
- var type1 = (typeNum > 4) ? typeMat[this.random(18)] : 'Skillful';
- p.types = [type0, type1];
- p.typesData = [
- {type: type0, suppressed: false, isAdded: false},
- {type: type1, suppressed: false, isAdded: false}
- ];
- //items, abilities, moves, and natures !_!
- var itemPool = [''];
- var j = 1;
- for (var i in this.data.Items) {
- itemPool[j] = i;
- j++;
- }
- p.item = itemPool[this.random(itemPool.length)];
- var abilityPool = [];
- j = 0;
- for (var i in this.data.Abilities) {
- abilityPool[j] = i;
- j++;
- }
- p.ability = abilityPool[this.random(abilityPool.length)];
- //Skillful moves are done in onResidual
- }
- },
- onModifyPriority: function (priority) {
- return (7 - this.random(15));
- },
- onModifyMove: function (move, pokemon) {
- //Easter egg
- if (!this.random(65536)) move.name = ['o3o', '.3.', 'Skillful Move Name', 'Easter Egg', '42', 'LET IT BE KNOWN BY ALL THAT IMAS IS A HUGE FRICKIN NERD'];
- //Accuracy
- move.accuracy = (this.random(5)) ? 70 + this.random(31) : true;
- var cate = this.random(5);
- //Base Power
- move.basePower = cate === 4 ? 0 : this.random(256);
- delete move.basePowerCallback;
- //Category
- move.category = ['Physical', 'Special', 'Physical', 'Special', 'Status'][cate];
- //Status/Volatile Status
- delete move.status;
- delete move.volatileStatus;
- if (!move.self) {
- move.self = {};
- } else {
- if (move.self.volatileStatus) delete move.self.volatileStatus;
- if (move.self.status) delete move.self.status;
- }
- var octagon = this.random(64);
- var statusMat = ['tox', 'psn', 'brn', 'frz', 'par', 'slp'];
- var volStatusMat = ['confusion', 'flinch', 'mustrecharge', 'partiallytrapped', 'trapped', 'aquaring', 'attract', 'autotomize', 'bide', 'charge', 'curse', 'DefenseCurl', 'destinybond', 'disable', 'electrify', 'encore', 'endure', 'focusenergy', 'followme', 'foresight', 'gastroacid', 'grudge', 'healblock', 'helpinghand', 'imprison', 'ingrain', 'kingsshield', 'leechseed', 'magiccoat', 'magnetrise', 'matblock', 'minimize', 'miracleeye', 'nightmare', 'powder', 'powertrick', 'protect', 'rage', 'ragepowder', 'roost', 'smackdown', 'snatch', 'spikyshield', 'stockpile', 'Substitute', 'taunt', 'telekinesis', 'torment', 'uproar', 'yawn'];
- if (!octagon || move.id === 'metronome') {
- move.status = statusMat[this.random(statusMat.length)];
- move.volatileStatus = volStatusMat[this.random(volStatusMat.length)];
- } else if (octagon > 0 && octagon < 8) {
- move.status = statusMat[this.random(statusMat.length)];
- } else if (octagon > 7 && octagon < 15) {
- move.volatileStatus = volStatusMat[this.random(volStatusMat.length)];
- }
- octagon = this.random(64);
- if (!octagon || move.id === 'metronome') {
- move.self.status = statusMat[this.random(statusMat.length)];
- move.self.volatileStatus = volStatusMat[this.random(volStatusMat.length)];
- } else if (octagon > 0 && octagon < 8) {
- move.self.status = statusMat[this.random(statusMat.length)];
- } else if (octagon > 7 && octagon < 15) {
- move.self.volatileStatus = volStatusMat[this.random(volStatusMat.length)];
- }
- //Secondaries
- delete move.secondary;
- delete move.secondaries;
- var coinFlip = 0;
- var otherCoinFlip = 0;
- var chance = 0;
- var fake = false;
- move.secondaries = [];
- while (!fake) {
- coinFlip = this.random(4);
- if (!coinFlip) {
- chance = this.random(101);
- move.secondaries[move.secondaries.length] = {chance: chance, status: statusMat[this.random(statusMat.length)]};
- } else if (coinFlip === 1) {
- chance = this.random(101);
- move.secondaries[move.secondaries.length] = {chance: chance, volatileStatus: volStatusMat[this.random(volStatusMat.length)]};
- } else if (coinFlip === 2) {
- chance = this.random(101);
- move.secondaries[move.secondaries.length] = {chance: chance, self: {status: statusMat[this.random(statusMat.length)]}};
- } else {
- chance = this.random(101);
- move.secondaries[move.secondaries.length] = {chance: chance, self: {volatileStatus: volStatusMat[this.random(volStatusMat.length)]}};
- }
- otherCoinFlip = this.random(2);
- fake = !!otherCoinFlip;
- }
- //Boosts
- delete move.boosts;
- if (move.self) delete move.self.boosts;
- var soMuchCoin = (!this.random(10)) ? this.random(4) : -1;
- if (!soMuchCoin || move.id === 'metronome') {
- move.boosts = {};
- if (!move.self) move.self = {boosts: {}};
- else move.self.boosts = {};
- var statArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
- var statSum = 0;
- for (var s in statArr) {
- if (!this.random(statSum + 2)) {
- statArr[s] = 3 - this.random(7);
- statSum += statArr[s]
- }
- }
- move.boosts = {atk: statArr[0], def: statArr[1], spa: statArr[2], spd: statArr[3], spe: statArr[4], accuracy: statArr[5], evasion: statArr[6]};
- move.self.boosts = {atk: statArr[7], def: statArr[8], spa: statArr[9], spd: statArr[10], spe: statArr[11], accuracy: statArr[12], evasion: statArr[13]};
- } else if (soMuchCoin === 1) {
- move.boosts = {};
- var statArr = [0, 0, 0, 0, 0, 0, 0];
- var statSum = 0;
- for (var s in statArr) {
- if (!this.random(statSum + 2)) {
- statArr[s] = 3 - this.random(7);
- statSum += statArr[s]
- }
- }
- move.boosts = {atk: statArr[0], def: statArr[1], spa: statArr[2], spd: statArr[3], spe: statArr[4], accuracy: statArr[5], evasion: statArr[6]};
- } else if (soMuchCoin === 2) {
- if (!move.self) move.self = {boosts: {}};
- else move.self.boosts = {};
- var statArr = [0, 0, 0, 0, 0, 0, 0];
- var statSum = 0;
- for (var s in statArr) {
- if (!this.random(statSum + 2)) {
- statArr[s] = 3 - this.random(7);
- statSum += statArr[s]
- }
- }
- move.self.boosts = {atk: statArr[0], def: statArr[1], spa: statArr[2], spd: statArr[3], spe: statArr[4], accuracy: statArr[5], evasion: statArr[6]};
- }
- //Target
- if (move.category === 'Status') move.target = ['normal', 'self', 'self', 'self'][this.random(4)];
- else move.target = ['normal', 'normal', 'normal', 'self'][this.random(4)];
- //Type
- move.type = (this.random(19) !== 18) ? Object.keys(Tools.data.TypeChart)[this.random(18)] : 'Skillful';
- //Recoil
- delete move.recoil;
- if (!this.random(10) || move.id === 'metronome') move.recoil = [this.random(100), (this.random(100) + 1)];
- //OHKO
- move.ohko = (!this.random(100)) ? true : false;
- //Multihit
- delete move.multihit;
- if (!this.random(25) || move.id === 'metronome') {
- var hit1 = this.random(7) + 1;
- var hit2 = 0;
- while (hit2 < hit1) hit2 = this.random(15) + 1;
- move.multihit = [hit1, hit2];
- }
- //Side Conditions
- delete move.sideCondition;
- if (!this.random(10) || move.id === 'metronome') move.sideCondition = ['craftyshield', 'healingwish', 'lightscreen', 'luckychant', 'lunardance', 'mist', 'quickguard', 'reflect', 'safeguard', 'spikes', 'stealthrock', 'tailwind', 'toxicspikes', 'wideguard', 'Wish'][this.random(16)];
- //Switching
- move.forceSwitch = (!this.random(33)) ? true : false;
- move.selfSwitch = (!this.random(33)) ? true : false;
- //misc
- delete move.heal;
- if (!this.random(20)) move.heal = [this.random(100), (this.random(100) + 1)];
- delete move.drain;
- if (!this.random(10) || move.id === 'metronome') move.drain = [this.random(100), (this.random(100) + 1)];
- move.flags = {authentic: !this.random(10), bite: !this.random(10), bullet: !this.random(10), charge: !this.random(10), contact: this.random(2), defrost: !this.random(5), distance: this.random(2), gravity: !this.random(5), heal: !this.random(10), mirror: !this.random(2), nonsky: !this.random(5), powder: !this.random(10), protect: !!this.random(10), pulse: !this.random(10), punch: !this.random(10), recharge: !this.random(10), reflectable: !this.random(10), snatch: !this.random(3), sound: !this.random(10)};
- delete move.selfdestruct;
- if (!this.random(100)) move.selfdestruct = true;
- move.breakProtect = (!this.random(20)) ? true : false;
- delete move.onHit;
- delete move.onTryHit;
- delete move.onPrepareHit;
- delete move.onBeforeHit;
- delete move.onModifyMove;
- delete move.onTry;
- delete move.weather;
- delete move.pseudoWeather;
- },
- onResidual: function (battle) {
- for (var s in battle.sides) {
- var thisSide = battle.sides[s];
- for (var n in thisSide.pokemon) {
- var p = thisSide.pokemon[n];
- var movePool = [];
- var moves = [];
- var moveset = [];
- j = 0;
- for (var i in this.data.Movedex) {
- movePool[j] = i;
- j++;
- }
- for (var k = 0; k < 4; k++) {
- moves[k] = movePool[this.random(movePool.length)];
- moveset[k] = {move: this.getMove(moves[k]).name, id: moves[k], maxpp: NaN, pp: 1, target: this.getMove(moves[k]).target, disabled: !this.random(50), used: !this.random(2)}
- }
- p.moves = moves;
- p.moveset = moveset;
- }
- }
- var f = this.random(9);
- if (!f) {
- var w = this.random(7);
- var weather = ['sunnyday', 'raindance', 'sandstorm', 'hail', 'desolateland', 'primordialsea', 'deltastream'][w];
- if (this.effectiveWeather() === weather) {
- this.clearWeather();
- } else {
- this.setWeather(weather);
- }
- } else if (f === 1) {
- var pw = this.random(9);
- var pseudoWeather = ['echoedvoice', 'fairylock', 'gravity', 'iondeluge', 'magicroom', 'mudsport', 'trickroom', 'watersport', 'wonderroom'][pw];
- if (this.pseudoWeather[pseudoWeather]) {
- this.removePseudoWeather(pseudoWeather);
- } else {
- if (!this.random(2)) {
- this.addPseudoWeather(pseudoWeather, this.p1.pokemon[0]);
- } else {
- this.addPseudoWeather(pseudoWeather, this.p2.pokemon[0]);
- }
- }
- } else if (f === 2) {
- var t = this.random(3);
- var terrain = ['electricterrain', 'grassyterrain', 'mistyterrain'][t];
- if (this.isTerrain(terrain)) {
- this.setTerrain('');
- } else {
- this.setTerrain(terrain);
- }
- }
- }
- },
- ==================================================================
- mods/skills/statuses.js
- ==================================================================
- exports.BattleStatuses = {
- brn: {
- inherit: true,
- onResidual: function (pokemon) {
- var h = this.random(4);
- if (h) {
- this.damage(pokemon.maxhp / ((this.random(8) + 1)*(this.random(8) + 1)));
- } else {
- this.heal(pokemon.maxhp / ((this.random(8) + 1)*(this.random(8) + 1)));
- }
- },
- onBeforeMove: function (pokemon) {
- if (!this.random(16)) {
- pokemon.cureStatus();
- return;
- }
- }
- },
- par: {
- inherit: true,
- onModifySpe: function (speMod, pokemon) {
- if (!(pokemon.hasAbility('quickfeet') || !this.random(4))) {
- return this.chain(speMod, this.random(4)/(this.random(16) + 1));
- } else {
- return this.chain(speMod, this.random(16)/(this.random(4) + 1))
- }
- },
- onBeforeMove: function (pokemon) {
- if (!this.random(16)) {
- pokemon.cureStatus();
- return;
- }
- if (!this.random(this.random(this.random(16) + 1) + 1)) {
- this.add('cant', pokemon, 'par');
- return false;
- } else if (!this.random(this.random(this.random(16) + 1) + 1)) {
- this.add('cant', pokemon, 'par');
- return false;
- }
- }
- },
- slp: {
- inherit: true,
- onStart: function (target) {
- this.add('-status', target, 'slp');
- // 1-3 turns
- var mat = [this.random(4), this.random(8)];
- this.effectData.startTime = (mat[0] > mat[1]) ? this.random(mat[1], mat[0]) : this.random(mat[0], mat[1]);
- this.effectData.time = this.effectData.startTime;
- },
- onBeforeMove: function (pokemon, target, move) {
- if (pokemon.hasAbility('earlybird') || !this.random(4)) {
- pokemon.statusData.time--;
- }
- pokemon.statusData.time--;
- if (pokemon.statusData.time <= 0 || !this.random(16)) {
- pokemon.cureStatus();
- return;
- }
- this.add('cant', pokemon, 'slp');
- if (move.sleepUsable) {
- return;
- }
- return false;
- }
- },
- frz: {
- inherit: true,
- onBeforeMove: function (pokemon, target, move) {
- if (move.flags['defrost']) return;
- if (!this.random(5) || !this.random(16) || !this.random(11)) {
- pokemon.cureStatus();
- return;
- }
- this.add('cant', pokemon, 'frz');
- return false;
- }
- },
- psn: {
- inherit: true,
- onResidual: function (pokemon) {
- var h = this.random(4);
- if (h) {
- this.damage(pokemon.maxhp / ((this.random(8) + 1)*(this.random(8) + 1)));
- } else {
- this.heal(pokemon.maxhp / ((this.random(8) + 1)*(this.random(8) + 1)));
- }
- },
- onBeforeMove: function (pokemon) {
- if (!this.random(16)) {
- pokemon.cureStatus();
- return;
- }
- }
- },
- tox: {
- inherit: true,
- onResidual: function (pokemon) {
- this.effectData.stage++; //WE MUST GO FURTHER BEYOND
- var h = this.random(4);
- if (h) {
- this.damage(pokemon.maxhp * this.effectData.stage / ((this.random(16) + 1)*(this.random(16) + 1)));
- } else {
- this.heal(pokemon.maxhp * this.effectData.stage / ((this.random(16) + 1)*(this.random(16) + 1)));
- }
- },
- onBeforeMove: function (pokemon) {
- if (!this.random(16)) {
- pokemon.cureStatus();
- return;
- }
- }
- },
- //Things I'll get to
- /*confusion: {
- // this is a volatile status
- onStart: function (target, source, sourceEffect) {
- var result = this.runEvent('TryConfusion', target, source, sourceEffect);
- if (!result) return result;
- if (sourceEffect && sourceEffect.id === 'lockedmove') {
- this.add('-start', target, 'confusion', '[fatigue]');
- } else {
- this.add('-start', target, 'confusion');
- }
- this.effectData.time = this.random(2, 6);
- },
- onEnd: function (target) {
- this.add('-end', target, 'confusion');
- },
- onBeforeMovePriority: 3,
- onBeforeMove: function (pokemon) {
- pokemon.volatiles.confusion.time--;
- if (!pokemon.volatiles.confusion.time) {
- pokemon.removeVolatile('confusion');
- return;
- }
- this.add('-activate', pokemon, 'confusion');
- if (this.random(2) === 0) {
- return;
- }
- this.damage(this.getDamage(pokemon, pokemon, 40), pokemon, pokemon, {
- id: 'confused',
- effectType: 'Move',
- type: '???'
- });
- return false;
- }
- },
- flinch: {
- duration: 1,
- onBeforeMovePriority: 8,
- onBeforeMove: function (pokemon) {
- if (!this.runEvent('Flinch', pokemon)) {
- return;
- }
- this.add('cant', pokemon, 'flinch');
- return false;
- }
- },
- trapped: {
- noCopy: true,
- onModifyPokemon: function (pokemon) {
- pokemon.tryTrap();
- },
- onStart: function (target) {
- this.add('-activate', target, 'trapped');
- }
- },
- trapper: {
- noCopy: true
- },
- partiallytrapped: {
- duration: 5,
- durationCallback: function (target, source) {
- if (source.hasItem('gripclaw')) return 8;
- return this.random(5, 7);
- },
- onStart: function (pokemon, source) {
- this.add('-activate', pokemon, 'move: ' + this.effectData.sourceEffect, '[of] ' + source);
- },
- onResidualOrder: 11,
- onResidual: function (pokemon) {
- if (this.effectData.source && (!this.effectData.source.isActive || this.effectData.source.hp <= 0)) {
- delete pokemon.volatiles['partiallytrapped'];
- return;
- }
- if (this.effectData.source.hasItem('bindingband')) {
- this.damage(pokemon.maxhp / 6);
- } else {
- this.damage(pokemon.maxhp / 8);
- }
- },
- onEnd: function (pokemon) {
- this.add('-end', pokemon, this.effectData.sourceEffect, '[partiallytrapped]');
- },
- onModifyPokemon: function (pokemon) {
- pokemon.tryTrap();
- }
- },
- lockedmove: {
- // Outrage, Thrash, Petal Dance...
- duration: 2,
- onResidual: function (target) {
- if (target.status === 'slp') {
- // don't lock, and bypass confusion for calming
- delete target.volatiles['lockedmove'];
- }
- this.effectData.trueDuration--;
- },
- onStart: function (target, source, effect) {
- this.effectData.trueDuration = this.random(2, 4);
- this.effectData.move = effect.id;
- },
- onRestart: function () {
- if (this.effectData.trueDuration >= 2) {
- this.effectData.duration = 2;
- }
- },
- onEnd: function (target) {
- if (this.effectData.trueDuration > 1) return;
- target.addVolatile('confusion');
- },
- onLockMove: function (pokemon) {
- return this.effectData.move;
- }
- },
- twoturnmove: {
- // Skull Bash, SolarBeam, Sky Drop...
- duration: 2,
- onStart: function (target, source, effect) {
- this.effectData.move = effect.id;
- // source and target are reversed since the event target is the
- // pokemon using the two-turn move
- this.effectData.targetLoc = this.getTargetLoc(source, target);
- target.addVolatile(effect.id, source);
- },
- onEnd: function (target) {
- target.removeVolatile(this.effectData.move);
- },
- onLockMove: function () {
- return this.effectData.move;
- },
- onLockMoveTarget: function () {
- return this.effectData.targetLoc;
- }
- },
- choicelock: {
- onStart: function (pokemon) {
- if (!this.activeMove.id || this.activeMove.sourceEffect && this.activeMove.sourceEffect !== this.activeMove.id) return false;
- this.effectData.move = this.activeMove.id;
- },
- onDisableMove: function (pokemon) {
- if (!pokemon.getItem().isChoice || !pokemon.hasMove(this.effectData.move)) {
- pokemon.removeVolatile('choicelock');
- return;
- }
- if (pokemon.ignoringItem()) {
- return;
- }
- var moves = pokemon.moveset;
- for (var i = 0; i < moves.length; i++) {
- if (moves[i].id !== this.effectData.move) {
- pokemon.disableMove(moves[i].id, false, this.effectData.sourceEffect);
- }
- }
- }
- },
- mustrecharge: {
- duration: 2,
- onBeforeMovePriority: 11,
- onBeforeMove: function (pokemon) {
- this.add('cant', pokemon, 'recharge');
- pokemon.removeVolatile('mustrecharge');
- return false;
- },
- onLockMove: function (pokemon) {
- this.add('-mustrecharge', pokemon);
- return 'recharge';
- }
- },
- futuremove: {
- // this is a side condition
- onStart: function (side) {
- this.effectData.positions = [];
- for (var i = 0; i < side.active.length; i++) {
- this.effectData.positions[i] = null;
- }
- },
- onResidualOrder: 3,
- onResidual: function (side) {
- var finished = true;
- for (var i = 0; i < side.active.length; i++) {
- var posData = this.effectData.positions[i];
- if (!posData) continue;
- posData.duration--;
- if (posData.duration > 0) {
- finished = false;
- continue;
- }
- // time's up; time to hit! :D
- var target = side.foe.active[posData.targetPosition];
- var move = this.getMove(posData.move);
- if (target.fainted) {
- this.add('-hint', '' + move.name + ' did not hit because the target is fainted.');
- this.effectData.positions[i] = null;
- continue;
- }
- this.add('-end', target, 'move: ' + move.name);
- target.removeVolatile('Protect');
- target.removeVolatile('Endure');
- if (posData.moveData.ignoreImmunity === undefined) {
- posData.moveData.ignoreImmunity = false;
- }
- if (target.hasAbility('wonderguard') && this.gen > 5) {
- this.debug('Wonder Guard immunity: ' + move.id);
- if (target.runEffectiveness(move) <= 0) {
- this.add('-activate', target, 'ability: Wonder Guard');
- this.effectData.positions[i] = null;
- return null;
- }
- }
- // Prior to gen 5, these moves had no STAB and no effectiveness.
- // This is done here and to moveData's type for two reasons:
- // - modifyMove event happens before the moveHit function is run.
- // - moveData here is different from move, as one is generated here and the other by the move itself.
- // So here we centralise any future hit move getting typeless on hit as it should be.
- if (this.gen < 5) {
- posData.moveData.type = '???';
- }
- this.moveHit(target, posData.source, move, posData.moveData);
- this.effectData.positions[i] = null;
- }
- if (finished) {
- side.removeSideCondition('futuremove');
- }
- }
- },
- stall: {
- // Protect, Detect, Endure counter
- duration: 2,
- counterMax: 729,
- onStart: function () {
- this.effectData.counter = 3;
- },
- onStallMove: function () {
- // this.effectData.counter should never be undefined here.
- // However, just in case, use 1 if it is undefined.
- var counter = this.effectData.counter || 1;
- this.debug("Success chance: " + Math.round(100 / counter) + "%");
- return (this.random(counter) === 0);
- },
- onRestart: function () {
- if (this.effectData.counter < this.effect.counterMax) {
- this.effectData.counter *= 3;
- }
- this.effectData.duration = 2;
- }
- },
- gem: {
- duration: 1,
- affectsFainted: true,
- onBasePower: function (basePower, user, target, move) {
- this.debug('Gem Boost');
- return this.chainModify([0x14CD, 0x1000]);
- }
- },
- aura: {
- duration: 1,
- onBasePowerPriority: 8,
- onBasePower: function (basePower, user, target, move) {
- var modifier = 0x1547;
- this.debug('Aura Boost');
- if (user.volatiles['aurabreak']) {
- modifier = 0x0C00;
- this.debug('Aura Boost reverted by Aura Break');
- }
- return this.chainModify([modifier, 0x1000]);
- }
- },*/
- // weather is implemented here since it's "so important" to the game
- raindance: {
- inherit: true,
- duration: Math.floor(Math.random()*10),
- durationCallback: function () {
- return Math.floor(Math.random()*10);
- },
- onBasePower: function (basePower, attacker, defender, move) {
- if (move.type === 'Water') {
- this.debug('rain water boost');
- return this.chainModify(this.random(27)/(this.random(8) + 1));
- }
- if (move.type === 'Fire') {
- this.debug('rain fire suppress');
- return this.chainModify(this.random(8)/(this.random(27) + 1));
- }
- },
- onStart: function (battle, source, effect) {
- this.add('-weather', 'RainDance');
- }
- },
- primordialsea: {
- inherit: true,
- duration: Math.floor(Math.random()*10),
- durationCallback: function () {
- return Math.floor(Math.random()*10);
- },
- onBasePower: function (basePower, attacker, defender, move) {
- if (move.type === 'Water') {
- this.debug('Rain water boost');
- return this.chainModify(this.random(27)/(this.random(8) + 1));
- }
- }
- },
- sunnyday: {
- inherit: true,
- duration: Math.floor(Math.random()*10),
- durationCallback: function () {
- return Math.floor(Math.random()*10);
- },
- onBasePower: function (basePower, attacker, defender, move) {
- if (move.type === 'Fire') {
- this.debug('Sunny Day fire boost');
- return this.chainModify(this.random(27)/(this.random(8) + 1));
- }
- if (move.type === 'Water') {
- this.debug('Sunny Day water suppress');
- return this.chainModify(this.random(8)/(this.random(27) + 1));
- }
- },
- onStart: function (battle, source, effect) {
- this.add('-weather', 'SunnyDay');
- }
- },
- desolateland: {
- inherit: true,
- duration: Math.floor(Math.random()*10),
- durationCallback: function () {
- return Math.floor(Math.random()*10);
- },
- onBasePower: function (basePower, attacker, defender, move) {
- if (move.type === 'Fire') {
- this.debug('Sunny Day fire boost');
- return this.chainModify(this.random(27)/(this.random(8) + 1));
- }
- }
- },
- sandstorm: {
- inherit: true,
- duration: Math.floor(Math.random()*10),
- durationCallback: function () {
- return Math.floor(Math.random()*10);
- },
- onModifySpD: function (spd, pokemon) {
- if (pokemon.hasType('Rock') && this.isWeather('sandstorm')) {
- return this.modify(spd, this.random(27)/(this.random(8) + 1));
- }
- },
- onStart: function (battle, source, effect) {
- this.add('-weather', 'Sandstorm');
- if (!this.random(666)) { //Loomymarty
- for (var darude = 0; darude < 420/10; darude++) {
- this.add('-message', 'DUDUDUDUDUDUDDUDUDUDUDUDUDDUDUDUDUDUDUDUDUDUDUDUDDUDUDUDUDDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDUDDUDUDUDDUDU');
- }
- }
- },
- onWeather: function (target) {
- var h = this.random(4);
- if (h) {
- this.damage(target.maxhp / ((this.random(16) + 1)*(this.random(16) + 1)));
- } else {
- this.heal(target.maxhp / ((this.random(16) + 1)*(this.random(16) + 1)));
- }
- }
- },
- hail: {
- inherit: true,
- duration: Math.floor(Math.random()*10),
- durationCallback: function () {
- return Math.floor(Math.random()*10);
- },
- onStart: function (battle, source, effect) {
- this.add('-weather', 'Hail');
- },
- onWeather: function (target) {
- var h = this.random(4);
- if (h) {
- this.damage(target.maxhp / ((this.random(16) + 1)*(this.random(16) + 1)));
- } else {
- this.heal(target.maxhp / ((this.random(16) + 1)*(this.random(16) + 1)));
- }
- },
- onEnd: function () {
- this.add('-weather', 'none');
- }
- },
- deltastream: {
- inherit: true,
- duration: Math.floor(Math.random()*10),
- onEffectiveness: function (typeMod, target, type, move) {
- if (move && move.effectType === 'Move' && type === 'Flying') {
- this.add('-activate', '', 'deltastream');
- return this.random(9) - 4; //Who needs a limit of 2x effectiveness in skill cup
- }
- }
- }
- };
- ==================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement