mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-17 22:02:18 +02:00
Fixing the crash bug that occurs when Endless runs
reach floor 5850
This commit is contained in:
parent
879f009156
commit
8857bbf530
@ -1592,15 +1592,20 @@ export function getEnemyBuffModifierForWave(tier: ModifierTier, enemyModifiers:
|
|||||||
const tierStackCount = tier === ModifierTier.ULTRA ? 5 : tier === ModifierTier.GREAT ? 3 : 1;
|
const tierStackCount = tier === ModifierTier.ULTRA ? 5 : tier === ModifierTier.GREAT ? 3 : 1;
|
||||||
const retryCount = 50;
|
const retryCount = 50;
|
||||||
let candidate = getNewModifierTypeOption(null, ModifierPoolType.ENEMY_BUFF, tier);
|
let candidate = getNewModifierTypeOption(null, ModifierPoolType.ENEMY_BUFF, tier);
|
||||||
let r = 0;
|
if (candidate != null) {
|
||||||
let matchingModifier: Modifiers.PersistentModifier;
|
let r = 0;
|
||||||
while (++r < retryCount && (matchingModifier = enemyModifiers.find(m => m.type.id === candidate.type.id)) && matchingModifier.getMaxStackCount(scene) < matchingModifier.stackCount + (r < 10 ? tierStackCount : 1))
|
let matchingModifier: Modifiers.PersistentModifier;
|
||||||
candidate = getNewModifierTypeOption(null, ModifierPoolType.ENEMY_BUFF, tier);
|
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;
|
|
||||||
modifier.stackCount = tierStackCount;
|
const modifier = candidate.type.newModifier() as Modifiers.EnemyPersistentModifier;
|
||||||
|
modifier.stackCount = tierStackCount;
|
||||||
return modifier;
|
|
||||||
|
return modifier;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getEnemyModifierTypesForWave(waveIndex: integer, count: integer, party: EnemyPokemon[], poolType: ModifierPoolType.WILD | ModifierPoolType.TRAINER, upgradeChance: integer = 0): PokemonHeldItemModifierType[] {
|
export function getEnemyModifierTypesForWave(waveIndex: integer, count: integer, party: EnemyPokemon[], poolType: ModifierPoolType.WILD | ModifierPoolType.TRAINER, upgradeChance: integer = 0): PokemonHeldItemModifierType[] {
|
||||||
|
Loading…
Reference in New Issue
Block a user