mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 14:29:28 +02:00
Merge branch 'beta' into fix-pokeballtype-import
This commit is contained in:
commit
b2828f26da
@ -7,7 +7,7 @@ import { Weather } from "#app/data/weather";
|
|||||||
import { BattlerTag, BattlerTagLapseType, GroundedTag } from "./battler-tags";
|
import { BattlerTag, BattlerTagLapseType, GroundedTag } from "./battler-tags";
|
||||||
import { getNonVolatileStatusEffects, getStatusEffectDescriptor, getStatusEffectHealText } from "#app/data/status-effect";
|
import { getNonVolatileStatusEffects, getStatusEffectDescriptor, getStatusEffectHealText } from "#app/data/status-effect";
|
||||||
import { Gender } from "./gender";
|
import { Gender } from "./gender";
|
||||||
import Move, { AttackMove, MoveCategory, MoveFlags, MoveTarget, FlinchAttr, OneHitKOAttr, HitHealAttr, allMoves, StatusMove, SelfStatusMove, VariablePowerAttr, applyMoveAttrs, IncrementMovePriorityAttr, VariableMoveTypeAttr, RandomMovesetMoveAttr, RandomMoveAttr, NaturePowerAttr, CopyMoveAttr, MoveAttr, MultiHitAttr, SacrificialAttr, SacrificialAttrOnHit, NeutralDamageAgainstFlyingTypeMultiplierAttr, FixedDamageAttr } from "./move";
|
import Move, { AttackMove, MoveCategory, MoveFlags, MoveTarget, FlinchAttr, OneHitKOAttr, HitHealAttr, allMoves, StatusMove, SelfStatusMove, VariablePowerAttr, applyMoveAttrs, VariableMoveTypeAttr, RandomMovesetMoveAttr, RandomMoveAttr, NaturePowerAttr, CopyMoveAttr, MoveAttr, MultiHitAttr, SacrificialAttr, SacrificialAttrOnHit, NeutralDamageAgainstFlyingTypeMultiplierAttr, FixedDamageAttr } from "./move";
|
||||||
import { ArenaTagSide, ArenaTrapTag } from "./arena-tag";
|
import { ArenaTagSide, ArenaTrapTag } from "./arena-tag";
|
||||||
import { BerryModifier, HitHealModifier, PokemonHeldItemModifier } from "../modifier/modifier";
|
import { BerryModifier, HitHealModifier, PokemonHeldItemModifier } from "../modifier/modifier";
|
||||||
import { TerrainType } from "./terrain";
|
import { TerrainType } from "./terrain";
|
||||||
@ -585,15 +585,11 @@ export class PostDefendAbAttr extends AbAttr {
|
|||||||
|
|
||||||
export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr {
|
export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr {
|
||||||
applyPreDefend(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
applyPreDefend(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
||||||
const attackPriority = new Utils.IntegerHolder(move.priority);
|
|
||||||
applyMoveAttrs(IncrementMovePriorityAttr, attacker, null, move, attackPriority);
|
|
||||||
applyAbAttrs(ChangeMovePriorityAbAttr, attacker, null, simulated, move, attackPriority);
|
|
||||||
|
|
||||||
if (move.moveTarget === MoveTarget.USER || move.moveTarget === MoveTarget.NEAR_ALLY) {
|
if (move.moveTarget === MoveTarget.USER || move.moveTarget === MoveTarget.NEAR_ALLY) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attackPriority.value > 0 && !move.isMultiTarget()) {
|
if (move.getPriority(attacker) > 0 && !move.isMultiTarget()) {
|
||||||
cancelled.value = true;
|
cancelled.value = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,12 @@ import { Arena } from "#app/field/arena";
|
|||||||
import BattleScene from "#app/battle-scene";
|
import BattleScene from "#app/battle-scene";
|
||||||
import { Type } from "#enums/type";
|
import { Type } from "#enums/type";
|
||||||
import { BooleanHolder, NumberHolder, toDmgValue } from "#app/utils";
|
import { BooleanHolder, NumberHolder, toDmgValue } from "#app/utils";
|
||||||
import { MoveCategory, allMoves, MoveTarget, IncrementMovePriorityAttr, applyMoveAttrs } from "#app/data/move";
|
import { MoveCategory, allMoves, MoveTarget } from "#app/data/move";
|
||||||
import { getPokemonNameWithAffix } from "#app/messages";
|
import { getPokemonNameWithAffix } from "#app/messages";
|
||||||
import Pokemon, { HitResult, PokemonMove } from "#app/field/pokemon";
|
import Pokemon, { HitResult, PokemonMove } from "#app/field/pokemon";
|
||||||
import { StatusEffect } from "#enums/status-effect";
|
import { StatusEffect } from "#enums/status-effect";
|
||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
import { BlockNonDirectDamageAbAttr, ChangeMovePriorityAbAttr, InfiltratorAbAttr, ProtectStatAbAttr, applyAbAttrs } from "#app/data/ability";
|
import { BlockNonDirectDamageAbAttr, InfiltratorAbAttr, ProtectStatAbAttr, applyAbAttrs } from "#app/data/ability";
|
||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import { CommonAnim, CommonBattleAnim } from "#app/data/battle-anims";
|
import { CommonAnim, CommonBattleAnim } from "#app/data/battle-anims";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
@ -318,17 +318,15 @@ export class ConditionalProtectTag extends ArenaTag {
|
|||||||
*/
|
*/
|
||||||
const QuickGuardConditionFunc: ProtectConditionFunc = (arena, moveId) => {
|
const QuickGuardConditionFunc: ProtectConditionFunc = (arena, moveId) => {
|
||||||
const move = allMoves[moveId];
|
const move = allMoves[moveId];
|
||||||
const priority = new NumberHolder(move.priority);
|
|
||||||
const effectPhase = arena.scene.getCurrentPhase();
|
const effectPhase = arena.scene.getCurrentPhase();
|
||||||
|
|
||||||
if (effectPhase instanceof MoveEffectPhase) {
|
if (effectPhase instanceof MoveEffectPhase) {
|
||||||
const attacker = effectPhase.getUserPokemon();
|
const attacker = effectPhase.getUserPokemon();
|
||||||
applyMoveAttrs(IncrementMovePriorityAttr, attacker, null, move, priority);
|
|
||||||
if (attacker) {
|
if (attacker) {
|
||||||
applyAbAttrs(ChangeMovePriorityAbAttr, attacker, null, false, move, priority);
|
return move.getPriority(attacker) > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return priority.value > 0;
|
return move.priority > 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -910,11 +910,15 @@ export class FrenzyTag extends BattlerTag {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class EncoreTag extends BattlerTag {
|
/**
|
||||||
|
* Applies the effects of the move Encore onto the target Pokemon
|
||||||
|
* Encore forces the target Pokemon to use its most-recent move for 3 turns
|
||||||
|
*/
|
||||||
|
export class EncoreTag extends MoveRestrictionBattlerTag {
|
||||||
public moveId: Moves;
|
public moveId: Moves;
|
||||||
|
|
||||||
constructor(sourceId: number) {
|
constructor(sourceId: number) {
|
||||||
super(BattlerTagType.ENCORE, BattlerTagLapseType.AFTER_MOVE, 3, Moves.ENCORE, sourceId);
|
super(BattlerTagType.ENCORE, [ BattlerTagLapseType.CUSTOM, BattlerTagLapseType.AFTER_MOVE ], 3, Moves.ENCORE, sourceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -970,6 +974,39 @@ export class EncoreTag extends BattlerTag {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the encored move has run out of PP, Encore ends early. Otherwise, Encore lapses based on the AFTER_MOVE battler tag lapse type.
|
||||||
|
* @returns `true` to persist | `false` to end and be removed
|
||||||
|
*/
|
||||||
|
override lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
|
if (lapseType === BattlerTagLapseType.CUSTOM) {
|
||||||
|
const encoredMove = pokemon.getMoveset().find(m => m?.moveId === this.moveId);
|
||||||
|
if (encoredMove && encoredMove?.getPpRatio() > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return super.lapse(pokemon, lapseType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the move matches the moveId stored within the tag and returns a boolean value
|
||||||
|
* @param move {@linkcode Moves} the move selected
|
||||||
|
* @param user N/A
|
||||||
|
* @returns `true` if the move does not match with the moveId stored and as a result, restricted
|
||||||
|
*/
|
||||||
|
override isMoveRestricted(move: Moves, _user?: Pokemon): boolean {
|
||||||
|
if (move !== this.moveId) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
override selectionDeniedText(_pokemon: Pokemon, move: Moves): string {
|
||||||
|
return i18next.t("battle:moveDisabled", { moveName: allMoves[move].name });
|
||||||
|
}
|
||||||
|
|
||||||
onRemove(pokemon: Pokemon): void {
|
onRemove(pokemon: Pokemon): void {
|
||||||
super.onRemove(pokemon);
|
super.onRemove(pokemon);
|
||||||
|
|
||||||
@ -2361,7 +2398,7 @@ export class HealBlockTag extends MoveRestrictionBattlerTag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uses DisabledTag's selectionDeniedText() message
|
* Uses its own unique selectionDeniedText() message
|
||||||
*/
|
*/
|
||||||
override selectionDeniedText(pokemon: Pokemon, move: Moves): string {
|
override selectionDeniedText(pokemon: Pokemon, move: Moves): string {
|
||||||
return i18next.t("battle:moveDisabledHealBlock", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), moveName: allMoves[move].name, healBlockName: allMoves[Moves.HEAL_BLOCK].name });
|
return i18next.t("battle:moveDisabledHealBlock", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), moveName: allMoves[move].name, healBlockName: allMoves[Moves.HEAL_BLOCK].name });
|
||||||
|
@ -9,7 +9,7 @@ import { Constructor, NumberHolder } from "#app/utils";
|
|||||||
import * as Utils from "../utils";
|
import * as Utils from "../utils";
|
||||||
import { WeatherType } from "#enums/weather-type";
|
import { WeatherType } from "#enums/weather-type";
|
||||||
import { ArenaTagSide, ArenaTrapTag, WeakenMoveTypeTag } from "./arena-tag";
|
import { ArenaTagSide, ArenaTrapTag, WeakenMoveTypeTag } from "./arena-tag";
|
||||||
import { allAbilities, AllyMoveCategoryPowerBoostAbAttr, applyAbAttrs, applyPostAttackAbAttrs, applyPostItemLostAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, BlockItemTheftAbAttr, BlockNonDirectDamageAbAttr, BlockOneHitKOAbAttr, BlockRecoilDamageAttr, ConfusionOnStatusEffectAbAttr, FieldMoveTypePowerBoostAbAttr, FieldPreventExplosiveMovesAbAttr, ForceSwitchOutImmunityAbAttr, HealFromBerryUseAbAttr, IgnoreContactAbAttr, IgnoreMoveEffectsAbAttr, IgnoreProtectOnContactAbAttr, InfiltratorAbAttr, MaxMultiHitAbAttr, MoveAbilityBypassAbAttr, MoveEffectChanceMultiplierAbAttr, MoveTypeChangeAbAttr, PostDamageForceSwitchAbAttr, PostItemLostAbAttr, ReverseDrainAbAttr, UncopiableAbilityAbAttr, UnsuppressableAbilityAbAttr, UnswappableAbilityAbAttr, UserFieldMoveTypePowerBoostAbAttr, VariableMovePowerAbAttr, WonderSkinAbAttr } from "./ability";
|
import { allAbilities, AllyMoveCategoryPowerBoostAbAttr, applyAbAttrs, applyPostAttackAbAttrs, applyPostItemLostAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, BlockItemTheftAbAttr, BlockNonDirectDamageAbAttr, BlockOneHitKOAbAttr, BlockRecoilDamageAttr, ChangeMovePriorityAbAttr, ConfusionOnStatusEffectAbAttr, FieldMoveTypePowerBoostAbAttr, FieldPreventExplosiveMovesAbAttr, ForceSwitchOutImmunityAbAttr, HealFromBerryUseAbAttr, IgnoreContactAbAttr, IgnoreMoveEffectsAbAttr, IgnoreProtectOnContactAbAttr, InfiltratorAbAttr, MaxMultiHitAbAttr, MoveAbilityBypassAbAttr, MoveEffectChanceMultiplierAbAttr, MoveTypeChangeAbAttr, PostDamageForceSwitchAbAttr, PostItemLostAbAttr, ReverseDrainAbAttr, UncopiableAbilityAbAttr, UnsuppressableAbilityAbAttr, UnswappableAbilityAbAttr, UserFieldMoveTypePowerBoostAbAttr, VariableMovePowerAbAttr, WonderSkinAbAttr } from "./ability";
|
||||||
import { AttackTypeBoosterModifier, BerryModifier, PokemonHeldItemModifier, PokemonMoveAccuracyBoosterModifier, PokemonMultiHitModifier, PreserveBerryModifier } from "../modifier/modifier";
|
import { AttackTypeBoosterModifier, BerryModifier, PokemonHeldItemModifier, PokemonMoveAccuracyBoosterModifier, PokemonMultiHitModifier, PreserveBerryModifier } from "../modifier/modifier";
|
||||||
import { BattlerIndex, BattleType } from "../battle";
|
import { BattlerIndex, BattleType } from "../battle";
|
||||||
import { TerrainType } from "./terrain";
|
import { TerrainType } from "./terrain";
|
||||||
@ -831,6 +831,15 @@ export default class Move implements Localizable {
|
|||||||
|
|
||||||
return power.value;
|
return power.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPriority(user: Pokemon, simulated: boolean = true) {
|
||||||
|
const priority = new Utils.NumberHolder(this.priority);
|
||||||
|
|
||||||
|
applyMoveAttrs(IncrementMovePriorityAttr, user, null, this, priority);
|
||||||
|
applyAbAttrs(ChangeMovePriorityAbAttr, user, null, simulated, this, priority);
|
||||||
|
|
||||||
|
return priority.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AttackMove extends Move {
|
export class AttackMove extends Move {
|
||||||
@ -6750,7 +6759,8 @@ export class SketchAttr extends MoveEffectAttr {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const targetMove = target.getMoveHistory().filter(m => !m.virtual).at(-1);
|
const targetMove = target.getLastXMoves(target.battleSummonData.turnCount)
|
||||||
|
.find(m => m.move !== Moves.NONE && m.move !== Moves.STRUGGLE && !m.virtual);
|
||||||
if (!targetMove) {
|
if (!targetMove) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -7453,6 +7463,27 @@ export class FirstMoveCondition extends MoveCondition {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Condition used by the move {@link https://bulbapedia.bulbagarden.net/wiki/Upper_Hand_(move) | Upper Hand}.
|
||||||
|
* Moves with this condition are only successful when the target has selected
|
||||||
|
* a high-priority attack (after factoring in priority-boosting effects) and
|
||||||
|
* hasn't moved yet this turn.
|
||||||
|
*/
|
||||||
|
export class UpperHandCondition extends MoveCondition {
|
||||||
|
constructor() {
|
||||||
|
super((user, target, move) => {
|
||||||
|
const targetCommand = user.scene.currentBattle.turnCommands[target.getBattlerIndex()];
|
||||||
|
|
||||||
|
return !!targetCommand
|
||||||
|
&& targetCommand.command === Command.FIGHT
|
||||||
|
&& !target.turnData.acted
|
||||||
|
&& !!targetCommand.move?.move
|
||||||
|
&& allMoves[targetCommand.move.move].category !== MoveCategory.STATUS
|
||||||
|
&& allMoves[targetCommand.move.move].getPriority(target) > 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class hitsSameTypeAttr extends VariableMoveTypeMultiplierAttr {
|
export class hitsSameTypeAttr extends VariableMoveTypeMultiplierAttr {
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
const multiplier = args[0] as Utils.NumberHolder;
|
const multiplier = args[0] as Utils.NumberHolder;
|
||||||
@ -10570,8 +10601,7 @@ export function initMoves() {
|
|||||||
.attr(AddBattlerTagAttr, BattlerTagType.HEAL_BLOCK, false, false, 2),
|
.attr(AddBattlerTagAttr, BattlerTagType.HEAL_BLOCK, false, false, 2),
|
||||||
new AttackMove(Moves.UPPER_HAND, Type.FIGHTING, MoveCategory.PHYSICAL, 65, 100, 15, 100, 3, 9)
|
new AttackMove(Moves.UPPER_HAND, Type.FIGHTING, MoveCategory.PHYSICAL, 65, 100, 15, 100, 3, 9)
|
||||||
.attr(FlinchAttr)
|
.attr(FlinchAttr)
|
||||||
.condition((user, target, move) => user.scene.currentBattle.turnCommands[target.getBattlerIndex()]?.command === Command.FIGHT && !target.turnData.acted && allMoves[user.scene.currentBattle.turnCommands[target.getBattlerIndex()]?.move?.move!].category !== MoveCategory.STATUS && allMoves[user.scene.currentBattle.turnCommands[target.getBattlerIndex()]?.move?.move!].priority > 0 ) // TODO: is this bang correct?
|
.condition(new UpperHandCondition()),
|
||||||
.partial(), // Should also apply when target move priority increased by ability ex. gale wings
|
|
||||||
new AttackMove(Moves.MALIGNANT_CHAIN, Type.POISON, MoveCategory.SPECIAL, 100, 100, 5, 50, 0, 9)
|
new AttackMove(Moves.MALIGNANT_CHAIN, Type.POISON, MoveCategory.SPECIAL, 100, 100, 5, 50, 0, 9)
|
||||||
.attr(StatusEffectAttr, StatusEffect.TOXIC)
|
.attr(StatusEffectAttr, StatusEffect.TOXIC)
|
||||||
);
|
);
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import Pokemon from "../field/pokemon";
|
import Pokemon from "../field/pokemon";
|
||||||
import Move from "./move";
|
import Move from "./move";
|
||||||
import { Type } from "#enums/type";
|
import { Type } from "#enums/type";
|
||||||
import * as Utils from "../utils";
|
|
||||||
import { ChangeMovePriorityAbAttr, applyAbAttrs } from "./ability";
|
|
||||||
import { ProtectAttr } from "./move";
|
import { ProtectAttr } from "./move";
|
||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
@ -58,10 +56,8 @@ export class Terrain {
|
|||||||
switch (this.terrainType) {
|
switch (this.terrainType) {
|
||||||
case TerrainType.PSYCHIC:
|
case TerrainType.PSYCHIC:
|
||||||
if (!move.hasAttr(ProtectAttr)) {
|
if (!move.hasAttr(ProtectAttr)) {
|
||||||
const priority = new Utils.IntegerHolder(move.priority);
|
|
||||||
applyAbAttrs(ChangeMovePriorityAbAttr, user, null, false, move, priority);
|
|
||||||
// Cancels move if the move has positive priority and targets a Pokemon grounded on the Psychic Terrain
|
// Cancels move if the move has positive priority and targets a Pokemon grounded on the Psychic Terrain
|
||||||
return priority.value > 0 && user.getOpponents().some(o => targets.includes(o.getBattlerIndex()) && o.isGrounded());
|
return move.getPriority(user) > 0 && user.getOpponents().some(o => targets.includes(o.getBattlerIndex()) && o.isGrounded());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5082,26 +5082,6 @@ export class EnemyPokemon extends Pokemon {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
heal(amount: integer): integer {
|
|
||||||
if (this.isBoss()) {
|
|
||||||
const amountRatio = amount / this.getMaxHp();
|
|
||||||
const segmentBypassCount = Math.floor(amountRatio / (1 / this.bossSegments));
|
|
||||||
const segmentSize = this.getMaxHp() / this.bossSegments;
|
|
||||||
for (let s = 1; s < this.bossSegments; s++) {
|
|
||||||
const hpThreshold = segmentSize * s;
|
|
||||||
if (this.hp <= Math.round(hpThreshold)) {
|
|
||||||
const healAmount = Math.min(amount, this.getMaxHp() - this.hp, Math.round(hpThreshold + (segmentSize * segmentBypassCount) - this.hp));
|
|
||||||
this.hp += healAmount;
|
|
||||||
return healAmount;
|
|
||||||
} else if (s >= this.bossSegmentIndex) {
|
|
||||||
return super.heal(amount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.heal(amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
getFieldIndex(): integer {
|
getFieldIndex(): integer {
|
||||||
return this.scene.getEnemyField().indexOf(this);
|
return this.scene.getEnemyField().indexOf(this);
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,12 @@ export class CommandPhase extends FieldPhase {
|
|||||||
this.scene.currentBattle.turnCommands[this.fieldIndex] = { command: Command.FIGHT, move: { move: Moves.NONE, targets: []}, skip: true };
|
this.scene.currentBattle.turnCommands[this.fieldIndex] = { command: Command.FIGHT, move: { move: Moves.NONE, targets: []}, skip: true };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Checks if the Pokemon is under the effects of Encore. If so, Encore can end early if the encored move has no more PP.
|
||||||
|
const encoreTag = this.getPokemon().getTag(BattlerTagType.ENCORE) as EncoreTag;
|
||||||
|
if (encoreTag) {
|
||||||
|
this.getPokemon().lapseTag(BattlerTagType.ENCORE);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.scene.currentBattle.turnCommands[this.fieldIndex]?.skip) {
|
if (this.scene.currentBattle.turnCommands[this.fieldIndex]?.skip) {
|
||||||
return this.end();
|
return this.end();
|
||||||
}
|
}
|
||||||
@ -291,26 +297,6 @@ export class CommandPhase extends FieldPhase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkFightOverride(): boolean {
|
|
||||||
const pokemon = this.getPokemon();
|
|
||||||
|
|
||||||
const encoreTag = pokemon.getTag(EncoreTag) as EncoreTag;
|
|
||||||
|
|
||||||
if (!encoreTag) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const moveIndex = pokemon.getMoveset().findIndex(m => m?.moveId === encoreTag.moveId);
|
|
||||||
|
|
||||||
if (moveIndex === -1 || !pokemon.getMoveset()[moveIndex]!.isUsable(pokemon)) { // TODO: is this bang correct?
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.handleCommand(Command.FIGHT, moveIndex, false);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
getFieldIndex(): integer {
|
getFieldIndex(): integer {
|
||||||
return this.fieldIndex;
|
return this.fieldIndex;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import BattleScene from "#app/battle-scene";
|
import BattleScene from "#app/battle-scene";
|
||||||
import { applyAbAttrs, BypassSpeedChanceAbAttr, PreventBypassSpeedChanceAbAttr, ChangeMovePriorityAbAttr } from "#app/data/ability";
|
import { applyAbAttrs, BypassSpeedChanceAbAttr, PreventBypassSpeedChanceAbAttr } from "#app/data/ability";
|
||||||
import { allMoves, applyMoveAttrs, IncrementMovePriorityAttr, MoveHeaderAttr } from "#app/data/move";
|
import { allMoves, MoveHeaderAttr } from "#app/data/move";
|
||||||
import { Abilities } from "#app/enums/abilities";
|
import { Abilities } from "#app/enums/abilities";
|
||||||
import { Stat } from "#app/enums/stat";
|
import { Stat } from "#app/enums/stat";
|
||||||
import Pokemon, { PokemonMove } from "#app/field/pokemon";
|
import Pokemon, { PokemonMove } from "#app/field/pokemon";
|
||||||
@ -98,26 +98,22 @@ export class TurnStartPhase extends FieldPhase {
|
|||||||
const aMove = allMoves[aCommand.move!.move];
|
const aMove = allMoves[aCommand.move!.move];
|
||||||
const bMove = allMoves[bCommand!.move!.move];
|
const bMove = allMoves[bCommand!.move!.move];
|
||||||
|
|
||||||
// The game now considers priority and applies the relevant move and ability attributes
|
const aUser = this.scene.getField(true).find(p => p.getBattlerIndex() === a)!;
|
||||||
const aPriority = new Utils.IntegerHolder(aMove.priority);
|
const bUser = this.scene.getField(true).find(p => p.getBattlerIndex() === b)!;
|
||||||
const bPriority = new Utils.IntegerHolder(bMove.priority);
|
|
||||||
|
|
||||||
applyMoveAttrs(IncrementMovePriorityAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === a)!, null, aMove, aPriority);
|
const aPriority = aMove.getPriority(aUser, false);
|
||||||
applyMoveAttrs(IncrementMovePriorityAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === b)!, null, bMove, bPriority);
|
const bPriority = bMove.getPriority(bUser, false);
|
||||||
|
|
||||||
applyAbAttrs(ChangeMovePriorityAbAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === a)!, null, false, aMove, aPriority);
|
|
||||||
applyAbAttrs(ChangeMovePriorityAbAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === b)!, null, false, bMove, bPriority);
|
|
||||||
|
|
||||||
// The game now checks for differences in priority levels.
|
// The game now checks for differences in priority levels.
|
||||||
// If the moves share the same original priority bracket, it can check for differences in battlerBypassSpeed and return the result.
|
// If the moves share the same original priority bracket, it can check for differences in battlerBypassSpeed and return the result.
|
||||||
// This conditional is used to ensure that Quick Claw can still activate with abilities like Stall and Mycelium Might (attack moves only)
|
// This conditional is used to ensure that Quick Claw can still activate with abilities like Stall and Mycelium Might (attack moves only)
|
||||||
// Otherwise, the game returns the user of the move with the highest priority.
|
// Otherwise, the game returns the user of the move with the highest priority.
|
||||||
const isSameBracket = Math.ceil(aPriority.value) - Math.ceil(bPriority.value) === 0;
|
const isSameBracket = Math.ceil(aPriority) - Math.ceil(bPriority) === 0;
|
||||||
if (aPriority.value !== bPriority.value) {
|
if (aPriority !== bPriority) {
|
||||||
if (isSameBracket && battlerBypassSpeed[a].value !== battlerBypassSpeed[b].value) {
|
if (isSameBracket && battlerBypassSpeed[a].value !== battlerBypassSpeed[b].value) {
|
||||||
return battlerBypassSpeed[a].value ? -1 : 1;
|
return battlerBypassSpeed[a].value ? -1 : 1;
|
||||||
}
|
}
|
||||||
return aPriority.value < bPriority.value ? 1 : -1;
|
return (aPriority < bPriority) ? 1 : -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
116
src/test/moves/encore.test.ts
Normal file
116
src/test/moves/encore.test.ts
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
|
import { BattlerIndex } from "#app/battle";
|
||||||
|
import { MoveResult } from "#app/field/pokemon";
|
||||||
|
import { Abilities } from "#enums/abilities";
|
||||||
|
import { Moves } from "#enums/moves";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
import GameManager from "#test/utils/gameManager";
|
||||||
|
import Phaser from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
|
describe("Moves - Encore", () => {
|
||||||
|
let phaserGame: Phaser.Game;
|
||||||
|
let game: GameManager;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
phaserGame = new Phaser.Game({
|
||||||
|
type: Phaser.HEADLESS,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
game.phaseInterceptor.restoreOg();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
game = new GameManager(phaserGame);
|
||||||
|
game.override
|
||||||
|
.moveset([ Moves.SPLASH, Moves.ENCORE ])
|
||||||
|
.ability(Abilities.BALL_FETCH)
|
||||||
|
.battleType("single")
|
||||||
|
.disableCrits()
|
||||||
|
.enemySpecies(Species.MAGIKARP)
|
||||||
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
|
.enemyMoveset([ Moves.SPLASH, Moves.TACKLE ])
|
||||||
|
.startingLevel(100)
|
||||||
|
.enemyLevel(100);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should prevent the target from using any move except the last used move", async () => {
|
||||||
|
await game.classicMode.startBattle([ Species.SNORLAX ]);
|
||||||
|
|
||||||
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
game.move.select(Moves.ENCORE);
|
||||||
|
await game.forceEnemyMove(Moves.SPLASH);
|
||||||
|
|
||||||
|
await game.toNextTurn();
|
||||||
|
expect(enemyPokemon.getTag(BattlerTagType.ENCORE)).toBeDefined();
|
||||||
|
|
||||||
|
game.move.select(Moves.SPLASH);
|
||||||
|
// The enemy AI would normally be inclined to use Tackle, but should be
|
||||||
|
// forced into using Splash.
|
||||||
|
await game.phaseInterceptor.to("BerryPhase", false);
|
||||||
|
|
||||||
|
expect(enemyPokemon.getLastXMoves().every(turnMove => turnMove.move === Moves.SPLASH)).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("should fail against the following moves:", () => {
|
||||||
|
it.each([
|
||||||
|
{ moveId: Moves.TRANSFORM, name: "Transform", delay: false },
|
||||||
|
{ moveId: Moves.MIMIC, name: "Mimic", delay: true },
|
||||||
|
{ moveId: Moves.SKETCH, name: "Sketch", delay: true },
|
||||||
|
{ moveId: Moves.ENCORE, name: "Encore", delay: false },
|
||||||
|
{ moveId: Moves.STRUGGLE, name: "Struggle", delay: false }
|
||||||
|
])("$name", async ({ moveId, delay }) => {
|
||||||
|
game.override.enemyMoveset(moveId);
|
||||||
|
|
||||||
|
await game.classicMode.startBattle([ Species.SNORLAX ]);
|
||||||
|
|
||||||
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
if (delay) {
|
||||||
|
game.move.select(Moves.SPLASH);
|
||||||
|
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
|
||||||
|
await game.toNextTurn();
|
||||||
|
}
|
||||||
|
|
||||||
|
game.move.select(Moves.ENCORE);
|
||||||
|
|
||||||
|
const turnOrder = delay
|
||||||
|
? [ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]
|
||||||
|
: [ BattlerIndex.ENEMY, BattlerIndex.PLAYER ];
|
||||||
|
await game.setTurnOrder(turnOrder);
|
||||||
|
|
||||||
|
await game.phaseInterceptor.to("BerryPhase", false);
|
||||||
|
expect(playerPokemon.getLastXMoves(1)[0].result).toBe(MoveResult.FAIL);
|
||||||
|
expect(enemyPokemon.getTag(BattlerTagType.ENCORE)).toBeUndefined();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("Pokemon under both Encore and Torment should alternate between Struggle and restricted move", async () => {
|
||||||
|
const turnOrder = [ BattlerIndex.ENEMY, BattlerIndex.PLAYER ];
|
||||||
|
game.override.moveset([ Moves.ENCORE, Moves.TORMENT, Moves.SPLASH ]);
|
||||||
|
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||||
|
|
||||||
|
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||||
|
game.move.select(Moves.ENCORE);
|
||||||
|
await game.setTurnOrder(turnOrder);
|
||||||
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
expect(enemyPokemon?.getTag(BattlerTagType.ENCORE)).toBeDefined();
|
||||||
|
|
||||||
|
await game.toNextTurn();
|
||||||
|
game.move.select(Moves.TORMENT);
|
||||||
|
await game.setTurnOrder(turnOrder);
|
||||||
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
expect(enemyPokemon?.getTag(BattlerTagType.TORMENT)).toBeDefined();
|
||||||
|
|
||||||
|
await game.toNextTurn();
|
||||||
|
game.move.select(Moves.SPLASH);
|
||||||
|
await game.setTurnOrder(turnOrder);
|
||||||
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
const lastMove = enemyPokemon?.getLastXMoves()[0];
|
||||||
|
expect(lastMove?.move).toBe(Moves.STRUGGLE);
|
||||||
|
});
|
||||||
|
});
|
@ -1,10 +1,12 @@
|
|||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { MoveResult } from "#app/field/pokemon";
|
import { MoveResult, PokemonMove } from "#app/field/pokemon";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
import { StatusEffect } from "#app/enums/status-effect";
|
||||||
|
import { BattlerIndex } from "#app/battle";
|
||||||
|
|
||||||
describe("Moves - Sketch", () => {
|
describe("Moves - Sketch", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
@ -32,22 +34,46 @@ describe("Moves - Sketch", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("Sketch should not fail even if a previous Sketch failed to retrieve a valid move and ran out of PP", async () => {
|
it("Sketch should not fail even if a previous Sketch failed to retrieve a valid move and ran out of PP", async () => {
|
||||||
game.override.moveset([ Moves.SKETCH, Moves.SKETCH ]);
|
|
||||||
|
|
||||||
await game.classicMode.startBattle([ Species.REGIELEKI ]);
|
await game.classicMode.startBattle([ Species.REGIELEKI ]);
|
||||||
const playerPokemon = game.scene.getPlayerPokemon();
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
// can't use normal moveset override because we need to check moveset changes
|
||||||
|
playerPokemon.moveset = [ new PokemonMove(Moves.SKETCH), new PokemonMove(Moves.SKETCH) ];
|
||||||
|
|
||||||
game.move.select(Moves.SKETCH);
|
game.move.select(Moves.SKETCH);
|
||||||
await game.phaseInterceptor.to("TurnEndPhase");
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
expect(playerPokemon?.getLastXMoves()[0].result).toBe(MoveResult.FAIL);
|
expect(playerPokemon.getLastXMoves()[0].result).toBe(MoveResult.FAIL);
|
||||||
const moveSlot0 = playerPokemon?.getMoveset()[0];
|
const moveSlot0 = playerPokemon.getMoveset()[0]!;
|
||||||
expect(moveSlot0?.moveId).toBe(Moves.SKETCH);
|
expect(moveSlot0.moveId).toBe(Moves.SKETCH);
|
||||||
expect(moveSlot0?.getPpRatio()).toBe(0);
|
expect(moveSlot0.getPpRatio()).toBe(0);
|
||||||
|
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
game.move.select(Moves.SKETCH);
|
game.move.select(Moves.SKETCH);
|
||||||
await game.phaseInterceptor.to("TurnEndPhase");
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
expect(playerPokemon?.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS);
|
expect(playerPokemon.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS);
|
||||||
// Can't verify if the player Pokemon's moveset was successfully changed because of overrides.
|
expect(playerPokemon.moveset[0]?.moveId).toBe(Moves.SPLASH);
|
||||||
|
expect(playerPokemon.moveset[1]?.moveId).toBe(Moves.SKETCH);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("Sketch should retrieve the most recent valid move from its target history", async () => {
|
||||||
|
game.override.enemyStatusEffect(StatusEffect.PARALYSIS);
|
||||||
|
await game.classicMode.startBattle([ Species.REGIELEKI ]);
|
||||||
|
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||||
|
playerPokemon.moveset = [ new PokemonMove(Moves.SKETCH), new PokemonMove(Moves.GROWL) ];
|
||||||
|
|
||||||
|
game.move.select(Moves.GROWL);
|
||||||
|
await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]);
|
||||||
|
await game.move.forceStatusActivation(false);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
expect(enemyPokemon.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS);
|
||||||
|
|
||||||
|
await game.toNextTurn();
|
||||||
|
game.move.select(Moves.SKETCH);
|
||||||
|
await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]);
|
||||||
|
await game.move.forceStatusActivation(true);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
expect(playerPokemon.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS);
|
||||||
|
expect(playerPokemon.moveset[0]?.moveId).toBe(Moves.SPLASH);
|
||||||
|
expect(playerPokemon.moveset[1]?.moveId).toBe(Moves.GROWL);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
103
src/test/moves/upper_hand.test.ts
Normal file
103
src/test/moves/upper_hand.test.ts
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
import { BattlerIndex } from "#app/battle";
|
||||||
|
import { MoveResult } from "#app/field/pokemon";
|
||||||
|
import { Abilities } from "#enums/abilities";
|
||||||
|
import { Moves } from "#enums/moves";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
import GameManager from "#test/utils/gameManager";
|
||||||
|
import Phaser from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
|
describe("Moves - Upper Hand", () => {
|
||||||
|
let phaserGame: Phaser.Game;
|
||||||
|
let game: GameManager;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
phaserGame = new Phaser.Game({
|
||||||
|
type: Phaser.HEADLESS,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
game.phaseInterceptor.restoreOg();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
game = new GameManager(phaserGame);
|
||||||
|
game.override
|
||||||
|
.moveset(Moves.UPPER_HAND)
|
||||||
|
.ability(Abilities.BALL_FETCH)
|
||||||
|
.battleType("single")
|
||||||
|
.disableCrits()
|
||||||
|
.enemySpecies(Species.MAGIKARP)
|
||||||
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
|
.enemyMoveset(Moves.QUICK_ATTACK)
|
||||||
|
.startingLevel(100)
|
||||||
|
.enemyLevel(100);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should flinch the opponent before they use a priority attack", async () => {
|
||||||
|
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||||
|
|
||||||
|
const feebas = game.scene.getPlayerPokemon()!;
|
||||||
|
const magikarp = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
game.move.select(Moves.UPPER_HAND);
|
||||||
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
|
expect(feebas.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS);
|
||||||
|
expect(magikarp.isFullHp()).toBeFalsy();
|
||||||
|
expect(feebas.isFullHp()).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it.each([
|
||||||
|
{ descriptor: "non-priority attack", move: Moves.TACKLE },
|
||||||
|
{ descriptor: "status move", move: Moves.BABY_DOLL_EYES }
|
||||||
|
])("should fail when the opponent selects a $descriptor", async ({ move }) => {
|
||||||
|
game.override.enemyMoveset(move);
|
||||||
|
|
||||||
|
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||||
|
|
||||||
|
const feebas = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
|
game.move.select(Moves.UPPER_HAND);
|
||||||
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
|
expect(feebas.getLastXMoves()[0].result).toBe(MoveResult.FAIL);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should flinch the opponent before they use an attack boosted by Gale Wings", async () => {
|
||||||
|
game.override
|
||||||
|
.enemyAbility(Abilities.GALE_WINGS)
|
||||||
|
.enemyMoveset(Moves.GUST);
|
||||||
|
|
||||||
|
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||||
|
|
||||||
|
const feebas = game.scene.getPlayerPokemon()!;
|
||||||
|
const magikarp = game.scene.getEnemyPokemon()!;
|
||||||
|
|
||||||
|
game.move.select(Moves.UPPER_HAND);
|
||||||
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
|
expect(feebas.getLastXMoves()[0].result).toBe(MoveResult.SUCCESS);
|
||||||
|
expect(magikarp.isFullHp()).toBeFalsy();
|
||||||
|
expect(feebas.isFullHp()).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should fail if the target has already moved", async () => {
|
||||||
|
game.override
|
||||||
|
.enemyMoveset(Moves.FAKE_OUT)
|
||||||
|
.enemyAbility(Abilities.SHEER_FORCE);
|
||||||
|
|
||||||
|
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||||
|
|
||||||
|
const feebas = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
|
game.move.select(Moves.UPPER_HAND);
|
||||||
|
|
||||||
|
await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]);
|
||||||
|
await game.phaseInterceptor.to("BerryPhase");
|
||||||
|
|
||||||
|
expect(feebas.getLastXMoves()[0].result).toBe(MoveResult.FAIL);
|
||||||
|
expect(feebas.isFullHp()).toBeFalsy();
|
||||||
|
});
|
||||||
|
});
|
@ -90,9 +90,6 @@ export default class CommandUiHandler extends UiHandler {
|
|||||||
switch (cursor) {
|
switch (cursor) {
|
||||||
// Fight
|
// Fight
|
||||||
case Command.FIGHT:
|
case Command.FIGHT:
|
||||||
if ((this.scene.getCurrentPhase() as CommandPhase).checkFightOverride()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
ui.setMode(Mode.FIGHT, (this.scene.getCurrentPhase() as CommandPhase).getFieldIndex());
|
ui.setMode(Mode.FIGHT, (this.scene.getCurrentPhase() as CommandPhase).getFieldIndex());
|
||||||
success = true;
|
success = true;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user