@wayward/types 2.13.4-beta.dev.20230704.1 → 2.13.4-beta.dev.20230705.3

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.
@@ -242,7 +242,7 @@ export declare enum PauseSource {
242
242
  Generic = 0,
243
243
  IslandLoad = 1,
244
244
  Mod = 2,
245
- PlayerMoveToIsland = 3,
245
+ HumanMoveToIsland = 3,
246
246
  SyncGameState = 4,
247
247
  WebGlContextLost = 5,
248
248
  MultiplayerConnect = 6,
@@ -24,7 +24,6 @@ import type { CanASeeBType } from "renderer/fieldOfView/IFieldOfView";
24
24
  import type { Direction } from "utilities/math/Direction";
25
25
  import type { IVector2 } from "utilities/math/IVector";
26
26
  import type Vector2 from "utilities/math/Vector2";
27
- import type { IVector4 } from "utilities/math/Vector4";
28
27
  export interface IEntityMovableEvents extends IEntityEvents {
29
28
  /**
30
29
  * Called before moving.
@@ -43,10 +42,16 @@ export interface IEntityMovableEvents extends IEntityEvents {
43
42
  export default abstract class EntityMovable<DescriptionType = unknown, TypeType extends number = number, TagType = unknown, CounterType = unknown> extends Entity<DescriptionType, TypeType, TagType, CounterType> implements IRendererOrigin {
44
43
  event: IEventEmitter<this, IEntityMovableEvents>;
45
44
  /**
46
- * Not guaranteed to be synced between the server and client for Human entities
45
+ * Note: This might not be a whole number.
47
46
  */
48
47
  fromX?: number;
48
+ /**
49
+ * Note: This might not be a whole number.
50
+ */
49
51
  fromY?: number;
52
+ /**
53
+ * Not guaranteed to be synced between the server and client for Human entities
54
+ */
50
55
  isMoving?: boolean;
51
56
  /**
52
57
  * Only used for Human entities
@@ -90,10 +95,7 @@ export default abstract class EntityMovable<DescriptionType = unknown, TypeType
90
95
  * Regular entities don't have a direction so this will be the same as getTile()
91
96
  */
92
97
  get facingTile(): Tile;
93
- canSeeObject(type: CanASeeBType, object: IVector4 & {
94
- fromX: number;
95
- fromY: number;
96
- }, fieldOfView?: FieldOfView, customRadius?: number): boolean;
98
+ canSeeObject(type: CanASeeBType, object: IRendererOrigin, fieldOfView?: FieldOfView, customRadius?: number): boolean;
97
99
  canSeeTile(type: CanASeeBType, tile: Tile, fieldOfView?: FieldOfView, customRadius?: number): boolean;
98
100
  canSeePosition(type: CanASeeBType, islandId: IslandId, x: number, y: number, z: number, fieldOfView?: FieldOfView | undefined, customRadius?: number): boolean;
99
101
  queueSoundEffectInFront(type: SfxType, delay?: number, speed?: number): void;
@@ -117,6 +119,7 @@ export default abstract class EntityMovable<DescriptionType = unknown, TypeType
117
119
  */
118
120
  animateBumpTowards(tile: Tile): void;
119
121
  protected setMoving(fromX: number, fromY: number, toZ?: number, options?: IMoveToOptions): void;
122
+ protected setFromPosition(fromX?: number, fromY?: number): void;
120
123
  animateAttack(damageType: DamageType[] | undefined): void;
121
124
  getMovementPoint(timeStamp: number): IVector2;
122
125
  /**
@@ -66,11 +66,11 @@ export default abstract class Human<TypeType extends number = number> extends En
66
66
  direction: Vector2;
67
67
  facingDirection: Direction.Cardinal;
68
68
  /**
69
- * Not guaranteed to be synced between the server and client for Human entities
69
+ * Note: This might not be a whole number.
70
70
  */
71
71
  fromX: number;
72
72
  /**
73
- * Not guaranteed to be synced between the server and client for Human entities
73
+ * Note: This might not be a whole number.
74
74
  */
75
75
  fromY: number;
76
76
  crafted: Record<number, ICrafted>;
@@ -61,7 +61,7 @@ export declare const usableActionSets: {
61
61
  16: UsableActionGenerator<[]>;
62
62
  17: UsableActionGenerator<[]>;
63
63
  18: UsableActionGenerator<[]>;
64
- 19: UsableActionGenerator<[]>;
64
+ 19: UsableActionGenerator<[moveTarget?: import("game/entity/action/usable/actions/item/UsableActionsItemMove").UsableActionsItemMoveTarget | undefined]>;
65
65
  20: UsableActionGenerator<[isDropMenu?: true | undefined]>;
66
66
  21: UsableActionGenerator<[]>;
67
67
  22: UsableActionGenerator<[]>;
@@ -9,5 +9,12 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import { UsableActionGenerator } from "game/entity/action/usable/UsableActionRegistrar";
12
- declare const UsableActionsItemMoveMenus: UsableActionGenerator<[]>;
13
- export default UsableActionsItemMoveMenus;
12
+ export declare enum UsableActionsItemMoveTarget {
13
+ None = 0,
14
+ Inventory = 1,
15
+ ActiveNonTradingContainer = 2,
16
+ TradeContainer = 3,
17
+ FacingContainer = 4
18
+ }
19
+ declare const UsableActionsItemMove: UsableActionGenerator<[moveTarget?: UsableActionsItemMoveTarget | undefined]>;
20
+ export default UsableActionsItemMove;
@@ -282,6 +282,10 @@ export interface IItemDescription extends IObjectDescription, IModdable, ITemper
282
282
  * The amount of civilization score to give when placing item in a bookcase.
283
283
  */
284
284
  civilizationContainerScore?: number;
285
+ /**
286
+ * Whether magical properties have no effect on this item.
287
+ */
288
+ magicInert?: true;
285
289
  /**
286
290
  * The item name to display instead of the item's default translation
287
291
  */
@@ -105,8 +105,10 @@ export default class MagicalPropertyManager extends EventEmitter.Host<IMagicalPr
105
105
  private cachedNormalTypes?;
106
106
  private cachedSubTypes?;
107
107
  private cachedHash?;
108
+ private inert?;
108
109
  static inherit(source: IHasMagic | MagicalPropertyManager | undefined, target: IHasMagic): void;
109
110
  constructor(properties?: Partial<Record<MagicalPropertyType, AnyMagicalProperty>>);
111
+ setInert(inert?: boolean): this;
110
112
  /**
111
113
  * @returns the number of magical properties on this object
112
114
  */
@@ -128,6 +130,15 @@ export default class MagicalPropertyManager extends EventEmitter.Host<IMagicalPr
128
130
  */
129
131
  has<T extends MagicalSubPropertyTypes>(type: T, subType: MagicalPropertyTypeSubTypeMap[T]): boolean;
130
132
  has(...identity: MagicalPropertyIdentity): boolean;
133
+ /**
134
+ * @returns a magical property on this object, if it exists
135
+ */
136
+ getInert<T extends MagicalNormalPropertyTypes>(type: T): number | undefined;
137
+ /**
138
+ * @returns a magical sub-property on this object, if it exists
139
+ */
140
+ getInert<T extends MagicalSubPropertyTypes>(type: T, subType: MagicalPropertyTypeSubTypeMap[T]): number | undefined;
141
+ getInert(...identity: MagicalPropertyIdentity): number | undefined;
131
142
  /**
132
143
  * @returns a magical property on this object, if it exists
133
144
  */
@@ -14,25 +14,82 @@ import { Stat } from "game/entity/IStats";
14
14
  import type { IItemDescription, IMagicalPropertyInfo } from "game/item/IItem";
15
15
  import type Item from "game/item/Item";
16
16
  export declare enum MagicalPropertyType {
17
+ /**
18
+ * Increases attack value (for weapons and ammo).
19
+ */
17
20
  Attack = 0,
21
+ /**
22
+ * Increases defense value for anything equippable.
23
+ */
18
24
  Defense = 1,
25
+ /**
26
+ * Increases the illumination strength of torches/candles.
27
+ */
19
28
  Illumination = 2,
29
+ /**
30
+ * Increases the amount of weight/items that can be contained.
31
+ */
20
32
  WeightCapacity = 3,
33
+ /**
34
+ * Decreases item weight to a minimum of 0.1.
35
+ */
21
36
  ItemWeight = 4,
37
+ /**
38
+ * Increases a stat when equipped.
39
+ */
22
40
  Stat = 5,
41
+ /**
42
+ * Increases a skill when equipped.
43
+ */
23
44
  Skill = 6,
45
+ /**
46
+ * Increases malignity or benignity when equipped (and past the normal cap).
47
+ */
24
48
  Reputation = 7,
25
49
  Unused = 8,
50
+ /**
51
+ * Increases the range in which a weapon can shoot a projectile or fishing pole/net can be thrown.
52
+ */
26
53
  Range = 9,
54
+ /**
55
+ * Increases the stats normally gained when consuming/using an item.
56
+ */
27
57
  UseBenefits = 10,
58
+ /**
59
+ * Increases the merchant sell value on an item.
60
+ */
28
61
  Worth = 11,
62
+ /**
63
+ * Increases a trap's damage.
64
+ */
29
65
  TrapDamage = 12,
66
+ /**
67
+ * Increases the player's max weight when equipped.
68
+ */
30
69
  MaxWeight = 13,
70
+ /**
71
+ * Reduces the weight of each item contained within by a certain percentage.
72
+ */
31
73
  ContainerWeight = 14,
74
+ /**
75
+ * Increases the preservation rate of a container of all contained items.
76
+ */
32
77
  PreservationRate = 15,
78
+ /**
79
+ * Increases an item's decay value, making it last longer.
80
+ */
33
81
  MaxDecay = 16,
82
+ /**
83
+ * Adds a chance in which an item does reduce in durability when taking damage.
84
+ */
34
85
  ItemDamage = 17,
86
+ /**
87
+ * Increases the stoking value of an item, adding more decay to a fire source.
88
+ */
35
89
  StokeValue = 18,
90
+ /**
91
+ * Increases the insulation effect of any equippable item or container.
92
+ */
36
93
  Insulation = 19,
37
94
  /**
38
95
  * Adds damage, range, and reduces stamina used when throwing items. It also removes the heavy item reduction when calculating the range.
@@ -66,6 +123,9 @@ export declare enum MagicalPropertyType {
66
123
  * Adds a property that emits skill bonus to anybody within range (3x3 square) of the doodad.
67
124
  */
68
125
  DoodadSkill = 27,
126
+ /**
127
+ * Adds a cold or fire damage type to a weapon.
128
+ */
69
129
  ElementalDamage = 28
70
130
  }
71
131
  export interface IMagicalPropertyDescription {
@@ -27,6 +27,7 @@ import { TerrainType } from "game/tile/ITerrain";
27
27
  import type TileEvent from "game/tile/TileEvent";
28
28
  import Translation from "language/Translation";
29
29
  import Message from "language/dictionary/Message";
30
+ import type { IRendererOrigin } from "renderer/context/RendererOrigin";
30
31
  import FieldOfView from "renderer/fieldOfView/FieldOfView";
31
32
  import type { IFieldOfViewOrigin } from "renderer/fieldOfView/IFieldOfView";
32
33
  import { CanASeeBType } from "renderer/fieldOfView/IFieldOfView";
@@ -283,10 +284,7 @@ export default class Tile implements IVector4, Partial<ITileContainer>, IFieldOf
283
284
  createPuddles(): void;
284
285
  addOrUpdateOverlay(overlay: IOverlayInfo): void;
285
286
  removeOverlay(overlay: IOverlayInfo): void;
286
- canSeeObject(type: CanASeeBType, object: IVector4 & {
287
- fromX: number;
288
- fromY: number;
289
- }, fieldOfView?: FieldOfView, customRadius?: number): boolean;
287
+ canSeeObject(type: CanASeeBType, object: IRendererOrigin, fieldOfView?: FieldOfView, customRadius?: number): boolean;
290
288
  canSeeTile(type: CanASeeBType, tile: Tile, fieldOfView?: FieldOfView, customRadius?: number): boolean;
291
289
  canSeePosition(type: CanASeeBType, islandId: IslandId, x: number, y: number, z: number, fieldOfView?: FieldOfView | undefined, customRadius?: number): boolean;
292
290
  messageIfVisible(callback: (manager: IMessageManager) => boolean): void;
@@ -82,29 +82,28 @@ export declare enum MultiplayerSyncCheck {
82
82
  PenaltyFieldHashCode = 42,
83
83
  PlaceOnTile = 43,
84
84
  PlayerManager = 44,
85
- PlayerPositions = 45,
86
- Players = 46,
87
- PlayerSetup = 47,
88
- Random = 48,
89
- Reputation = 49,
90
- Seed = 50,
91
- SeededGenerator = 51,
92
- SetPosition = 52,
93
- SetZ = 53,
94
- SkillGain = 54,
95
- StaminaChanges = 55,
96
- StatChange = 56,
97
- Stats = 57,
98
- StatusChange = 58,
99
- StatusEffect = 59,
100
- TemperatureManager = 60,
101
- Temporary = 61,
102
- Tick = 62,
103
- TileEvent = 63,
104
- Time = 64,
105
- UpdateDirection = 65,
106
- Weight = 66,
107
- WorldUpdateTile = 67
85
+ Players = 45,
86
+ PlayerSetup = 46,
87
+ Random = 47,
88
+ Reputation = 48,
89
+ Seed = 49,
90
+ SeededGenerator = 50,
91
+ SetPosition = 51,
92
+ SetZ = 52,
93
+ SkillGain = 53,
94
+ StaminaChanges = 54,
95
+ StatChange = 55,
96
+ Stats = 56,
97
+ StatusChange = 57,
98
+ StatusEffect = 58,
99
+ TemperatureManager = 59,
100
+ Temporary = 60,
101
+ Tick = 61,
102
+ TileEvent = 62,
103
+ Time = 63,
104
+ UpdateDirection = 64,
105
+ Weight = 65,
106
+ WorldUpdateTile = 66
108
107
  }
109
108
  export declare const maxPlayers = 32;
110
109
  export declare const packetTickRate = 16;
@@ -16,7 +16,6 @@ import type { IslandId } from "game/island/IIsland";
16
16
  import type Island from "game/island/Island";
17
17
  import FieldOfView from "renderer/fieldOfView/FieldOfView";
18
18
  import type { CanASeeBType, IFieldOfViewOrigin } from "renderer/fieldOfView/IFieldOfView";
19
- import type { IVector4 } from "utilities/math/Vector4";
20
19
  export interface IRendererOrigin extends IFieldOfViewOrigin {
21
20
  readonly fromX?: number;
22
21
  readonly fromY?: number;
@@ -24,10 +23,7 @@ export interface IRendererOrigin extends IFieldOfViewOrigin {
24
23
  readonly asEntity: Entity;
25
24
  readonly asPlayer: Player | undefined;
26
25
  readonly asHuman: Human | undefined;
27
- canSeeObject(type: CanASeeBType, object: IVector4 & {
28
- fromX: number;
29
- fromY: number;
30
- }, fieldOfView: FieldOfView | undefined): boolean;
26
+ canSeeObject(type: CanASeeBType, object: IRendererOrigin, fieldOfView: FieldOfView | undefined): boolean;
31
27
  canSeePosition(type: CanASeeBType, islandId: IslandId, x: number, y: number, z: number, fieldOfView: FieldOfView | undefined): boolean;
32
28
  getMovementProgress(timeStamp: number): number;
33
29
  }
@@ -46,9 +42,6 @@ export declare class RendererOrigin implements IRendererOrigin {
46
42
  constructor(islandId: IslandId, x: number, y: number, z: number);
47
43
  get island(): Island;
48
44
  getMovementProgress(_timeStamp: number): number;
49
- canSeeObject(type: CanASeeBType, object: IVector4 & {
50
- fromX: number;
51
- fromY: number;
52
- }, fieldOfView: FieldOfView | undefined): boolean;
45
+ canSeeObject(type: CanASeeBType, object: IRendererOrigin, fieldOfView: FieldOfView | undefined): boolean;
53
46
  canSeePosition(type: CanASeeBType, islandId: IslandId, x: number, y: number, z: number, fieldOfView: FieldOfView | undefined): boolean;
54
47
  }
@@ -89,7 +89,7 @@ export default class ActionBar extends QuadrantComponent {
89
89
  configure(number: number): void;
90
90
  protected onResize(): void;
91
91
  endConfiguration(): void;
92
- hasFilledSlot(): boolean;
92
+ hasFilledSlot(predicate?: (slot: IActionBarSlotData) => any): boolean;
93
93
  protected getContextMenuDescription(api: IBindHandlerApi): ContextMenuDescriptions;
94
94
  protected onClearActionSlot(api: IBindHandlerApi): boolean;
95
95
  protected onToggleUseWhileMoving(api: IBindHandlerApi): boolean;
@@ -60,5 +60,7 @@ export declare enum ActionSlotUpdateReason {
60
60
  Replace = 1,
61
61
  Using = 2,
62
62
  Verify = 3,
63
- Used = 4
63
+ Used = 4,
64
+ ActionsDrawer = 5,
65
+ LoadOrUpdateDirection = 6
64
66
  }
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import type Tile from "game/tile/Tile";
12
12
  import type { WorldZ } from "game/WorldZ";
13
+ import type { IRendererOrigin } from "renderer/context/RendererOrigin";
13
14
  export interface IVector2 {
14
15
  x: number;
15
16
  y: number;
@@ -26,4 +27,4 @@ export declare module IVector3 {
26
27
  export declare function objectIsOrWasInTile(tile: Tile, object: IVector3 & {
27
28
  fromX?: number;
28
29
  fromY?: number;
29
- }): boolean;
30
+ } | IRendererOrigin): boolean;
@@ -30,6 +30,12 @@ declare module Math2 {
30
30
  * Example: `roundNumber(1.24999999, 2): 1.25`
31
31
  */
32
32
  function roundNumber(num: number, places: number): number;
33
+ /**
34
+ * Returns a number floored to a certain number of decimal places.
35
+ *
36
+ * Example: `roundNumber(1.24999999, 2): 1.24`
37
+ */
38
+ function floorNumber(num: number, places: number): number;
33
39
  /**
34
40
  * Returns a number rounded to a multiple
35
41
  *
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.13.4-beta.dev.20230704.1",
4
+ "version": "2.13.4-beta.dev.20230705.3",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",