mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-07 07:59:26 +02:00
Merge remote-tracking branch 'upstream/beta' into modifier-rework
This commit is contained in:
commit
5e7a5a7a94
@ -2799,6 +2799,23 @@ export class BattleScene extends SceneBase {
|
||||
|
||||
return this.removeModifier(itemModifier);
|
||||
}
|
||||
/**
|
||||
* Attempt to discard one or more copies of a held item.
|
||||
* @param itemModifier - The {@linkcode PokemonHeldItemModifier} being discarded
|
||||
* @param discardQuantity - The number of copies to remove (up to the amount currently held); default `1`
|
||||
* @returns Whether the item was successfully discarded.
|
||||
* Removing fewer items than requested is still considered a success.
|
||||
*/
|
||||
tryDiscardHeldItemModifier(itemModifier: PokemonHeldItemModifier, discardQuantity = 1): boolean {
|
||||
const countTaken = Math.min(discardQuantity, itemModifier.stackCount);
|
||||
itemModifier.stackCount -= countTaken;
|
||||
|
||||
if (itemModifier.stackCount > 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return this.removeModifier(itemModifier);
|
||||
}
|
||||
|
||||
canTransferHeldItemModifier(itemModifier: PokemonHeldItemModifier, target: Pokemon, transferQuantity = 1): boolean {
|
||||
const mod = itemModifier.clone() as PokemonHeldItemModifier;
|
||||
|
@ -780,6 +780,10 @@ export class PartyUiHandler extends MessageUiHandler {
|
||||
return this.processDiscardMenuInput(pokemon);
|
||||
}
|
||||
|
||||
if (this.partyUiMode === PartyUiMode.DISCARD) {
|
||||
return this.processDiscardMenuInput(pokemon);
|
||||
}
|
||||
|
||||
// options specific to the mode (moves)
|
||||
if (this.partyUiMode === PartyUiMode.REMEMBER_MOVE_REWARD) {
|
||||
return this.processRememberMoveModeInput(pokemon);
|
||||
|
Loading…
Reference in New Issue
Block a user