@wayward/types 2.11.4-beta.dev.20220130.1 → 2.11.4-beta.dev.20220201.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.
@@ -16,7 +16,7 @@ import type { ICausesDamage } from "game/entity/IEntity";
16
16
  import type { ICheckUnderOptions, ICrafted, ICustomizations, IHumanEvents, IRestData, RestCancelReason } from "game/entity/IHuman";
17
17
  import { EquipType, SkillType } from "game/entity/IHuman";
18
18
  import { Stat } from "game/entity/IStats";
19
- import type { IAttackHand, IMobCheck } from "game/entity/player/IPlayer";
19
+ import type { IAttackHand, IMobCheck, IMovementIntent, IWalkPath } from "game/entity/player/IPlayer";
20
20
  import { WeightStatus, PlayerState } from "game/entity/player/IPlayer";
21
21
  import PlayerDefense from "game/entity/player/PlayerDefense";
22
22
  import SkillManager from "game/entity/skill/SkillManager";
@@ -36,7 +36,7 @@ import type TileEvent from "game/tile/TileEvent";
36
36
  import Message from "language/dictionary/Message";
37
37
  import Translation from "language/Translation";
38
38
  import type { IOptions } from "save/data/ISaveDataGlobal";
39
- import type { IVector3 } from "utilities/math/IVector";
39
+ import type { IVector2, IVector3 } from "utilities/math/IVector";
40
40
  export declare const REPUTATION_MAX = 64000;
41
41
  export default abstract class Human extends Entity implements IHasInsulation {
42
42
  static getNameTranslation(): import("../../language/impl/TranslationImpl").default;
@@ -53,11 +53,13 @@ export default abstract class Human extends Entity implements IHasInsulation {
53
53
  islandId: IslandId;
54
54
  options: Readonly<IOptions>;
55
55
  readonly equipEffects: Map<EquipEffect, EquipEffects>;
56
+ readonly movementIntent: IMovementIntent;
56
57
  restData: IRestData | undefined;
57
58
  score: number;
58
59
  state: PlayerState;
59
60
  swimming: boolean;
60
61
  vehicleItemReference: ItemReference | undefined;
62
+ walkPath: IWalkPath | undefined;
61
63
  identifier: string;
62
64
  skill: SkillManager;
63
65
  private readonly privateStore;
@@ -107,6 +109,10 @@ export default abstract class Human extends Entity implements IHasInsulation {
107
109
  burn(fireType: FireType, skipMessage?: boolean, skipParry?: boolean, equipType?: EquipType, fromCombat?: boolean): number | undefined;
108
110
  setPosition(point: IVector3): void;
109
111
  setZ(z: number, updateFlowField?: boolean): void;
112
+ getMovementIntent(): IMovementIntent;
113
+ updateMovementIntent(movementIntent: IMovementIntent): boolean;
114
+ hasWalkPath(): boolean;
115
+ walkAlongPath(path: IVector2[] | undefined, force?: boolean): void;
110
116
  checkUnder(inFacingDirection?: boolean, options?: ICheckUnderOptions): ICheckUnderOptions;
111
117
  damageByInteractingWith(thing: Doodad | TileEvent, options: ICheckUnderOptions | undefined, damageLocation: EquipType): ICheckUnderOptions;
112
118
  equip(item: Item, slot: EquipType): boolean;
@@ -25,6 +25,7 @@ import type { ITile } from "game/tile/ITerrain";
25
25
  import type { IModdable } from "mod/ModRegistry";
26
26
  import type { IRGB } from "utilities/Color";
27
27
  import type { Direction } from "utilities/math/Direction";
28
+ import type { IVector2 } from "utilities/math/IVector";
28
29
  import type { IRange } from "utilities/math/Range";
29
30
  export interface IHumanEvents extends Events<Entity>, ISkillEvents {
30
31
  /**
@@ -67,6 +68,10 @@ export interface IHumanEvents extends Events<Entity>, ISkillEvents {
67
68
  * @returns True if the human should be swimming, false if they should not be swimming, or undefined to use the default logic
68
69
  */
69
70
  isSwimming(isSwimming: boolean): boolean | undefined;
71
+ /**
72
+ * Called when the walk path of the player changes.
73
+ */
74
+ walkPathChange(walkPath: IVector2[] | undefined): any;
70
75
  /**
71
76
  * Called when a book is opened by a player
72
77
  * @param book The book that was opened
@@ -100,7 +100,7 @@ declare const actionDescriptions: {
100
100
  32: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
101
101
  82: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemInventory, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../player/Player").default, void, [(import("../../item/Item").default | undefined)?]>;
102
102
  2: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemInventory, import("game/entity/action/IAction").ActionArgument.Undefined], [import("game/entity/action/IAction").ActionArgument.AttackType, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../player/Player").default | import("../npc/NPC").default, void, [(import("../../item/Item").default | undefined)?, (import("../IEntity").AttackType | undefined)?]>;
103
- 67: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemInventory]], import("../player/Player").default, void, [import("../../item/Item").default]>;
103
+ 67: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemInventory]], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
104
104
  103: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.Container, 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").IContainer | undefined)?, (boolean | undefined)?]>;
105
105
  102: import("./Action").Action<[], import("../player/Player").default | import("../npc/NPC").default, boolean, []>;
106
106
  101: import("./Action").Action<[], import("../player/Player").default | import("../npc/NPC").default, void, []>;
@@ -10,5 +10,5 @@
10
10
  */
11
11
  import { Action } from "game/entity/action/Action";
12
12
  import { ActionArgument } from "game/entity/action/IAction";
13
- declare const _default: Action<[[ActionArgument.ItemInventory]], import("../../player/Player").default, void, [import("../../../item/Item").default]>;
13
+ declare const _default: Action<[[ActionArgument.ItemInventory]], import("../../player/Player").default | import("../../npc/NPC").default, void, [import("../../../item/Item").default]>;
14
14
  export default _default;
@@ -82,10 +82,10 @@ export default class Creature extends Entity implements IUnserializedCallback, I
82
82
  checkUnder(x?: number, y?: number): boolean;
83
83
  /**
84
84
  * Check if this creature can swap with the player in the event that the player is moving into them
85
- * @param player Player object
85
+ * @param human Human object
86
86
  * @param source Source string. Set to undefined if this is being called from the clientside
87
87
  */
88
- canSwapWith(player: Player, source: string | undefined): boolean;
88
+ canSwapWith(human: Human, source: string | undefined): boolean;
89
89
  getOwner(): Player | undefined;
90
90
  damage(damageInfo: IDamageInfo): number | undefined;
91
91
  damage(damageInfo: IDamageInfo, creatureX?: number, creatureY?: number, creatureZ?: number): number | undefined;
@@ -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 type Player from "game/entity/player/Player";
11
+ import type Human from "game/entity/Human";
12
12
  import type Island from "game/island/Island";
13
13
  import type { ITile } from "game/tile/ITerrain";
14
14
  import type { IVector2 } from "utilities/math/IVector";
@@ -24,7 +24,7 @@ declare const _default: {
24
24
  /**
25
25
  * Returns whether the tile is blocked (completely impassible)
26
26
  */
27
- isWalkToTileBlocked(player: Player, tile: ITile, pos: IVector2, clientSide: boolean): boolean;
27
+ isWalkToTileBlocked(human: Human, tile: ITile, pos: IVector2, clientSide: boolean): boolean;
28
28
  readonly event: import("event/EventEmitter").IEventEmitter<any, IPathingEvents>;
29
29
  };
30
30
  export default _default;
@@ -129,7 +129,7 @@ export default abstract class NPC extends Human {
129
129
  protected autoScaleStats(): void;
130
130
  protected preMove(fromX: number, fromY: number, fromZ: number, fromTile: ITile, toX: number, toY: number, toZ: number, toTile: ITile): boolean | void | undefined;
131
131
  protected postMove(): void;
132
- private checkMove;
132
+ protected checkMove(moveType: MoveType, tileX: number, tileY: number, tileZ: number): 0 | -1 | -2 | -3 | -4 | -5;
133
133
  get asNPC(): NPC;
134
134
  get asPlayer(): undefined;
135
135
  get asLocalPlayer(): undefined;
@@ -19,7 +19,7 @@ import type { ICheckUnderOptions, IRestData } from "game/entity/IHuman";
19
19
  import { EquipType, RestCancelReason, SkillType } from "game/entity/IHuman";
20
20
  import type { IStat } from "game/entity/IStats";
21
21
  import { Stat } from "game/entity/IStats";
22
- import type { ILoadOnIslandOptions, IMovementIntent, IPlayerEvents, IWalkPath } from "game/entity/player/IPlayer";
22
+ import type { ILoadOnIslandOptions, IMovementIntent, IPlayerEvents } from "game/entity/player/IPlayer";
23
23
  import { TurnType } from "game/entity/player/IPlayer";
24
24
  import MessageManager from "game/entity/player/MessageManager";
25
25
  import NoteManager from "game/entity/player/note/NoteManager";
@@ -71,7 +71,6 @@ export default class Player extends Human implements IUnserializedCallback {
71
71
  quests: QuestManager;
72
72
  messages: MessageManager;
73
73
  notes: NoteManager;
74
- walkPath: IWalkPath | undefined;
75
74
  exploredMap: ExploreMap[] | undefined;
76
75
  finishedMovingClientside: boolean;
77
76
  nextX: number;
@@ -81,7 +80,6 @@ export default class Player extends Human implements IUnserializedCallback {
81
80
  nextMoveTime: number;
82
81
  nextMoveDirection: Direction.Cardinal | Direction.None | undefined;
83
82
  displayCreature?: CreatureType;
84
- private readonly _movementIntent;
85
83
  private readonly milestonesCollection;
86
84
  private gameOptionsCached?;
87
85
  private handEquippedToLast;
@@ -122,8 +120,7 @@ export default class Player extends Human implements IUnserializedCallback {
122
120
  equip(item: Item, slot: EquipType, internal?: boolean, switchingHands?: boolean): boolean;
123
121
  unequip(item: Item, internal?: boolean, skipMessage?: boolean, skipRevertItem?: boolean): void;
124
122
  unequipAll(): void;
125
- getMovementIntent(): IMovementIntent;
126
- updateMovementIntent(movementIntent: IMovementIntent): void;
123
+ updateMovementIntent(movementIntent: IMovementIntent): boolean;
127
124
  resetStatTimers(type?: StatChangeCurrentTimerStrategy): void;
128
125
  /**
129
126
  * Gets the max health of the player.
@@ -189,7 +186,6 @@ export default class Player extends Human implements IUnserializedCallback {
189
186
  respawn(reset: boolean): Promise<void>;
190
187
  getMovementProgress(): number;
191
188
  checkUnder(inFacingDirection?: boolean, options?: ICheckUnderOptions): ICheckUnderOptions;
192
- hasWalkPath(): boolean;
193
189
  walkAlongPath(path: IVector2[] | undefined, force?: boolean): void;
194
190
  /**
195
191
  * This is only ran on the server
@@ -200,7 +200,7 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
200
200
  isItemInContainer(container: IContainer, itemTypeSearch: ItemType, options?: Partial<IGetItemOptions>): boolean;
201
201
  isContainableInContainer(containable: IContainable, container: IContainer): boolean;
202
202
  getAdjacentContainers(humanOrPosition: Human | IVector3, includeNpcs?: boolean, ignoreOptions?: boolean): IContainer[];
203
- isContainableInAdjacentContainer(player: Player, containable: IContainable, includeNpcs?: boolean, ignoreOptions?: boolean): boolean;
203
+ isContainableInAdjacentContainer(human: Human, containable: IContainable, includeNpcs?: boolean, ignoreOptions?: boolean): boolean;
204
204
  isInInventory(containable: IContainable): boolean;
205
205
  isTileContainer(container: IContainer | undefined): boolean;
206
206
  /**
@@ -44,7 +44,7 @@ interface IReferenceTypeMap {
44
44
  export declare type Referenceable = IReferenceTypeMap[ReferenceableReferenceTypes];
45
45
  export default class ReferenceManager {
46
46
  static isEnumReference(type: ReferenceType): type is EnumReferenceTypes;
47
- static getList(type: ReferenceType, gameIsland?: Island): import("../entity/creature/corpse/CorpseManager").default | import("../entity/creature/CreatureManager").default | import("../doodad/DoodadManager").default | import("../item/ItemManager").default | import("../entity/npc/NPCManager").default | import("../tile/TileEventManager").default | Player[] | readonly Milestone[] | readonly ItemType[] | readonly SkillType[] | IterableIterator<Island> | readonly Stat[];
47
+ static getList(type: ReferenceType, gameIsland?: Island): import("../entity/creature/corpse/CorpseManager").default | import("../entity/creature/CreatureManager").default | import("../doodad/DoodadManager").default | import("../item/ItemManager").default | import("../entity/npc/NPCManager").default | import("../tile/TileEventManager").default | Player[] | readonly Milestone[] | readonly SkillType[] | readonly ItemType[] | IterableIterator<Island> | readonly Stat[];
48
48
  private referenceCursor;
49
49
  create(): number;
50
50
  get(thing: Referenceable): Reference | 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.11.4-beta.dev.20220130.1",
4
+ "version": "2.11.4-beta.dev.20220201.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",