Fixed apply method and French local for DoubleBattlePreventionModifierType

This commit is contained in:
Federico Rossi 2024-05-18 20:08:06 +02:00
parent e5f05f5b96
commit 9e81fea365
3 changed files with 8 additions and 12 deletions

View File

@ -869,15 +869,11 @@ export default class BattleScene extends SceneBase {
if (double === undefined && newWaveIndex > 1) { if (double === undefined && newWaveIndex > 1) {
if (newBattleType === BattleType.WILD && !this.gameMode.isWaveFinal(newWaveIndex)) { if (newBattleType === BattleType.WILD && !this.gameMode.isWaveFinal(newWaveIndex)) {
// Check if Repel and prevent double battle const doubleChance = new Utils.IntegerHolder(newWaveIndex % 10 === 0 ? 32 : 8);
if (this.getModifiers(DoubleBattlePreventionModifierType, true).length > 0) { this.applyModifiers(DoubleBattleChanceBoosterModifier, true, doubleChance);
newDouble = false; playerField.forEach(p => applyAbAttrs(DoubleBattleChanceAbAttr, p, null, doubleChance));
} else { newDouble = !Utils.randSeedInt(doubleChance.value);
const doubleChance = new Utils.IntegerHolder(newWaveIndex % 10 === 0 ? 32 : 8); this.applyModifiers(DoubleBattlePreventionModifierType, true, newDouble);
this.applyModifiers(DoubleBattleChanceBoosterModifier, true, doubleChance);
playerField.forEach(p => applyAbAttrs(DoubleBattleChanceAbAttr, p, null, doubleChance));
newDouble = !Utils.randSeedInt(doubleChance.value);
}
} else if (newBattleType === BattleType.TRAINER) } else if (newBattleType === BattleType.TRAINER)
newDouble = newTrainer.variant === TrainerVariant.DOUBLE; newDouble = newTrainer.variant === TrainerVariant.DOUBLE;
} else if (!battleConfig) } else if (!battleConfig)

View File

@ -52,7 +52,7 @@ export const modifierType: ModifierTypeTranslationEntries = {
description: "Double les chances de tomber sur un combat double pendant {{battleCount}} combats", description: "Double les chances de tomber sur un combat double pendant {{battleCount}} combats",
}, },
"DoubleBattlePreventionModifierType": { "DoubleBattlePreventionModifierType": {
description: "Empêcher l'apparition de doubles batailles pour {{battleCount}} batailles", description: "Empêche les combats doubles pendant {{battleCount}}",
}, },
"TempBattleStatBoosterModifierType": { "TempBattleStatBoosterModifierType": {
description: "Augmente d1 cran {{tempBattleStatName}} pour toute léquipe pendant 5 combats", description: "Augmente d1 cran {{tempBattleStatName}} pour toute léquipe pendant 5 combats",

View File

@ -330,8 +330,8 @@ export class DoubleBattlePreventionModifierType extends LapsingPersistentModifie
} }
apply(args: any[]): boolean { apply(args: any[]): boolean {
const doubleBattleChance = args[0] as Utils.NumberHolder; const newDouble = args[0] as Utils.BooleanHolder;
doubleBattleChance.value = Math.ceil(doubleBattleChance.value / 2); newDouble.value = false;
return true; return true;
} }