mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 23:42:18 +02:00
Fix issue with Hydro Steam outside sun
This commit is contained in:
parent
5e72b589cb
commit
1300dcd72c
@ -793,16 +793,14 @@ export class IgnoreWeatherTypeDebuffAttr extends MoveAttr {
|
||||
public weather: WeatherType;
|
||||
constructor(weather: WeatherType){
|
||||
super();
|
||||
this.weather=weather;
|
||||
this.weather = weather;
|
||||
}
|
||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
(args[0] as Utils.IntegerHolder).value = Math.max((args[0] as Utils.IntegerHolder).value, 1);
|
||||
|
||||
const weatherModifier=args[0] as Utils.NumberHolder;
|
||||
if (user.scene.arena.weather?.weatherType === this.weather)
|
||||
weatherModifier.value = Math.max(weatherModifier.value, 1);
|
||||
return true;
|
||||
}
|
||||
getCondition(): MoveCondition | MoveConditionFunc {
|
||||
return (user, target, move) => user.scene.arena.weather?.weatherType==this.weather;
|
||||
}
|
||||
}
|
||||
|
||||
export abstract class WeatherHealAttr extends HealAttr {
|
||||
@ -2887,7 +2885,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
||||
if (this.batonPass)
|
||||
return false;
|
||||
//U-turn et al should not switch a wild mon out, but a player's Dragon Tail can
|
||||
if (!(user instanceof PlayerPokemon) && move.category !== MoveCategory.STATUS)
|
||||
if (!user.hasTrainer() && move.category !== MoveCategory.STATUS)
|
||||
return false;
|
||||
// Don't allow wild opponents to flee on the boss stage since it can ruin a run early on
|
||||
if (!(user.scene.currentBattle.waveIndex % 10))
|
||||
|
@ -1264,7 +1264,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
this.removeTag(typeBoost.tagType);
|
||||
}
|
||||
}
|
||||
const arenaAttackTypeMultiplier = this.scene.arena.getAttackTypeMultiplier(type, source.isGrounded());
|
||||
const arenaAttackTypeMultiplier = new Utils.NumberHolder(this.scene.arena.getAttackTypeMultiplier(type, source.isGrounded()));
|
||||
applyMoveAttrs(IgnoreWeatherTypeDebuffAttr, source, this, move, arenaAttackTypeMultiplier);
|
||||
if (this.scene.arena.getTerrainType() === TerrainType.GRASSY && this.isGrounded() && type === Type.GROUND && move.moveTarget === MoveTarget.ALL_NEAR_OTHERS)
|
||||
power.value /= 2;
|
||||
@ -1309,7 +1309,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
if (!isCritical) {
|
||||
this.scene.arena.applyTagsForSide(WeakenMoveScreenTag, this.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY, move.category, this.scene.currentBattle.double, screenMultiplier);
|
||||
}
|
||||
const isTypeImmune = (typeMultiplier.value * arenaAttackTypeMultiplier) === 0;
|
||||
const isTypeImmune = (typeMultiplier.value * arenaAttackTypeMultiplier.value) === 0;
|
||||
const sourceTypes = source.getTypes();
|
||||
const matchesSourceType = sourceTypes[0] === type || (sourceTypes.length > 1 && sourceTypes[1] === type);
|
||||
let stabMultiplier = new Utils.NumberHolder(1);
|
||||
@ -1327,7 +1327,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
applyMoveAttrs(VariableDefAttr, source, this, move, targetDef);
|
||||
|
||||
if (!isTypeImmune) {
|
||||
damage.value = Math.ceil(((((2 * source.level / 5 + 2) * power.value * sourceAtk.value / targetDef.value) / 50) + 2) * stabMultiplier.value * typeMultiplier.value * arenaAttackTypeMultiplier * screenMultiplier.value * ((this.scene.randBattleSeedInt(15) + 85) / 100) * criticalMultiplier);
|
||||
damage.value = Math.ceil(((((2 * source.level / 5 + 2) * power.value * sourceAtk.value / targetDef.value) / 50) + 2) * stabMultiplier.value * typeMultiplier.value * arenaAttackTypeMultiplier.value * screenMultiplier.value * ((this.scene.randBattleSeedInt(15) + 85) / 100) * criticalMultiplier);
|
||||
if (isPhysical && source.status && source.status.effect === StatusEffect.BURN) {
|
||||
const burnDamageReductionCancelled = new Utils.BooleanHolder(false);
|
||||
applyAbAttrs(BypassBurnDamageReductionAbAttr, source, burnDamageReductionCancelled);
|
||||
|
Loading…
Reference in New Issue
Block a user