@wayward/types 2.11.0-beta.dev.20211124.4 → 2.11.0-beta.dev.20211128.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.
@@ -8,6 +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
+ /// <reference types="node" />
11
12
  import EventEmitter from "event/EventEmitter";
12
13
  import type Entity from "game/entity/Entity";
13
14
  import type { Defense } from "game/entity/IEntity";
@@ -60,6 +61,7 @@ export declare class Game extends EventEmitter.Host<IGameEvents> {
60
61
  lastTickTime: number | undefined;
61
62
  saveClear: boolean;
62
63
  tileDecorations: Uint16Array;
64
+ initialThumbnailTimeout: NodeJS.Timer | undefined;
63
65
  mapSize: number;
64
66
  mapSizeSq: number;
65
67
  readonly itemStylesheetHandler: ItemStylesheetHandler | undefined;
@@ -17,9 +17,20 @@ export interface IEntityManagerEvents<T extends Entity> {
17
17
  spawn(entity: T): any;
18
18
  remove(entity: T): any;
19
19
  }
20
+ export interface IEntityCanCreateOptions {
21
+ allowEdgeSpawning?: boolean;
22
+ allowOnBlockedTiles?: boolean;
23
+ allowOnFire?: boolean;
24
+ allowOverDooadsAndTileEvents?: boolean;
25
+ chanceOfScarecrowScare?: number;
26
+ }
20
27
  export default abstract class EntityManager<T extends Entity> extends ObjectManager<T, IEntityManagerEvents<T>> implements IEntityManager<T> {
21
28
  private readonly moveTypesInFov;
22
29
  remove(entity: T): void;
23
30
  updateFov(bounds: Bound3[]): number;
24
31
  getMoveTypesInFov(): IMoveTypeZ[];
32
+ /**
33
+ * Checks if the target position is a good spot for a new entity
34
+ */
35
+ protected canCreateEntity(x: number, y: number, z: number, options?: IEntityCanCreateOptions): boolean;
25
36
  }
@@ -23,12 +23,12 @@ declare const actionDescriptions: {
23
23
  49: import("./Action").Action<[], import("../player/Player").default | import("../npc/NPC").default, boolean, []>;
24
24
  25: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../player/Player").default, void, [import("../../item/Item").default]>;
25
25
  66: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemType, import("game/entity/action/IAction").ActionArgument.ItemArrayNearby, import("game/entity/action/IAction").ActionArgument.ItemArrayNearby, [import("game/entity/action/IAction").ActionArgument.ItemNearby, import("game/entity/action/IAction").ActionArgument.Undefined], [import("game/entity/action/IAction").ActionArgument.Boolean, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/IItem").ItemType, import("../../item/Item").default[], import("../../item/Item").default[], (import("../../item/Item").default | undefined)?, (boolean | undefined)?]>;
26
+ 31: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
26
27
  79: import("./Action").Action<[], import("../player/Player").default | import("../npc/NPC").default, void, []>;
27
28
  12: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemInventory, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../player/Player").default | import("../npc/NPC").default, void, [(import("../../item/Item").default | undefined)?]>;
28
29
  0: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
29
30
  39: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
30
31
  38: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
31
- 31: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
32
32
  61: import("./Action").Action<[], import("../player/Player").default | import("../npc/NPC").default, void, []>;
33
33
  8: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
34
34
  55: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby, [import("game/entity/action/IAction").ActionArgument.Boolean, import("game/entity/action/IAction").ActionArgument.Undefined], [import("game/entity/action/IAction").ActionArgument.Boolean, import("game/entity/action/IAction").ActionArgument.Undefined], [import("game/entity/action/IAction").ActionArgument.String, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default, (boolean | undefined)?, (boolean | undefined)?, (string | undefined)?]>;
@@ -63,7 +63,7 @@ export declare enum ActionType {
63
63
  OpenContainer = 28,
64
64
  Preserve = 29,
65
65
  OpenBottle = 30,
66
- DrinkCure = 31,
66
+ Cure = 31,
67
67
  TellTime = 32,
68
68
  SailToCivilization = 33,
69
69
  Transmogrify = 34,
@@ -16,7 +16,7 @@ import type Human from "game/entity/Human";
16
16
  import { MoveType } from "game/entity/IEntity";
17
17
  import type Player from "game/entity/player/Player";
18
18
  import type { ITile } from "game/tile/ITerrain";
19
- import Vector3 from "utilities/math/Vector3";
19
+ import type Vector3 from "utilities/math/Vector3";
20
20
  export interface ICreatureManagerEvents extends Events<EntityManager<Creature>> {
21
21
  /**
22
22
  * Called when a creature is about to be spawned
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * Copyright 2011-2021 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
+ export interface INPCOld {
12
+ equipped?: Record<number, number>;
13
+ }
@@ -50,10 +50,10 @@ export default class ItemUses extends Uses<Item> {
50
50
  type: ItemType;
51
51
  description: IItemDescription;
52
52
  quality: import("../../../IObject").Quality;
53
- action: ActionType.Eat | ActionType.DrinkItem | ActionType.Heal | ActionType.DrinkCure | ActionType.HealOther;
54
- union: import("../UseInfo").IUseInfoBase<Item, ActionType.Eat | ActionType.DrinkItem | ActionType.Heal | ActionType.DrinkCure | ActionType.HealOther>;
53
+ action: ActionType.Eat | ActionType.DrinkItem | ActionType.Heal | ActionType.Cure | ActionType.HealOther;
54
+ union: import("../UseInfo").IUseInfoBase<Item, ActionType.Eat | ActionType.DrinkItem | ActionType.Heal | ActionType.Cure | ActionType.HealOther>;
55
55
  details: Set<symbol>;
56
- }, ActionType.Eat | ActionType.DrinkItem | ActionType.Heal | ActionType.DrinkCure | ActionType.HealOther, {
56
+ }, ActionType.Eat | ActionType.DrinkItem | ActionType.Heal | ActionType.Cure | ActionType.HealOther, {
57
57
  generateUseConsumeTooltip: () => (tooltip: import("../../../../ui/tooltip/Tooltip").default, stat: import("../../../entity/IStats").Stat, base: number) => import("../../../../ui/tooltip/Tooltip").default;
58
58
  }, Item> | import("../UseInfo").default<{
59
59
  objectType: CreationId.Item;
@@ -26,10 +26,10 @@ declare const _default: UseInfo<{
26
26
  type: import("../../../../item/IItem").ItemType;
27
27
  description: import("../../../../item/IItem").IItemDescription;
28
28
  quality: import("../../../../IObject").Quality;
29
- action: ActionType.Eat | ActionType.DrinkItem | ActionType.Heal | ActionType.DrinkCure | ActionType.HealOther;
30
- union: import("game/inspection/infoProviders/UseInfo").IUseInfoBase<Item, ActionType.Eat | ActionType.DrinkItem | ActionType.Heal | ActionType.DrinkCure | ActionType.HealOther>;
29
+ action: ActionType.Eat | ActionType.DrinkItem | ActionType.Heal | ActionType.Cure | ActionType.HealOther;
30
+ union: import("game/inspection/infoProviders/UseInfo").IUseInfoBase<Item, ActionType.Eat | ActionType.DrinkItem | ActionType.Heal | ActionType.Cure | ActionType.HealOther>;
31
31
  details: Set<symbol>;
32
- }, ActionType.Eat | ActionType.DrinkItem | ActionType.Heal | ActionType.DrinkCure | ActionType.HealOther, {
32
+ }, ActionType.Eat | ActionType.DrinkItem | ActionType.Heal | ActionType.Cure | ActionType.HealOther, {
33
33
  generateUseConsumeTooltip: () => (tooltip: Tooltip, stat: Stat, base: number) => Tooltip;
34
34
  }, Item>;
35
35
  export default _default;
@@ -243,7 +243,7 @@ export declare type ConsumeItemStatsTuple = [health: number, stamina: number, hu
243
243
  export interface IOnUse {
244
244
  [ActionType.Apply]?: ConsumeItemStatsTuple;
245
245
  [ActionType.Build]?: DoodadType | [build: DoodadType, keepItem: true];
246
- [ActionType.DrinkCure]?: ConsumeItemStatsTuple;
246
+ [ActionType.Cure]?: ConsumeItemStatsTuple;
247
247
  [ActionType.DrinkItem]?: ConsumeItemStatsTuple;
248
248
  [ActionType.Eat]?: ConsumeItemStatsTuple;
249
249
  [ActionType.Heal]?: ConsumeItemStatsTuple;
@@ -182,7 +182,7 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
182
182
  getNPCWithItemInInventory(containable: IContainable): NPC | undefined;
183
183
  countItemsInContainer(containers: IContainer | IContainer[], itemTypeSearch: ItemType, ignoreItem?: Item): number;
184
184
  countItemsInContainerByGroup(containers: IContainer | IContainer[], itemTypeGroupSearch: ItemTypeGroup, ignoreItem?: Item): number;
185
- getSafeItemInContainerByUse(container: IContainer, action: ActionType, allowProtectedItems?: boolean): Item | undefined;
185
+ getSafeItemInContainerByUse(container: IContainer, action: ActionType, allowProtectedItems?: boolean, canDamageItem?: boolean, consumable?: boolean): Item | undefined;
186
186
  getItemInContainer(container: IContainer, itemTypeSearch: ItemType, ignoreItem?: Item, allowProtectedItems?: boolean): Item | undefined;
187
187
  getItemForHuman(human: Human, search: ItemType | ItemTypeGroup, allowProtectedItems?: boolean): Item | undefined;
188
188
  getItemInContainerByGroup(container: IContainer, itemTypeGroupSearch: ItemTypeGroup, ignoreItemId?: number, allowProtectedItems?: boolean): Item | undefined;
@@ -111,6 +111,8 @@ declare class InputManager extends EventEmitter.Host<IInputManagerEvents> {
111
111
  extractModifiers(evt: Event): Set<Modifier> | undefined;
112
112
  getCatalyst(evt: Event): InputCatalyst | undefined;
113
113
  disableUntil(until: number | Promise<any>, disabler: string): void;
114
+ disable(disabler: string): boolean;
115
+ enable(disabler: string): void;
114
116
  isDisabled(): boolean;
115
117
  isDisabledBy(disabler: string): boolean;
116
118
  private handleRising;
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.11.0-beta.dev.20211124.4",
4
+ "version": "2.11.0-beta.dev.20211128.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",