Fix Protosynthesis and Quark Drive (#289)
* Fix Protosynthesis and Quark Drive * add partial tags
This commit is contained in:
parent
4a49ff848a
commit
67ee104178
|
@ -3511,13 +3511,15 @@ export function initAbilities() {
|
|||
.attr(PostWeatherChangeAddBattlerTagAttr, BattlerTagType.PROTOSYNTHESIS, 0, WeatherType.SUNNY, WeatherType.HARSH_SUN)
|
||||
.attr(UncopiableAbilityAbAttr)
|
||||
.attr(UnswappableAbilityAbAttr)
|
||||
.attr(NoTransformAbilityAbAttr),
|
||||
.attr(NoTransformAbilityAbAttr)
|
||||
.partial(), // While setting the tag, the getbattlestat should ignore all modifiers to stats except stat stages
|
||||
new Ability(Abilities.QUARK_DRIVE, 9)
|
||||
.conditionalAttr(getTerrainCondition(TerrainType.ELECTRIC), PostSummonAddBattlerTagAbAttr, BattlerTagType.QUARK_DRIVE, 0, true)
|
||||
.attr(PostTerrainChangeAddBattlerTagAttr, BattlerTagType.QUARK_DRIVE, 0, TerrainType.ELECTRIC)
|
||||
.attr(UncopiableAbilityAbAttr)
|
||||
.attr(UnswappableAbilityAbAttr)
|
||||
.attr(NoTransformAbilityAbAttr),
|
||||
.attr(NoTransformAbilityAbAttr)
|
||||
.partial(), // While setting the tag, the getbattlestat should ignore all modifiers to stats except stat stages
|
||||
new Ability(Abilities.GOOD_AS_GOLD, 9)
|
||||
.attr(MoveImmunityAbAttr, (pokemon, attacker, move) => pokemon !== attacker && move.getMove().category === MoveCategory.STATUS)
|
||||
.ignorable()
|
||||
|
|
|
@ -920,7 +920,7 @@ export class HighestStatBoostTag extends AbilityBattlerTag {
|
|||
stats.map(s => pokemon.getBattleStat(s)).reduce((highestValue: integer, value: integer, i: integer) => {
|
||||
if (value > highestValue) {
|
||||
highestStat = stats[i];
|
||||
return highestValue += value;
|
||||
return value;
|
||||
}
|
||||
return highestValue;
|
||||
}, 0);
|
||||
|
|
|
@ -19,7 +19,7 @@ import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEv
|
|||
import { reverseCompatibleTms, tmSpecies } from '../data/tms';
|
||||
import { DamagePhase, FaintPhase, LearnMovePhase, ObtainStatusEffectPhase, StatChangePhase, SwitchSummonPhase } from '../phases';
|
||||
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 { Species } from '../data/enums/species';
|
||||
import { WeatherType } from '../data/weather';
|
||||
|
@ -600,7 +600,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
ret >>= 1;
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue