Skip to content

Commit

Permalink
Consolidate identical variables
Browse files Browse the repository at this point in the history
  • Loading branch information
DayKev committed Sep 19, 2024
1 parent c6a7ac2 commit f292087
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/data/challenge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -861,21 +861,19 @@ export class NoAutomaticHealChallenge extends Challenge {

/** Challenge that removes the ability to revive fallen pokemon */
export class HardcoreChallenge extends Challenge {
private itemBlackList = ["modifierType:ModifierType.REVIVE", "modifierType:ModifierType.MAX_REVIVE", "modifierType:ModifierType.SACRED_ASH", "modifierType:ModifierType.REVIVER_SEED"];

constructor() {
super(Challenges.HARDCORE, 1);
}

override applyRandomItemBlacklist(randomItem: ModifierTypeOption, isValid: BooleanHolder): boolean {
const randomItemBlackList = ["modifierType:ModifierType.REVIVE", "modifierType:ModifierType.MAX_REVIVE", "modifierType:ModifierType.SACRED_ASH", "modifierType:ModifierType.REVIVER_SEED"];

isValid.value = !randomItemBlackList.includes(randomItem.type.localeKey);
isValid.value = !this.itemBlackList.includes(randomItem.type.localeKey);
return true;
}

override applyShopItemBlacklist(shopItem: ModifierTypeOption, isValid: BooleanHolder): boolean {
const shopItemBlackList = ["modifierType:ModifierType.REVIVE", "modifierType:ModifierType.MAX_REVIVE", "modifierType:ModifierType.SACRED_ASH", "modifierType:ModifierType.REVIVER_SEED"];

isValid.value = !shopItemBlackList.includes(shopItem.type.localeKey);
isValid.value = !this.itemBlackList.includes(shopItem.type.localeKey);
return true;
}

Expand Down

0 comments on commit f292087

Please sign in to comment.