Fix Protosynthesis and Quark Drive

fix
This commit is contained in:
LaukkaE 2024-04-25 17:48:36 +03:00
parent 382f1a8d78
commit 64a46f4ccc
2 changed files with 7 additions and 3 deletions

View File

@ -887,7 +887,7 @@ export class HighestStatBoostTag extends AbilityBattlerTag {
stats.map(s => pokemon.getBattleStat(s)).reduce((highestValue: integer, value: integer, i: integer) => { stats.map(s => pokemon.getBattleStat(s)).reduce((highestValue: integer, value: integer, i: integer) => {
if (value > highestValue) { if (value > highestValue) {
highestStat = stats[i]; highestStat = stats[i];
return highestValue += value; return highestValue = value;
} }
return highestValue; return highestValue;
}, 0); }, 0);

View File

@ -19,7 +19,7 @@ import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEv
import { reverseCompatibleTms, tmSpecies } from '../data/tms'; import { reverseCompatibleTms, tmSpecies } from '../data/tms';
import { DamagePhase, FaintPhase, LearnMovePhase, ObtainStatusEffectPhase, StatChangePhase, SwitchSummonPhase } from '../phases'; import { DamagePhase, FaintPhase, LearnMovePhase, ObtainStatusEffectPhase, StatChangePhase, SwitchSummonPhase } from '../phases';
import { BattleStat } from '../data/battle-stat'; import { BattleStat } from '../data/battle-stat';
import { BattlerTag, BattlerTagLapseType, EncoreTag, HelpingHandTag, TypeBoostTag, getBattlerTag } from '../data/battler-tags'; import { BattlerTag, BattlerTagLapseType, EncoreTag, HelpingHandTag, HighestStatBoostTag, TypeBoostTag, getBattlerTag } from '../data/battler-tags';
import { BattlerTagType } from "../data/enums/battler-tag-type"; import { BattlerTagType } from "../data/enums/battler-tag-type";
import { Species } from '../data/enums/species'; import { Species } from '../data/enums/species';
import { WeatherType } from '../data/weather'; import { WeatherType } from '../data/weather';
@ -579,7 +579,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
ret >>= 1; ret >>= 1;
break; break;
} }
const highestStatBoost = this.findTag(t => t instanceof HighestStatBoostTag && (t as HighestStatBoostTag).stat === stat) as HighestStatBoostTag;
if (highestStatBoost)
ret *= highestStatBoost.multiplier;
return Math.floor(ret); return Math.floor(ret);
} }