mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 06:19:29 +02:00
some work
This commit is contained in:
parent
7a0c88e661
commit
3b98003ad0
@ -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
|
||||
|
@ -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)
|
||||
|
@ -88,5 +88,6 @@ export enum BattlerTagType {
|
||||
IMPRISON = "IMPRISON",
|
||||
SYRUP_BOMB = "SYRUP_BOMB",
|
||||
ELECTRIFIED = "ELECTRIFIED",
|
||||
TELEKINESIS = "TELEKINESIS"
|
||||
TELEKINESIS = "TELEKINESIS",
|
||||
GRUDGE = "GRUDGE"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user