Changes from suggestions

This commit is contained in:
Wlowscha 2025-06-07 10:33:43 +02:00
parent 74ef0078cb
commit 4e8abfcab2
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04

View File

@ -56,6 +56,10 @@ export class SelectModifierPhase extends BattlePhase {
start() { start() {
super.start(); super.start();
if (!this.isPlayer()) {
return false;
}
if (!this.rerollCount && !this.isCopy) { if (!this.rerollCount && !this.isCopy) {
this.updateSeed(); this.updateSeed();
} else if (this.rerollCount) { } else if (this.rerollCount) {
@ -156,15 +160,14 @@ export class SelectModifierPhase extends BattlePhase {
// Apply a chosen modifier: do an effect or open the party menu // Apply a chosen modifier: do an effect or open the party menu
private applyChosenModifier(modifierType: ModifierType, cost: number, modifierSelectCallback): boolean { private applyChosenModifier(modifierType: ModifierType, cost: number, modifierSelectCallback): boolean {
if (modifierType! instanceof PokemonModifierType) { if (modifierType instanceof PokemonModifierType) {
//TODO: is the bang correct?
if (modifierType instanceof FusePokemonModifierType) { if (modifierType instanceof FusePokemonModifierType) {
this.openFusionMenu(modifierType, cost, modifierSelectCallback); this.openFusionMenu(modifierType, cost, modifierSelectCallback);
} else { } else {
this.openModifierMenu(modifierType, cost, modifierSelectCallback); this.openModifierMenu(modifierType, cost, modifierSelectCallback);
} }
} else { } else {
this.applyModifier(modifierType!.newModifier()!); // TODO: is the bang correct? this.applyModifier(modifierType.newModifier()!);
} }
return !cost; return !cost;
} }
@ -349,17 +352,15 @@ export class SelectModifierPhase extends BattlePhase {
// Function that determines how many reward slots are available // Function that determines how many reward slots are available
private getModifierCount(): number { private getModifierCount(): number {
const modifierCountHolder = new NumberHolder(3); const modifierCountHolder = new NumberHolder(3);
if (this.isPlayer()) { globalScene.applyModifiers(ExtraModifierModifier, true, modifierCountHolder);
globalScene.applyModifiers(ExtraModifierModifier, true, modifierCountHolder); globalScene.applyModifiers(TempExtraModifierModifier, true, modifierCountHolder);
globalScene.applyModifiers(TempExtraModifierModifier, true, modifierCountHolder);
}
// If custom modifiers are specified, overrides default item count // If custom modifiers are specified, overrides default item count
if (this.customModifierSettings) { if (this.customModifierSettings) {
const newItemCount = const newItemCount =
(this.customModifierSettings.guaranteedModifierTiers?.length || 0) + (this.customModifierSettings.guaranteedModifierTiers?.length ?? 0) +
(this.customModifierSettings.guaranteedModifierTypeOptions?.length || 0) + (this.customModifierSettings.guaranteedModifierTypeOptions?.length ?? 0) +
(this.customModifierSettings.guaranteedModifierTypeFuncs?.length || 0); (this.customModifierSettings.guaranteedModifierTypeFuncs?.length ?? 0);
if (this.customModifierSettings.fillRemaining) { if (this.customModifierSettings.fillRemaining) {
const originalCount = modifierCountHolder.value; const originalCount = modifierCountHolder.value;
modifierCountHolder.value = originalCount > newItemCount ? originalCount : newItemCount; modifierCountHolder.value = originalCount > newItemCount ? originalCount : newItemCount;