mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 15:03:24 +02:00
Restricted party options for fainted mons in hardcore (#6336)
This commit is contained in:
parent
978f06427c
commit
b9a46a6a26
@ -6,6 +6,7 @@ import { SpeciesFormChangeItemTrigger } from "#data/form-change-triggers";
|
||||
import { Gender, getGenderColor, getGenderSymbol } from "#data/gender";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { ChallengeType } from "#enums/challenge-type";
|
||||
import { Challenges } from "#enums/challenges";
|
||||
import { Command } from "#enums/command";
|
||||
import { FormChangeItem } from "#enums/form-change-item";
|
||||
import { MoveId } from "#enums/move-id";
|
||||
@ -1427,6 +1428,11 @@ export class PartyUiHandler extends MessageUiHandler {
|
||||
this.eraseOptionsCursor();
|
||||
}
|
||||
|
||||
if (pokemon.isFainted() && globalScene.gameMode.hasChallenge(Challenges.HARDCORE)) {
|
||||
this.updateOptionsHardcore();
|
||||
return;
|
||||
}
|
||||
|
||||
switch (this.partyUiMode) {
|
||||
case PartyUiMode.MOVE_MODIFIER:
|
||||
this.updateOptionsWithMoveModifierMode(pokemon);
|
||||
@ -1526,6 +1532,34 @@ export class PartyUiHandler extends MessageUiHandler {
|
||||
this.updateOptionsWindow();
|
||||
}
|
||||
|
||||
updateOptionsHardcore(): void {
|
||||
const pokemon = globalScene.getPlayerParty()[this.cursor];
|
||||
|
||||
switch (this.partyUiMode) {
|
||||
case PartyUiMode.MODIFIER_TRANSFER:
|
||||
if (!this.transferMode) {
|
||||
this.updateOptionsWithModifierTransferMode(pokemon);
|
||||
} else {
|
||||
this.options.push(PartyOption.TRANSFER);
|
||||
this.addCommonOptions(pokemon);
|
||||
}
|
||||
break;
|
||||
case PartyUiMode.DISCARD:
|
||||
this.updateOptionsWithModifierTransferMode(pokemon);
|
||||
break;
|
||||
case PartyUiMode.SWITCH:
|
||||
this.options.push(PartyOption.RELEASE);
|
||||
break;
|
||||
case PartyUiMode.RELEASE:
|
||||
this.options.push(PartyOption.RELEASE);
|
||||
break;
|
||||
}
|
||||
|
||||
// Generic, these are applied to all Modes
|
||||
this.addCancelAndScrollOptions();
|
||||
this.updateOptionsWindow();
|
||||
}
|
||||
|
||||
private updateOptionsWindow(): void {
|
||||
const pokemon = globalScene.getPlayerParty()[this.cursor];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user