From 238ed3e23d1e0ca6ab08bd05ee603db891f04dae Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Mon, 4 Aug 2025 01:42:29 +0200 Subject: [PATCH] Removed WeightedReward --- src/items/reward-pool-utils.ts | 3 --- src/items/reward.ts | 18 ------------------ 2 files changed, 21 deletions(-) diff --git a/src/items/reward-pool-utils.ts b/src/items/reward-pool-utils.ts index 9b33a9bc14f..4ad5df55b9a 100644 --- a/src/items/reward-pool-utils.ts +++ b/src/items/reward-pool-utils.ts @@ -25,9 +25,6 @@ cases to assign modifiers. This usage is now deprecated, as we have separate poo However, `getNewRewardOption` is not called directly by `generatePlayerRewardOptions`. Instead, it is filtered by `getRewardOptionWithRetry`, which also checks existing rewards to minimize the chance of duplicates. -Note that the pool contains `WeightedReward` instances, which contain either a `Reward` or a `RewardGenerator`. -Once a pool entry is chosen, a specific `Reward` is generated accordingly and put in the returned `RewardOption`. - This will allow more customization in creating pools for challenges, MEs etc. */ diff --git a/src/items/reward.ts b/src/items/reward.ts index cd725667970..fd0afcf8820 100644 --- a/src/items/reward.ts +++ b/src/items/reward.ts @@ -36,7 +36,6 @@ import { SPECIES_STAT_BOOSTER_ITEMS, type SpeciesStatBoostHeldItem } from "#item import { TrainerItemEffect, tempStatToTrainerItem } from "#items/trainer-item"; import type { PokemonMove } from "#moves/pokemon-move"; import { getVoucherTypeIcon, getVoucherTypeName, type VoucherType } from "#system/voucher"; -import type { RewardFunc, WeightedRewardWeightFunc } from "#types/rewards"; import type { Exact } from "#types/type-helpers"; import type { PokemonMoveSelectFilter, PokemonSelectFilter } from "#ui/party-ui-handler"; import { PartyUiHandler } from "#ui/party-ui-handler"; @@ -86,7 +85,6 @@ for example. The entries of rewardInitObj are used in the RewardPool. There are some more derived classes, in particular: RewardGenerator, which creates Reward instances from a certain group (e.g. TMs, nature mints, or berries); -WeightedReward, which is a Reward with an attached weight or weight function to be used in pools; and RewardOption, which is displayed during the select reward phase at the end of each encounter. */ @@ -1508,22 +1506,6 @@ export class FormChangeItemRewardGenerator extends RewardGenerator { } } -export class WeightedReward { - public reward: Reward | RewardGenerator; - public weight: number | WeightedRewardWeightFunc; - public maxWeight: number | WeightedRewardWeightFunc; - - constructor( - rewardFunc: RewardFunc, - weight: number | WeightedRewardWeightFunc, - maxWeight?: number | WeightedRewardWeightFunc, - ) { - this.reward = rewardFunc(); - this.weight = weight; - this.maxWeight = maxWeight || (!(weight instanceof Function) ? weight : 0); - } -} - export class RewardOption { public type: Reward; public upgradeCount: number;