@wayward/types 2.15.4-beta.dev.20260411.1 → 2.15.5-beta.dev.20260413.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -93,6 +93,7 @@ export interface IUsableActionPossibleUsing {
93
93
  targetTile?: Tile;
94
94
  fromTile?: Tile;
95
95
  item?: Item;
96
+ stackItems?: readonly Item[];
96
97
  itemType?: ItemType;
97
98
  itemQuality?: ArrayOr<Quality>;
98
99
  container?: IContainer;
@@ -33,6 +33,8 @@ export interface IUsableActionResolveUsingOptions {
33
33
  skipTiles?: boolean;
34
34
  /** Whether to skip filling in the `item`. Defaults to `false` */
35
35
  skipItem?: boolean;
36
+ /** Whether to keep the already-provided `item` instead of resolving it again. */
37
+ useProvidedItem?: boolean;
36
38
  }
37
39
  export interface IUsableActionEvents {
38
40
  preExecute(player: Player, using: IUsableActionPossibleUsing, context: IUsableActionExecutionContext): any;
@@ -81,6 +83,7 @@ declare class UsableAction<REQUIREMENTS extends IUsableActionRequirements = IUsa
81
83
  resolveUsing(player: Player, using: IUsableActionUsing<REQUIREMENTS>, options?: IUsableActionResolveUsingOptions): Message | IUsableActionUsing<REQUIREMENTS>;
82
84
  resolveUsingOrUndefined(player: Player, using: IUsableActionUsing<REQUIREMENTS>, options?: IUsableActionResolveUsingOptions): IUsableActionUsing<REQUIREMENTS> | undefined;
83
85
  isUsable(player: Player, provided: IUsableActionUsing<REQUIREMENTS>, context: UsableActionExecutionContext | IUsableActionExecutionContext): UsableActionUsability<REQUIREMENTS>;
86
+ private getResolvedUsability;
84
87
  isApplicable(player: Player, provided?: IUsableActionPossibleUsing, fullUsabilityCheck?: boolean, requireItem?: boolean): provided is IUsableActionUsing<REQUIREMENTS>;
85
88
  private isItemApplicable;
86
89
  private isDoodadApplicable;
@@ -89,6 +92,9 @@ declare class UsableAction<REQUIREMENTS extends IUsableActionRequirements = IUsa
89
92
  private readonly findItemCannotUse;
90
93
  getFindItemCannotUse(): IUsableActionNotUsable[];
91
94
  getItem(player: Player, provided?: IUsableActionPossibleUsing, fullUsabilityCheck?: boolean): Item | false | undefined;
95
+ private getProvidedItems;
96
+ private isProvidedStackItem;
97
+ private getProvidedItem;
92
98
  private requirementsItemFinders?;
93
99
  private getItemFinder;
94
100
  createItemFinder(player: Player, options?: IItemFinderOptions, provided?: IUsableActionPossibleUsing): ItemFinder;
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * Copyright 2011-2025 Unlok
3
+ * https://www.unlok.ca
4
+ *
5
+ * Credits & Thanks:
6
+ * https://www.unlok.ca/credits-thanks/
7
+ *
8
+ * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
9
+ * https://github.com/WaywardGame/types/wiki
10
+ */
11
+ interface IChanceRandom {
12
+ chance(decimal: number): boolean;
13
+ }
14
+ /**
15
+ * Normalizes endurance durability-loss chances into the effective per-event proc chance.
16
+ * Cursed endurance uses the same magnitude as uncursed endurance, but applies an extra loss proc instead of preventing one.
17
+ */
18
+ export declare function getEffectiveDurabilityLossChance(durabilityLossChance?: number): number;
19
+ /**
20
+ * Returns the number of durability-loss procs for a single endurance check.
21
+ * Uncursed endurance can prevent the event entirely, while cursed endurance can add at most one extra proc.
22
+ */
23
+ export declare function getDurabilityLossProcCount(random: IChanceRandom, durabilityLossChance?: number): number;
24
+ export {};
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * Copyright 2011-2025 Unlok
3
+ * https://www.unlok.ca
4
+ *
5
+ * Credits & Thanks:
6
+ * https://www.unlok.ca/credits-thanks/
7
+ *
8
+ * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
9
+ * https://github.com/WaywardGame/types/wiki
10
+ */
11
+ import type { Random } from "@wayward/utilities/random/Random";
12
+ export declare function getEffectiveDecayLossChance(decayLossChance?: number): number;
13
+ export declare function adjustDecayLossByPerpetuity(random: Random, baseDecayLoss: number, decayLossChance?: number): number;
@@ -213,7 +213,10 @@ declare namespace Translation {
213
213
  private translateComponent;
214
214
  private translateComponentValue;
215
215
  private resolveComponentValue;
216
- private getHighestValueComponent;
216
+ private getHighestMagnitudeComponent;
217
+ private getCombinedColorCandidateComponents;
218
+ private getQualitySourceValue;
219
+ private getHighestPriorityColorComponent;
217
220
  private getCombinedComponent;
218
221
  combined(value?: FVal, reformatter?: SupplierOr<Translation | undefined>): this;
219
222
  base(value: FVal, reformatter?: SupplierOr<Translation | undefined>): this;
@@ -232,7 +235,7 @@ declare namespace Translation {
232
235
  private addComponent;
233
236
  }
234
237
  export type RefreshEvents = Map<GameEmitterOrBus, Map<string, Set<AnyFunction<boolean> | undefined>>>;
235
- export function getRefreshEvents(translation: Translation): Generator<RefreshEvents>;
238
+ export function getRefreshEvents(translation: Translation, visited?: WeakSet<object>): Generator<RefreshEvents>;
236
239
  export {};
237
240
  }
238
241
  export default Translation;