Removed WeightedReward

This commit is contained in:
Wlowscha 2025-08-04 01:42:29 +02:00
parent be017438ff
commit 238ed3e23d
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
2 changed files with 0 additions and 21 deletions

View File

@ -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 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. 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. This will allow more customization in creating pools for challenges, MEs etc.
*/ */

View File

@ -36,7 +36,6 @@ import { SPECIES_STAT_BOOSTER_ITEMS, type SpeciesStatBoostHeldItem } from "#item
import { TrainerItemEffect, tempStatToTrainerItem } from "#items/trainer-item"; import { TrainerItemEffect, tempStatToTrainerItem } from "#items/trainer-item";
import type { PokemonMove } from "#moves/pokemon-move"; import type { PokemonMove } from "#moves/pokemon-move";
import { getVoucherTypeIcon, getVoucherTypeName, type VoucherType } from "#system/voucher"; import { getVoucherTypeIcon, getVoucherTypeName, type VoucherType } from "#system/voucher";
import type { RewardFunc, WeightedRewardWeightFunc } from "#types/rewards";
import type { Exact } from "#types/type-helpers"; import type { Exact } from "#types/type-helpers";
import type { PokemonMoveSelectFilter, PokemonSelectFilter } from "#ui/party-ui-handler"; import type { PokemonMoveSelectFilter, PokemonSelectFilter } from "#ui/party-ui-handler";
import { PartyUiHandler } 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: There are some more derived classes, in particular:
RewardGenerator, which creates Reward instances from a certain group (e.g. TMs, nature mints, or berries); 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. 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 { export class RewardOption {
public type: Reward; public type: Reward;
public upgradeCount: number; public upgradeCount: number;