@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.
- package/definitions/game/game/entity/Entity.d.ts +26 -0
- package/definitions/game/game/entity/IEntity.d.ts +0 -3
- package/definitions/game/game/entity/npc/NPC.d.ts +1 -9
- package/definitions/game/game/item/IItem.d.ts +1 -1
- package/definitions/game/game/options/IGameOptions.d.ts +1 -0
- package/definitions/game/game/tile/Tile.d.ts +5 -0
- package/definitions/game/language/impl/TranslationImpl.d.ts +1 -0
- package/definitions/game/ui/screen/Screen.d.ts +1 -1
- package/definitions/game/ui/screen/screens/game/util/movement/MovementHandler.d.ts +2 -1
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -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
|
|
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
|
*/
|
|
@@ -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
|
|
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
|
-
|
|
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