mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-24 15:33:29 +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 { Gender, getGenderColor, getGenderSymbol } from "#data/gender";
|
||||||
import { Button } from "#enums/buttons";
|
import { Button } from "#enums/buttons";
|
||||||
import { ChallengeType } from "#enums/challenge-type";
|
import { ChallengeType } from "#enums/challenge-type";
|
||||||
|
import { Challenges } from "#enums/challenges";
|
||||||
import { Command } from "#enums/command";
|
import { Command } from "#enums/command";
|
||||||
import { FormChangeItem } from "#enums/form-change-item";
|
import { FormChangeItem } from "#enums/form-change-item";
|
||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
@ -1427,6 +1428,11 @@ export class PartyUiHandler extends MessageUiHandler {
|
|||||||
this.eraseOptionsCursor();
|
this.eraseOptionsCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pokemon.isFainted() && globalScene.gameMode.hasChallenge(Challenges.HARDCORE)) {
|
||||||
|
this.updateOptionsHardcore();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (this.partyUiMode) {
|
switch (this.partyUiMode) {
|
||||||
case PartyUiMode.MOVE_MODIFIER:
|
case PartyUiMode.MOVE_MODIFIER:
|
||||||
this.updateOptionsWithMoveModifierMode(pokemon);
|
this.updateOptionsWithMoveModifierMode(pokemon);
|
||||||
@ -1526,6 +1532,34 @@ export class PartyUiHandler extends MessageUiHandler {
|
|||||||
this.updateOptionsWindow();
|
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 {
|
private updateOptionsWindow(): void {
|
||||||
const pokemon = globalScene.getPlayerParty()[this.cursor];
|
const pokemon = globalScene.getPlayerParty()[this.cursor];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user