mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 09:19:31 +02:00
Imprison
This commit is contained in:
parent
145167f3a2
commit
66465a5076
@ -919,13 +919,41 @@ class SafeguardTag extends ArenaTag {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
class ImprisonTag extends ArenaTag {
|
||||
constructor(turnCount: integer, sourceId: integer, side: ArenaTagSide) {
|
||||
super();
|
||||
class ImprisonTag extends ArenaTrapTag {
|
||||
private source: Pokemon;
|
||||
|
||||
constructor(sourceId: integer, side: ArenaTagSide) {
|
||||
super(ArenaTagType.IMPRISON, Moves.IMPRISON, sourceId, side, 1);
|
||||
}
|
||||
|
||||
onAdd(arena: Arena) {
|
||||
this.source = arena.scene.getPokemonById(this.sourceId!)!;
|
||||
const party = (this.side === ArenaTagSide.PLAYER) ? arena.scene.getPlayerField() : arena.scene.getEnemyField();
|
||||
party?.forEach((p: PlayerPokemon | EnemyPokemon ) => {
|
||||
p.addTag(BattlerTagType.IMPRISON, 1, Moves.IMPRISON, this.sourceId);
|
||||
});
|
||||
arena.scene.queueMessage(i18next.t("battlerTags:imprisonOnAdd", {pokemonNameWithAffix: getPokemonNameWithAffix(this.source)}), 1500);
|
||||
console.log(arena.scene);
|
||||
}
|
||||
|
||||
lapse(_arena: Arena): boolean {
|
||||
return this.source.isActive(true);
|
||||
}
|
||||
|
||||
activateTrap(pokemon: Pokemon): boolean {
|
||||
if (this.source.isActive(true)) {
|
||||
pokemon.addTag(BattlerTagType.IMPRISON, 1, Moves.IMPRISON, this.sourceId);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
onRemove(arena: Arena): void {
|
||||
const party = (this.side === ArenaTagSide.PLAYER) ? arena.scene.getPlayerField() : arena.scene.getEnemyField();
|
||||
party?.forEach((p: PlayerPokemon | EnemyPokemon) => {
|
||||
p.removeTag(BattlerTagType.IMPRISON);
|
||||
});
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
class AromaVeilTag extends ArenaTag {
|
||||
private protectedTags: BattlerTagType[];
|
||||
@ -936,7 +964,6 @@ class AromaVeilTag extends ArenaTag {
|
||||
this.protectedTags = [BattlerTagType.TAUNT, BattlerTagType.TORMENT, BattlerTagType.DISABLED, BattlerTagType.HEAL_BLOCK, BattlerTagType.ENCORE, BattlerTagType.INFATUATED];
|
||||
}
|
||||
|
||||
|
||||
onAdd(arena: Arena): void {
|
||||
this.source = arena.scene.getPokemonById(this.sourceId!)!;
|
||||
const party = this.source.isPlayer() ? this.source.scene.getPlayerField() : this.source.scene.getEnemyField();
|
||||
@ -1009,6 +1036,8 @@ export function getArenaTag(tagType: ArenaTagType, turnCount: integer, sourceMov
|
||||
return new HappyHourTag(turnCount, sourceId, side);
|
||||
case ArenaTagType.SAFEGUARD:
|
||||
return new SafeguardTag(turnCount, sourceId, side);
|
||||
case ArenaTagType.IMPRISON:
|
||||
return new ImprisonTag(sourceId, side);
|
||||
case ArenaTagType.AROMA_VEIL:
|
||||
return new AromaVeilTag(turnCount, sourceId, side);
|
||||
default:
|
||||
|
@ -2525,7 +2525,6 @@ export class ImprisonTag extends MoveRestrictionBattlerTag {
|
||||
|
||||
override onAdd(pokemon: Pokemon) {
|
||||
this.source = pokemon.scene.getPokemonById(this.sourceId!)!;
|
||||
pokemon.scene.queueMessage(i18next.t("battlerTags:imprisonOnAdd", {pokemonNameWithAffix: getPokemonNameWithAffix(this.source)}), 1500);
|
||||
}
|
||||
|
||||
override lapse(_pokemon: Pokemon, _lapseType: BattlerTagLapseType): boolean {
|
||||
|
@ -7583,7 +7583,7 @@ export function initMoves() {
|
||||
.attr(SwitchAbilitiesAttr),
|
||||
new StatusMove(Moves.IMPRISON, Type.PSYCHIC, 100, 10, -1, 0, 3)
|
||||
.ignoresSubstitute()
|
||||
.attr(AddBattlerTagAttr, BattlerTagType.IMPRISON, false, true, 1),
|
||||
.attr(AddArenaTagAttr, ArenaTagType.IMPRISON, 1, true, false),
|
||||
new SelfStatusMove(Moves.REFRESH, Type.NORMAL, -1, 20, -1, 0, 3)
|
||||
.attr(HealStatusEffectAttr, true, StatusEffect.PARALYSIS, StatusEffect.POISON, StatusEffect.TOXIC, StatusEffect.BURN)
|
||||
.condition((user, target, move) => !!user.status && (user.status.effect === StatusEffect.PARALYSIS || user.status.effect === StatusEffect.POISON || user.status.effect === StatusEffect.TOXIC || user.status.effect === StatusEffect.BURN)),
|
||||
|
Loading…
Reference in New Issue
Block a user