parent
dd3d38b5d8
commit
1bd3ec2fd6
|
@ -15,6 +15,7 @@ import { TerrainType } from "./terrain";
|
|||
import { WeatherType } from "./weather";
|
||||
import { BattleStat } from "./battle-stat";
|
||||
import { allAbilities } from "./ability";
|
||||
import { Species } from "./enums/species";
|
||||
|
||||
export enum BattlerTagLapseType {
|
||||
FAINT,
|
||||
|
@ -117,7 +118,11 @@ export class TrappedTag extends BattlerTag {
|
|||
}
|
||||
|
||||
canAdd(pokemon: Pokemon): boolean {
|
||||
return !pokemon.isOfType(Type.GHOST) && !pokemon.getTag(BattlerTagType.TRAPPED);
|
||||
const isGhost = pokemon.isOfType(Type.GHOST);
|
||||
const isTrapped = pokemon.getTag(BattlerTagType.TRAPPED);
|
||||
const isAllowedGhostType = pokemon.species.speciesId === Species.PHANTUMP || pokemon.species.speciesId === Species.TREVENANT;
|
||||
|
||||
return !isTrapped && (!isGhost || isAllowedGhostType);
|
||||
}
|
||||
|
||||
onAdd(pokemon: Pokemon): void {
|
||||
|
|
|
@ -60,6 +60,8 @@ import i18next from './plugins/i18n';
|
|||
import { Abilities } from "./data/enums/abilities";
|
||||
import * as Overrides from './overrides';
|
||||
import { TextStyle, addTextObject } from "./ui/text";
|
||||
import { Type } from "./data/type";
|
||||
|
||||
|
||||
export class LoginPhase extends Phase {
|
||||
private showText: boolean;
|
||||
|
@ -1816,7 +1818,14 @@ export class CommandPhase extends FieldPhase {
|
|||
if (!isSwitch && this.fieldIndex)
|
||||
this.scene.currentBattle.turnCommands[this.fieldIndex - 1].skip = true;
|
||||
} else if (trapTag) {
|
||||
if (!isSwitch) {
|
||||
if(trapTag.sourceMove === Moves.INGRAIN && this.scene.getPokemonById(trapTag.sourceId).isOfType(Type.GHOST)) {
|
||||
success = true;
|
||||
this.scene.currentBattle.turnCommands[this.fieldIndex] = isSwitch
|
||||
? { command: Command.POKEMON, cursor: cursor, args: args }
|
||||
: { command: Command.RUN };
|
||||
break;
|
||||
}
|
||||
if (!isSwitch) {
|
||||
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||
this.scene.ui.setMode(Mode.MESSAGE);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue