@wayward/types 2.15.0-beta.dev.20251002.1 → 2.15.0-beta.dev.20251004.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.
Files changed (45) hide show
  1. package/definitions/game/game/Game.d.ts +3 -1
  2. package/definitions/game/game/IGame.d.ts +2 -7
  3. package/definitions/game/game/curse/Curse.d.ts +107 -0
  4. package/definitions/game/game/curse/CurseEvent.d.ts +115 -0
  5. package/definitions/game/game/curse/CurseEventDefinitions.d.ts +14 -0
  6. package/definitions/game/game/curse/ICurse.d.ts +72 -0
  7. package/definitions/game/game/curse/event/CurseEventFrigidNight.d.ts +13 -0
  8. package/definitions/game/game/curse/event/CurseEventHeatWave.d.ts +13 -0
  9. package/definitions/game/game/deity/Deity.d.ts +0 -2
  10. package/definitions/game/game/entity/Human.d.ts +4 -1
  11. package/definitions/game/game/entity/IHuman.d.ts +5 -1
  12. package/definitions/game/game/entity/action/actions/SetTitle.d.ts +1 -1
  13. package/definitions/game/game/entity/player/MessageManager.d.ts +1 -1
  14. package/definitions/game/game/entity/status/IStatus.d.ts +30 -7
  15. package/definitions/game/game/entity/status/IStatusContext.d.ts +2 -1
  16. package/definitions/game/game/entity/status/Status.d.ts +2 -2
  17. package/definitions/game/game/entity/status/handler/BadTemperatureEffect.d.ts +3 -0
  18. package/definitions/game/game/entity/status/statuses/Cursed.d.ts +13 -0
  19. package/definitions/game/game/inspection/infoProviders/doodad/StillWater.d.ts +1 -0
  20. package/definitions/game/game/inspection/inspections/StatusInspection.d.ts +5 -2
  21. package/definitions/game/game/island/Island.d.ts +5 -1
  22. package/definitions/game/game/milestones/IMilestone.d.ts +1 -1
  23. package/definitions/game/game/options/modifiers/milestone/modifiers/Exsanguinated.d.ts +1 -1
  24. package/definitions/game/game/temperature/TemperatureManager.d.ts +3 -0
  25. package/definitions/game/game/time/ITimeManager.d.ts +1 -0
  26. package/definitions/game/game/time/TimeManager.d.ts +4 -4
  27. package/definitions/game/language/Dictionary.d.ts +110 -108
  28. package/definitions/game/language/DictionaryMap.d.ts +221 -217
  29. package/definitions/game/language/dictionary/Message.d.ts +563 -555
  30. package/definitions/game/language/dictionary/Misc.d.ts +4 -0
  31. package/definitions/game/language/dictionary/UiTranslation.d.ts +665 -664
  32. package/definitions/game/language/english/game/CurseEventGroups.d.ts +13 -0
  33. package/definitions/game/language/english/game/CurseEvents.d.ts +13 -0
  34. package/definitions/game/language/english/ui/CurseComponents.d.ts +1 -1
  35. package/definitions/game/resource/IResourceLoader.d.ts +44 -42
  36. package/definitions/game/ui/screen/screens/game/static/stats/component/StatusContext.d.ts +2 -1
  37. package/definitions/game/ui/screen/screens/game/static/stats/component/StatusIcon.d.ts +2 -1
  38. package/definitions/game/ui/screen/screens/game/static/stats/component/Statuses.d.ts +2 -1
  39. package/definitions/{utilities/class → game/utilities}/Inject.d.ts +3 -2
  40. package/definitions/utilities/event/EventBusManager.d.ts +4 -3
  41. package/definitions/utilities/math/Math2.d.ts +1 -0
  42. package/definitions/utilities/object/Objects.d.ts +1 -0
  43. package/definitions/utilities/random/Random.d.ts +6 -0
  44. package/package.json +1 -1
  45. package/definitions/game/game/deity/Curse.d.ts +0 -40
@@ -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 { CurseGroup } from "@wayward/game/game/curse/ICurse";
12
+ declare const curseEventGroups: Record<CurseGroup, string>;
13
+ export default curseEventGroups;
@@ -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 { CurseEventType } from "@wayward/game/game/curse/ICurse";
12
+ declare const curseEvents: Record<CurseEventType, [string, string]>;
13
+ export default curseEvents;
@@ -8,6 +8,6 @@
8
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
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
- import { CurseComponent } from "@wayward/game/game/deity/Curse";
11
+ import { CurseComponent } from "@wayward/game/game/curse/ICurse";
12
12
  declare const curseComponents: Descriptions<CurseComponent, string>;
13
13
  export default curseComponents;
@@ -19,46 +19,48 @@ export declare enum PathType {
19
19
  ContainerTabAction = 7,
20
20
  Corpse = 8,
21
21
  Creature = 9,
22
- Damage = 10,
23
- Deity = 11,
24
- Doodad = 12,
25
- Equip = 13,
26
- EquipSlot = 14,
27
- GameOptionsIcon = 15,
28
- Hairstyle = 16,
29
- HelpArticleIcon = 17,
30
- InfoIcon = 18,
31
- InputIcon = 19,
32
- Island = 20,
33
- IslandModifier = 21,
34
- Item = 22,
35
- Map = 23,
36
- MapTile = 24,
37
- MarkerIcon = 25,
38
- MenuBarButtonIcon = 26,
39
- MilestoneIcon = 27,
40
- Music = 28,
41
- Notifier = 29,
42
- Overlay = 30,
43
- Pin = 31,
44
- Quality = 32,
45
- RecipeLevel = 33,
46
- SkillIcon = 34,
47
- Sleep = 35,
48
- SoundEffect = 36,
49
- StatIcon = 37,
50
- StatusEffectGroup = 38,
51
- StatusIcon = 39,
52
- StatusIconFrame = 40,
53
- StatusIconNotifier = 41,
54
- StatusOverlay = 42,
55
- StatusThreatLevel = 43,
56
- Terrain = 44,
57
- TerrainDecoration = 45,
58
- TerrainDug = 46,
59
- TerrainMound = 47,
60
- TerrainTilled = 48,
61
- TileEvent = 49,
62
- Vehicle = 50,
63
- Website = 51
22
+ CurseCategory = 10,
23
+ CurseIcon = 11,
24
+ Damage = 12,
25
+ Deity = 13,
26
+ Doodad = 14,
27
+ Equip = 15,
28
+ EquipSlot = 16,
29
+ GameOptionsIcon = 17,
30
+ Hairstyle = 18,
31
+ HelpArticleIcon = 19,
32
+ InfoIcon = 20,
33
+ InputIcon = 21,
34
+ Island = 22,
35
+ IslandModifier = 23,
36
+ Item = 24,
37
+ Map = 25,
38
+ MapTile = 26,
39
+ MarkerIcon = 27,
40
+ MenuBarButtonIcon = 28,
41
+ MilestoneIcon = 29,
42
+ Music = 30,
43
+ Notifier = 31,
44
+ Overlay = 32,
45
+ Pin = 33,
46
+ Quality = 34,
47
+ RecipeLevel = 35,
48
+ SkillIcon = 36,
49
+ Sleep = 37,
50
+ SoundEffect = 38,
51
+ StatIcon = 39,
52
+ StatusEffectGroup = 40,
53
+ StatusIcon = 41,
54
+ StatusIconFrame = 42,
55
+ StatusIconNotifier = 43,
56
+ StatusOverlay = 44,
57
+ StatusThreatLevel = 45,
58
+ Terrain = 46,
59
+ TerrainDecoration = 47,
60
+ TerrainDug = 48,
61
+ TerrainMound = 49,
62
+ TerrainTilled = 50,
63
+ TileEvent = 51,
64
+ Vehicle = 52,
65
+ Website = 53
64
66
  }
@@ -13,7 +13,8 @@ import { InfoProviderContext } from "@wayward/game/game/inspection/InfoProviderC
13
13
  export default class StatusContext extends InfoProviderContext {
14
14
  private readonly statusRef?;
15
15
  get status(): Status | undefined;
16
- constructor(status: Status);
16
+ get display(): number | undefined;
17
+ constructor(status: Status, display?: number);
17
18
  }
18
19
  declare module "@wayward/game/game/inspection/InfoProviderContext" {
19
20
  interface InfoProviderContextRegistration {
@@ -14,6 +14,7 @@ import Component from "@wayward/game/ui/component/Component";
14
14
  import type { IRefreshable } from "@wayward/game/ui/component/Refreshable";
15
15
  export default class StatusIcon extends Component implements IRefreshable {
16
16
  readonly status: Status;
17
+ readonly display?: number | undefined;
17
18
  background: Component<HTMLElement>;
18
19
  effect: Component<HTMLElement>;
19
20
  foreground: Component<HTMLElement>;
@@ -22,7 +23,7 @@ export default class StatusIcon extends Component implements IRefreshable {
22
23
  private readonly pathFrameForeground;
23
24
  private readonly entityRef;
24
25
  get entity(): EntityWithStats | undefined;
25
- constructor(entity: EntityWithStats, status: Status);
26
+ constructor(entity: EntityWithStats, status: Status, display?: number | undefined);
26
27
  setTitleMode(): this;
27
28
  updateIcon(): void;
28
29
  refresh(): this;
@@ -28,7 +28,8 @@ export default class Statuses extends Component {
28
28
  /**
29
29
  * Event handler for the status effects of this entity changing
30
30
  */
31
- onStatusChange(_: any, status: StatusType, level: number): void;
31
+ onStatusChange(_: any, type: StatusType, level: number): void;
32
+ private removeStatusIcons;
32
33
  protected updateStatusScale(): void;
33
34
  private initializeTooltipLocation;
34
35
  }
@@ -8,7 +8,7 @@
8
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
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
- import "@wayward/goodstream/apply";
11
+ import { EventBus, type EventBuses } from "@wayward/game/event/EventBuses";
12
12
  export interface IInjectionApi<T, K extends keyof T> {
13
13
  /**
14
14
  * The instance that the injected method was called on.
@@ -44,6 +44,7 @@ export declare enum InjectionPosition {
44
44
  }
45
45
  export declare function InjectObject<T, K extends keyof T>(injectInto: T, property: K, position: InjectionPosition, priority?: number): T extends Partial<Record<K, AnyFunction>> ? (host: any, property2: string | number | symbol, descriptor: TypedPropertyDescriptor<InjectionMethod<T, K>>) => any : never;
46
46
  export declare function Inject<T extends Record<K, AnyFunction>, K extends keyof T>(injectInto: AnyClass<T>, property: K, position: InjectionPosition, priority?: number): (host: any, property2: string | number | symbol, descriptor: TypedPropertyDescriptor<InjectionMethod<T, K>>) => any;
47
+ export declare function Inject<E extends EventBus, I extends ReturnType<EventBuses[E]>, K extends keyof I>(injectInto: E, property: K, position: InjectionPosition, priority?: number): (host: any, property2: string | number | symbol, descriptor: TypedPropertyDescriptor<InjectionMethod<I, K>>) => any;
47
48
  export declare namespace Inject {
48
49
  function makeInjectableClass<T extends AbstractNullaryClass<any>, O>(cls: T): Class<Merge<InstanceOf<T>, O>>;
49
50
  }
@@ -76,6 +77,6 @@ export declare namespace Injector {
76
77
  *
77
78
  * Note: Due to the implementation, this operation is negligible, so don't worry about performance impacts of calling it.
78
79
  */
79
- function deregister<T>(injectorClass: Class<T>, instance: T): boolean;
80
+ function deregister<T>(injectorClass?: Class<T>, instance?: T): boolean;
80
81
  }
81
82
  export {};
@@ -8,17 +8,18 @@
8
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
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
- export interface IEventBusRegistration {
11
+ export interface IEventBusRegistrationHandler {
12
12
  subscribe: NullaryFunction;
13
13
  unsubscribe: NullaryFunction;
14
14
  }
15
15
  export declare class EventBusManager<EventBus extends number, EventBuses extends Record<EventBus, any>> {
16
16
  readonly eventBuses: EventBuses;
17
- eventBusRegistrationHandlers: Map<EventBus, IEventBusRegistration[]>;
17
+ eventBusRegistrationHandlers: Map<EventBus, IEventBusRegistrationHandler[]>;
18
18
  constructor(eventBuses: EventBuses);
19
+ getClass<CLASS>(eventBus: EventBus): CLASS | undefined;
19
20
  register<E extends EventBus>(eventBus: E, classOrHost: ReturnType<EventBuses[E]>): void;
20
21
  register(eventBus: EventBus): (constructor: AbstractNullaryClass<any>) => any;
21
22
  unregister(eventBus: EventBus): boolean;
22
23
  private handleEventBusRegistration;
23
- onEventBusRegistration(eventBus: EventBus, registration: IEventBusRegistration): void;
24
+ onEventBusRegistration(eventBus: EventBus, registration: IEventBusRegistrationHandler): () => void;
24
25
  }
@@ -46,6 +46,7 @@ declare namespace Math2 {
46
46
  * Example: `roundNumberToMultiple(97, 10): 100`
47
47
  */
48
48
  function roundNumberToMultiple(num: number, multiple: number): number;
49
+ function listLerp(t: number, ...values: number[]): number;
49
50
  /**
50
51
  * Return a number between `from` and `to`, using the decimal `t`
51
52
  *
@@ -17,6 +17,7 @@ export type UnWeakRefified<ARGS extends any[]> = {
17
17
  [INDEX in keyof ARGS]: ARGS[INDEX] | (ARGS[INDEX] extends WeakKey ? undefined : never);
18
18
  };
19
19
  declare namespace Objects {
20
+ function as<T>(value: T): T;
20
21
  function mapOrRecordKeys<RK extends PropertyKey, MK>(o: Partial<Record<RK, any>> | Map<MK, any>): Array<RK | MK>;
21
22
  function mapOrRecordValues<V>(o: Partial<Record<PropertyKey, V>> | Map<any, V>): V[];
22
23
  function mapOrRecordEntries<RK extends PropertyKey, MK, V>(o: Partial<Record<RK, V>> | Map<MK, V>): Array<[RK | MK, V]>;
@@ -61,6 +61,12 @@ export declare class Random<G extends IRandomGenerator = IRandomGenerator> {
61
61
  * Example: `chance(0.1)` is a `1/10` chance, `chance(0.8)` is a `4/5` chance
62
62
  */
63
63
  chance(decimal: number): boolean;
64
+ /**
65
+ * Returns the number procs that should happen, given a decimal number.
66
+ *
67
+ * Example: `procs(0.1)` is a `1/10` chance for one proc, `procs(1.8)` is 1 guaranteed and `4/5` chance of another
68
+ */
69
+ procs(decimal: number): number;
64
70
  /**
65
71
  * Chooses a random entry in an array and returns it
66
72
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wayward/types",
3
3
  "description": "TypeScript declarations for Wayward, used for modding.",
4
- "version": "2.15.0-beta.dev.20251002.1",
4
+ "version": "2.15.0-beta.dev.20251004.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,40 +0,0 @@
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 Human from "@wayward/game/game/entity/Human";
12
- import { SkillType } from "@wayward/game/game/entity/IHuman";
13
- export declare enum CurseComponent {
14
- Skill = 0,
15
- HighestAttack = 1,
16
- HighestDefense = 2,
17
- CumulativeEvilCrafting = 3,
18
- Equipment = 4,
19
- Modifier = 5
20
- }
21
- export declare const CURSE_WEIGHTS: PartialRecord<CurseComponent, number>;
22
- export declare const CURSE_ATTACK_MAX = 50;
23
- export declare const CURSE_DEFENSE_MAX = 100;
24
- export declare const CURSE_CRAFTING_MAX = 100;
25
- export declare const CURSE_SKILL_MAX = 100;
26
- export declare const CURSE_COMPONENTS: Record<CurseComponent, (human: Human) => number>;
27
- /**
28
- * Gets the highest value of either current or max skill multiplied by the "evilness" of each skill (from rune chance)
29
- * (Basically, high values in any of the evil-er skills make curse go brrrr)
30
- */
31
- declare function getSkillValue(human: Human): {
32
- value: number;
33
- skill: SkillType;
34
- };
35
- declare namespace Curse {
36
- const getSkill: typeof getSkillValue;
37
- function getComponentValue(human: Human, component: CurseComponent): number;
38
- function getValue(human: Human): number;
39
- }
40
- export default Curse;