@wayward/types 2.11.4-beta.dev.20220201.1 → 2.11.4-beta.dev.20220204.2

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.
@@ -50,15 +50,15 @@ export default abstract class Human extends Entity implements IHasInsulation {
50
50
  equippedReferences: Map<EquipType, ItemReference>;
51
51
  handToUse: EquipType | undefined;
52
52
  inventory: IContainer;
53
- islandId: IslandId;
54
53
  options: Readonly<IOptions>;
54
+ islandId: IslandId;
55
55
  readonly equipEffects: Map<EquipEffect, EquipEffects>;
56
- readonly movementIntent: IMovementIntent;
57
56
  restData: IRestData | undefined;
58
57
  score: number;
59
58
  state: PlayerState;
60
59
  swimming: boolean;
61
60
  vehicleItemReference: ItemReference | undefined;
61
+ readonly movementIntent: IMovementIntent;
62
62
  walkPath: IWalkPath | undefined;
63
63
  identifier: string;
64
64
  skill: SkillManager;
@@ -143,6 +143,10 @@ export default abstract class Human extends Entity implements IHasInsulation {
143
143
  isSwimming(): boolean;
144
144
  updateSwimming(): void;
145
145
  updatePaddling(): void;
146
+ /**
147
+ * Returns the bartering bonus for a given credit value
148
+ */
149
+ getBarteringBonus(baseCredits: number): number;
146
150
  getInsulation(type: TempType): number;
147
151
  protected resetStatTimers(type?: StatChangeCurrentTimerStrategy): void;
148
152
  protected getBaseStatBonuses(): OptionalDescriptions<Stat, number>;
@@ -17,7 +17,7 @@ import type { AttackType } from "game/entity/IEntity";
17
17
  import type { WeightStatus } from "game/entity/player/IPlayer";
18
18
  import type { ISkillEvents } from "game/entity/skill/SkillManager";
19
19
  import type { IHasImagePath, Quality } from "game/IObject";
20
- import type { ItemType } from "game/item/IItem";
20
+ import type { IContainer, ItemType } from "game/item/IItem";
21
21
  import { RecipeLevel } from "game/item/IItem";
22
22
  import type Item from "game/item/Item";
23
23
  import { TempType } from "game/temperature/ITemperature";
@@ -28,6 +28,25 @@ import type { Direction } from "utilities/math/Direction";
28
28
  import type { IVector2 } from "utilities/math/IVector";
29
29
  import type { IRange } from "utilities/math/Range";
30
30
  export interface IHumanEvents extends Events<Entity>, ISkillEvents {
31
+ /**
32
+ * Called when an item is added to the player's inventory
33
+ * @param item The item object
34
+ * @param container The container object the item was added to. This container might be inventory or a container within the inventory.
35
+ */
36
+ inventoryItemAdd(item: Item, container: IContainer): any;
37
+ /**
38
+ * Called when an item is removed from the players inventory
39
+ * @param item The item object
40
+ * @param container The container object the item was moved to.
41
+ */
42
+ inventoryItemRemove(item: Item, container: IContainer): any;
43
+ /**
44
+ * Called when an item is moved from one container to another, while still in the players inventory.
45
+ * @param item The item object
46
+ * @param container The container object the item was moved to. This container might be inventory or a container within the inventory.
47
+ * @param previousContainer The container object the item was moved from. This container might be inventory or a container within the inventory.
48
+ */
49
+ inventoryItemUpdate(item: Item, container: IContainer, previousContainer?: IContainer): any;
31
50
  /**
32
51
  * Called when the human faces a different direction
33
52
  * @param direction The direction the player is now facing
@@ -89,10 +89,6 @@ export default abstract class NPC extends Human {
89
89
  * Sets the default weightCapacity of an NPC (based on their equipment and starting items).
90
90
  */
91
91
  generateWeightCapacity(): void;
92
- /**
93
- * Returns the bartering bonus for a given credit value
94
- */
95
- getBarteringBonus(baseCredits: number): number;
96
92
  getName(): import("../../../language/impl/TranslationImpl").default;
97
93
  protected getApplicableStatusEffects(): Set<StatusType>;
98
94
  /**
@@ -21,7 +21,6 @@ import type { INote } from "game/entity/player/note/NoteManager";
21
21
  import type Player from "game/entity/player/Player";
22
22
  import type { IslandId } from "game/island/IIsland";
23
23
  import type Island from "game/island/Island";
24
- import type { IContainer } from "game/item/IItem";
25
24
  import { ItemType } from "game/item/IItem";
26
25
  import type Item from "game/item/Item";
27
26
  import type { Prompt } from "game/meta/prompt/IPrompt";
@@ -115,25 +114,6 @@ export interface IPlayerEvents extends Events<Human> {
115
114
  * Called when the player attempts to sail off the edge of the map
116
115
  */
117
116
  sailOffMapEdge(direction: Direction): any;
118
- /**
119
- * Called when an item is added to the player's inventory
120
- * @param item The item object
121
- * @param container The container object the item was added to. This container might be inventory or a container within the inventory.
122
- */
123
- inventoryItemAdd(item: Item, container: IContainer): any;
124
- /**
125
- * Called when an item is removed from the players inventory
126
- * @param item The item object
127
- * @param container The container object the item was moved to.
128
- */
129
- inventoryItemRemove(item: Item, container: IContainer): any;
130
- /**
131
- * Called when an item is moved from one container to another, while still in the players inventory.
132
- * @param item The item object
133
- * @param container The container object the item was moved to. This container might be inventory or a container within the inventory.
134
- * @param previousContainer The container object the item was moved from. This container might be inventory or a container within the inventory.
135
- */
136
- inventoryItemUpdate(item: Item, container: IContainer, previousContainer?: IContainer): any;
137
117
  /**
138
118
  * Called when the player equips an item to a slot
139
119
  * @param player The player object
@@ -206,10 +206,6 @@ export default class Player extends Human implements IUnserializedCallback {
206
206
  * 2. If a mod is using the `GetPlayerStrength` hook and the calculation needs to be refreshed.
207
207
  */
208
208
  updateStrength(): void;
209
- /**
210
- * Returns the bartering bonus for a given credit value
211
- */
212
- getBarteringBonus(baseCredits: number): number;
213
209
  /**
214
210
  * Check if a position is marked as explored
215
211
  * Only use this clientside
@@ -13,13 +13,13 @@ import type { InfoProviderContext } from "game/inspection/InfoProviderContext";
13
13
  import LabelledValue from "game/inspection/infoProviders/LabelledValue";
14
14
  import Inspection from "game/inspection/Inspection";
15
15
  import Island from "game/island/Island";
16
- import Vector2 from "utilities/math/Vector2";
17
- export default class IslandInspection extends Inspection<Vector2> {
16
+ import type { IVector2 } from "utilities/math/IVector";
17
+ export default class IslandInspection extends Inspection<IVector2> {
18
18
  private readonly title;
19
19
  static getIslandName(island?: Island, useGenerated?: boolean): import("../../../language/impl/TranslationImpl").default;
20
20
  static handles(type: InspectType, island: unknown): boolean;
21
21
  get island(): Island | undefined;
22
- constructor(island: Island | Vector2, title?: boolean);
22
+ constructor(island: Island | IVector2, title?: boolean);
23
23
  getId(): string;
24
24
  get(context: InfoProviderContext): (import("game/inspection/InfoProvider").SimpleInfoProvider | LabelledValue)[];
25
25
  private getTreasureMaps;
@@ -9,11 +9,12 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import NPC from "game/entity/npc/NPC";
12
+ import { InspectType } from "game/inspection/IInspection";
12
13
  import HumanInspection from "game/inspection/inspections/HumanInspection";
13
14
  import type { IVector3 } from "utilities/math/IVector";
14
15
  export default class NPCInspection extends HumanInspection<NPC> {
15
16
  static getFromTile(position: IVector3): never[] | NPCInspection;
16
- static handles(npc: unknown): boolean;
17
+ static handles(type: InspectType, npc: unknown): boolean;
17
18
  constructor(npc: NPC);
18
19
  getBorder(): string;
19
20
  }
@@ -17,7 +17,6 @@ import type Entity from "game/entity/Entity";
17
17
  import type Human from "game/entity/Human";
18
18
  import { DamageType, EntityType } from "game/entity/IEntity";
19
19
  import { EquipType, SkillType } from "game/entity/IHuman";
20
- import type NPC from "game/entity/npc/NPC";
21
20
  import type Player from "game/entity/player/Player";
22
21
  import { CreationId } from "game/IGame";
23
22
  import type { IObject, IObjectOptions } from "game/IObject";
@@ -202,22 +201,22 @@ export default class Item extends EventEmitter.Host<IItemEvents> implements IRef
202
201
  rerollMagicalPropertyValues(): void;
203
202
  addMagicalProperty(type: MagicalPropertyType, subType?: MagicalSubPropertySubTypes): boolean;
204
203
  getMagicalPropertyInfo(type: MagicalPropertyType): IMagicalPropertyInfo | undefined;
205
- acquireNotify(player: Player): void;
204
+ acquireNotify(human: Human): void;
206
205
  getStokeFireValue(): number | undefined;
207
206
  getStokeFireBonusValue(): number;
208
207
  getOnUseBonus(): number;
209
208
  /**
210
209
  * Gets the worth of an item used for merchant trading. Does not consider batering or modifiers bonuses; use Item.getTraderSellPrice for that.
211
- * @param player The player that is trading the item for its worth (used for durability calculations).
210
+ * @param human The human that is trading the item for its worth (used for durability calculations).
212
211
  * @param magicalWorth Include the value of `MagicalPropertyType.Worth`, defaults to true
213
212
  */
214
- getWorth(player: Player | undefined, magicalWorth?: boolean): number;
213
+ getWorth(human: Human | undefined, magicalWorth?: boolean): number;
215
214
  /**
216
- * The full price the item will go for when traded to a merchant NPC. Considers modifiers and a player's bartering skill.
217
- * @param player The player that is trading the item.
215
+ * The full price the item will go for when traded to a merchant NPC. Considers modifiers and a human's bartering skill.
216
+ * @param human The human that is trading the item.
218
217
  * @param magicalWorth Include the value of `MagicalPropertyType.Worth`, defaults to true
219
218
  */
220
- getTraderSellPrice(player: Player | undefined, magicalWorth?: boolean): number;
219
+ getTraderSellPrice(human: Human | undefined, magicalWorth?: boolean): number;
221
220
  canBurnPlayer(): boolean;
222
221
  getBaseDefense(): number;
223
222
  getDurabilityCharge(): number;
@@ -259,12 +258,12 @@ export default class Item extends EventEmitter.Host<IItemEvents> implements IRef
259
258
  * @returns A number (possibly 0 if no quality or action level).
260
259
  */
261
260
  getItemUseBonus(action: ActionType): number;
262
- getRangedWeapon(player: Player | NPC): Item | boolean;
261
+ getRangedWeapon(human: Human): Item | boolean;
263
262
  /**
264
263
  * Extinguishes to item if it is lit.
265
- * @param player Player or NPC entity that is carrying the item to extinguish.
264
+ * @param human Human entity that is carrying the item to extinguish.
266
265
  */
267
- extinguish(player: Player | NPC | undefined): void;
266
+ extinguish(human: Human | undefined): void;
268
267
  /**
269
268
  * Get the maximum durability for an item based on many factors.
270
269
  * @param human Player that we checking to get the maximum item durability (as game options can affect this).
@@ -253,11 +253,11 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
253
253
  /**
254
254
  * Summons a void dweller based on item worth and chance or provides a hint message.
255
255
  * @param item Item to get the worth of.
256
- * @param player The player that is dropping the item.
256
+ * @param human The human that is dropping the item.
257
257
  * @param point The point in which we are dropping the item.
258
258
  * @returns True or false based on if we get a message or not.
259
259
  */
260
- summonVoidDweller(item: Item, player: Player | NPC, point: IVector3): boolean;
260
+ summonVoidDweller(item: Item, human: Human, point: IVector3): boolean;
261
261
  /**
262
262
  * Note: don't print items to the console because the console will hold the item indefinitely
263
263
  */
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.20220201.1",
4
+ "version": "2.11.4-beta.dev.20220204.2",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",