[Bug] Preventing the MBH from being stolen in Endless (#3630)

* Endless MBH Fix

* add import

* Revert "add import"

This reverts commit 814a4059c2.

* Revert "Endless MBH Fix"

This reverts commit 8eb4481301.

* removed newline

---------

Co-authored-by: Frederico Santos <frederico.f.santos@tecnico.ulisboa.pt>
Co-authored-by: frutescens <info@laptop>
This commit is contained in:
Mumble 2024-08-18 13:51:08 -07:00 committed by GitHub
parent c8ed89e186
commit 65af7a5699
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2419,9 +2419,14 @@ export default class BattleScene extends SceneBase {
count = Math.max(count, Math.floor(chances / 2)); count = Math.max(count, Math.floor(chances / 2));
} }
getEnemyModifierTypesForWave(difficultyWaveIndex, count, [ enemyPokemon ], this.currentBattle.battleType === BattleType.TRAINER ? ModifierPoolType.TRAINER : ModifierPoolType.WILD, upgradeChance) getEnemyModifierTypesForWave(difficultyWaveIndex, count, [ enemyPokemon ], this.currentBattle.battleType === BattleType.TRAINER ? ModifierPoolType.TRAINER : ModifierPoolType.WILD, upgradeChance)
.map(mt => mt.newModifier(enemyPokemon).add(this.enemyModifiers, false, this)); .map(mt => {
const enemyModifier = mt.newModifier(enemyPokemon);
if (enemyModifier instanceof TurnHeldItemTransferModifier) {
enemyModifier.setTransferrableFalse();
}
enemyModifier.add(this.enemyModifiers, false, this);
});
}); });
this.updateModifiers(false).then(() => resolve()); this.updateModifiers(false).then(() => resolve());
}); });
} }