Rebalance base stat boosters and make max stack count rely on IVs

This commit is contained in:
Flashfyre 2023-12-09 00:33:29 -05:00
parent d4b620b155
commit e2a6a93209
7 changed files with 104 additions and 59 deletions

View File

@ -1174,7 +1174,7 @@ export default class BattleScene extends Phaser.Scene {
const soundName = modifier.type.soundName;
this.validateAchvs(ModifierAchv, modifier);
if (modifier instanceof PersistentModifier) {
if ((modifier as PersistentModifier).add(this.modifiers, !!virtual)) {
if ((modifier as PersistentModifier).add(this.modifiers, !!virtual, this)) {
if (playSound && !this.sound.get(soundName))
this.playSound(soundName);
} else if (!virtual) {
@ -1222,7 +1222,7 @@ export default class BattleScene extends Phaser.Scene {
addEnemyModifier(itemModifier: PersistentModifier, ignoreUpdate?: boolean): Promise<void> {
return new Promise(resolve => {
itemModifier.add(this.enemyModifiers, false);
itemModifier.add(this.enemyModifiers, false, this);
if (!ignoreUpdate)
this.updateModifiers(false).then(() => resolve());
else
@ -1245,7 +1245,7 @@ export default class BattleScene extends Phaser.Scene {
&& (m as PokemonHeldItemModifier).matchType(itemModifier) && m.pokemonId === target.id, target.isPlayer()) as PokemonHeldItemModifier;
let removeOld = true;
if (matchingModifier) {
const maxStackCount = matchingModifier.getMaxStackCount();
const maxStackCount = matchingModifier.getMaxStackCount(source.scene);
if (matchingModifier.stackCount >= maxStackCount) {
resolve(false);
return;
@ -1312,7 +1312,7 @@ export default class BattleScene extends Phaser.Scene {
if (isBoss)
count = Math.max(count, Math.floor(chances / 2));
getEnemyModifierTypesForWave(waveIndex, count, [ enemyPokemon ], this.currentBattle.battleType === BattleType.TRAINER ? ModifierPoolType.TRAINER : ModifierPoolType.WILD, this.gameMode)
.map(mt => mt.newModifier(enemyPokemon).add(this.enemyModifiers, false));
.map(mt => mt.newModifier(enemyPokemon).add(this.enemyModifiers, false, this));
});
this.updateModifiers(false).then(() => resolve());

View File

@ -2458,7 +2458,7 @@ export const speciesStarters = {
[Species.PANCHAM]: 3,
[Species.FURFROU]: 4,
[Species.ESPURR]: 3,
[Species.HONEDGE]: 3,
[Species.HONEDGE]: 4,
[Species.SPRITZEE]: 3,
[Species.SWIRLIX]: 3,
[Species.INKAY]: 3,

View File

@ -569,7 +569,7 @@ export const trainerConfigs: TrainerConfigs = {
.setPartyTemplates(trainerPartyTemplates.ONE_STRONG, trainerPartyTemplates.ONE_WEAK_ONE_STRONG, trainerPartyTemplates.ONE_AVG_ONE_STRONG)
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.RHYHORN, Species.AIPOM, Species.MAKUHITA, Species.MAWILE, Species.NUMEL, Species.LILLIPUP, Species.SANDILE, /* Species.WOOLOO */ ],
[TrainerPoolTier.UNCOMMON]: [ Species.GIRAFARIG, Species.ZANGOOSE, Species.SEVIPER, Species.CUBCHOO, /* Species.PANCHAM, */ /*Species.SKIDDO*/ /* Species.MUDBRAY */ ],
[TrainerPoolTier.UNCOMMON]: [ Species.GIRAFARIG, Species.ZANGOOSE, Species.SEVIPER, Species.CUBCHOO, Species.PANCHAM, /*Species.SKIDDO*/ /* Species.MUDBRAY */ ],
[TrainerPoolTier.RARE]: [ Species.TAUROS, Species.STANTLER, Species.DARUMAKA, Species.BOUFFALANT, Species.DEERLING, /*Species.IMPIDIMP, */ ],
[TrainerPoolTier.SUPER_RARE]: [ /* Species.GALAR_DARUMAKA */ /* Species.TEDDIURSA */ ]
}),
@ -580,18 +580,19 @@ export const trainerConfigs: TrainerConfigs = {
.setPartyTemplates(trainerPartyTemplates.TWO_WEAK_ONE_AVG, trainerPartyTemplates.TWO_WEAK_ONE_AVG, trainerPartyTemplates.TWO_AVG, trainerPartyTemplates.TWO_AVG, trainerPartyTemplates.TWO_WEAK_ONE_STRONG, trainerPartyTemplates.THREE_AVG, trainerPartyTemplates.TWO_AVG_ONE_STRONG)
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.NIDORAN_F, Species.NIDORAN_M, Species.MACHOP, Species.MAKUHITA, Species.MEDITITE, Species.CROAGUNK, Species.TIMBURR ],
[TrainerPoolTier.UNCOMMON]: [ Species.MANKEY, Species.POLIWRATH, Species.TYROGUE, Species.BRELOOM, Species.SCRAGGY, Species.MIENFOO, /* Species.PANCHAM, */ /* Species.STUFFUL */ /* Species.CRABRAWLER, */ ],
[TrainerPoolTier.UNCOMMON]: [ Species.MANKEY, Species.POLIWRATH, Species.TYROGUE, Species.BRELOOM, Species.SCRAGGY, Species.MIENFOO, Species.PANCHAM, /* Species.STUFFUL */ /* Species.CRABRAWLER, */ ],
[TrainerPoolTier.RARE]: [ Species.HERACROSS, Species.RIOLU, Species.THROH, Species.SAWK, /* Species.CLOBBOPUS, */ /* Species.PASSIMIAN, */ ],
[TrainerPoolTier.SUPER_RARE]: [ Species.INFERNAPE, Species.GALLADE, Species.HITMONTOP, /* Species.HAWLUCHA, */ /* Species.HAKAMO_O, */ ]
[TrainerPoolTier.SUPER_RARE]: [ Species.INFERNAPE, Species.GALLADE, Species.HITMONTOP, Species.HAWLUCHA, /* Species.HAKAMO_O, */ ],
[TrainerPoolTier.ULTRA_RARE]: [ Species.KUBFU ]
}),
[TrainerType.BREEDER]: new TrainerConfig(++t).setMoneyMultiplier(1.325).setEncounterBgm(TrainerType.POKEFAN).setHasGenders().setDouble()
.setPartyTemplateFunc(scene => getWavePartyTemplate(scene, trainerPartyTemplates.FOUR_WEAKER, trainerPartyTemplates.FIVE_WEAKER, trainerPartyTemplates.SIX_WEAKER)),
[TrainerType.CLERK]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.CLERK)
.setPartyTemplates(trainerPartyTemplates.TWO_WEAK, trainerPartyTemplates.THREE_WEAK, trainerPartyTemplates.ONE_AVG, trainerPartyTemplates.TWO_AVG, trainerPartyTemplates.TWO_WEAK_ONE_AVG)
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.MEOWTH, Species.PSYDUCK, Species.BUDEW, Species.PIDOVE, Species.CINCCINO, /* Species.LITLEO */ ],
[TrainerPoolTier.COMMON]: [ Species.MEOWTH, Species.PSYDUCK, Species.BUDEW, Species.PIDOVE, Species.CINCCINO, Species.LITLEO ],
[TrainerPoolTier.UNCOMMON]: [ Species.JIGGLYPUFF, Species.MAGNEMITE, Species.MARILL, Species.COTTONEE, /* Species.SKIDDO */ ],
[TrainerPoolTier.RARE]: [ Species.BUIZEL, Species.SNEASEL, /* Species.KLEFKI, Species.INDEEDEE, */ ]
[TrainerPoolTier.RARE]: [ Species.BUIZEL, Species.SNEASEL, Species.KLEFKI, /* Species.INDEEDEE, */ ]
}),
[TrainerType.CYCLIST]: new TrainerConfig(++t).setMoneyMultiplier(1.3).setHasGenders().setEncounterBgm(TrainerType.CYCLIST).setSpeciesFilter(s => !!s.getLevelMoves().find(plm => plm[1] === Moves.QUICK_ATTACK))
.setPartyTemplates(trainerPartyTemplates.TWO_WEAK, trainerPartyTemplates.ONE_AVG)
@ -664,10 +665,16 @@ export const trainerConfigs: TrainerConfigs = {
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.ABRA, Species.DROWZEE, Species.RALTS, Species.SPOINK, Species.GOTHITA, Species.SOLOSIS, /* Species.BLIPBUG, Species.ESPURR, Species.HATTENA */ ],
[TrainerPoolTier.UNCOMMON]: [ Species.MIME_JR, Species.EXEGGCUTE, Species.MEDITITE, Species.NATU, Species.EXEGGCUTE, Species.WOOBAT, /* Species.INKAY, Species.ORANGURU, */],
[TrainerPoolTier.RARE]: [ Species.ELGYEM, Species.SIGILYPH, Species.BALTOY, Species.GIRAFARIG, /* Species.MEOWSTIC */ ],
[TrainerPoolTier.RARE]: [ Species.ELGYEM, Species.SIGILYPH, Species.BALTOY, Species.GIRAFARIG, Species.MEOWSTIC ],
[TrainerPoolTier.SUPER_RARE]: [ Species.BELDUM, Species.ESPEON /* Species.WYRDEER, */ ],
}),
[TrainerType.RANGER]: new TrainerConfig(++t).setMoneyMultiplier(1.4).setEncounterBgm(TrainerType.BACKPACKER).setHasGenders(),
[TrainerType.RANGER]: new TrainerConfig(++t).setMoneyMultiplier(1.4).setEncounterBgm(TrainerType.BACKPACKER).setHasGenders()
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.PICHU, Species.GROWLITHE, Species.PONYTA, Species.ZIGZAGOON, Species.SEEDOT, Species.BIDOOF, Species.RIOLU, Species.SEWADDLE, Species.SKIDDO, /* Species.SALANDIT */ /* Species.YAMPER */ ],
[TrainerPoolTier.UNCOMMON]: [ Species.AZURILL, Species.TAUROS, Species.MAREEP, Species.FARFETCHD, Species.TEDDIURSA, Species.SHROOMISH, Species.ELECTRIKE, Species.BUDEW, Species.BUIZEL, /* Species.MUDBRAY, */ /* Species.STUFFUL */ ],
[TrainerPoolTier.RARE]: [ Species.EEVEE, Species.SCYTHER, Species.KANGASKHAN, Species.RALTS, Species.MUNCHLAX, Species.ZORUA, /* Species.PALDEA_TAUROS */ /* Species.TINKATINK */ /* Species.CYCLIZAR */ /* Species.FLAMIGO */ ],
[TrainerPoolTier.SUPER_RARE]: [ Species.LARVESTA ],
}),
[TrainerType.RICH]: new TrainerConfig(++t).setMoneyMultiplier(5).setName('Gentleman').setHasGenders(),
[TrainerType.RICH_KID]: new TrainerConfig(++t).setMoneyMultiplier(3.75).setName('Rich Boy').setHasGenders('Lady').setEncounterBgm(TrainerType.RICH),
[TrainerType.ROUGHNECK]: new TrainerConfig(++t).setMoneyMultiplier(1.4).setEncounterBgm(TrainerType.ROUGHNECK).setSpeciesFilter(s => s.isOfType(Type.DARK)),

View File

@ -14,6 +14,7 @@ import { Unlockables } from '../system/unlockables';
import { GameMode } from '../game-mode';
import { StatusEffect, getStatusEffectDescriptor } from '../data/status-effect';
import { SpeciesFormKey } from '../data/pokemon-species';
import BattleScene from '../battle-scene';
type Modifier = Modifiers.Modifier;
@ -107,7 +108,13 @@ export class PokemonModifierType extends ModifierType {
export class PokemonHeldItemModifierType extends PokemonModifierType {
constructor(name: string, description: string, newModifierFunc: NewModifierFunc, iconImage?: string, group?: string, soundName?: string) {
super(name, description, newModifierFunc, undefined, iconImage, group, soundName);
super(name, description, newModifierFunc, (pokemon: PlayerPokemon) => {
const dummyModifier = this.newModifier(pokemon);
const matchingModifier = pokemon.scene.findModifier(m => m instanceof Modifiers.PokemonHeldItemModifier && m.pokemonId === pokemon.id && m.matchType(dummyModifier)) as Modifiers.PokemonHeldItemModifier;
if (matchingModifier && matchingModifier.stackCount === matchingModifier.getMaxStackCount(pokemon.scene))
return `${pokemon.name} has too many\nof this item!`;
return null;
}, iconImage, group, soundName);
}
newModifier(...args: any[]): Modifiers.PokemonHeldItemModifier {
@ -354,7 +361,7 @@ export class PokemonBaseStatBoosterModifierType extends PokemonHeldItemModifierT
private stat: Stat;
constructor(name: string, stat: Stat, _iconImage?: string) {
super(name, `Increases the holder's base ${getStatName(stat)} by 20%`, (_type, args) => new Modifiers.PokemonBaseStatModifier(this, (args[0] as Pokemon).id, this.stat));
super(name, `Increases the holder's base ${getStatName(stat)} by 10%. The higher your IVs, the higher the stack limit.`, (_type, args) => new Modifiers.PokemonBaseStatModifier(this, (args[0] as Pokemon).id, this.stat));
this.stat = stat;
}
@ -921,7 +928,7 @@ export function regenerateModifierPoolThresholds(party: Pokemon[], poolType: Mod
pool[t].reduce((total: integer, modifierType: WeightedModifierType) => {
const weightedModifierType = modifierType as WeightedModifierType;
const existingModifiers = party[0].scene.findModifiers(m => (m.type.generatorId || m.type.id) === weightedModifierType.modifierType.id, player);
const weight = !existingModifiers.length || existingModifiers.filter(m => m.stackCount < m.getMaxStackCount()).length
const weight = !existingModifiers.length || existingModifiers.filter(m => m.stackCount < m.getMaxStackCount(party[0].scene, true)).length
? weightedModifierType.weight instanceof Function
? (weightedModifierType.weight as Function)(party)
: weightedModifierType.weight as integer
@ -968,13 +975,13 @@ export function getPlayerModifierTypeOptionsForWave(waveIndex: integer, count: i
return options;
}
export function getEnemyBuffModifierForWave(tier: ModifierTier, enemyModifiers: Modifiers.PersistentModifier[]): Modifiers.EnemyPersistentModifier {
export function getEnemyBuffModifierForWave(tier: ModifierTier, enemyModifiers: Modifiers.PersistentModifier[], scene: BattleScene): Modifiers.EnemyPersistentModifier {
const tierStackCount = tier === ModifierTier.ULTRA ? 10 : tier === ModifierTier.GREAT ? 5 : 1;
const retryCount = 50;
let candidate = getNewModifierTypeOption(null, ModifierPoolType.ENEMY_BUFF, tier);
let r = 0;
let matchingModifier: Modifiers.PersistentModifier;
while (++r < retryCount && (matchingModifier = enemyModifiers.find(m => m.type.id === candidate.type.id)) && matchingModifier.getMaxStackCount() < matchingModifier.stackCount + (r < 10 ? tierStackCount : 1))
while (++r < retryCount && (matchingModifier = enemyModifiers.find(m => m.type.id === candidate.type.id)) && matchingModifier.getMaxStackCount(scene) < matchingModifier.stackCount + (r < 10 ? tierStackCount : 1))
candidate = getNewModifierTypeOption(null, ModifierPoolType.ENEMY_BUFF, tier);
const modifier = candidate.type.newModifier() as Modifiers.EnemyPersistentModifier;

View File

@ -111,10 +111,10 @@ export abstract class PersistentModifier extends Modifier {
this.virtualStackCount = 0;
}
add(modifiers: PersistentModifier[], virtual: boolean): boolean {
add(modifiers: PersistentModifier[], virtual: boolean, scene: BattleScene): boolean {
for (let modifier of modifiers) {
if (this.match(modifier))
return modifier.incrementStack(this.stackCount, virtual);
return modifier.incrementStack(scene, this.stackCount, virtual);
}
if (virtual) {
@ -131,8 +131,8 @@ export abstract class PersistentModifier extends Modifier {
return [];
}
incrementStack(amount: integer, virtual: boolean): boolean {
if (this.getStackCount() + amount <= this.getMaxStackCount()) {
incrementStack(scene: BattleScene, amount: integer, virtual: boolean): boolean {
if (this.getStackCount() + amount <= this.getMaxStackCount(scene)) {
if (!virtual)
this.stackCount += amount;
else
@ -147,9 +147,7 @@ export abstract class PersistentModifier extends Modifier {
return this.stackCount + this.virtualStackCount;
}
getMaxStackCount(): integer {
return 99;
}
abstract getMaxStackCount(scene: BattleScene, forThreshold?: boolean): integer
isIconVisible(scene: BattleScene): boolean {
return true;
@ -175,10 +173,10 @@ export abstract class PersistentModifier extends Modifier {
}
getIconStackText(scene: BattleScene, virtual?: boolean): Phaser.GameObjects.Text {
if (this.getMaxStackCount() === 1 || (virtual && !this.virtualStackCount))
if (this.getMaxStackCount(scene) === 1 || (virtual && !this.virtualStackCount))
return null;
const isStackMax = this.getStackCount() >= this.getMaxStackCount();
const isStackMax = this.getStackCount() >= this.getMaxStackCount(scene);
const maxColor = '#f89890';
const maxStrokeColor = '#984038';
@ -257,6 +255,10 @@ export abstract class LapsingPersistentModifier extends PersistentModifier {
return container;
}
getMaxStackCount(scene: BattleScene, forThreshold?: boolean): number {
return 99;
}
}
export class DoubleBattleChanceBoosterModifier extends LapsingPersistentModifier {
@ -336,7 +338,7 @@ export class MapModifier extends PersistentModifier {
return true;
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 1;
}
}
@ -354,7 +356,7 @@ export class MegaEvolutionAccessModifier extends PersistentModifier {
return true;
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 1;
}
}
@ -425,6 +427,15 @@ export abstract class PokemonHeldItemModifier extends PersistentModifier {
getPokemon(scene: BattleScene): Pokemon {
return scene.getPokemonById(this.pokemonId);
}
getMaxStackCount(scene: BattleScene, forThreshold?: boolean): integer {
const pokemon = this.getPokemon(scene);
if (pokemon.isPlayer() && forThreshold)
return scene.getParty().map(p => this.getMaxHeldItemCount(p)).reduce((stackCount: integer, maxStackCount: integer) => Math.max(stackCount, maxStackCount), 0);
return this.getMaxHeldItemCount(pokemon);
}
abstract getMaxHeldItemCount(pokemon: Pokemon): integer
}
export class PokemonBaseStatModifier extends PokemonHeldItemModifier {
@ -454,7 +465,7 @@ export class PokemonBaseStatModifier extends PokemonHeldItemModifier {
}
apply(args: any[]): boolean {
args[1][this.stat] = Math.min(Math.floor(args[1][this.stat] * (1 + this.getStackCount() * 0.2)), 999999);
args[1][this.stat] = Math.min(Math.floor(args[1][this.stat] * (1 + this.getStackCount() * 0.1)), 999999);
return true;
}
@ -463,8 +474,8 @@ export class PokemonBaseStatModifier extends PokemonHeldItemModifier {
return false;
}
getMaxStackCount(): integer {
return 10;
getMaxHeldItemCount(pokemon: Pokemon): integer {
return pokemon.ivs[this.stat];
}
}
@ -503,6 +514,10 @@ export class AttackTypeBoosterModifier extends PokemonHeldItemModifier {
return true;
}
getMaxHeldItemCount(pokemon: Pokemon): integer {
return 10;
}
}
export class SurviveDamageModifier extends PokemonHeldItemModifier {
@ -536,7 +551,7 @@ export class SurviveDamageModifier extends PokemonHeldItemModifier {
return false;
}
getMaxStackCount(): integer {
getMaxHeldItemCount(pokemon: Pokemon): integer {
return 5;
}
}
@ -569,7 +584,7 @@ export class FlinchChanceModifier extends PokemonHeldItemModifier {
return false;
}
getMaxStackCount(): integer {
getMaxHeldItemCount(pokemon: Pokemon): integer {
return 3;
}
}
@ -600,7 +615,7 @@ export class TurnHealModifier extends PokemonHeldItemModifier {
return false;
}
getMaxStackCount(): integer {
getMaxHeldItemCount(pokemon: Pokemon): integer {
return 4;
}
}
@ -630,7 +645,7 @@ export class HitHealModifier extends PokemonHeldItemModifier {
return true;
}
getMaxStackCount(): integer {
getMaxHeldItemCount(pokemon: Pokemon): integer {
return 4;
}
}
@ -657,6 +672,10 @@ export class LevelIncrementBoosterModifier extends PersistentModifier {
return true;
}
getMaxStackCount(scene: BattleScene, forThreshold?: boolean): number {
return 99;
}
}
export class BerryModifier extends PokemonHeldItemModifier {
@ -698,6 +717,10 @@ export class BerryModifier extends PokemonHeldItemModifier {
return true;
}
getMaxHeldItemCount(pokemon: Pokemon): integer {
return 10;
}
}
export class PreserveBerryModifier extends PersistentModifier {
@ -719,12 +742,12 @@ export class PreserveBerryModifier extends PersistentModifier {
apply(args: any[]): boolean {
if (!(args[0] as Utils.BooleanHolder).value)
(args[0] as Utils.BooleanHolder).value = Utils.randInt(this.getMaxStackCount()) < this.getStackCount();
(args[0] as Utils.BooleanHolder).value = Utils.randInt(this.getMaxStackCount(null)) < this.getStackCount();
return true;
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 3;
}
}
@ -753,7 +776,7 @@ export class PokemonInstantReviveModifier extends PokemonHeldItemModifier {
return true;
}
getMaxStackCount(): integer {
getMaxHeldItemCount(pokemon: Pokemon): integer {
return 1;
}
}
@ -991,7 +1014,7 @@ export class MultipleParticipantExpBonusModifier extends PersistentModifier {
return new MultipleParticipantExpBonusModifier(this.type, this.stackCount);
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 5;
}
}
@ -1024,7 +1047,7 @@ export class HealingBoosterModifier extends PersistentModifier {
return true;
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 4;
}
}
@ -1063,6 +1086,10 @@ export class ExpBoosterModifier extends PersistentModifier {
getStackCount(): integer {
return this.boostMultiplier < 1 ? super.getStackCount() : 10;
}
getMaxStackCount(scene: BattleScene, forThreshold?: boolean): integer {
return 99;
}
}
export class PokemonExpBoosterModifier extends PokemonHeldItemModifier {
@ -1098,6 +1125,10 @@ export class PokemonExpBoosterModifier extends PokemonHeldItemModifier {
return true;
}
getMaxHeldItemCount(pokemon: Pokemon): integer {
return 99;
}
}
export class ExpShareModifier extends PersistentModifier {
@ -1117,7 +1148,7 @@ export class ExpShareModifier extends PersistentModifier {
return true;
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 5;
}
}
@ -1139,7 +1170,7 @@ export class ExpBalanceModifier extends PersistentModifier {
return true;
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 1;
}
}
@ -1163,7 +1194,7 @@ export class MoneyMultiplierModifier extends PersistentModifier {
return true;
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 5;
}
}
@ -1192,7 +1223,7 @@ export class DamageMoneyRewardModifier extends PokemonHeldItemModifier {
return true;
}
getMaxStackCount(): integer {
getMaxHeldItemCount(pokemon: Pokemon): integer {
return 5;
}
}
@ -1222,7 +1253,7 @@ export class MoneyInterestModifier extends PersistentModifier {
return new MoneyInterestModifier(this.type, this.stackCount);
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 5;
}
}
@ -1246,7 +1277,7 @@ export class HiddenAbilityRateBoosterModifier extends PersistentModifier {
return true;
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 4;
}
}
@ -1270,7 +1301,7 @@ export class ShinyRateBoosterModifier extends PersistentModifier {
return true;
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 4;
}
}
@ -1292,7 +1323,7 @@ export class SwitchEffectTransferModifier extends PokemonHeldItemModifier {
return true;
}
getMaxStackCount(): integer {
getMaxHeldItemCount(pokemon: Pokemon): integer {
return 1;
}
}
@ -1368,7 +1399,7 @@ export class TurnHeldItemTransferModifier extends HeldItemTransferModifier {
return getPokemonMessage(targetPokemon, `'s ${item.name} was absorbed\nby ${pokemon.name}'s ${this.type.name}!`);
}
getMaxStackCount(): integer {
getMaxHeldItemCount(pokemon: Pokemon): integer {
return 3;
}
}
@ -1402,7 +1433,7 @@ export class ContactHeldItemTransferChanceModifier extends HeldItemTransferModif
return getPokemonMessage(targetPokemon, `'s ${item.name} was snatched\nby ${pokemon.name}'s ${this.type.name}!`);
}
getMaxStackCount(): integer {
getMaxHeldItemCount(pokemon: Pokemon): integer {
return 5;
}
}
@ -1424,7 +1455,7 @@ export class IvScannerModifier extends PersistentModifier {
return true;
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 5;
}
}
@ -1448,7 +1479,7 @@ export class ExtraModifierModifier extends PersistentModifier {
return true;
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 3;
}
}
@ -1458,7 +1489,7 @@ export abstract class EnemyPersistentModifier extends PersistentModifier {
super(type, stackCount);
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return this.type.tier ? 1 : 5;
}
}
@ -1478,7 +1509,7 @@ abstract class EnemyDamageMultiplierModifier extends EnemyPersistentModifier {
return true;
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 99;
}
}
@ -1553,7 +1584,7 @@ export class EnemyTurnHealModifier extends EnemyPersistentModifier {
return false;
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 20;
}
}
@ -1663,7 +1694,7 @@ export class EnemyInstantReviveChanceModifier extends EnemyPersistentModifier {
return true;
}
getMaxStackCount(): integer {
getMaxStackCount(scene: BattleScene): integer {
return 10;
}
}

View File

@ -41,8 +41,8 @@ export default class ModifierData {
const ret = Reflect.construct(constructor, ([ type ] as any[]).concat(this.args).concat(this.stackCount)) as PersistentModifier;
if (ret.stackCount > ret.getMaxStackCount())
ret.stackCount = ret.getMaxStackCount();
if (ret.stackCount > ret.getMaxStackCount(scene))
ret.stackCount = ret.getMaxStackCount(scene);
return ret;
}

View File

@ -96,7 +96,7 @@ export default class PartyUiHandler extends MessageUiHandler {
public static FilterItemMaxStacks = (pokemon: PlayerPokemon, modifier: PokemonHeldItemModifier) => {
const matchingModifier = pokemon.scene.findModifier(m => m instanceof PokemonHeldItemModifier && (m as PokemonHeldItemModifier).matchType(modifier)) as PokemonHeldItemModifier;
if (matchingModifier && matchingModifier.stackCount === matchingModifier.getMaxStackCount())
if (matchingModifier && matchingModifier.stackCount === matchingModifier.getMaxStackCount(pokemon.scene))
return `${pokemon.name} has too many\nof this item!`;
return null;
};