@wayward/types 2.12.0-beta.dev.20220908.1 → 2.12.0-beta.dev.20220911.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.
Files changed (50) hide show
  1. package/definitions/game/game/Game.d.ts +0 -2
  2. package/definitions/game/game/doodad/Doodad.d.ts +9 -5
  3. package/definitions/game/game/entity/Entity.d.ts +3 -0
  4. package/definitions/game/game/entity/Human.d.ts +2 -1
  5. package/definitions/game/game/entity/IHuman.d.ts +11 -1
  6. package/definitions/game/game/entity/action/ActionsRegistration.d.ts +1 -1
  7. package/definitions/game/game/entity/action/actions/Equip.d.ts +1 -1
  8. package/definitions/game/game/entity/action/actions/Upgrade.d.ts +0 -2
  9. package/definitions/game/game/entity/action/usable/UsableActionType.d.ts +1 -1
  10. package/definitions/game/game/entity/action/usable/actions/UsableActionsWorld.d.ts +1 -1
  11. package/definitions/game/game/entity/npc/NPC.d.ts +1 -5
  12. package/definitions/game/game/entity/player/IPlayer.d.ts +0 -10
  13. package/definitions/game/game/entity/player/Player.d.ts +0 -2
  14. package/definitions/game/game/inspection/infoProviders/LevelValue.d.ts +2 -1
  15. package/definitions/game/game/inspection/infoProviders/MagicalPropertyValue.d.ts +2 -1
  16. package/definitions/game/game/inspection/infoProviders/UseInfo.d.ts +4 -1
  17. package/definitions/game/game/inspection/infoProviders/item/ItemUses.d.ts +8 -0
  18. package/definitions/game/game/inspection/infoProviders/item/MagicalSourceTooltip.d.ts +2 -1
  19. package/definitions/game/game/inspection/infoProviders/item/use/ItemEquipInfo.d.ts +10 -0
  20. package/definitions/game/game/inspection/inspections/IslandInspection.d.ts +2 -1
  21. package/definitions/game/game/item/IItem.d.ts +16 -4
  22. package/definitions/game/game/item/IItemManager.d.ts +2 -1
  23. package/definitions/game/game/item/ItemManager.d.ts +6 -1
  24. package/definitions/game/game/magic/MagicalPropertyManager.d.ts +2 -4
  25. package/definitions/game/game/magic/MagicalPropertyType.d.ts +23 -8
  26. package/definitions/game/language/dictionary/UiTranslation.d.ts +675 -674
  27. package/definitions/game/mod/ModRegistry.d.ts +41 -27
  28. package/definitions/game/multiplayer/packets/HumanTargetedClientPacket.d.ts +18 -0
  29. package/definitions/game/multiplayer/packets/client/{EmitPlayerEventPacket.d.ts → EmitHumanEventPacket.d.ts} +5 -4
  30. package/definitions/game/multiplayer/packets/client/{SetPlayerZPacket.d.ts → SetHumanZPacket.d.ts} +2 -2
  31. package/definitions/game/renderer/IRenderer.d.ts +4 -3
  32. package/definitions/game/renderer/Renderer.d.ts +7 -1
  33. package/definitions/game/renderer/Renderers.d.ts +4 -0
  34. package/definitions/game/renderer/fieldOfView/FieldOfView.d.ts +1 -1
  35. package/definitions/game/steamworks/Steamworks.d.ts +0 -1
  36. package/definitions/game/ui/component/dropdown/PlayerDropdown.d.ts +1 -1
  37. package/definitions/game/ui/old/OldUi.d.ts +0 -1
  38. package/definitions/game/ui/old/screens/InGameScreen.d.ts +1 -2
  39. package/definitions/game/ui/screen/screens/game/component/Dialog.d.ts +2 -1
  40. package/definitions/game/ui/screen/screens/game/component/Item.d.ts +18 -1
  41. package/definitions/game/ui/screen/screens/game/dialog/EquipmentDialog.d.ts +1 -1
  42. package/definitions/game/ui/screen/screens/game/static/menubar/MenuBarButton.d.ts +2 -1
  43. package/definitions/game/utilities/class/Classes.d.ts +1 -0
  44. package/definitions/game/utilities/class/Inject.d.ts +7 -8
  45. package/definitions/game/utilities/enum/IEnum.d.ts +2 -1
  46. package/definitions/game/utilities/math/Bezier.d.ts +27 -0
  47. package/definitions/game/utilities/math/Math2.d.ts +14 -0
  48. package/definitions/test/core/application.d.ts +0 -4
  49. package/definitions/test/core/applicationInteractions.d.ts +6 -1
  50. package/package.json +1 -1
@@ -32,7 +32,6 @@ import type MilestoneModifier from "game/options/modifiers/milestone/MilestoneMo
32
32
  import ReferenceManager from "game/reference/ReferenceManager";
33
33
  import TimeManager from "game/time/TimeManager";
34
34
  import VotingManager from "game/VotingManager";
35
- import { RenderSource } from "renderer/IRenderer";
36
35
  import type ITextureDebugRenderer from "renderer/ITextureDebugRenderer";
37
36
  import type WebGlContext from "renderer/WebGlContext";
38
37
  import ReplayManager from "replay/ReplayManager";
@@ -136,7 +135,6 @@ export declare class Game extends EventEmitter.Host<IGameEvents> {
136
135
  */
137
136
  passTurn(human: Human, turnType?: TurnTypeFlag): void;
138
137
  tickRealtime(): void;
139
- updateView(source: RenderSource, updateFov?: boolean, computeSpritesNow?: boolean): void;
140
138
  updateTablesAndWeight(): void;
141
139
  /**
142
140
  * Gets the largest damage type weaknesses of a human or creature based on a type and damage value
@@ -66,6 +66,8 @@ export interface IDoodadEvents {
66
66
  * Emitted when the doodad's type changes.
67
67
  */
68
68
  transformed(newType: DoodadType, oldType: DoodadType): any;
69
+ durabilityChange(durability: number, oldDurability: number): any;
70
+ durabilityMaxChange(durability: number, oldDurability: number): any;
69
71
  }
70
72
  export default class Doodad extends EventEmitter.Host<IDoodadEvents> implements IReferenceable, IUnserializedCallback, IObject<DoodadType>, IDoodadOptions, IVector3, Partial<IContainer>, ITemperatureSource, IHasInsulation, IHasBuilder, IHasMagic {
71
73
  static is(value: any): value is Doodad;
@@ -85,8 +87,8 @@ export default class Doodad extends EventEmitter.Host<IDoodadEvents> implements
85
87
  id: number;
86
88
  referenceId?: number;
87
89
  itemOrders?: number[];
88
- durabilityMax: number;
89
- durability: number;
90
+ maxDur: number;
91
+ minDur: number;
90
92
  orientation?: DoorOrientation | Direction.Cardinal;
91
93
  crafterIdentifier?: string;
92
94
  builderIdentifier?: string;
@@ -109,7 +111,6 @@ export default class Doodad extends EventEmitter.Host<IDoodadEvents> implements
109
111
  private _tile;
110
112
  private _tileId;
111
113
  private readonly _doodadGroupCache;
112
- private _minDur;
113
114
  constructor(type?: DoodadType, islandId?: `${number},${number}`, x?: number, y?: number, z?: number, options?: IDoodadOptions);
114
115
  get island(): import("../island/Island").default;
115
116
  toString(): string;
@@ -178,7 +179,7 @@ export default class Doodad extends EventEmitter.Host<IDoodadEvents> implements
178
179
  getBuilder(): Player | undefined;
179
180
  unhitch(): void;
180
181
  damage(forceBreak?: boolean, skipDropAsItem?: boolean, skipSound?: boolean, skipResources?: boolean): void;
181
- getDefaultDurability(): number;
182
+ getDefaultDurability(random?: import("../../utilities/random/Random").Random<import("../../utilities/random/Random").SeededGenerator>): number;
182
183
  addTreasureChestLoot(): void;
183
184
  attachStillContainer(item: Item): void;
184
185
  detachStillContainer(human?: Human): Item | undefined;
@@ -237,7 +238,10 @@ export default class Doodad extends EventEmitter.Host<IDoodadEvents> implements
237
238
  */
238
239
  revert(): boolean;
239
240
  onUnserialized(): void;
240
- private setupDurabilityHandlers;
241
+ get durability(): number;
242
+ set durability(value: number);
243
+ get durabilityMax(): number;
244
+ set durabilityMax(value: number);
241
245
  private processSpecials;
242
246
  /**
243
247
  * Check for items on top of lit/fire doodads, set them on fire
@@ -133,6 +133,9 @@ export default abstract class Entity extends EventEmitter.Host<IEntityEvents> im
133
133
  protected setMoving(delay: Delay, fromX: number, fromY: number, toZ?: number): void;
134
134
  animateAttack(damageType: DamageType[] | undefined): void;
135
135
  getMovementPoint(timeStamp: number): IVector2;
136
+ /**
137
+ * Gets movement progress and moves the state machine forward when the movement is completed
138
+ */
136
139
  getMovementProgress(timeStamp: number): number;
137
140
  protected onMovementCompleted(): void;
138
141
  getMoveType(): MoveType;
@@ -202,7 +202,7 @@ export default abstract class Human extends Entity implements IHasInsulation {
202
202
  /**
203
203
  * @param effects If true, adds a delay to the player, clears any particles, and updates the view. (Default: true)
204
204
  */
205
- setZ(z: number, effects?: boolean, updateFlowField?: boolean): void;
205
+ setZ(z: number, allowCancelation?: boolean, effects?: boolean, updateFlowField?: boolean): boolean;
206
206
  getMovementIntent(): IMovementIntent;
207
207
  updateMovementIntent(movementIntent: IMovementIntent): boolean;
208
208
  hasWalkPath(): boolean;
@@ -307,6 +307,7 @@ export default abstract class Human extends Entity implements IHasInsulation {
307
307
  */
308
308
  protected statGain(stat: Stat, bypass: boolean): void;
309
309
  protected calculateStats(): void;
310
+ kill(): void;
310
311
  protected resetDefense(skipStatChangedEvent?: boolean): void;
311
312
  protected swimAndSootheCheck(): void;
312
313
  /**
@@ -168,6 +168,10 @@ export interface IHumanEvents extends Events<Entity>, ISkillEvents {
168
168
  * Called when the player completes a movement
169
169
  */
170
170
  moveComplete(): any;
171
+ /**
172
+ * Called when no input is received
173
+ */
174
+ noInput(): any;
171
175
  /**
172
176
  * Called when a book is opened by a player
173
177
  * @param book The book that was opened
@@ -239,6 +243,12 @@ export interface IHumanEvents extends Events<Entity>, ISkillEvents {
239
243
  * @param options Load island options
240
244
  */
241
245
  loadedOnIsland(island: Island, options?: Partial<ILoadOnIslandOptions>): any;
246
+ /**
247
+ * Called when the human will be killed. If any handlers return `false` to stop the human from dying,
248
+ * no further handlers will be called.
249
+ * @return `false` to stop the human from dying
250
+ */
251
+ shouldDie(): false | void;
242
252
  }
243
253
  export interface IHairstyleDescription extends IModdable, IHasImagePath {
244
254
  name: string;
@@ -271,7 +281,7 @@ export declare enum EquipType {
271
281
  Legs = 2,
272
282
  Chest = 3,
273
283
  Head = 4,
274
- Belt = 5,
284
+ Waist = 5,
275
285
  Feet = 6,
276
286
  Neck = 7,
277
287
  Hands = 8,
@@ -40,7 +40,7 @@ export declare const actionDescriptionsSlow: {
40
40
  7: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../Human").default, void, import("./actions/ConsumeItem").IConsumeItemCanUse, [import("../../item/Item").default]>;
41
41
  83: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby, [import("game/entity/action/IAction").ActionArgument.ItemNearby, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, void, import("game/entity/action/actions/Enchant").IEnchantCanUse, [import("../../item/Item").default, (import("../../item/Item").default | undefined)?]>;
42
42
  93: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory, [import("game/entity/action/IAction").ActionArgument.ItemInventory, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, void, import("game/entity/action/actions/Enhance").IEnhanceCanUse, [import("../../item/Item").default, (import("../../item/Item").default | undefined)?]>;
43
- 63: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby, import("game/entity/action/IAction").ActionArgument.EquipType, [import("game/entity/action/IAction").ActionArgument.Boolean, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, boolean, import("game/entity/action/IAction").IActionUsable, [import("../../item/Item").default, import("../IHuman").EquipType, (boolean | undefined)?]>;
43
+ 63: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby, import("game/entity/action/IAction").ActionArgument.EquipType], import("../Human").default, boolean, import("game/entity/action/IAction").IActionUsable, [import("../../item/Item").default, import("../IHuman").EquipType]>;
44
44
  38: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory], import("../Human").default, void, import("game/entity/action/IAction").IActionUsable, [import("../../item/Item").default]>;
45
45
  110: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory, [import("game/entity/action/IAction").ActionArgument.ItemInventory, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, void, import("game/entity/action/actions/Exude").IExudeCanUse, [import("../../item/Item").default, (import("../../item/Item").default | undefined)?]>;
46
46
  36: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory], import("../Human").default, void, import("game/entity/action/IAction").IActionUsable, [import("../../item/Item").default]>;
@@ -11,5 +11,5 @@
11
11
  import { Action } from "game/entity/action/Action";
12
12
  import { ActionArgument } from "game/entity/action/IAction";
13
13
  import { EquipType } from "game/entity/IHuman";
14
- declare const _default: Action<[ActionArgument.ItemNearby, ActionArgument.EquipType, [ActionArgument.Boolean, ActionArgument.Undefined]], import("../../Human").default, boolean, import("game/entity/action/IAction").IActionUsable, [import("../../../item/Item").default, EquipType, (boolean | undefined)?]>;
14
+ declare const _default: Action<[ActionArgument.ItemNearby, ActionArgument.EquipType], import("../../Human").default, boolean, import("game/entity/action/IAction").IActionUsable, [import("../../../item/Item").default, EquipType]>;
15
15
  export default _default;
@@ -13,7 +13,6 @@ import type { IActionUsable } from "game/entity/action/IAction";
13
13
  import { ActionArgument } from "game/entity/action/IAction";
14
14
  import type { IMagicalPropertyInfo } from "game/item/IItem";
15
15
  import type Item from "game/item/Item";
16
- import type { MagicalSubPropertySubTypes } from "game/magic/MagicalPropertyManager";
17
16
  import type { MagicalPropertyType } from "game/magic/MagicalPropertyType";
18
17
  export interface IUpgradeCanUse extends IActionUsable {
19
18
  upgrade: IUpgradeable;
@@ -24,6 +23,5 @@ export default _default;
24
23
  export interface IUpgradeable extends IMagicalPropertyInfo {
25
24
  target: Item;
26
25
  type: MagicalPropertyType;
27
- subType?: MagicalSubPropertySubTypes;
28
26
  currentValue: number;
29
27
  }
@@ -59,7 +59,7 @@ export declare enum UsableActionType {
59
59
  EquipLegs = 100038,
60
60
  EquipChest = 100039,
61
61
  EquipHead = 100040,
62
- EquipBelt = 100041,
62
+ EquipWaist = 100041,
63
63
  EquipFeet = 100042,
64
64
  EquipNeck = 100043,
65
65
  EquipHands = 100044,
@@ -17,7 +17,7 @@ export declare enum WorldContextMenuClasses {
17
17
  OptionText = "world-context-menu-option-text"
18
18
  }
19
19
  export declare namespace WorldContextMenuClasses {
20
- const OptionSpecific: (enumValue: UsableActionType) => "world-context-menu-option-actions" | "world-context-menu-option-use" | "world-context-menu-option-move" | "world-context-menu-option-digwithhands" | "world-context-menu-option-dropall" | "world-context-menu-option-dropallofsamequality" | "world-context-menu-option-gatherwithhands" | "world-context-menu-option-harvestwithhands" | "world-context-menu-option-movetoinventory" | "world-context-menu-option-pickupexcrementwithhands" | "world-context-menu-option-tillwithhands" | "world-context-menu-option-quickslotremove" | "world-context-menu-option-quickslotadd" | "world-context-menu-option-quickslotaddtofree" | "world-context-menu-option-quickslotaddtoslot" | "world-context-menu-option-dropmenu" | "world-context-menu-option-repairwithitem" | "world-context-menu-option-reinforcewithitem" | "world-context-menu-option-enhancewithitem" | "world-context-menu-option-enchantwithitem" | "world-context-menu-option-transmogrifywithitem" | "world-context-menu-option-upgradewithitem" | "world-context-menu-option-alterwithitem" | "world-context-menu-option-refinewithitem" | "world-context-menu-option-preservewithitem" | "world-context-menu-option-addfuelwithitem" | "world-context-menu-option-ignitewithitem" | "world-context-menu-option-absorbwithitem" | "world-context-menu-option-exudewithitem" | "world-context-menu-option-movetoinventorymenu" | "world-context-menu-option-movetoactivecontainermenu" | "world-context-menu-option-movetofacingcontainermenu" | "world-context-menu-option-moveall" | "world-context-menu-option-moveallofsamequality" | "world-context-menu-option-tradetradersell" | "world-context-menu-option-tradetraderbuy" | "world-context-menu-option-itemactions" | "world-context-menu-option-equipheld" | "world-context-menu-option-equiplegs" | "world-context-menu-option-equipchest" | "world-context-menu-option-equiphead" | "world-context-menu-option-equipbelt" | "world-context-menu-option-equipfeet" | "world-context-menu-option-equipneck" | "world-context-menu-option-equiphands" | "world-context-menu-option-equipback" | "world-context-menu-option-equipmainhand" | "world-context-menu-option-equipoffhand";
20
+ const OptionSpecific: (enumValue: UsableActionType) => "world-context-menu-option-actions" | "world-context-menu-option-use" | "world-context-menu-option-move" | "world-context-menu-option-digwithhands" | "world-context-menu-option-dropall" | "world-context-menu-option-dropallofsamequality" | "world-context-menu-option-gatherwithhands" | "world-context-menu-option-harvestwithhands" | "world-context-menu-option-movetoinventory" | "world-context-menu-option-pickupexcrementwithhands" | "world-context-menu-option-tillwithhands" | "world-context-menu-option-quickslotremove" | "world-context-menu-option-quickslotadd" | "world-context-menu-option-quickslotaddtofree" | "world-context-menu-option-quickslotaddtoslot" | "world-context-menu-option-dropmenu" | "world-context-menu-option-repairwithitem" | "world-context-menu-option-reinforcewithitem" | "world-context-menu-option-enhancewithitem" | "world-context-menu-option-enchantwithitem" | "world-context-menu-option-transmogrifywithitem" | "world-context-menu-option-upgradewithitem" | "world-context-menu-option-alterwithitem" | "world-context-menu-option-refinewithitem" | "world-context-menu-option-preservewithitem" | "world-context-menu-option-addfuelwithitem" | "world-context-menu-option-ignitewithitem" | "world-context-menu-option-absorbwithitem" | "world-context-menu-option-exudewithitem" | "world-context-menu-option-movetoinventorymenu" | "world-context-menu-option-movetoactivecontainermenu" | "world-context-menu-option-movetofacingcontainermenu" | "world-context-menu-option-moveall" | "world-context-menu-option-moveallofsamequality" | "world-context-menu-option-tradetradersell" | "world-context-menu-option-tradetraderbuy" | "world-context-menu-option-itemactions" | "world-context-menu-option-equipheld" | "world-context-menu-option-equiplegs" | "world-context-menu-option-equipchest" | "world-context-menu-option-equiphead" | "world-context-menu-option-equipwaist" | "world-context-menu-option-equipfeet" | "world-context-menu-option-equipneck" | "world-context-menu-option-equiphands" | "world-context-menu-option-equipback" | "world-context-menu-option-equipmainhand" | "world-context-menu-option-equipoffhand";
21
21
  }
22
22
  export declare const UsableActionsWorldActions: UsableActionGenerator<[]>;
23
23
  export declare const UsableActionsWorldItemActions: UsableActionGenerator<[]>;
@@ -37,11 +37,6 @@ export interface INPCEvents extends Events<Human> {
37
37
  * @returns True if the npc can move, false if the npc cannot move, or undefined to use the default logic
38
38
  */
39
39
  canNPCMove(tile: ITile, x: number, y: number, z: number, moveType: MoveType): boolean | undefined;
40
- /**
41
- * Called when an npc is killed
42
- * @returns False to stop the npc from dying or undefined to use the default logic
43
- */
44
- die?(): boolean | undefined;
45
40
  }
46
41
  export default abstract class NPC extends Human {
47
42
  protected static registrarId: number;
@@ -132,6 +127,7 @@ export default abstract class NPC extends Human {
132
127
  protected attack(): boolean;
133
128
  protected move(): boolean;
134
129
  protected autoScaleStats(): void;
130
+ protected changeZ(toZ: number, fromZ: number): boolean | void | undefined;
135
131
  protected preMove(fromX: number, fromY: number, fromZ: number, fromTile: ITile, toX: number, toY: number, toZ: number, toTile: ITile, isMoving: boolean): boolean | void | undefined;
136
132
  protected postMove(): void;
137
133
  protected checkMove(moveType: MoveType, tileX: number, tileY: number, tileZ: number): 0 | -1 | -2 | -3 | -4 | -5;
@@ -43,12 +43,6 @@ export interface IPlayerEvents extends Events<Human> {
43
43
  * @param choice The selected choice
44
44
  */
45
45
  promptResponse(interrupt: Prompt, choice: boolean | InterruptChoice): any;
46
- /**
47
- * Called when the player will be killed. If any handlers return `false` to stop the player from dying,
48
- * no further handlers will be called.
49
- * @return `false` to stop the player from dying
50
- */
51
- shouldDie(): false | void;
52
46
  /**
53
47
  * Called when the player is killed.
54
48
  * @param showingGameEndScreen True if the game end screen will be shown
@@ -74,10 +68,6 @@ export interface IPlayerEvents extends Events<Human> {
74
68
  * @param itemType The item type
75
69
  */
76
70
  updatedQuickslotInfo?(quickslot: number, itemType?: ItemType): any;
77
- /**
78
- * Called when no input is received
79
- */
80
- noInput(): any;
81
71
  /**
82
72
  * Called when the player will write a note.
83
73
  * @param note The note that will be written.
@@ -67,7 +67,6 @@ export default class Player extends Human implements IUnserializedCallback {
67
67
  setup(spawnPoint: IVector3): void;
68
68
  onNoInput(): void;
69
69
  updateTables(source: string, options?: Partial<{
70
- allowDeferingUpdate: boolean;
71
70
  allowCaching: boolean;
72
71
  }>): void;
73
72
  private updateCraftTable;
@@ -93,7 +92,6 @@ export default class Player extends Human implements IUnserializedCallback {
93
92
  */
94
93
  isExploredClientSide(x: number, y: number, z: number): boolean;
95
94
  protected onSkillGain(skill: SkillType, mod: number): void;
96
- protected calculateStats(): void;
97
95
  private canWriteInHours;
98
96
  private canWriteNote;
99
97
  private onWriteNote;
@@ -9,7 +9,8 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import { InfoProvider } from "game/inspection/InfoProvider";
12
- import type { IHasMagic, MagicalNormalPropertyTypes, MagicalPropertyTypeSubTypeMap, MagicalSubPropertyTypes } from "game/magic/MagicalPropertyManager";
12
+ import type { IHasMagic, MagicalNormalPropertyTypes, MagicalSubPropertyTypes } from "game/magic/MagicalPropertyManager";
13
+ import type { MagicalPropertyTypeSubTypeMap } from "game/magic/MagicalPropertyType";
13
14
  import type { DictionaryEnum } from "language/DictionaryMap";
14
15
  import type { TextContext } from "language/ITranslation";
15
16
  import Translation from "language/Translation";
@@ -11,8 +11,9 @@
11
11
  import type { SkillType } from "game/entity/IHuman";
12
12
  import { InfoProvider } from "game/inspection/InfoProvider";
13
13
  import type { Quality } from "game/IObject";
14
- import type { IHasMagic, MagicalNormalPropertyTypes, MagicalPropertyTypeSubTypeMap, MagicalSubPropertyTypes } from "game/magic/MagicalPropertyManager";
14
+ import type { IHasMagic, MagicalNormalPropertyTypes, MagicalSubPropertyTypes } from "game/magic/MagicalPropertyManager";
15
15
  import { MagicalPropertyIdentity } from "game/magic/MagicalPropertyManager";
16
+ import type { MagicalPropertyTypeSubTypeMap } from "game/magic/MagicalPropertyType";
16
17
  import UiTranslation from "language/dictionary/UiTranslation";
17
18
  import Translation from "language/Translation";
18
19
  import type { TranslationGenerator } from "ui/component/IComponent";
@@ -61,12 +61,15 @@ export interface IUseInfoFactory<I extends IUseInfoBase<T, A>, T extends IDescri
61
61
  methods: M;
62
62
  }, T, A>): UseInfo<I, A, M, T>;
63
63
  }
64
+ export declare type IGetUseInfo<USE_INFO extends UseInfo<any, any, any>> = USE_INFO extends UseInfo<infer I extends IUseInfoBase<any, any>, any, any> ? I : never;
64
65
  export default class UseInfo<I extends IUseInfoBase<T, A>, A extends ActionType, M extends Record<string, AnyFunction>, T extends IDescribed = any> {
65
66
  readonly predicates: Array<UseInfoPredicate<I, T, A>>;
66
67
  readonly handle: UseInfoHandler<I & {
67
68
  methods: M;
68
69
  }, T, A>;
69
- readonly methods: M;
70
+ readonly methods: {
71
+ [KEY in keyof M]: (info: I, ...args: ArgumentsOf<M[KEY]>) => ReturnType<M[KEY]>;
72
+ };
70
73
  static of<T extends IDescribed>(): IUseInfoFactory<IUseInfoBase<T, never>, T, never>;
71
74
  displayLevel: InfoDisplayLevel | UseInfoDisplayLevelGetter<I, T, A>;
72
75
  ownRow?: true;
@@ -100,6 +100,14 @@ export default class ItemUses extends Uses<Item> {
100
100
  union: import("../UseInfo").IUseInfoBase<Item, ActionType.Equip>;
101
101
  details: Set<symbol>;
102
102
  }, ActionType.Equip, {
103
+ getMagicalEquipTypes: () => Set<import("../../../magic/MagicalPropertyType").MagicalPropertyType>;
104
+ } & {
105
+ getMagicalPropertyLabels: () => Map<import("../../../magic/MagicalPropertyType").MagicalPropertyType, import("../../../../language/dictionary/UiTranslation").default>;
106
+ } & {
107
+ isMagicalPropertyPercentage: (property: import("../../../magic/MagicalPropertyType").MagicalPropertyType) => boolean;
108
+ } & {
109
+ isMagicalPropertyPercentagePremultiplied: (property: import("../../../magic/MagicalPropertyType").MagicalPropertyType) => boolean;
110
+ } & {
103
111
  getAttack: () => import("../MagicalPropertyValue").default | undefined;
104
112
  } & {
105
113
  getDefense: () => (import("../../../../language/impl/TranslationImpl").default | import("../MagicalPropertyValue").default)[];
@@ -8,7 +8,8 @@
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 { MagicalNormalPropertyTypes, MagicalPropertyIdentity, MagicalPropertyTypeSubTypeMap, MagicalSubPropertyTypes } from "game/magic/MagicalPropertyManager";
11
+ import type { MagicalNormalPropertyTypes, MagicalPropertyIdentity, MagicalSubPropertyTypes } from "game/magic/MagicalPropertyManager";
12
+ import type { MagicalPropertyTypeSubTypeMap } from "game/magic/MagicalPropertyType";
12
13
  import Translation from "language/Translation";
13
14
  declare function MagicalSourceTooltip(type: MagicalNormalPropertyTypes): Translation;
14
15
  declare function MagicalSourceTooltip<T extends MagicalSubPropertyTypes>(type: T, subType: MagicalPropertyTypeSubTypeMap[T]): Translation;
@@ -14,7 +14,9 @@ import MagicalPropertyValue from "game/inspection/infoProviders/MagicalPropertyV
14
14
  import UseInfo from "game/inspection/infoProviders/UseInfo";
15
15
  import type Item from "game/item/Item";
16
16
  import { MagicalPropertyEntry } from "game/magic/MagicalPropertyManager";
17
+ import { MagicalPropertyType } from "game/magic/MagicalPropertyType";
17
18
  import { TempType } from "game/temperature/ITemperature";
19
+ import UiTranslation from "language/dictionary/UiTranslation";
18
20
  declare const _default: UseInfo<{
19
21
  equip: import("../../../../entity/IHuman").EquipType;
20
22
  objectType: import("../../../../IGame").CreationId.Item;
@@ -26,6 +28,14 @@ declare const _default: UseInfo<{
26
28
  union: import("game/inspection/infoProviders/UseInfo").IUseInfoBase<Item, ActionType.Equip>;
27
29
  details: Set<symbol>;
28
30
  }, ActionType.Equip, {
31
+ getMagicalEquipTypes: () => Set<MagicalPropertyType>;
32
+ } & {
33
+ getMagicalPropertyLabels: () => Map<MagicalPropertyType, UiTranslation>;
34
+ } & {
35
+ isMagicalPropertyPercentage: (property: MagicalPropertyType) => boolean;
36
+ } & {
37
+ isMagicalPropertyPercentagePremultiplied: (property: MagicalPropertyType) => boolean;
38
+ } & {
29
39
  getAttack: () => MagicalPropertyValue | undefined;
30
40
  } & {
31
41
  getDefense: () => (import("../../../../../language/impl/TranslationImpl").default | MagicalPropertyValue)[];
@@ -26,6 +26,7 @@ export default class IslandInspection extends Inspection<IVector2> {
26
26
  private getTreasureMaps;
27
27
  private getModifiers;
28
28
  private getBiome;
29
- private getAllies;
29
+ private getPlayers;
30
+ private getPlayerLikeNPCs;
30
31
  private getYouAreHereLabel;
31
32
  }
@@ -22,6 +22,7 @@ import type { IslandId } from "game/island/IIsland";
22
22
  import type Item from "game/item/Item";
23
23
  import type Recipe from "game/item/recipe/Recipe";
24
24
  import type MagicalPropertyManager from "game/magic/MagicalPropertyManager";
25
+ import type { MagicalSubPropertySubTypes } from "game/magic/MagicalPropertyManager";
25
26
  import type { MagicalPropertyType } from "game/magic/MagicalPropertyType";
26
27
  import type { IInsulationDescription, ITemperatureDescription } from "game/temperature/ITemperature";
27
28
  import type { TerrainType } from "game/tile/ITerrain";
@@ -432,11 +433,22 @@ export interface IRanged {
432
433
  skillType?: SkillType;
433
434
  }
434
435
  export interface IMagicalPropertyInfo {
436
+ /**
437
+ * The maximum value this magical property can be on this item.
438
+ */
435
439
  max: number;
436
- float?: true;
440
+ /**
441
+ * Does nothing for integer magical properties. For decimal magical properties, rounds it to the nearest `.1` for calculations and display.
442
+ */
443
+ roundToNearestTenthPlace?: true;
444
+ /**
445
+ * Generates a random starting value for this magical property.
446
+ */
437
447
  value(): number;
438
- stat?(): Stat;
439
- skill?(): SkillType;
448
+ /**
449
+ * Generates the random sub-property to use for this magical property, if this magical property is a magical property with subtypes.
450
+ */
451
+ subType?: MagicalSubPropertySubTypes | (() => MagicalSubPropertySubTypes);
440
452
  }
441
453
  export interface IItemUsed {
442
454
  usedBy?: string[];
@@ -1411,7 +1423,7 @@ export declare enum ItemTypeGroup {
1411
1423
  EquippableNeck = 905,
1412
1424
  EquippableChest = 906,
1413
1425
  EquippableHands = 907,
1414
- EquippableBelt = 908,
1426
+ EquippableWaist = 908,
1415
1427
  EquippableLegs = 909,
1416
1428
  EquippableFeet = 910,
1417
1429
  EquippableBack = 911,
@@ -112,7 +112,8 @@ export declare enum ContainerReferenceSource {
112
112
  ResolveContainer = 9,
113
113
  ScheduleContainerInvalidation = 10,
114
114
  Serializer = 11,
115
- WriteContainer = 12
115
+ WriteContainer = 12,
116
+ GetContainerName = 13
116
117
  }
117
118
  export interface ICraftResultChances {
118
119
  success: number;
@@ -146,6 +146,11 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
146
146
  moveAllFromContainerToContainer(human: Human | undefined, fromContainer: IContainer, toContainer: IContainer, itemType?: ItemType | undefined, ofQuality?: Quality | undefined, checkWeight?: boolean, filterText?: string | undefined, onMoveItem?: (item: Item) => void): Item[];
147
147
  moveToContainer(human: Human | undefined, item: Item, container: IContainer): boolean;
148
148
  hasRoomInContainer(targetContainer: IContainer, itemToMove: Item): boolean;
149
+ /**
150
+ * Gets the name of a container
151
+ * @returns Name of the container or undefined if it's ending up on the ground
152
+ */
153
+ getContainerName(container: IContainer): Translation | undefined;
149
154
  breakContainerOnTile(itemContainer: Item, x: number, y: number, z: number): void;
150
155
  /**
151
156
  * Drop items in a 3x3 square around the location
@@ -308,7 +313,7 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
308
313
  /**
309
314
  * Note: don't print items to the console because the console will hold the item indefinitely
310
315
  */
311
- loadReference(container: IContainer, loadChildReferences?: boolean): boolean;
316
+ loadReference(container: IContainer, loadChildReferences?: boolean, parentContainer?: IContainer): boolean;
312
317
  private removeFromContainerInternal;
313
318
  private onItemMoveOrRemove;
314
319
  private getCraftTierBonus;
@@ -9,7 +9,8 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import EventEmitter from "event/EventEmitter";
12
- import { MagicalPropertyType, magicalPropertyTypeSubTypeMap } from "game/magic/MagicalPropertyType";
12
+ import type { MagicalPropertyTypeSubTypeMap } from "game/magic/MagicalPropertyType";
13
+ import { MagicalPropertyType } from "game/magic/MagicalPropertyType";
13
14
  import type { ListEnder } from "language/ITranslation";
14
15
  import Translation from "language/Translation";
15
16
  export interface IHasMagic {
@@ -29,9 +30,6 @@ export interface IMagicalSubProperty<T extends number> {
29
30
  value: number;
30
31
  }>;
31
32
  }
32
- export declare type MagicalPropertyTypeSubTypeMap = {
33
- [K in keyof typeof magicalPropertyTypeSubTypeMap]: Value<(typeof magicalPropertyTypeSubTypeMap)[K]>;
34
- };
35
33
  export declare type MagicalProperty<T extends MagicalPropertyType> = MagicalPropertyTypeSubTypeMap extends {
36
34
  [key in T]: any;
37
35
  } ? IMagicalSubProperty<MagicalPropertyTypeSubTypeMap[T]> : IMagicalProperty;
@@ -10,6 +10,8 @@
10
10
  */
11
11
  import { SkillType } from "game/entity/IHuman";
12
12
  import { Stat } from "game/entity/IStats";
13
+ import type { IItemDescription, IMagicalPropertyInfo } from "game/item/IItem";
14
+ import type Item from "game/item/Item";
13
15
  export declare enum MagicalPropertyType {
14
16
  Attack = 0,
15
17
  Defense = 1,
@@ -56,11 +58,24 @@ export declare enum MagicalPropertyType {
56
58
  */
57
59
  GrowingSpeed = 25
58
60
  }
59
- /**
60
- * A map of magical property types that contain sub-properties to the corresponding sub property enum
61
- */
62
- export declare const magicalPropertyTypeSubTypeMap: {
63
- 6: typeof SkillType;
64
- 5: typeof Stat;
65
- 7: typeof Stat;
66
- };
61
+ export interface IMagicalPropertyDescription {
62
+ /**
63
+ * Whether this magical property is applicable for the given item.
64
+ */
65
+ isApplicable(item: Item, description: IItemDescription): boolean;
66
+ /**
67
+ * Generates the magical property value when added.
68
+ */
69
+ getInfo(item: Item, description: IItemDescription): IMagicalPropertyInfo | undefined;
70
+ /**
71
+ * By default, all magical property types can be inscribed. This allows disabling that feature for this magical property type.
72
+ */
73
+ disableInscription?: true;
74
+ subTypeEnum?: any;
75
+ }
76
+ export interface MagicalPropertyTypeSubTypeMap {
77
+ [MagicalPropertyType.Stat]: Stat;
78
+ [MagicalPropertyType.Skill]: SkillType;
79
+ [MagicalPropertyType.Reputation]: Stat;
80
+ }
81
+ export declare const magicalPropertyDescriptions: PartialRecord<MagicalPropertyType, IMagicalPropertyDescription>;