This commit is contained in:
frutescens 2024-09-22 15:35:59 -07:00
parent 23b64b94b5
commit 8f5f10b45b
4 changed files with 45 additions and 2 deletions

View File

@ -2407,6 +2407,43 @@ export class MysteryEncounterPostSummonTag extends BattlerTag {
}
}
export class TormentTag extends MoveRestrictionBattlerTag {
private target: Pokemon;
constructor(sourceId: number) {
super(BattlerTagType.TORMENT, BattlerTagLapseType.AFTER_MOVE, 1, Moves.TORMENT, sourceId);
}
onAdd(pokemon: Pokemon) {
super.onAdd(pokemon);
this.target = pokemon;
//pokemon.scene.triggerPokemonBattleAnim(pokemon, PokemonAnimType.TORMENT_ADD);
pokemon.scene.queueMessage(i18next.t("battlerTags:tormentOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) }), 1500);
}
override lapse(pokemon: Pokemon, tagType: BattlerTagLapseType): boolean {
if (!pokemon.isActive(true)) {
return super.lapse(pokemon, tagType);
}
return true;
}
isMoveRestricted(move: Moves): boolean {
const lastMove = this.target.getLastXMoves(1)[0];
if ( !lastMove ) {
return false;
}
if (lastMove.move === move && lastMove.result === MoveResult.SUCCESS && lastMove.move !== Moves.STRUGGLE) {
return true;
}
return false;
}
override selectionDeniedText(_pokemon: Pokemon, move: Moves): string {
return i18next.t("battle:moveCannotBeSelected", { moveName: allMoves[move].name });
}
}
/**
* Retrieves a {@linkcode BattlerTag} based on the provided tag type, turn count, source move, and source ID.
*
@ -2572,6 +2609,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source
return new MysteryEncounterPostSummonTag();
case BattlerTagType.HEAL_BLOCK:
return new HealBlockTag(turnCount, sourceMove);
case BattlerTagType.TORMENT:
return new TormentTag(sourceId);
case BattlerTagType.NONE:
default:
return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId);

View File

@ -7489,7 +7489,7 @@ export function initMoves() {
.target(MoveTarget.BOTH_SIDES),
new StatusMove(Moves.TORMENT, Type.DARK, 100, 15, -1, 0, 3)
.ignoresSubstitute()
.unimplemented(),
.attr(AddBattlerTagAttr, BattlerTagType.TORMENT, false, true, 1),
new StatusMove(Moves.FLATTER, Type.DARK, 100, 15, -1, 0, 3)
.attr(StatStageChangeAttr, [ Stat.SPATK ], 1)
.attr(ConfuseAttr),

View File

@ -81,4 +81,7 @@ export enum BattlerTagType {
DOUBLE_SHOCKED = "DOUBLE_SHOCKED",
MYSTERY_ENCOUNTER_POST_SUMMON = "MYSTERY_ENCOUNTER_POST_SUMMON",
HEAL_BLOCK = "HEAL_BLOCK",
TORMENT = "TORMENT",
TAUNT = "TAUNT",
IMPRISON = "IMPRISON",
}

View File

@ -73,5 +73,6 @@
"tarShotOnAdd": "{{pokemonNameWithAffix}} became weaker to fire!",
"substituteOnAdd": "{{pokemonNameWithAffix}} put in a substitute!",
"substituteOnHit": "The substitute took damage for {{pokemonNameWithAffix}}!",
"substituteOnRemove": "{{pokemonNameWithAffix}}'s substitute faded!"
"substituteOnRemove": "{{pokemonNameWithAffix}}'s substitute faded!",
"tormentOnAdd": "{{pokemonNameWithAffix}} was subjected to torment!"
}