Fix cases of items not using seeded random

pull/16/head
Flashfyre 2024-02-28 14:57:11 -05:00
parent d7a81925b0
commit 5280840cac
2 changed files with 6 additions and 6 deletions

View File

@ -993,8 +993,8 @@ const modifierPool = {
new WeightedModifierType(modifierTypes.SHINY_CHARM, 18),
new WeightedModifierType(modifierTypes.HEALING_CHARM, 18),
new WeightedModifierType(modifierTypes.VOUCHER_PLUS, 6),
new WeightedModifierType(modifierTypes.MEGA_BRACELET, (party: Pokemon[]) => Math.ceil(party[0].scene.currentBattle.waveIndex / 50) * 8),
new WeightedModifierType(modifierTypes.DYNAMAX_BAND, (party: Pokemon[]) => Math.ceil(party[0].scene.currentBattle.waveIndex / 50) * 8),
new WeightedModifierType(modifierTypes.MEGA_BRACELET, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 8),
new WeightedModifierType(modifierTypes.DYNAMAX_BAND, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 8),
new WeightedModifierType(modifierTypes.DNA_SPLICERS, (party: Pokemon[]) => party[0].scene.gameMode !== GameMode.SPLICED_ENDLESS && party.filter(p => !p.fusionSpecies).length > 1 ? 12 : 0),
new WeightedModifierType(modifierTypes.MINI_BLACK_HOLE, (party: Pokemon[]) => party[0].scene.gameData.unlocks[Unlockables.MINI_BLACK_HOLE] ? 2 : 0),
].map(m => { m.setTier(ModifierTier.MASTER); return m; }),

View File

@ -1736,7 +1736,7 @@ export class ContactHeldItemTransferChanceModifier extends HeldItemTransferModif
}
getTransferredItemCount(): integer {
return Math.random() < (this.chance * this.getStackCount()) ? 1 : 0;
return Phaser.Math.RND.realInRange(0, 1) < (this.chance * this.getStackCount()) ? 1 : 0;
}
getTransferMessage(pokemon: Pokemon, targetPokemon: Pokemon, item: ModifierTypes.ModifierType): string {
@ -1924,7 +1924,7 @@ export class EnemyAttackStatusEffectChanceModifier extends EnemyPersistentModifi
apply(args: any[]): boolean {
const target = (args[0] as Pokemon);
if (Math.random() < this.chance * this.getStackCount()) {
if (Phaser.Math.RND.realInRange(0, 1) < (this.chance * this.getStackCount())) {
target.scene.unshiftPhase(new ObtainStatusEffectPhase(target.scene, target.getBattlerIndex(), this.effect));
return true;
}
@ -1956,7 +1956,7 @@ export class EnemyStatusEffectHealChanceModifier extends EnemyPersistentModifier
apply(args: any[]): boolean {
const target = (args[0] as Pokemon);
if (target.status && Math.random() < this.chance * this.getStackCount()) {
if (target.status && Phaser.Math.RND.realInRange(0, 1) < (this.chance * this.getStackCount())) {
target.scene.queueMessage(getPokemonMessage(target, ` was cured of its\n${getStatusEffectDescriptor(target.status.effect)}!`));
target.resetStatus();
target.updateInfo();
@ -1991,7 +1991,7 @@ export class EnemyInstantReviveChanceModifier extends EnemyPersistentModifier {
}
apply(args: any[]): boolean {
if (Math.random() >= this.chance * this.getStackCount())
if (Phaser.Math.RND.realInRange(0, 1) >= (this.chance * this.getStackCount()))
return false;
const pokemon = args[0] as Pokemon;