mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 06:19:29 +02:00
beginning immplementation of lunar dance
This commit is contained in:
parent
6442b8345f
commit
f9bae3aa4b
@ -1884,6 +1884,34 @@ export class SacrificialFullRestoreAttr extends SacrificialAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class SacrificialFullRestoreAndPPRestoreAttr extends SacrificialAttr {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
|
if (!super.apply(user, target, move, args)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We don't know which party member will be chosen, so pick the highest max HP in the party
|
||||||
|
const maxPartyMemberHp = user.scene.getPlayerParty().map(p => p.getMaxHp()).reduce((maxHp: integer, hp: integer) => Math.max(hp, maxHp), 0);
|
||||||
|
|
||||||
|
user.scene.pushPhase(new PokemonHealPhase(user.scene, user.getBattlerIndex(),
|
||||||
|
maxPartyMemberHp, i18next.t("moveTriggers:sacrificialFullRestore", { pokemonName: getPokemonNameWithAffix(user) }), true, false, false, true, false, true), true);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer {
|
||||||
|
return -20;
|
||||||
|
}
|
||||||
|
|
||||||
|
getCondition(): MoveConditionFunc {
|
||||||
|
return (user, _target, _move) => user.scene.getPlayerParty().filter(p => p.isActive()).length > user.scene.currentBattle.getBattlerCount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attribute used for moves which ignore type-based debuffs from weather, namely Hydro Steam.
|
* Attribute used for moves which ignore type-based debuffs from weather, namely Hydro Steam.
|
||||||
* Called during damage calculation after getting said debuff from getAttackTypeMultiplier in the Pokemon class.
|
* Called during damage calculation after getting said debuff from getAttackTypeMultiplier in the Pokemon class.
|
||||||
@ -9069,10 +9097,9 @@ export function initMoves() {
|
|||||||
new AttackMove(Moves.SPACIAL_REND, Type.DRAGON, MoveCategory.SPECIAL, 100, 95, 5, -1, 0, 4)
|
new AttackMove(Moves.SPACIAL_REND, Type.DRAGON, MoveCategory.SPECIAL, 100, 95, 5, -1, 0, 4)
|
||||||
.attr(HighCritAttr),
|
.attr(HighCritAttr),
|
||||||
new SelfStatusMove(Moves.LUNAR_DANCE, Type.PSYCHIC, -1, 10, -1, 0, 4)
|
new SelfStatusMove(Moves.LUNAR_DANCE, Type.PSYCHIC, -1, 10, -1, 0, 4)
|
||||||
.attr(SacrificialAttrOnHit)
|
.attr(SacrificialFullRestoreAndPPRestoreAttr)
|
||||||
.danceMove()
|
.danceMove()
|
||||||
.triageMove()
|
.triageMove(),
|
||||||
.unimplemented(),
|
|
||||||
new AttackMove(Moves.CRUSH_GRIP, Type.NORMAL, MoveCategory.PHYSICAL, -1, 100, 5, -1, 0, 4)
|
new AttackMove(Moves.CRUSH_GRIP, Type.NORMAL, MoveCategory.PHYSICAL, -1, 100, 5, -1, 0, 4)
|
||||||
.attr(OpponentHighHpPowerAttr, 120),
|
.attr(OpponentHighHpPowerAttr, 120),
|
||||||
new AttackMove(Moves.MAGMA_STORM, Type.FIRE, MoveCategory.SPECIAL, 100, 75, 5, -1, 0, 4)
|
new AttackMove(Moves.MAGMA_STORM, Type.FIRE, MoveCategory.SPECIAL, 100, 75, 5, -1, 0, 4)
|
||||||
|
@ -21,8 +21,9 @@ export class PokemonHealPhase extends CommonAnimPhase {
|
|||||||
private revive: boolean;
|
private revive: boolean;
|
||||||
private healStatus: boolean;
|
private healStatus: boolean;
|
||||||
private preventFullHeal: boolean;
|
private preventFullHeal: boolean;
|
||||||
|
private fullRestorePP: boolean;
|
||||||
|
|
||||||
constructor(scene: BattleScene, battlerIndex: BattlerIndex, hpHealed: integer, message: string | null, showFullHpMessage: boolean, skipAnim: boolean = false, revive: boolean = false, healStatus: boolean = false, preventFullHeal: boolean = false) {
|
constructor(scene: BattleScene, battlerIndex: BattlerIndex, hpHealed: integer, message: string | null, showFullHpMessage: boolean, skipAnim: boolean = false, revive: boolean = false, healStatus: boolean = false, preventFullHeal: boolean = false, fullRestorePP: boolean = false) {
|
||||||
super(scene, battlerIndex, undefined, CommonAnim.HEALTH_UP);
|
super(scene, battlerIndex, undefined, CommonAnim.HEALTH_UP);
|
||||||
|
|
||||||
this.hpHealed = hpHealed;
|
this.hpHealed = hpHealed;
|
||||||
@ -32,6 +33,7 @@ export class PokemonHealPhase extends CommonAnimPhase {
|
|||||||
this.revive = revive;
|
this.revive = revive;
|
||||||
this.healStatus = healStatus;
|
this.healStatus = healStatus;
|
||||||
this.preventFullHeal = preventFullHeal;
|
this.preventFullHeal = preventFullHeal;
|
||||||
|
this.fullRestorePP = fullRestorePP;
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
@ -86,6 +88,13 @@ export class PokemonHealPhase extends CommonAnimPhase {
|
|||||||
lastStatusEffect = pokemon.status.effect;
|
lastStatusEffect = pokemon.status.effect;
|
||||||
pokemon.resetStatus();
|
pokemon.resetStatus();
|
||||||
}
|
}
|
||||||
|
if (this.fullRestorePP) {
|
||||||
|
for (const move of this.getPokemon().getMoveset()) {
|
||||||
|
if (move) {
|
||||||
|
move.ppUsed = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
pokemon.updateInfo().then(() => super.end());
|
pokemon.updateInfo().then(() => super.end());
|
||||||
} else if (this.healStatus && !this.revive && pokemon.status) {
|
} else if (this.healStatus && !this.revive && pokemon.status) {
|
||||||
lastStatusEffect = pokemon.status.effect;
|
lastStatusEffect = pokemon.status.effect;
|
||||||
|
Loading…
Reference in New Issue
Block a user