Powder basic implementation
This commit is contained in:
parent
c846f552bb
commit
55974903ae
|
@ -542,6 +542,41 @@ export class SeedTag extends BattlerTag {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BattlerTag representing the effects of {@link https://bulbapedia.bulbagarden.net/wiki/Powder_(move) | Powder}.
|
||||||
|
* When the afflicted Pokemon uses a Fire-type move, the move is cancelled, and the
|
||||||
|
* Pokemon takes damage equal to 1/4 of it's maximum HP (rounded down).
|
||||||
|
*/
|
||||||
|
export class PowderTag extends BattlerTag {
|
||||||
|
constructor() {
|
||||||
|
super(BattlerTagType.POWDER, [ BattlerTagLapseType.PRE_MOVE, BattlerTagLapseType.TURN_END ], 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
onAdd(pokemon: Pokemon): void {
|
||||||
|
super.onAdd(pokemon);
|
||||||
|
|
||||||
|
pokemon.scene.queueMessage(i18next.t("battlerTags:powderOnAdd", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) }));
|
||||||
|
}
|
||||||
|
|
||||||
|
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
|
if (lapseType === BattlerTagLapseType.PRE_MOVE) {
|
||||||
|
const movePhase = pokemon.scene.getCurrentPhase();
|
||||||
|
if (movePhase instanceof MovePhase) {
|
||||||
|
const move = movePhase.move.getMove();
|
||||||
|
if (move.type === Type.FIRE) {
|
||||||
|
movePhase.cancel();
|
||||||
|
pokemon.damageAndUpdate(Math.floor(pokemon.getMaxHp() / 4), HitResult.OTHER);
|
||||||
|
|
||||||
|
pokemon.scene.queueMessage(i18next.t("battlerTags:powderLapse"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return super.lapse(pokemon, lapseType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class NightmareTag extends BattlerTag {
|
export class NightmareTag extends BattlerTag {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(BattlerTagType.NIGHTMARE, BattlerTagLapseType.AFTER_MOVE, 1, Moves.NIGHTMARE);
|
super(BattlerTagType.NIGHTMARE, BattlerTagLapseType.AFTER_MOVE, 1, Moves.NIGHTMARE);
|
||||||
|
@ -1846,6 +1881,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source
|
||||||
return new InfatuatedTag(sourceMove, sourceId);
|
return new InfatuatedTag(sourceMove, sourceId);
|
||||||
case BattlerTagType.SEEDED:
|
case BattlerTagType.SEEDED:
|
||||||
return new SeedTag(sourceId);
|
return new SeedTag(sourceId);
|
||||||
|
case BattlerTagType.POWDER:
|
||||||
|
return new PowderTag();
|
||||||
case BattlerTagType.NIGHTMARE:
|
case BattlerTagType.NIGHTMARE:
|
||||||
return new NightmareTag();
|
return new NightmareTag();
|
||||||
case BattlerTagType.FRENZY:
|
case BattlerTagType.FRENZY:
|
||||||
|
|
|
@ -7864,8 +7864,8 @@ export function initMoves() {
|
||||||
.attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK, BattleStat.SPD ], -1, false, (user, target, move) => target.status?.effect === StatusEffect.POISON || target.status?.effect === StatusEffect.TOXIC)
|
.attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK, BattleStat.SPD ], -1, false, (user, target, move) => target.status?.effect === StatusEffect.POISON || target.status?.effect === StatusEffect.TOXIC)
|
||||||
.target(MoveTarget.ALL_NEAR_ENEMIES),
|
.target(MoveTarget.ALL_NEAR_ENEMIES),
|
||||||
new StatusMove(Moves.POWDER, Type.BUG, 100, 20, -1, 1, 6)
|
new StatusMove(Moves.POWDER, Type.BUG, 100, 20, -1, 1, 6)
|
||||||
.powderMove()
|
.attr(AddBattlerTagAttr, BattlerTagType.POWDER, false, true)
|
||||||
.unimplemented(),
|
.powderMove(),
|
||||||
new SelfStatusMove(Moves.GEOMANCY, Type.FAIRY, -1, 10, -1, 0, 6)
|
new SelfStatusMove(Moves.GEOMANCY, Type.FAIRY, -1, 10, -1, 0, 6)
|
||||||
.attr(ChargeAttr, ChargeAnim.GEOMANCY_CHARGING, i18next.t("moveTriggers:isChargingPower", {pokemonName: "{USER}"}))
|
.attr(ChargeAttr, ChargeAnim.GEOMANCY_CHARGING, i18next.t("moveTriggers:isChargingPower", {pokemonName: "{USER}"}))
|
||||||
.attr(StatChangeAttr, [ BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD ], 2, true)
|
.attr(StatChangeAttr, [ BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD ], 2, true)
|
||||||
|
|
|
@ -69,5 +69,6 @@ export enum BattlerTagType {
|
||||||
GULP_MISSILE_ARROKUDA = "GULP_MISSILE_ARROKUDA",
|
GULP_MISSILE_ARROKUDA = "GULP_MISSILE_ARROKUDA",
|
||||||
GULP_MISSILE_PIKACHU = "GULP_MISSILE_PIKACHU",
|
GULP_MISSILE_PIKACHU = "GULP_MISSILE_PIKACHU",
|
||||||
BEAK_BLAST_CHARGING = "BEAK_BLAST_CHARGING",
|
BEAK_BLAST_CHARGING = "BEAK_BLAST_CHARGING",
|
||||||
SHELL_TRAP = "SHELL_TRAP"
|
SHELL_TRAP = "SHELL_TRAP",
|
||||||
|
POWDER = "POWDER"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue