mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-22 23:39:34 +02:00
Restore move history entry for charge phases
This commit is contained in:
parent
97806d7d4d
commit
185f7f2656
@ -6132,6 +6132,10 @@ const targetMoveCopiableCondition: MoveConditionFunc = (user, target, move) => {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (allMoves[copiableMove.move].isChargingMove() && copiableMove.result === MoveResult.OTHER) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Add last turn of Bide
|
// TODO: Add last turn of Bide
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -2,7 +2,7 @@ import BattleScene from "#app/battle-scene";
|
|||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
import { MoveChargeAnim } from "#app/data/battle-anims";
|
import { MoveChargeAnim } from "#app/data/battle-anims";
|
||||||
import { applyMoveChargeAttrs, MoveEffectAttr, InstantChargeAttr } from "#app/data/move";
|
import { applyMoveChargeAttrs, MoveEffectAttr, InstantChargeAttr } from "#app/data/move";
|
||||||
import Pokemon, { PokemonMove } from "#app/field/pokemon";
|
import Pokemon, { MoveResult, PokemonMove } from "#app/field/pokemon";
|
||||||
import { BooleanHolder } from "#app/utils";
|
import { BooleanHolder } from "#app/utils";
|
||||||
import { MovePhase } from "#app/phases/move-phase";
|
import { MovePhase } from "#app/phases/move-phase";
|
||||||
import { PokemonPhase } from "#app/phases/pokemon-phase";
|
import { PokemonPhase } from "#app/phases/pokemon-phase";
|
||||||
@ -26,13 +26,10 @@ export class MoveChargePhase extends PokemonPhase {
|
|||||||
|
|
||||||
const user = this.getUserPokemon();
|
const user = this.getUserPokemon();
|
||||||
const target = this.getTargetPokemon();
|
const target = this.getTargetPokemon();
|
||||||
if (!target) {
|
|
||||||
return this.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
const move = this.move.getMove();
|
const move = this.move.getMove();
|
||||||
if (!(move.isChargingMove())) {
|
|
||||||
return this.end();
|
if (!target || !(move.isChargingMove())) {
|
||||||
|
return super.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
new MoveChargeAnim(move.chargeAnim, move.id, user).play(this.scene, false, () => {
|
new MoveChargeAnim(move.chargeAnim, move.id, user).play(this.scene, false, () => {
|
||||||
@ -61,6 +58,9 @@ export class MoveChargePhase extends PokemonPhase {
|
|||||||
} else {
|
} else {
|
||||||
user.getMoveQueue().push({ move: move.id, targets: [ this.targetIndex ]});
|
user.getMoveQueue().push({ move: move.id, targets: [ this.targetIndex ]});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add this move's charging phase to the user's move history
|
||||||
|
user.pushMoveHistory({ move: this.move.moveId, targets: [ this.targetIndex ], result: MoveResult.OTHER });
|
||||||
}
|
}
|
||||||
super.end();
|
super.end();
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,6 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
* (and not random target) and failed the hit check against its target (MISS), log the move
|
* (and not random target) and failed the hit check against its target (MISS), log the move
|
||||||
* as FAILed or MISSed (depending on the conditions above) and end this phase.
|
* as FAILed or MISSed (depending on the conditions above) and end this phase.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!hasActiveTargets || (!move.hasAttr(VariableTargetAttr) && !move.isMultiTarget() && !targetHitChecks[this.targets[0]] && !targets[0].getTag(ProtectedTag) && !isImmune)) {
|
if (!hasActiveTargets || (!move.hasAttr(VariableTargetAttr) && !move.isMultiTarget() && !targetHitChecks[this.targets[0]] && !targets[0].getTag(ProtectedTag) && !isImmune)) {
|
||||||
this.stopMultiHit();
|
this.stopMultiHit();
|
||||||
if (hasActiveTargets) {
|
if (hasActiveTargets) {
|
||||||
|
@ -303,6 +303,7 @@ export class MovePhase extends BattlePhase {
|
|||||||
// Protean and Libero apply on the charging turn of charge moves
|
// Protean and Libero apply on the charging turn of charge moves
|
||||||
applyPreAttackAbAttrs(PokemonTypeChangeAbAttr, this.pokemon, null, this.move.getMove());
|
applyPreAttackAbAttrs(PokemonTypeChangeAbAttr, this.pokemon, null, this.move.getMove());
|
||||||
|
|
||||||
|
this.showMoveText();
|
||||||
this.scene.unshiftPhase(new MoveChargePhase(this.scene, this.pokemon.getBattlerIndex(), this.targets[0], this.move));
|
this.scene.unshiftPhase(new MoveChargePhase(this.scene, this.pokemon.getBattlerIndex(), this.targets[0], this.move));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user