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 (newBattleType === BattleType.WILD && !this.gameMode.isWaveFinal(newWaveIndex)) {
// Check if Repel and prevent double battle
if (this.getModifiers(DoubleBattlePreventionModifierType, true).length > 0) {
newDouble = false;
} else {
const doubleChance = new Utils.IntegerHolder(newWaveIndex % 10 === 0 ? 32 : 8);
this.applyModifiers(DoubleBattleChanceBoosterModifier, true, doubleChance);
playerField.forEach(p => applyAbAttrs(DoubleBattleChanceAbAttr, p, null, doubleChance));
newDouble = !Utils.randSeedInt(doubleChance.value);
}
const doubleChance = new Utils.IntegerHolder(newWaveIndex % 10 === 0 ? 32 : 8);
this.applyModifiers(DoubleBattleChanceBoosterModifier, true, doubleChance);
playerField.forEach(p => applyAbAttrs(DoubleBattleChanceAbAttr, p, null, doubleChance));
newDouble = !Utils.randSeedInt(doubleChance.value);
this.applyModifiers(DoubleBattlePreventionModifierType, true, newDouble);
} else if (newBattleType === BattleType.TRAINER)
newDouble = newTrainer.variant === TrainerVariant.DOUBLE;
} 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",
},
"DoubleBattlePreventionModifierType": {
description: "Empêcher l'apparition de doubles batailles pour {{battleCount}} batailles",
description: "Empêche les combats doubles pendant {{battleCount}}",
},
"TempBattleStatBoosterModifierType": {
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 {
const doubleBattleChance = args[0] as Utils.NumberHolder;
doubleBattleChance.value = Math.ceil(doubleBattleChance.value / 2);
const newDouble = args[0] as Utils.BooleanHolder;
newDouble.value = false;
return true;
}