mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 09:02:47 +02:00
Fixed select-modifier-phase
This commit is contained in:
parent
847b938480
commit
a15920a605
@ -229,7 +229,7 @@ export class SelectModifierPhase extends BattlePhase {
|
|||||||
party[toSlotIndex],
|
party[toSlotIndex],
|
||||||
true,
|
true,
|
||||||
itemQuantity,
|
itemQuantity,
|
||||||
true,
|
undefined,
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@ -287,7 +287,11 @@ export class SelectModifierPhase extends BattlePhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Opens the party menu specifically for fusions
|
// Opens the party menu specifically for fusions
|
||||||
private openFusionMenu(modifierType, cost, modifierSelectCallback) {
|
private openFusionMenu(
|
||||||
|
modifierType: PokemonModifierType,
|
||||||
|
cost: number,
|
||||||
|
modifierSelectCallback: ModifierSelectCallback,
|
||||||
|
): void {
|
||||||
const party = globalScene.getPlayerParty();
|
const party = globalScene.getPlayerParty();
|
||||||
globalScene.ui.setModeWithoutClear(
|
globalScene.ui.setModeWithoutClear(
|
||||||
UiMode.PARTY,
|
UiMode.PARTY,
|
||||||
@ -313,7 +317,11 @@ export class SelectModifierPhase extends BattlePhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Opens the party menu to apply one of various modifiers
|
// Opens the party menu to apply one of various modifiers
|
||||||
private openModifierMenu(modifierType, cost, modifierSelectCallback) {
|
private openModifierMenu(
|
||||||
|
modifierType: PokemonModifierType,
|
||||||
|
cost: number,
|
||||||
|
modifierSelectCallback: ModifierSelectCallback,
|
||||||
|
): void {
|
||||||
const party = globalScene.getPlayerParty();
|
const party = globalScene.getPlayerParty();
|
||||||
const pokemonModifierType = modifierType as PokemonModifierType;
|
const pokemonModifierType = modifierType as PokemonModifierType;
|
||||||
const isMoveModifier = modifierType instanceof PokemonMoveModifierType;
|
const isMoveModifier = modifierType instanceof PokemonMoveModifierType;
|
||||||
@ -382,17 +390,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;
|
||||||
@ -465,6 +471,7 @@ export class SelectModifierPhase extends BattlePhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getModifierTypeOptions(modifierCount: number): ModifierTypeOption[] {
|
getModifierTypeOptions(modifierCount: number): ModifierTypeOption[] {
|
||||||
|
console.log("HERE WE ARE", modifierCount, this.customModifierSettings);
|
||||||
return getPlayerModifierTypeOptions(
|
return getPlayerModifierTypeOptions(
|
||||||
modifierCount,
|
modifierCount,
|
||||||
globalScene.getPlayerParty(),
|
globalScene.getPlayerParty(),
|
||||||
|
Loading…
Reference in New Issue
Block a user