mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-16 12:29:26 +02:00
Fixed bugs with freeze dry
This commit is contained in:
parent
7c60d0a5b1
commit
216018b409
@ -5359,10 +5359,11 @@ export class VariableMoveTypeChartAttr extends MoveAttr {
|
|||||||
* @param move - The {@linkcode Move} with this attribute
|
* @param move - The {@linkcode Move} with this attribute
|
||||||
* @param args -
|
* @param args -
|
||||||
* `[0]`: A {@linkcode NumberHolder} holding the type effectiveness
|
* `[0]`: A {@linkcode NumberHolder} holding the type effectiveness
|
||||||
* `[1]`: The target's entire defensive type profile.
|
* `[1]`: The target's entire defensive type profile
|
||||||
|
* `[2]`: The current {@linkcode PokemonType} of the move
|
||||||
* @returns `true` if application of the attribute succeeds
|
* @returns `true` if application of the attribute succeeds
|
||||||
*/
|
*/
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: [multiplier: NumberHolder, types: PokemonType[]]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: [multiplier: NumberHolder, types: PokemonType[], moveType: PokemonType]): boolean {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5371,15 +5372,17 @@ export class VariableMoveTypeChartAttr extends MoveAttr {
|
|||||||
* Attribute to implement {@linkcode MoveId.FREEZE_DRY}'s guaranteed water type super effectiveness.
|
* Attribute to implement {@linkcode MoveId.FREEZE_DRY}'s guaranteed water type super effectiveness.
|
||||||
*/
|
*/
|
||||||
export class FreezeDryAttr extends VariableMoveTypeChartAttr {
|
export class FreezeDryAttr extends VariableMoveTypeChartAttr {
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: [NumberHolder, PokemonType[]]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: [multiplier: NumberHolder, types: PokemonType[], moveType: PokemonType]): boolean {
|
||||||
const [multiplier, types] = args;
|
const [multiplier, types, moveType] = args;
|
||||||
|
if (!types.includes(PokemonType.WATER)) {
|
||||||
if (types.includes(PokemonType.WATER)) {
|
|
||||||
multiplier.value = Math.max(multiplier.value, 2);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Replace whatever the prior "normal" water effectiveness was with a guaranteed 2x multi
|
||||||
|
const normalEff = getTypeDamageMultiplier(moveType, PokemonType.WATER)
|
||||||
|
multiplier.value = 2 * multiplier.value / normalEff;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -5387,7 +5390,7 @@ export class FreezeDryAttr extends VariableMoveTypeChartAttr {
|
|||||||
* against all ungrounded flying types.
|
* against all ungrounded flying types.
|
||||||
*/
|
*/
|
||||||
export class NeutralDamageAgainstFlyingTypeAttr extends VariableMoveTypeChartAttr {
|
export class NeutralDamageAgainstFlyingTypeAttr extends VariableMoveTypeChartAttr {
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: [multiplier: NumberHolder, types: PokemonType[]]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: [multiplier: NumberHolder, types: PokemonType[], moveType: PokemonType]): boolean {
|
||||||
const [multiplier, types] = args;
|
const [multiplier, types] = args;
|
||||||
if (target.isGrounded() || !types.includes(PokemonType.FLYING)) {
|
if (target.isGrounded() || !types.includes(PokemonType.FLYING)) {
|
||||||
return false;
|
return false;
|
||||||
@ -5402,7 +5405,7 @@ export class NeutralDamageAgainstFlyingTypeAttr extends VariableMoveTypeChartAtt
|
|||||||
* Attribute used by {@linkcode MoveId.FLYING_PRESS} to add the Flying Type to its type effectiveness.
|
* Attribute used by {@linkcode MoveId.FLYING_PRESS} to add the Flying Type to its type effectiveness.
|
||||||
*/
|
*/
|
||||||
export class FlyingTypeMultiplierAttr extends VariableMoveTypeChartAttr {
|
export class FlyingTypeMultiplierAttr extends VariableMoveTypeChartAttr {
|
||||||
apply(user: Pokemon, target: Pokemon, _move: Move, args: [multiplier: NumberHolder, types: PokemonType[]]): boolean {
|
apply(user: Pokemon, target: Pokemon, _move: Move, args: [multiplier: NumberHolder, types: PokemonType[], moveType: PokemonType]): boolean {
|
||||||
const multiplier = args[0];
|
const multiplier = args[0];
|
||||||
multiplier.value *= target.getAttackTypeEffectiveness(PokemonType.FLYING, {source: user});
|
multiplier.value *= target.getAttackTypeEffectiveness(PokemonType.FLYING, {source: user});
|
||||||
return true;
|
return true;
|
||||||
@ -5413,7 +5416,7 @@ export class FlyingTypeMultiplierAttr extends VariableMoveTypeChartAttr {
|
|||||||
* Attribute used by {@linkcode MoveId.SHEER_COLD} to implement its Gen VII+ ice ineffectiveness.
|
* Attribute used by {@linkcode MoveId.SHEER_COLD} to implement its Gen VII+ ice ineffectiveness.
|
||||||
*/
|
*/
|
||||||
export class IceNoEffectTypeAttr extends VariableMoveTypeChartAttr {
|
export class IceNoEffectTypeAttr extends VariableMoveTypeChartAttr {
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: [multiplier: NumberHolder, types: PokemonType[]]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: [multiplier: NumberHolder, types: PokemonType[], moveType: PokemonType]): boolean {
|
||||||
const [multiplier, types] = args;
|
const [multiplier, types] = args;
|
||||||
if (types.includes(PokemonType.ICE)) {
|
if (types.includes(PokemonType.ICE)) {
|
||||||
multiplier.value = 0;
|
multiplier.value = 0;
|
||||||
@ -5423,7 +5426,6 @@ export class IceNoEffectTypeAttr extends VariableMoveTypeChartAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export class OneHitKOAccuracyAttr extends VariableAccuracyAttr {
|
export class OneHitKOAccuracyAttr extends VariableAccuracyAttr {
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
const accuracy = args[0] as NumberHolder;
|
const accuracy = args[0] as NumberHolder;
|
||||||
|
@ -2547,7 +2547,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
// Apply any typing changes from Freeze-Dry, etc.
|
// Apply any typing changes from Freeze-Dry, etc.
|
||||||
if (move) {
|
if (move) {
|
||||||
applyMoveAttrs("VariableMoveTypeChartAttr", null, this, move, multi, types);
|
applyMoveAttrs("VariableMoveTypeChartAttr", null, this, move, multi, types, moveType);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle strong winds lowering effectiveness of types super effective against pure flying
|
// Handle strong winds lowering effectiveness of types super effective against pure flying
|
||||||
|
Loading…
Reference in New Issue
Block a user