Updated and separated the accuracy attribute and the Ice no effect attribute

This commit is contained in:
Ethan 2024-04-29 19:58:01 -04:00
parent 990eda0aca
commit da88aa2858

View File

@ -2329,6 +2329,17 @@ export class WaterSuperEffectTypeMultiplierAttr extends VariableMoveTypeMultipli
}
}
export class IceNoEffectTypeMultiplierAttr extends VariableMoveTypeMultiplierAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const multiplier = args[0] as Utils.NumberHolder;
if (target.isOfType(Type.ICE)) {
multiplier.value *= 0; // Increased twice because initial reduction against water
return true;
}
return false;
}
}
export class FlyingTypeMultiplierAttr extends VariableMoveTypeMultiplierAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const multiplier = args[0] as Utils.NumberHolder;
@ -2351,18 +2362,17 @@ export class OneHitKOAccuracyAttr extends VariableAccuracyAttr {
export class SheerColdAttr extends OneHitKOAccuracyAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const accuracy = args[0] as Utils.NumberHolder;
if (!target.isOfType(Type.ICE)) {
if (user.level < target.level)
if (user.level < target.level) {
accuracy.value = 0;
else {
if (user.isOfType(Type.ICE))
} else {
if (user.isOfType(Type.ICE)) {
accuracy.value = Math.min(Math.max(30 + 100 * (1 - target.level / user.level), 0), 100);
else
}
else {
accuracy.value = Math.min(Math.max(20 + 100 * (1 - target.level / user.level), 0), 100);
}
return true;
}
return false;
return true;
}
}
@ -4643,7 +4653,8 @@ export function initMoves() {
new AttackMove(Moves.SAND_TOMB, Type.GROUND, MoveCategory.PHYSICAL, 35, 85, 15, 100, 0, 3)
.attr(TrapAttr, BattlerTagType.SAND_TOMB)
.makesContact(false),
new AttackMove(Moves.SHEER_COLD, Type.ICE, MoveCategory.SPECIAL, 200, 30, 5, -1, 0, 3)
new AttackMove(Moves.SHEER_COLD, Type.ICE, MoveCategory.SPECIAL, 200, 20, 5, -1, 0, 3)
.attr(IceNoEffectTypeMultiplierAttr)
.attr(SheerColdAttr),
new AttackMove(Moves.MUDDY_WATER, Type.WATER, MoveCategory.SPECIAL, 90, 85, 10, 30, 0, 3)
.attr(StatChangeAttr, BattleStat.ACC, -1)