Removed debug code and reverted const -> let changes in battle-scene.ts

pull/544/head
Sophie Kujo 2024-05-06 14:41:42 -04:00
parent 29138ebef7
commit cc51ae411b
3 changed files with 9 additions and 8 deletions

View File

@ -821,11 +821,12 @@ export default class BattleScene extends SceneBase {
if (trainerConfigs[trainerType].doubleOnly)
doubleTrainer = true;
else if (trainerConfigs[trainerType].hasDouble) {
let doubleChance = new Utils.IntegerHolder(newWaveIndex % 10 === 0 ? 32 : 8);
const doubleChance = new Utils.IntegerHolder(newWaveIndex % 10 === 0 ? 32 : 8);
this.applyModifiers(DoubleBattleChanceBoosterModifier, true, doubleChance);
playerField.forEach(p => applyAbAttrs(DoubleBattleChanceAbAttr, p, null, doubleChance));
doubleTrainer = !Utils.randSeedInt(doubleChance.value);
if (this.getModifiers(DoubleBattleChancePreventerModifier).length != 0) doubleTrainer = false;
if (this.getModifiers(DoubleBattleChancePreventerModifier).length != 0)
doubleTrainer = false;
}
newTrainer = trainerData !== undefined ? trainerData.toTrainer(this) : new Trainer(this, trainerType, doubleTrainer ? TrainerVariant.DOUBLE : Utils.randSeedInt(2) ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT);
this.field.add(newTrainer);
@ -834,11 +835,12 @@ export default class BattleScene extends SceneBase {
if (double === undefined && newWaveIndex > 1) {
if (newBattleType === BattleType.WILD && !this.gameMode.isWaveFinal(newWaveIndex)) {
let doubleChance = new Utils.IntegerHolder(newWaveIndex % 10 === 0 ? 32 : 8);
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);
if (this.getModifiers(DoubleBattleChancePreventerModifier).length != 0) newDouble = false;
if (this.getModifiers(DoubleBattleChancePreventerModifier).length != 0)
newDouble = false;
} else if (newBattleType === BattleType.TRAINER)
newDouble = newTrainer.variant === TrainerVariant.DOUBLE;
} else if (!battleConfig)

View File

@ -336,7 +336,7 @@ export class DoubleBattleChancePreventerModifierType extends ModifierType {
public battleCount: integer;
constructor(name: string, battleCount: integer) {
super(name, `Prevents the chance of an encounter being a double battle for ${battleCount} battles`, (_type, _args) => new Modifiers.DoubleBattleChancePreventerModifier(this, this.battleCount),
super(name, `Prevents double battles for ${battleCount} battles`, (_type, _args) => new Modifiers.DoubleBattleChancePreventerModifier(this, this.battleCount),
null, 'repel');
this.battleCount = battleCount;
@ -996,8 +996,7 @@ const modifierPool: ModifierPool = {
}, 3),
new WeightedModifierType(modifierTypes.REPEL, (party: Pokemon[]) => {
const existingItem = party[0].scene.findModifier(m => m.type instanceof DoubleBattleChancePreventerModifierType || m.type instanceof DoubleBattleChanceBoosterModifierType);
//return existingItem ? 0 : 2;
return 10000
return existingItem ? 0 : 2;
}),
new WeightedModifierType(modifierTypes.LURE, (party: Pokemon[]) => {
const existingItem = party[0].scene.findModifier(m => m.type instanceof DoubleBattleChancePreventerModifierType || m.type instanceof DoubleBattleChanceBoosterModifierType);

View File

@ -4,7 +4,7 @@ import { Biome } from "./data/enums/biome";
import { Moves } from "./data/enums/moves";
import { WeatherType } from "./data/weather";
export const SEED_OVERRIDE = 'b3DoubDG5i4izShAO06Z2V2y';
export const SEED_OVERRIDE = '';
export const STARTER_SPECIES_OVERRIDE = 0;
export const STARTER_FORM_OVERRIDE = 0;
export const STARTING_LEVEL_OVERRIDE = 0;