Fix terrain power boosting

fix
pull/118/head
LaukkaE 2024-04-13 20:41:59 +03:00 committed by Samuel H
parent aa0a88a468
commit 8cf8ce1258
2 changed files with 2 additions and 4 deletions

View File

@ -337,7 +337,7 @@ export class Arena {
weatherMultiplier = this.weather.getAttackTypeMultiplier(attackType); weatherMultiplier = this.weather.getAttackTypeMultiplier(attackType);
let terrainMultiplier = 1; let terrainMultiplier = 1;
if (this.terrain && !grounded) if (this.terrain && grounded)
terrainMultiplier = this.terrain.getAttackTypeMultiplier(attackType); terrainMultiplier = this.terrain.getAttackTypeMultiplier(attackType);
return weatherMultiplier * terrainMultiplier; return weatherMultiplier * terrainMultiplier;

View File

@ -1159,11 +1159,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
else { else {
if (source.findTag(t => t instanceof TypeBoostTag && (t as TypeBoostTag).boostedType === type)) if (source.findTag(t => t instanceof TypeBoostTag && (t as TypeBoostTag).boostedType === type))
power.value *= 1.5; power.value *= 1.5;
const arenaAttackTypeMultiplier = this.scene.arena.getAttackTypeMultiplier(type, this.isGrounded()); const arenaAttackTypeMultiplier = this.scene.arena.getAttackTypeMultiplier(type, source.isGrounded());
if (this.scene.arena.getTerrainType() === TerrainType.GRASSY && this.isGrounded() && type === Type.GROUND && move.moveTarget === MoveTarget.ALL_NEAR_OTHERS) if (this.scene.arena.getTerrainType() === TerrainType.GRASSY && this.isGrounded() && type === Type.GROUND && move.moveTarget === MoveTarget.ALL_NEAR_OTHERS)
power.value /= 2; power.value /= 2;
else if (this.scene.arena.getTerrainType() === TerrainType.ELECTRIC && source.isGrounded() && type === Type.ELECTRIC)
power.value *= 1.3;
applyMoveAttrs(VariablePowerAttr, source, this, move, power); applyMoveAttrs(VariablePowerAttr, source, this, move, power);
this.scene.applyModifiers(PokemonMultiHitModifier, source.isPlayer(), source, new Utils.IntegerHolder(0), power); this.scene.applyModifiers(PokemonMultiHitModifier, source.isPlayer(), source, new Utils.IntegerHolder(0), power);
if (!typeless) { if (!typeless) {