Merge remote-tracking branch 'upstream/beta' into modifier-rework

This commit is contained in:
Bertie690 2025-08-03 19:01:10 -04:00
commit 5e7a5a7a94
2 changed files with 21 additions and 0 deletions

View File

@ -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;

View File

@ -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);