Fix Secret Power interaction with Parental Bond

This commit is contained in:
The Immortal 2016-02-12 20:32:41 +04:00
parent f8e27d3b3a
commit 6603f9703a
2 changed files with 23 additions and 29 deletions

View File

@ -11727,31 +11727,23 @@ exports.BattleMovedex = {
pp: 20,
priority: 0,
flags: {protect: 1, mirror: 1},
onHit: function (target, source, move) {
if (this.isTerrain('')) return;
move.secondaries = [];
if (this.isTerrain('electricterrain')) {
move.secondaries.push({
chance: 30,
status: 'par',
});
} else if (this.isTerrain('grassyterrain')) {
move.secondaries.push({
chance: 30,
status: 'slp',
});
} else if (this.isTerrain('mistyterrain')) {
move.secondaries.push({
chance: 30,
boosts: {
spa: -1,
},
});
}
onHit: function (target, pokemon) {
pokemon.addVolatile('secretpower');
},
secondary: {
chance: 30,
status: 'par',
effect: {
duration: 1,
onAfterMoveSecondarySelf: function (source, target, move) {
if (this.random(10) < 3) {
if (this.isTerrain('') || this.isTerrain('electricterrain')) {
target.trySetStatus('par', source, move);
} else if (this.isTerrain('grassyterrain')) {
target.trySetStatus('slp', source, move);
} else if (this.isTerrain('mistyterrain')) {
this.boost({spa: -1}, target, source);
}
}
source.removeVolatile('secretpower');
},
},
target: "normal",
type: "Normal",

View File

@ -734,11 +734,13 @@ exports.BattleMovedex = {
},
secretpower: {
inherit: true,
onHit: function () {},
secondary: {
chance: 30,
boosts: {
accuracy: -1,
effect: {
duration: 1,
onAfterMoveSecondarySelf: function (source, target, move) {
if (this.random(10) < 3) {
this.boost({accuracy: -1}, target, source);
}
source.removeVolatile('secretpower');
},
},
},