mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-20 16:42:45 +02:00
Compare commits
6 Commits
a43dcd1b12
...
632dd27d91
Author | SHA1 | Date | |
---|---|---|---|
|
632dd27d91 | ||
|
51a3b09da7 | ||
|
7cc64a9dae | ||
|
427021a117 | ||
|
e135751537 | ||
|
6b6e2ad93a |
@ -18,16 +18,18 @@ export class AttemptRunPhase extends PokemonPhase {
|
||||
|
||||
const playerField = globalScene.getPlayerField();
|
||||
const enemyField = globalScene.getEnemyField();
|
||||
|
||||
const playerPokemon = this.getPokemon();
|
||||
|
||||
const escapeChance = new NumberHolder(0);
|
||||
|
||||
this.attemptRunAway(playerField, enemyField, escapeChance);
|
||||
|
||||
applyAbAttrs("RunSuccessAbAttr", playerPokemon, null, false, escapeChance);
|
||||
applyAbAttrs("RunSuccessAbAttr", playerField[0], null, false, escapeChance);
|
||||
|
||||
if (playerPokemon.randBattleSeedInt(100) < escapeChance.value && !this.forceFailEscape) {
|
||||
//TODO: needed?
|
||||
if (globalScene.currentBattle.double) {
|
||||
applyAbAttrs("RunSuccessAbAttr", playerField[1], null, false, escapeChance);
|
||||
}
|
||||
|
||||
if (playerField[0].randBattleSeedInt(100) < escapeChance.value && !this.forceFailEscape) {
|
||||
enemyField.forEach(enemyPokemon => applyPreLeaveFieldAbAttrs("PreLeaveFieldAbAttr", enemyPokemon));
|
||||
|
||||
globalScene.playSound("se/flee");
|
||||
@ -60,7 +62,12 @@ export class AttemptRunPhase extends PokemonPhase {
|
||||
|
||||
globalScene.phaseManager.pushNew("NewBattlePhase");
|
||||
} else {
|
||||
playerPokemon.turnData.failedRunAway = true;
|
||||
playerField[0].turnData.failedRunAway = true;
|
||||
|
||||
if (globalScene.currentBattle.double) {
|
||||
playerField[1].turnData.failedRunAway = true;
|
||||
}
|
||||
|
||||
globalScene.phaseManager.queueMessage(i18next.t("battle:runAwayCannotEscape"), null, true, 500);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user