created MultiStatusEffectAttr

This commit is contained in:
Luc 2024-04-30 19:54:35 -04:00
parent 2402b8e6a0
commit 31dce6c106

View File

@ -1009,6 +1009,31 @@ export class StatusEffectAttr extends MoveEffectAttr {
} }
} }
export class MultiStatusEffectAttr extends StatusEffectAttr {
public effects: StatusEffect[];
public cureTurn: integer;
public overrideStatus: boolean;
constructor(effects: StatusEffect[], selfTarget?: boolean, cureTurn?: integer, overrideStatus?: boolean) {
super(effects[0], selfTarget, cureTurn, overrideStatus);
this.effects = effects;
this.cureTurn = cureTurn;
this.overrideStatus = !!overrideStatus;
}
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const statusIndex = Math.floor((Utils.randSeedInt(100)*this.effects.length-1)/100)
this.effect = this.effects[statusIndex] as StatusEffect;
const result = super.apply(user, target, move, args);
return result;
}
getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): number {
return !(this.selfTarget ? user : target).status && (this.selfTarget ? user : target).canSetStatus(this.effect, true) ? Math.floor(move.chance * -0.1) : 0;
}
}
export class PsychoShiftEffectAttr extends MoveEffectAttr { export class PsychoShiftEffectAttr extends MoveEffectAttr {
constructor() { constructor() {
super(false, MoveEffectTrigger.HIT); super(false, MoveEffectTrigger.HIT);
@ -4152,9 +4177,7 @@ export function initMoves() {
new SelfStatusMove(Moves.CONVERSION, Type.NORMAL, -1, 30, -1, 0, 1) new SelfStatusMove(Moves.CONVERSION, Type.NORMAL, -1, 30, -1, 0, 1)
.attr(FirstMoveTypeAttr), .attr(FirstMoveTypeAttr),
new AttackMove(Moves.TRI_ATTACK, Type.NORMAL, MoveCategory.SPECIAL, 80, 100, 10, 20, 0, 1) new AttackMove(Moves.TRI_ATTACK, Type.NORMAL, MoveCategory.SPECIAL, 80, 100, 10, 20, 0, 1)
.attr(StatusEffectAttr, StatusEffect.PARALYSIS) .attr(MultiStatusEffectAttr, [StatusEffect.BURN, StatusEffect.FREEZE, StatusEffect.PARALYSIS]),
.attr(StatusEffectAttr, StatusEffect.BURN)
.attr(StatusEffectAttr, StatusEffect.FREEZE),
new AttackMove(Moves.SUPER_FANG, Type.NORMAL, MoveCategory.PHYSICAL, -1, 90, 10, -1, 0, 1) new AttackMove(Moves.SUPER_FANG, Type.NORMAL, MoveCategory.PHYSICAL, -1, 90, 10, -1, 0, 1)
.attr(TargetHalfHpDamageAttr), .attr(TargetHalfHpDamageAttr),
new AttackMove(Moves.SLASH, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 20, -1, 0, 1) new AttackMove(Moves.SLASH, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 20, -1, 0, 1)
@ -5497,6 +5520,9 @@ export function initMoves() {
/* End Unused */ /* End Unused */
new SelfStatusMove(Moves.SHORE_UP, Type.GROUND, -1, 5, -1, 0, 7) new SelfStatusMove(Moves.SHORE_UP, Type.GROUND, -1, 5, -1, 0, 7)
.attr(SandHealAttr) .attr(SandHealAttr)
.attr(HealStatusEffectAttr, true, StatusEffect.POISON)
.attr(HealStatusEffectAttr, true, StatusEffect.PARALYSIS)
.attr(HealStatusEffectAttr, true, StatusEffect.SLEEP)
.triageMove(), .triageMove(),
new AttackMove(Moves.FIRST_IMPRESSION, Type.BUG, MoveCategory.PHYSICAL, 90, 100, 10, -1, 2, 7) new AttackMove(Moves.FIRST_IMPRESSION, Type.BUG, MoveCategory.PHYSICAL, 90, 100, 10, -1, 2, 7)
.condition(new FirstMoveCondition()), .condition(new FirstMoveCondition()),
@ -5968,9 +5994,7 @@ export function initMoves() {
.soundBased() .soundBased()
.partial(), .partial(),
new AttackMove(Moves.DIRE_CLAW, Type.POISON, MoveCategory.PHYSICAL, 80, 100, 15, 50, 0, 8) new AttackMove(Moves.DIRE_CLAW, Type.POISON, MoveCategory.PHYSICAL, 80, 100, 15, 50, 0, 8)
.attr(StatusEffectAttr, StatusEffect.POISON) .attr(MultiStatusEffectAttr, [StatusEffect.POISON, StatusEffect.PARALYSIS, StatusEffect.SLEEP]),
.attr(StatusEffectAttr, StatusEffect.PARALYSIS)
.attr(StatusEffectAttr, StatusEffect.SLEEP),
new AttackMove(Moves.PSYSHIELD_BASH, Type.PSYCHIC, MoveCategory.PHYSICAL, 70, 90, 10, 100, 0, 8) new AttackMove(Moves.PSYSHIELD_BASH, Type.PSYCHIC, MoveCategory.PHYSICAL, 70, 90, 10, 100, 0, 8)
.attr(StatChangeAttr, BattleStat.DEF, 1, true), .attr(StatChangeAttr, BattleStat.DEF, 1, true),
new SelfStatusMove(Moves.POWER_SHIFT, Type.NORMAL, -1, 10, 100, 0, 8) new SelfStatusMove(Moves.POWER_SHIFT, Type.NORMAL, -1, 10, 100, 0, 8)