mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-09-11 02:35:33 -05:00
Fix Protean interaction with Sucker Punch
and other assorted things
This commit is contained in:
@@ -337,7 +337,16 @@ export const BattleScripts: BattleScriptsData = {
|
||||
|
||||
this.setActiveMove(move, pokemon, targets[0]);
|
||||
|
||||
let hitResult = this.singleEvent('PrepareHit', move, {}, targets[0], pokemon, move);
|
||||
let hitResult = this.singleEvent('Try', move, null, pokemon, targets[0], move);
|
||||
if (!hitResult) {
|
||||
if (hitResult === false) {
|
||||
this.add('-fail', pokemon);
|
||||
this.attrLastMove('[still]');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
hitResult = this.singleEvent('PrepareHit', move, {}, targets[0], pokemon, move);
|
||||
if (!hitResult) {
|
||||
if (hitResult === false) {
|
||||
this.add('-fail', pokemon);
|
||||
@@ -347,15 +356,6 @@ export const BattleScripts: BattleScriptsData = {
|
||||
}
|
||||
this.runEvent('PrepareHit', pokemon, targets[0], move);
|
||||
|
||||
hitResult = this.singleEvent('Try', move, null, pokemon, targets[0], move);
|
||||
if (!hitResult) {
|
||||
if (hitResult === false) {
|
||||
this.add('-fail', pokemon);
|
||||
this.attrLastMove('[still]');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
let atLeastOneFailure!: boolean;
|
||||
for (const step of moveSteps) {
|
||||
// @ts-ignore
|
||||
@@ -574,6 +574,10 @@ export const BattleScripts: BattleScriptsData = {
|
||||
tryMoveHit(target, pokemon, move) {
|
||||
this.setActiveMove(move, pokemon, target);
|
||||
|
||||
if (!this.singleEvent('Try', move, null, pokemon, target, move)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let hitResult = this.singleEvent('PrepareHit', move, {}, target, pokemon, move);
|
||||
if (!hitResult) {
|
||||
if (hitResult === false) {
|
||||
@@ -584,10 +588,6 @@ export const BattleScripts: BattleScriptsData = {
|
||||
}
|
||||
this.runEvent('PrepareHit', pokemon, target, move);
|
||||
|
||||
if (!this.singleEvent('Try', move, null, pokemon, target, move)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (move.target === 'all') {
|
||||
hitResult = this.runEvent('TryHitField', target, pokemon, move);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user