@wayward/types 2.13.2-beta.dev.20230525.1 → 2.13.2-beta.dev.20230527.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.
@@ -46,6 +46,7 @@ export default abstract class Entity<DescriptionType = unknown, TypeType extends
46
46
  x: number;
47
47
  y: number;
48
48
  z: number;
49
+ private _data?;
49
50
  private _tags?;
50
51
  islandId: IslandId;
51
52
  preventRendering?: boolean;
@@ -111,6 +112,31 @@ export default abstract class Entity<DescriptionType = unknown, TypeType extends
111
112
  hasTag(tag: TagType): boolean;
112
113
  addTag(tag: TagType): void;
113
114
  removeTag(tag: TagType): void;
115
+ /**
116
+ * Check if a data was set
117
+ * @param key Data key
118
+ * @returns True if the data exists, false if it doesn't
119
+ */
120
+ hasData(key: string): boolean;
121
+ /**
122
+ * Sets a data
123
+ * @param key Data key
124
+ * @param value Data value
125
+ * @rturns The value
126
+ */
127
+ setData<T>(key: string, value: T): T;
128
+ /**
129
+ * Gets a data
130
+ * @param key Data key
131
+ * @returns Data value or undefined if it wasn't found
132
+ */
133
+ getData<T>(key: string): T | undefined;
134
+ /**
135
+ * Removes a data
136
+ * @param key Data key
137
+ * @returns True when the data is removed. False if the key wasn't set
138
+ */
139
+ removeData(key: string): boolean;
114
140
  abstract isValid(): boolean;
115
141
  get asEntity(): Entity<DescriptionType, TypeType, TagType>;
116
142
  get asEntityMovable(): EntityMovable<DescriptionType, TypeType, TagType> | undefined;
@@ -92,9 +92,6 @@ export interface ICausesStatusEffect {
92
92
  export interface ICausesDamage {
93
93
  damage?: number;
94
94
  }
95
- export declare enum Property {
96
- }
97
- export type IProperties = Map<Property, any>;
98
95
  export declare enum EntityType {
99
96
  Player = 0,
100
97
  Creature = 1,
@@ -12,7 +12,7 @@ import type { Events, IEventEmitter } from "event/EventEmitter";
12
12
  import type { IActionHandlerApi, IActionNotUsable, IActionUsable } from "game/entity/action/IAction";
13
13
  import { ActionType } from "game/entity/action/IAction";
14
14
  import Human from "game/entity/Human";
15
- import type { IEntityConstructorOptions, IProperties, Property } from "game/entity/IEntity";
15
+ import type { IEntityConstructorOptions } from "game/entity/IEntity";
16
16
  import { AiType, EntityType, MoveType, StatusType } from "game/entity/IEntity";
17
17
  import type { ICustomizations } from "game/entity/IHuman";
18
18
  import { EquipType } from "game/entity/IHuman";
@@ -52,7 +52,6 @@ export default abstract class NPC extends Human<NPCType> {
52
52
  ai: AiType;
53
53
  seen: number;
54
54
  weightCapacity: number;
55
- properties?: IProperties;
56
55
  talked?: Map<string, number>;
57
56
  interactions?: Map<string, Set<number>>;
58
57
  static getRegistrarId(): number;
@@ -179,13 +178,6 @@ export default abstract class NPC extends Human<NPCType> {
179
178
  get asNPC(): NPC;
180
179
  get asPlayer(): undefined;
181
180
  get asLocalPlayer(): undefined;
182
- /**
183
- * Properties system that is only used for merchants
184
- */
185
- hasProperty(property: Property): boolean;
186
- addProperty(property: Property, value: any): void;
187
- getProperty<T>(property: Property): T | undefined;
188
- removeProperty(property: Property): boolean;
189
181
  /**
190
182
  * Equip better things when available
191
183
  */
@@ -1567,7 +1567,7 @@ export declare enum ItemTypeGroup {
1567
1567
  Spine = 892,
1568
1568
  Spores = 893,
1569
1569
  Stick = 894,
1570
- NotForSale = 895,
1570
+ NotStockedOnMerchants = 895,
1571
1571
  ContainerOfSwampWater = 896,
1572
1572
  ContainerOfFilteredWater = 897,
1573
1573
  Sundial = 898,
@@ -154,6 +154,7 @@ export interface IGameOptions {
154
154
  */
155
155
  decayMultiplier: number;
156
156
  };
157
+ randomEvents: boolean;
157
158
  }
158
159
  export declare enum UnlockedRecipesStrategy {
159
160
  StartWithNone = 0,
@@ -258,6 +258,11 @@ export default class Tile implements IVector4, Partial<ITileContainer>, IFieldOf
258
258
  * @returns True if it created a lava passage
259
259
  */
260
260
  makeLavaPassage(source: Human | undefined): boolean;
261
+ /**
262
+ * Checks if another cave entrance is nearby.
263
+ * @returns True if it created cave entrances
264
+ */
265
+ isCaveEntranceNearby(): boolean;
261
266
  /**
262
267
  * Used to genererate and find appropriate cave entrances
263
268
  * @returns True if it created cave entrances
@@ -68,6 +68,7 @@ export default class TranslationImpl implements Omit<ISerializable, "deserialize
68
68
  withSegments(...segments: ISegment[]): this;
69
69
  withSegments(priority: true, ...segments: ISegment[]): this;
70
70
  withTooltip(tooltip?: Falsy | ITooltipSection["tooltip"]): this;
71
+ getReference(): Reference | undefined;
71
72
  setReference(reference?: Reference | Referenceable): this;
72
73
  addArgs(...args: TranslationArg[]): this;
73
74
  inContext(context?: TextContext, normalize?: boolean): this;
@@ -44,7 +44,7 @@ export default abstract class Screen extends Component {
44
44
  removeBackground(): this;
45
45
  hasContextMenu(): boolean;
46
46
  getPartialContextMenuMacros(): Macros.IBindableMatch | undefined;
47
- hasPartialContextMenuMacro(api: IBindHandlerApi, macroMatch?: Macros.IBindableMatch): boolean;
47
+ hasPartialContextMenuMacro(api?: Pick<IBindHandlerApi, "input">, macroMatch?: Macros.IBindableMatch): boolean;
48
48
  /**
49
49
  * Remove the context menu from this element
50
50
  */
@@ -35,7 +35,8 @@ export default class MovementHandler extends EventEmitter.Host<IMovementHandlerE
35
35
  protected onPlayerDamage(_: any, damageInfo: IDamageInfo): void;
36
36
  protected onPlayerDeath(): void;
37
37
  protected onFaceDown(api: IBindHandlerApi): boolean;
38
- protected onFaceDirection(api: IBindHandlerApi): boolean;
38
+ faceTowardsMouse(api?: Pick<IBindHandlerApi, "mouse">): void;
39
+ protected onFaceDirection(api?: Pick<IBindHandlerApi, "mouse" | "input">): boolean;
39
40
  protected onIdle(api: IBindHandlerApi): boolean;
40
41
  protected onMoveToTile(api: IBindHandlerApi): boolean;
41
42
  protected onMove(api: IBindHandlerApi): boolean;
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.2-beta.dev.20230525.1",
4
+ "version": "2.13.2-beta.dev.20230527.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",