some work

This commit is contained in:
frutescens 2024-11-04 15:39:03 -08:00
parent 7a0c88e661
commit 3b98003ad0
3 changed files with 28 additions and 2 deletions

View File

@ -2796,6 +2796,31 @@ export class PowerTrickTag extends BattlerTag {
}
}
export class GrudgeTag extends BattlerTag {
constructor() {
super(BattlerTagType.GRUDGE, [ BattlerTagLapseType.FAINT, BattlerTagLapseType.TURN_END ], 1);
}
onAdd(pokemon: Pokemon) {
super.onAdd(pokemon);
pokemon.scene.queueMessage(i18next.t("battlerTags:grudgeOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) }));
}
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
if (lapseType === BattlerTagLapseType.FAINT) {
if (pokemon.isFainted() && pokemon.turnData.attacksReceived.length > 0) {
const lastAttackSource = pokemon.scene.getPokemonById(pokemon.turnData.attacksReceived[0].sourceId);
if (lastAttackSource && lastAttackSource?.isOnField()) {
lastAttackSource.summonData.moveset[0]?.getMovePp();
}
}
return false;
} else {
return super.lapse(pokemon, lapseType);
}
}
}
/**
* Retrieves a {@linkcode BattlerTag} based on the provided tag type, turn count, source move, and source ID.
* @param sourceId - The ID of the pokemon adding the tag

View File

@ -8423,7 +8423,7 @@ export function initMoves() {
.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)),
new SelfStatusMove(Moves.GRUDGE, Type.GHOST, -1, 5, -1, 0, 3)
.unimplemented(),
.attr(AddBattlerTagAttr, BattlerTagType.GRUDGE, true, undefined, 1),
new SelfStatusMove(Moves.SNATCH, Type.DARK, -1, 10, -1, 4, 3)
.unimplemented(),
new AttackMove(Moves.SECRET_POWER, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 20, 30, 0, 3)

View File

@ -88,5 +88,6 @@ export enum BattlerTagType {
IMPRISON = "IMPRISON",
SYRUP_BOMB = "SYRUP_BOMB",
ELECTRIFIED = "ELECTRIFIED",
TELEKINESIS = "TELEKINESIS"
TELEKINESIS = "TELEKINESIS",
GRUDGE = "GRUDGE"
}