mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-01 14:02:18 +02:00
Select modifier phase tentatively working with new held items
This commit is contained in:
parent
b32400e81a
commit
77f8cd9643
@ -13,6 +13,7 @@ import {
|
|||||||
PokemonPpUpModifierType,
|
PokemonPpUpModifierType,
|
||||||
ModifierPoolType,
|
ModifierPoolType,
|
||||||
getPlayerModifierTypeOptions,
|
getPlayerModifierTypeOptions,
|
||||||
|
PokemonHeldItemReward,
|
||||||
} from "#app/modifier/modifier-type";
|
} from "#app/modifier/modifier-type";
|
||||||
import type { Modifier } from "#app/modifier/modifier";
|
import type { Modifier } from "#app/modifier/modifier";
|
||||||
import {
|
import {
|
||||||
@ -158,6 +159,9 @@ export class SelectModifierPhase extends BattlePhase {
|
|||||||
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?
|
//TODO: is the bang correct?
|
||||||
|
if (modifierType instanceof PokemonHeldItemReward) {
|
||||||
|
this.openGiveHeldItemMenu(modifierType, modifierSelectCallback);
|
||||||
|
}
|
||||||
if (modifierType instanceof FusePokemonModifierType) {
|
if (modifierType instanceof FusePokemonModifierType) {
|
||||||
this.openFusionMenu(modifierType, cost, modifierSelectCallback);
|
this.openFusionMenu(modifierType, cost, modifierSelectCallback);
|
||||||
} else {
|
} else {
|
||||||
@ -231,6 +235,26 @@ export class SelectModifierPhase extends BattlePhase {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private openGiveHeldItemMenu(reward, modifierSelectCallback) {
|
||||||
|
const party = globalScene.getPlayerParty();
|
||||||
|
const partyUiMode = PartyUiMode.MODIFIER;
|
||||||
|
globalScene.ui.setModeWithoutClear(
|
||||||
|
UiMode.PARTY,
|
||||||
|
partyUiMode,
|
||||||
|
-1,
|
||||||
|
(slotIndex: number, _option: PartyOption) => {
|
||||||
|
if (slotIndex < 6) {
|
||||||
|
globalScene.ui.setMode(UiMode.MODIFIER_SELECT, this.isPlayer()).then(() => {
|
||||||
|
party[slotIndex].heldItemManager.addHeldItem(reward.itemId);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.resetModifierSelect(modifierSelectCallback);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
reward.selectFilter,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Toggle reroll lock
|
// Toggle reroll lock
|
||||||
private toggleRerollLock() {
|
private toggleRerollLock() {
|
||||||
const rerollCost = this.getRerollCost(globalScene.lockModifierTiers);
|
const rerollCost = this.getRerollCost(globalScene.lockModifierTiers);
|
||||||
|
Loading…
Reference in New Issue
Block a user