mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-09 04:23:45 -05:00
CAP: Improve Persistent activation (#9214)
This commit is contained in:
parent
140dc9b38e
commit
a8a0465cf1
|
|
@ -637,13 +637,17 @@ export const Moves: {[k: string]: ModdedMoveData} = {
|
|||
duration: 5,
|
||||
durationCallback(source, effect) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-activate', source, 'ability: Persistent', effect);
|
||||
this.add('-activate', source, 'ability: Persistent', '[move] Gravity');
|
||||
return 7;
|
||||
}
|
||||
return 5;
|
||||
},
|
||||
onFieldStart() {
|
||||
this.add('-fieldstart', 'move: Gravity');
|
||||
onFieldStart(target, source) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-fieldstart', 'move: Gravity', '[persistent]');
|
||||
} else {
|
||||
this.add('-fieldstart', 'move: Gravity');
|
||||
}
|
||||
for (const pokemon of this.getAllActive()) {
|
||||
let applies = false;
|
||||
if (pokemon.removeVolatile('bounce') || pokemon.removeVolatile('fly')) {
|
||||
|
|
@ -727,7 +731,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
|
|||
duration: 5,
|
||||
durationCallback(target, source, effect) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-activate', source, 'ability: Persistent', effect);
|
||||
this.add('-activate', source, 'ability: Persistent', '[move] Heal Block');
|
||||
return 7;
|
||||
}
|
||||
return 5;
|
||||
|
|
@ -1373,7 +1377,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
|
|||
duration: 5,
|
||||
durationCallback(target, source, effect) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-activate', source, 'ability: Persistent', effect);
|
||||
this.add('-activate', source, 'ability: Persistent', '[move] Safeguard');
|
||||
return 7;
|
||||
}
|
||||
return 5;
|
||||
|
|
@ -1398,8 +1402,12 @@ export const Moves: {[k: string]: ModdedMoveData} = {
|
|||
return null;
|
||||
}
|
||||
},
|
||||
onSideStart(side) {
|
||||
this.add('-sidestart', side, 'Safeguard');
|
||||
onSideStart(side, source) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-sidestart', side, 'Safeguard', '[persistent]');
|
||||
} else {
|
||||
this.add('-sidestart', side, 'Safeguard');
|
||||
}
|
||||
},
|
||||
onSideResidualOrder: 4,
|
||||
onSideEnd(side) {
|
||||
|
|
@ -1602,13 +1610,17 @@ export const Moves: {[k: string]: ModdedMoveData} = {
|
|||
duration: 3,
|
||||
durationCallback(target, source, effect) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-activate', source, 'ability: Persistent', effect);
|
||||
this.add('-activate', source, 'ability: Persistent', '[move] Tailwind');
|
||||
return 5;
|
||||
}
|
||||
return 3;
|
||||
},
|
||||
onSideStart(side) {
|
||||
this.add('-sidestart', side, 'move: Tailwind');
|
||||
onSideStart(side, source) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-sidestart', side, 'move: Tailwind', '[persistent]');
|
||||
} else {
|
||||
this.add('-sidestart', side, 'move: Tailwind');
|
||||
}
|
||||
},
|
||||
onModifySpe(spe) {
|
||||
return spe * 2;
|
||||
|
|
@ -1709,13 +1721,17 @@ export const Moves: {[k: string]: ModdedMoveData} = {
|
|||
duration: 5,
|
||||
durationCallback(source, effect) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-activate', source, 'ability: Persistent', effect);
|
||||
this.add('-activate', source, 'ability: Persistent', '[move] Trick Room');
|
||||
return 7;
|
||||
}
|
||||
return 5;
|
||||
},
|
||||
onFieldStart(target, source) {
|
||||
this.add('-fieldstart', 'move: Trick Room', '[of] ' + source);
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-fieldstart', 'move: Trick Room', '[of] ' + source, '[persistent]');
|
||||
} else {
|
||||
this.add('-fieldstart', 'move: Trick Room', '[of] ' + source);
|
||||
}
|
||||
},
|
||||
onFieldRestart(target, source) {
|
||||
this.field.removePseudoWeather('trickroom');
|
||||
|
|
|
|||
|
|
@ -7876,13 +7876,17 @@ export const Moves: {[moveid: string]: MoveData} = {
|
|||
duration: 5,
|
||||
durationCallback(source, effect) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-activate', source, 'ability: Persistent', effect);
|
||||
this.add('-activate', source, 'ability: Persistent', '[move] Gravity');
|
||||
return 7;
|
||||
}
|
||||
return 5;
|
||||
},
|
||||
onFieldStart() {
|
||||
this.add('-fieldstart', 'move: Gravity');
|
||||
onFieldStart(target, source) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-fieldstart', 'move: Gravity', '[persistent]');
|
||||
} else {
|
||||
this.add('-fieldstart', 'move: Gravity');
|
||||
}
|
||||
for (const pokemon of this.getAllActive()) {
|
||||
let applies = false;
|
||||
if (pokemon.removeVolatile('bounce') || pokemon.removeVolatile('fly')) {
|
||||
|
|
@ -8381,7 +8385,7 @@ export const Moves: {[moveid: string]: MoveData} = {
|
|||
duration: 5,
|
||||
durationCallback(target, source, effect) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-activate', source, 'ability: Persistent', effect);
|
||||
this.add('-activate', source, 'ability: Persistent', '[move] Heal Block');
|
||||
return 7;
|
||||
}
|
||||
return 5;
|
||||
|
|
@ -10902,13 +10906,17 @@ export const Moves: {[moveid: string]: MoveData} = {
|
|||
duration: 5,
|
||||
durationCallback(source, effect) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-activate', source, 'ability: Persistent', effect);
|
||||
this.add('-activate', source, 'ability: Persistent', '[move] Magic Room');
|
||||
return 7;
|
||||
}
|
||||
return 5;
|
||||
},
|
||||
onFieldStart(target, source) {
|
||||
this.add('-fieldstart', 'move: Magic Room', '[of] ' + source);
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-fieldstart', 'move: Magic Room', '[of] ' + source, '[persistent]');
|
||||
} else {
|
||||
this.add('-fieldstart', 'move: Magic Room', '[of] ' + source);
|
||||
}
|
||||
for (const mon of this.getAllActive()) {
|
||||
this.singleEvent('End', mon.getItem(), mon.itemState, mon);
|
||||
}
|
||||
|
|
@ -15831,7 +15839,7 @@ export const Moves: {[moveid: string]: MoveData} = {
|
|||
duration: 5,
|
||||
durationCallback(target, source, effect) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-activate', source, 'ability: Persistent', effect);
|
||||
this.add('-activate', source, 'ability: Persistent', '[move] Safeguard');
|
||||
return 7;
|
||||
}
|
||||
return 5;
|
||||
|
|
@ -15856,8 +15864,12 @@ export const Moves: {[moveid: string]: MoveData} = {
|
|||
return null;
|
||||
}
|
||||
},
|
||||
onSideStart(side) {
|
||||
this.add('-sidestart', side, 'Safeguard');
|
||||
onSideStart(side, source) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-sidestart', side, 'Safeguard', '[persistent]');
|
||||
} else {
|
||||
this.add('-sidestart', side, 'Safeguard');
|
||||
}
|
||||
},
|
||||
onSideResidualOrder: 26,
|
||||
onSideResidualSubOrder: 3,
|
||||
|
|
@ -19227,13 +19239,17 @@ export const Moves: {[moveid: string]: MoveData} = {
|
|||
duration: 4,
|
||||
durationCallback(target, source, effect) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-activate', source, 'ability: Persistent', effect);
|
||||
this.add('-activate', source, 'ability: Persistent', '[move] Tailwind');
|
||||
return 6;
|
||||
}
|
||||
return 4;
|
||||
},
|
||||
onSideStart(side) {
|
||||
this.add('-sidestart', side, 'move: Tailwind');
|
||||
onSideStart(side, source) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-sidestart', side, 'move: Tailwind', '[persistent]');
|
||||
} else {
|
||||
this.add('-sidestart', side, 'move: Tailwind');
|
||||
}
|
||||
},
|
||||
onModifySpe(spe, pokemon) {
|
||||
return this.chainModify(2);
|
||||
|
|
@ -20253,13 +20269,17 @@ export const Moves: {[moveid: string]: MoveData} = {
|
|||
duration: 5,
|
||||
durationCallback(source, effect) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-activate', source, 'ability: Persistent', effect);
|
||||
this.add('-activate', source, 'ability: Persistent', '[move] Trick Room');
|
||||
return 7;
|
||||
}
|
||||
return 5;
|
||||
},
|
||||
onFieldStart(target, source) {
|
||||
this.add('-fieldstart', 'move: Trick Room', '[of] ' + source);
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-fieldstart', 'move: Trick Room', '[of] ' + source, '[persistent]');
|
||||
} else {
|
||||
this.add('-fieldstart', 'move: Trick Room', '[of] ' + source);
|
||||
}
|
||||
},
|
||||
onFieldRestart(target, source) {
|
||||
this.field.removePseudoWeather('trickroom');
|
||||
|
|
@ -21284,7 +21304,7 @@ export const Moves: {[moveid: string]: MoveData} = {
|
|||
duration: 5,
|
||||
durationCallback(source, effect) {
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-activate', source, 'ability: Persistent', effect);
|
||||
this.add('-activate', source, 'ability: Persistent', '[move] Wonder Room');
|
||||
return 7;
|
||||
}
|
||||
return 5;
|
||||
|
|
@ -21298,7 +21318,11 @@ export const Moves: {[moveid: string]: MoveData} = {
|
|||
this.hint(`${move.name} uses ${statAndBoosts === 'def' ? '' : 'Sp. '}Def boosts when Wonder Room is active.`);
|
||||
},
|
||||
onFieldStart(field, source) {
|
||||
this.add('-fieldstart', 'move: Wonder Room', '[of] ' + source);
|
||||
if (source?.hasAbility('persistent')) {
|
||||
this.add('-fieldstart', 'move: Wonder Room', '[of] ' + source, '[persistent]');
|
||||
} else {
|
||||
this.add('-fieldstart', 'move: Wonder Room', '[of] ' + source);
|
||||
}
|
||||
},
|
||||
onFieldRestart(target, source) {
|
||||
this.field.removePseudoWeather('wonderroom');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user