Implement Purify (#1291)
* Implement purify * Code review fixes * Remove vitest import * Update status-effect.ts * Update status-effect.ts --------- Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
This commit is contained in:
parent
79f69ddfe0
commit
5c327e347a
|
@ -6,7 +6,7 @@ import { EncoreTag } from "./battler-tags";
|
|||
import { BattlerTagType } from "./enums/battler-tag-type";
|
||||
import { getPokemonMessage } from "../messages";
|
||||
import Pokemon, { AttackMoveResult, EnemyPokemon, HitResult, MoveResult, PlayerPokemon, PokemonMove, TurnMove } from "../field/pokemon";
|
||||
import { StatusEffect, getStatusEffectHealText } from "./status-effect";
|
||||
import { StatusEffect, getStatusEffectHealText, isNonVolatileStatusEffect, getNonVolatileStatusEffects} from "./status-effect";
|
||||
import { Type } from "./type";
|
||||
import * as Utils from "../utils";
|
||||
import { WeatherType } from "./weather";
|
||||
|
@ -6813,8 +6813,11 @@ export function initMoves() {
|
|||
.unimplemented(),
|
||||
new AttackMove(Moves.SMART_STRIKE, Type.STEEL, MoveCategory.PHYSICAL, 70, -1, 10, -1, 0, 7),
|
||||
new StatusMove(Moves.PURIFY, Type.POISON, -1, 20, -1, 0, 7)
|
||||
.triageMove()
|
||||
.unimplemented(),
|
||||
.condition(
|
||||
(user: Pokemon, target: Pokemon, move: Move) => isNonVolatileStatusEffect(user.status?.effect))
|
||||
.attr(HealAttr, 0.5)
|
||||
.attr(HealStatusEffectAttr, true, ...getNonVolatileStatusEffects())
|
||||
.triageMove(),
|
||||
new AttackMove(Moves.REVELATION_DANCE, Type.NORMAL, MoveCategory.SPECIAL, 90, 100, 15, -1, 0, 7)
|
||||
.danceMove()
|
||||
.attr(MatchUserTypeAttr),
|
||||
|
|
|
@ -175,3 +175,27 @@ export function getRandomStatus(statusA: Status, statusB: Status): Status {
|
|||
|
||||
return Utils.randIntRange(0, 2) ? statusA : statusB;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all non volatile status effects
|
||||
* @returns A list containing all non volatile status effects
|
||||
*/
|
||||
export function getNonVolatileStatusEffects():Array<StatusEffect> {
|
||||
return [
|
||||
StatusEffect.POISON,
|
||||
StatusEffect.TOXIC,
|
||||
StatusEffect.PARALYSIS,
|
||||
StatusEffect.SLEEP,
|
||||
StatusEffect.FREEZE,
|
||||
StatusEffect.BURN
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether a statuss effect is non volatile.
|
||||
* Non-volatile status condition is a status that remains after being switched out.
|
||||
* @param status The status to check
|
||||
*/
|
||||
export function isNonVolatileStatusEffect(status: StatusEffect): boolean {
|
||||
return getNonVolatileStatusEffects().includes(status);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue