@wayward/types 2.15.0-beta.dev.20251010.1 → 2.15.0-beta.dev.20251011.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.
@@ -13,66 +13,70 @@ export declare enum SfxType {
13
13
  Bow = 1,
14
14
  Chat = 2,
15
15
  Craft = 3,
16
- CreatureHit = 4,
17
- CreatureNoise = 5,
18
- Damaged = 6,
19
- DangerousMove = 7,
20
- Death = 8,
21
- Eating = 9,
22
- Encumbered = 10,
23
- Exceptional = 11,
24
- Extinguish = 12,
25
- Fail = 13,
26
- FluteNoteA = 14,
27
- FluteNoteB = 15,
28
- FluteNoteC = 16,
29
- FluteNoteD = 17,
30
- FluteNoteE = 18,
31
- FluteNoteF = 19,
32
- FluteNoteG = 20,
33
- FluteNoteH = 21,
34
- FluteNoteI = 22,
35
- GraniteHit = 23,
36
- Hit = 24,
37
- Hurt = 25,
38
- InvokeChaos = 26,
39
- InvokeEvil = 27,
40
- InvokeGood = 28,
41
- Minecart = 29,
42
- Miss = 30,
43
- Overburdened = 31,
44
- PickUp = 32,
45
- Sacrifice = 33,
46
- SandstoneHit = 34,
47
- Slip = 35,
48
- Swim = 36,
49
- Throw = 37,
50
- Trample = 38,
51
- TreeHit = 39,
52
- UiActivate = 40,
53
- UiChoose = 41,
54
- UiClose = 42,
55
- UiDisable = 43,
56
- UiEnable = 44,
57
- UiEquip = 45,
58
- UiInput = 46,
59
- UiInputdelete = 47,
60
- UiInvalid = 48,
61
- UiOpen = 49,
62
- UiOpensmall = 50,
63
- UiProtect = 51,
64
- UiReorder = 52,
65
- UiSelect = 53,
66
- UiSort = 54,
67
- UiStack = 55,
68
- UiTrade = 56,
69
- UiUnequip = 57,
70
- UiUnprotect = 58,
71
- UiUnstack = 59,
72
- Walk = 60,
73
- Water = 61,
74
- Wheelbarrow = 62,
75
- CraftFail = 63
16
+ CraftFail = 4,
17
+ CreatureHit = 5,
18
+ CreatureNoise = 6,
19
+ Damaged = 7,
20
+ DangerousMove = 8,
21
+ Death = 9,
22
+ Eating = 10,
23
+ Encumbered = 11,
24
+ Exceptional = 12,
25
+ Extinguish = 13,
26
+ Fail = 14,
27
+ FluteNoteA = 15,
28
+ FluteNoteB = 16,
29
+ FluteNoteC = 17,
30
+ FluteNoteD = 18,
31
+ FluteNoteE = 19,
32
+ FluteNoteF = 20,
33
+ FluteNoteG = 21,
34
+ FluteNoteH = 22,
35
+ FluteNoteI = 23,
36
+ GraniteHit = 24,
37
+ Hit = 25,
38
+ Hurt = 26,
39
+ InvokeChaos = 27,
40
+ InvokeEvil = 28,
41
+ InvokeGood = 29,
42
+ Minecart = 30,
43
+ Miss = 31,
44
+ Overburdened = 32,
45
+ PickUp = 33,
46
+ Sacrifice = 34,
47
+ SandstoneHit = 35,
48
+ Slip = 36,
49
+ Swim = 37,
50
+ Throw = 38,
51
+ Trample = 39,
52
+ TreeHit = 40,
53
+ UiActivate = 41,
54
+ UiChoose = 42,
55
+ UiClose = 43,
56
+ UiDisable = 44,
57
+ UiEnable = 45,
58
+ UiEquip = 46,
59
+ UiInput = 47,
60
+ UiInputdelete = 48,
61
+ UiInvalid = 49,
62
+ UiOpen = 50,
63
+ UiOpensmall = 51,
64
+ UiProtect = 52,
65
+ UiReorder = 53,
66
+ UiSelect = 54,
67
+ UiSort = 55,
68
+ UiStack = 56,
69
+ UiTrade = 57,
70
+ UiUnequip = 58,
71
+ UiUnprotect = 59,
72
+ UiUnstack = 60,
73
+ Walk = 61,
74
+ Water = 62,
75
+ Wheelbarrow = 63,
76
+ Break = 64,
77
+ GeneralAction = 65,
78
+ GeneralMagicalAction = 66,
79
+ Exude = 67
76
80
  }
77
81
  export type SfxUi = Extract<keyof typeof SfxType, `Ui${string}`> extends `Ui${infer RESULT}` ? Lowercase<RESULT> : never;
78
82
  export declare enum Music {
@@ -79,6 +79,11 @@ export declare const CURSE_EVENTS_FIRST_NIGHT = 3;
79
79
  * If the entity is on a tile that can be seen by a player, it will not despawn.
80
80
  */
81
81
  export declare const CURSE_EVENTS_ENTITY_DESPAWN_CHANCE = 0.1;
82
+ /**
83
+ * Some curse events extinguish light sources via additional decay (both static & dynamic (based on % of decay remaining))
84
+ * This multiplier affects how quickly curse ward doodads & items are extinguished compared to the rest
85
+ */
86
+ export declare const CURSE_EVENTS_EXTINGUISH_WARD_MULTIPLIER = 0.2;
82
87
  declare namespace Curse {
83
88
  interface Helper {
84
89
  context: CurseEventContext;
@@ -19,6 +19,10 @@ import { IRange } from "@wayward/utilities/math/Range";
19
19
  import type Tile from "@wayward/game/game/tile/Tile";
20
20
  import type Creature from "@wayward/game/game/entity/creature/Creature";
21
21
  import type { CreatureType } from "@wayward/game/game/entity/creature/ICreature";
22
+ import type Doodad from "@wayward/game/game/doodad/Doodad";
23
+ import type Item from "@wayward/game/game/item/Item";
24
+ import type TileEvent from "@wayward/game/game/tile/TileEvent";
25
+ import type WorldZ from "@wayward/utilities/game/WorldZ";
22
26
  /** The API that curse events have access to */
23
27
  export interface CurseEventContext {
24
28
  readonly island: Island;
@@ -38,11 +42,29 @@ export interface CurseEventContext {
38
42
  getNearbyPlayers(): Human[];
39
43
  /** Get a random tile within the curse event's radius. This is based on `CurseEvent.position` and `CurseEvent.radius` */
40
44
  getRandomTile(radius?: number): Tile | undefined;
45
+ /** Get a random tile within the curse event's radius. This is based on `CurseEvent.position` and `CurseEvent.radius` */
46
+ getTilesInRange(radius?: number, z?: WorldZ): Tile[];
41
47
  /**
42
48
  * Spawn a creature at the given tile using the curse event spawning rules.
49
+ *
50
+ * Note that "curse event" creatures:
51
+ * - Do not display alerted notifiers
52
+ * - Do not randomly despawn
53
+ * - Are despawned at the event end
54
+ *
43
55
  * @param evenWhenAsleep Disable the default functionality of preventing spawns if the cursebearer is asleep
44
56
  */
45
57
  spawnCreature(type?: CreatureType, tile?: Tile, evenWhenAsleep?: true): Creature | undefined;
58
+ /**
59
+ * Note: This does not check whether or not the cursebearer is asleep.
60
+ * @param options The options for extinguishing lights
61
+ * @param lights The lights that should lose decay. If no lights are provided, all lights in the event radius will be affected
62
+ */
63
+ extinguish(options: CurseEventExtinguishOptions, ...lights: Array<Doodad | Item | TileEvent>): void;
64
+ /**
65
+ * Mark the given creatures as "curse event" creatures. See the `spawnCreature` function for more information
66
+ */
67
+ claim(...creatures: Creature[]): void;
46
68
  /**
47
69
  * Inject a custom curse event subscriber class into the game.
48
70
  * This class *must* be included in `CurseEvent.subscribers`.
@@ -54,6 +76,20 @@ export interface CurseEventContext {
54
76
  uninject<T extends CurseEventSubscriber>(subscriber: Class<T>): void;
55
77
  toString(): string;
56
78
  }
79
+ export interface CurseEventExtinguishOptions {
80
+ /**
81
+ * The number of flat ticks to reduce decays by
82
+ *
83
+ * Chooses the higher of `staticDecay` and `dynamicDecay`.
84
+ */
85
+ staticDecay?: number | IRange;
86
+ /**
87
+ * The percentage of the current decay to reduce by, represented as a number between 0 and 1.
88
+ *
89
+ * Chooses the higher of `staticDecay` and `dynamicDecay`.
90
+ */
91
+ dynamicDecay?: number | IRange;
92
+ }
57
93
  export interface CurseEvent {
58
94
  group: CurseGroup;
59
95
  category: CurseCategory;
@@ -9,5 +9,11 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import { CurseEvent } from "@wayward/game/game/curse/CurseEvent";
12
+ import { IRange, IRangeRange } from "@wayward/utilities/math/Range";
13
+ export declare const CURSE_EVENT_SHADOWS_SPAWN_DELAY: IRangeRange;
14
+ export declare const CURSE_EVENT_SHADOWS_EXTINGUISH_DELAY: IRangeRange;
15
+ export declare const CURSE_EVENT_SHADOWS_EXTINGUISH_STATIC: IRangeRange;
16
+ export declare const CURSE_EVENT_SHADOWS_EXTINGUISH_DYNAMIC: IRangeRange;
17
+ export declare const CURSE_EVENT_SHADOWS_EXTINGUISH_TIME_MULTIPLIER: IRange;
12
18
  declare const _default: CurseEvent;
13
19
  export default _default;
@@ -403,6 +403,7 @@ export default class Doodad extends EntityMovable<IDoodadDescription, DoodadType
403
403
  * @returns True if the solar still can work in the current temperature, false if not.
404
404
  */
405
405
  willStillWorkInTemperature(): boolean;
406
+ forceDecayTick(): void;
406
407
  /**
407
408
  * Decay over time
408
409
  */
@@ -381,7 +381,7 @@ export default class Item extends EntityMovable<IItemDescription, ItemType, Refe
381
381
  /**
382
382
  * Decreases the time until the item will decay (ticks until it decays at 1x decay speed).
383
383
  */
384
- reduceDecayTime(time?: number): number | undefined;
384
+ reduceDecayTime(time?: number, skipChance?: boolean): number | undefined;
385
385
  /**
386
386
  * Sets the item's decay time (ticks until it decays at 1x decay speed).
387
387
  * @param decayTime The new decay time to set, or `undefined` to remove the decay time.
@@ -297,7 +297,7 @@ export default class ItemManager extends EntityManager<Item, IItemRemoveOptions>
297
297
  */
298
298
  getEfficacyTranslation(human: Human, qualityBonus: number, maxQualityBonus: number, recipe: IRecipe, ui?: boolean): TranslationImpl | undefined;
299
299
  updateItems(ticks: number, playerIds: Set<number>, skipHumanItems?: boolean): boolean;
300
- updateItem(ticks: number, item: Item, isInInventory: boolean): boolean;
300
+ updateItem(ticks: number, item: Item, isInInventory?: boolean): boolean;
301
301
  getPlayerWithItemInInventory(containable: IContainable): Player | undefined;
302
302
  getAbsentPlayerWithItemInInventory(containable: IContainable): Player | undefined;
303
303
  getNPCWithItemInInventory(containable: IContainable): NPC | undefined;
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.20251010.1",
4
+ "version": "2.15.0-beta.dev.20251011.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",