mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-30 21:42:20 +02:00
Fixed rest thing...?
This commit is contained in:
parent
c24f630caf
commit
9301e6db87
@ -1948,22 +1948,20 @@ export class HealAttr extends MoveEffectAttr {
|
|||||||
return Math.round(score / (1 - this.healRatio / 2));
|
return Math.round(score / (1 - this.healRatio / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Remove once `canApply` is made to make status moves fail if no attributes apply
|
// TODO: Change post move failure rework
|
||||||
override getCondition(): MoveConditionFunc {
|
|
||||||
return (user, target, move) => this.canApply(user, target, move, [])
|
|
||||||
}
|
|
||||||
|
|
||||||
override canApply(user: Pokemon, target: Pokemon, _move: Move, _args?: any[]): boolean {
|
override canApply(user: Pokemon, target: Pokemon, _move: Move, _args?: any[]): boolean {
|
||||||
return super.canApply(user, target, _move, _args) && !(this.selfTarget ? user : target).isFullHp();
|
if (!super.canApply(user, target, _move, _args)) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
override getFailedText(user: Pokemon, target: Pokemon, _move: Move): string | undefined {
|
|
||||||
const healedPokemon = this.selfTarget ? user : target;
|
const healedPokemon = this.selfTarget ? user : target;
|
||||||
return healedPokemon.isFullHp()
|
if (healedPokemon.isFullHp()) {
|
||||||
? i18next.t("battle:hpIsFull", {
|
globalScene.phaseManager.queueMessage(i18next.t("battle:hpIsFull", {
|
||||||
pokemonName: getPokemonNameWithAffix(healedPokemon),
|
pokemonName: getPokemonNameWithAffix(healedPokemon),
|
||||||
})
|
}))
|
||||||
: undefined;
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1991,13 +1989,12 @@ export class RestAttr extends HealAttr {
|
|||||||
globalScene.phaseManager.unshiftNew("PokemonHealPhase", user.getBattlerIndex(), user.getMaxHp(), null)
|
globalScene.phaseManager.unshiftNew("PokemonHealPhase", user.getBattlerIndex(), user.getMaxHp(), null)
|
||||||
}
|
}
|
||||||
|
|
||||||
override canApply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
override getCondition(): MoveConditionFunc {
|
||||||
|
return (user, target, move) =>
|
||||||
|
super.canApply(user, target, move, [])
|
||||||
// Intentionally suppress messages here as we display generic fail msg
|
// Intentionally suppress messages here as we display generic fail msg
|
||||||
// TODO: This might have order-of-operation jank
|
// TODO: This might have order-of-operation jank
|
||||||
return (
|
|
||||||
super.canApply(user, target, move, args)
|
|
||||||
&& user.canSetStatus(StatusEffect.SLEEP, true, true, user)
|
&& user.canSetStatus(StatusEffect.SLEEP, true, true, user)
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4433,11 +4430,6 @@ export class SwallowHealAttr extends HealAttr {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Is this correct? Should stockpile count as "succeeding" even at full HP?
|
|
||||||
override getCondition(): MoveConditionFunc {
|
|
||||||
return hasStockpileStacksCondition;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasStockpileStacksCondition: MoveConditionFunc = (user) => {
|
const hasStockpileStacksCondition: MoveConditionFunc = (user) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user