Restricted party options for fainted mons in hardcore (#6336)

This commit is contained in:
Wlowscha 2025-08-22 16:00:13 +02:00 committed by GitHub
parent 978f06427c
commit b9a46a6a26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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