Implemented Frustration, and Return Damage Calcs

pull/2/head
xDasone 2023-10-26 22:03:24 -07:00
parent 1d8cf50f1b
commit 36b030d019
1 changed files with 25 additions and 2 deletions

View File

@ -1589,6 +1589,27 @@ export class SolarBeamPowerAttr extends VariablePowerAttr {
}
}
export class WinCountPowerMoveAttr extends VariablePowerAttr {
private invert: boolean;
constructor(invert?: boolean) {
super();
this.invert = !!invert;
}
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const power = args[0] as Utils.NumberHolder;
if (user instanceof PlayerPokemon) {
const winCount = Math.min(user.winCount, 100);
power.value = Math.max(!this.invert ? winCount : 100 - winCount, 1);
}
return true;
}
}
export class VariableAccuracyAttr extends MoveAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
//const accuracy = args[0] as Utils.NumberHolder;
@ -2753,10 +2774,12 @@ export function initMoves() {
.condition((user: Pokemon, target: Pokemon, move: Move) => user.status?.effect === StatusEffect.SLEEP),
new SelfStatusMove(Moves.HEAL_BELL, "Heal Bell (N)", Type.NORMAL, -1, 5, -1, "Heals the user's party's status conditions.", -1, 0, 2)
.target(MoveTarget.USER_AND_ALLIES),
new AttackMove(Moves.RETURN, "Return (N)", Type.NORMAL, MoveCategory.PHYSICAL, -1, 100, 20, -1, "Power increases with higher Friendship.", -1, 0, 2),
new AttackMove(Moves.RETURN, "Return", Type.NORMAL, MoveCategory.PHYSICAL, -1, 100, 20, -1, "Power increases with higher Friendship.", -1, 0, 2)
.attr(WinCountPowerMoveAttr),
new AttackMove(Moves.PRESENT, "Present (N)", Type.NORMAL, MoveCategory.PHYSICAL, -1, 90, 15, -1, "Either deals damage or heals.", -1, 0, 2)
.makesContact(false),
new AttackMove(Moves.FRUSTRATION, "Frustration (N)", Type.NORMAL, MoveCategory.PHYSICAL, -1, 100, 20, -1, "Power decreases with higher Friendship.", -1, 0, 2),
new AttackMove(Moves.FRUSTRATION, "Frustration", Type.NORMAL, MoveCategory.PHYSICAL, -1, 100, 20, -1, "Power decreases with higher Friendship.", -1, 0, 2)
.attr(WinCountPowerMoveAttr, true),
new SelfStatusMove(Moves.SAFEGUARD, "Safeguard (N)", Type.NORMAL, -1, 25, -1, "The user's party is protected from status conditions.", -1, 0, 2)
.target(MoveTarget.USER_SIDE),
new StatusMove(Moves.PAIN_SPLIT, "Pain Split", Type.NORMAL, -1, 20, -1, "The user's and opponent's HP becomes the average of both.", -1, 0, 2)