@wayward/types 2.15.0-beta.dev.20251009.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
  */
@@ -86,7 +86,7 @@ export default class DoodadManager extends EntityManager<Doodad> {
86
86
  */
87
87
  updateAllAsync(ticks: number, playingHumans: Human[], playerHumanTiles: Set<Tile>, onProgress: (progess: number) => Promise<void>): Promise<void>;
88
88
  verifyAndFixItemWeights(): void;
89
- getScarecrowInRange(tile: Tile): Doodad | undefined;
89
+ getScarecrowInRange(tile: Tile, group?: DoodadTypeGroup): Doodad | undefined;
90
90
  getScarecrowInLineOfSight(creature: Creature, isClientside: boolean): Doodad | undefined;
91
91
  addScarecrow(doodad: Doodad): void;
92
92
  removeScarecrow(doodad: Doodad): void;
@@ -17,6 +17,7 @@ import type { SkillType } from "@wayward/game/game/entity/IHuman";
17
17
  import type { IDecayTemperatureRange } from "@wayward/game/game/IGame";
18
18
  import type { ILootItem } from "@wayward/game/game/ILoot";
19
19
  import type { IObjectDescription, IObjectOptions } from "@wayward/game/game/IObject";
20
+ import type { WaterType } from "@wayward/game/game/island/IIsland";
20
21
  import type Island from "@wayward/game/game/island/Island";
21
22
  import type { IContainer, IItemOld, ItemType, ItemTypeExtra, ItemTypeGroup } from "@wayward/game/game/item/IItem";
22
23
  import type Item from "@wayward/game/game/item/Item";
@@ -528,7 +529,8 @@ export declare enum DoodadTypeGroup {
528
529
  Altar = -9978,
529
530
  OpenFireSource = -9977,
530
531
  RequiresCandleToLight = -9976,
531
- ContainsFuelSource = -9975
532
+ ContainsFuelSource = -9975,
533
+ CurseWard = -9974
532
534
  }
533
535
  export declare enum DoorOrientation {
534
536
  /**
@@ -559,6 +561,7 @@ export interface IHasBuilder {
559
561
  export interface IHasWater {
560
562
  top?: true;
561
563
  bottom?: true;
564
+ waterType?: WaterType;
562
565
  }
563
566
  export interface IDoodadGetNameOptions {
564
567
  count: number;
@@ -10,8 +10,8 @@
10
10
  */
11
11
  import CombatStrengthManager from "@wayward/game/game/entity/CombatStrengthManager";
12
12
  import Creature from "@wayward/game/game/entity/creature/Creature";
13
- import type { ICreatureCheckMoveOptions } from "@wayward/game/game/entity/creature/ICreature";
14
- import { CreatureType, TileGroup } from "@wayward/game/game/entity/creature/ICreature";
13
+ import type { ICreatureCheckMoveOptions, ICreatureSpawnOptions } from "@wayward/game/game/entity/creature/ICreature";
14
+ import { CreatureType } from "@wayward/game/game/entity/creature/ICreature";
15
15
  import type { IEntityRemoveOptions } from "@wayward/game/game/entity/EntityManager";
16
16
  import EntityManager from "@wayward/game/game/entity/EntityManager";
17
17
  import type Human from "@wayward/game/game/entity/Human";
@@ -48,12 +48,8 @@ export default class CreatureManager extends EntityManager<Creature, IEntityRemo
48
48
  * Spawns a creature.
49
49
  * @param type The type of creature to spawn.
50
50
  * @param tile The tile
51
- * @param bypass Whether to bypass checks for whether the creature can spawn there naturally. Defaults to false, if the creature can't spawn naturally, it won't.
52
- * @param forceAberrant If provided, forces the spawned creature's aberrant state to be the passed boolean. True = aberrant, false = not aberrant. If not provided, the aberrant state is decided based on chance.
53
- * @param spawnTiles If set, this will overwrite the creature's description for which tiles it can spawn on
54
- * @param bypassCreatureLimit If set, the creature limit will be ignored and spawn the creature over the set limit
55
51
  */
56
- spawn(type: CreatureType, tile: Tile, bypass?: boolean, forceAberrant?: boolean, spawnTiles?: TileGroup, bypassCreatureLimit?: boolean, bypassAll?: boolean): Creature | undefined;
52
+ spawn(type: CreatureType, tile: Tile, options?: ICreatureSpawnOptions): Creature | undefined;
57
53
  spawnFromZone(tile: Tile, bypassCreatureLimit?: boolean, checkTerrainType?: boolean): Creature | undefined;
58
54
  createFake(type: CreatureType, aberrant: boolean, tile?: Tile, id?: number): Creature;
59
55
  exists(creature: Creature): boolean;
@@ -521,3 +521,29 @@ export interface ICreatureCheckMoveOptions {
521
521
  ignoreScareCrow: boolean;
522
522
  ignoreMoveTypeNone: boolean;
523
523
  }
524
+ export interface ICreatureSpawnOptions {
525
+ /**
526
+ * If set to true, the creature will ignore blocked or full tile checks as well as ignore spawnTiles definitions set on the creature.
527
+ */
528
+ bypassTiles?: boolean;
529
+ /**
530
+ * If provided, forces the spawned creature's aberrant state to be the passed boolean. True = aberrant, false = not aberrant. If not provided, the aberrant state is decided based on chance.
531
+ */
532
+ forceAberrant?: boolean;
533
+ /**
534
+ * If set, this will overwrite the creature's description for which tiles it can spawn on. This will also change which tiles it can path on to, differing from its set definitions.
535
+ */
536
+ spawnTiles?: TileGroup;
537
+ /**
538
+ * If set to true, this will bypass the current zone's creature limit and spawn it regardless.
539
+ */
540
+ bypassCreatureLimit?: boolean;
541
+ /**
542
+ * If set to true, the creatures will ignore scarecrows when spawning. Note that this does NOT ignore the chance of being scared by a scarecrow when moving, just the initial spawn checks.
543
+ */
544
+ bypassScarecrows?: boolean;
545
+ /**
546
+ * If set to true, all checks will be bypassed and the creature will spawn no matter what.
547
+ */
548
+ bypassAll?: boolean;
549
+ }
@@ -29,6 +29,7 @@ import type Corpse from "@wayward/game/game/entity/creature/corpse/Corpse";
29
29
  import type NPC from "@wayward/game/game/entity/npc/NPC";
30
30
  import type Player from "@wayward/game/game/entity/player/Player";
31
31
  import type { IMobCheck, IslandId } from "@wayward/game/game/island/IIsland";
32
+ import { WaterType } from "@wayward/game/game/island/IIsland";
32
33
  import type { ContainerReference, DisplayableItemType, IConstructedInfo, IContainable, IContainer, IItemChangeIntoOptions, IItemDescription, IItemDisassembleResult, IItemDisassembly, IItemGetNameOptions, IItemUsed, IItemVehicle, IMagicalPropertyInfo, IItemMovementResult as IMoveToTileMobCheckResult, IMoveToTileOptions, ItemTag } from "@wayward/game/game/item/IItem";
33
34
  import { ItemTypeExtra } from "@wayward/game/game/item/IItem";
34
35
  import { BookType, ContainerSort, ItemDamageResult, ItemType, ItemTypeGroup, ItemWeightChange, SYMBOL_CONTAINER_CACHED_REFERENCE } from "@wayward/game/game/item/IItem";
@@ -380,7 +381,7 @@ export default class Item extends EntityMovable<IItemDescription, ItemType, Refe
380
381
  /**
381
382
  * Decreases the time until the item will decay (ticks until it decays at 1x decay speed).
382
383
  */
383
- reduceDecayTime(time?: number): number | undefined;
384
+ reduceDecayTime(time?: number, skipChance?: boolean): number | undefined;
384
385
  /**
385
386
  * Sets the item's decay time (ticks until it decays at 1x decay speed).
386
387
  * @param decayTime The new decay time to set, or `undefined` to remove the decay time.
@@ -525,6 +526,11 @@ export default class Item extends EntityMovable<IItemDescription, ItemType, Refe
525
526
  */
526
527
  getReturnType(): ItemType;
527
528
  createReturnItem(returnType: ItemType, container?: IContainer): Item | undefined;
529
+ /**
530
+ * Returns the type of water contained in the item in the case of containers of liquid.
531
+ * @returns WaterType enum value.
532
+ */
533
+ getWaterType(): WaterType;
528
534
  private checkIfItemsMatch;
529
535
  private checkIfItemArraysMatch;
530
536
  }
@@ -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.20251009.1",
4
+ "version": "2.15.0-beta.dev.20251011.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",