mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-08-23 01:24:29 -05:00
Fix Z-move priority interaction
Priority Z-moves exist (namely, Gale Wings Supersonic Skystrike). Quick Guard now partially protects against priority Z-moves. Psychic Terrain now fully protects against priority Z-moves.
This commit is contained in:
@@ -3949,7 +3949,7 @@ class Battle extends Tools.BattleDex {
|
||||
baseDamage = this.runEvent('ModifyDamage', pokemon, target, move, baseDamage);
|
||||
|
||||
// TODO: Find out where this actually goes in the damage calculation
|
||||
if (move.isZ && (target.volatiles['banefulbunker'] || target.volatiles['kingsshield'] || target.side.sideConditions['matblock'] || target.volatiles['protect'] || target.volatiles['spikyshield'])) {
|
||||
if (move.isZ && (move.zBrokeProtect || target.volatiles['banefulbunker'] || target.volatiles['kingsshield'] || target.side.sideConditions['matblock'] || target.volatiles['protect'] || target.volatiles['spikyshield'])) {
|
||||
baseDamage = this.modify(baseDamage, 0.25);
|
||||
this.add('-message', target.name + " couldn't fully protect itself and got hurt! (placeholder)");
|
||||
}
|
||||
|
||||
@@ -12710,10 +12710,14 @@ exports.BattleMovedex = {
|
||||
this.add('-singleturn', source, 'Quick Guard');
|
||||
},
|
||||
onTryHitPriority: 4,
|
||||
onTryHit: function (target, source, effect) {
|
||||
onTryHit: function (target, source, move) {
|
||||
// Quick Guard blocks moves with positive priority, even those given increased priority by Prankster or Gale Wings.
|
||||
// (e.g. it blocks 0 priority moves boosted by Prankster or Gale Wings; Quick Claw/Custap Berry do not count)
|
||||
if (effect && (effect.id === 'feint' || effect.priority <= 0.1 || effect.target === 'self')) {
|
||||
if (move.id === 'feint' || move.priority <= 0.1 || move.target === 'self') {
|
||||
return;
|
||||
}
|
||||
if (move.isZ) {
|
||||
move.zBrokeProtect = true;
|
||||
return;
|
||||
}
|
||||
this.add('-activate', target, 'move: Quick Guard');
|
||||
|
||||
@@ -17,6 +17,9 @@ exports.BattleScripts = {
|
||||
move = zMove ? this.getZMoveCopy(move, pokemon) : baseMove;
|
||||
if (!target && target !== false) target = this.resolveTarget(pokemon, move);
|
||||
|
||||
// copy the priority for Quick Guard
|
||||
if (zMove) move.priority = baseMove.priority;
|
||||
|
||||
this.setActiveMove(move, pokemon, target);
|
||||
|
||||
/* if (pokemon.moveThisTurn) {
|
||||
|
||||
Reference in New Issue
Block a user