@wayward/types 2.13.0-beta.dev.20230330.1 → 2.13.0-beta.dev.20230401.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/event/EventEmitter.d.ts +6 -1
- package/definitions/game/game/doodad/Doodad.d.ts +2 -3
- package/definitions/game/game/entity/Entity.d.ts +14 -5
- package/definitions/game/game/entity/EntityMovable.d.ts +2 -2
- package/definitions/game/game/entity/EntityWithStats.d.ts +2 -2
- package/definitions/game/game/entity/Human.d.ts +4 -3
- package/definitions/game/game/entity/action/ActionExecutor.d.ts +1 -1
- package/definitions/game/game/entity/creature/Creature.d.ts +2 -3
- package/definitions/game/game/entity/creature/corpse/Corpse.d.ts +2 -3
- package/definitions/game/game/entity/player/IPlayer.d.ts +0 -17
- package/definitions/game/game/inspection/infoProviders/UseInfo.d.ts +2 -2
- package/definitions/game/game/island/IIsland.d.ts +16 -0
- package/definitions/game/game/island/Island.d.ts +2 -1
- package/definitions/game/game/item/IItem.d.ts +7 -2
- package/definitions/game/game/item/Item.d.ts +2 -3
- package/definitions/game/game/item/recipe/Crafter.d.ts +1 -1
- package/definitions/game/game/temperature/TemperatureManager.d.ts +7 -0
- package/definitions/game/game/tile/ITerrain.d.ts +2 -1
- package/definitions/game/game/tile/Tile.d.ts +12 -4
- package/definitions/game/game/tile/TileEvent.d.ts +2 -3
- package/definitions/game/game/tile/events/IFire.d.ts +4 -5
- package/definitions/game/save/data/ISaveDataGlobal.d.ts +2 -1
- package/definitions/game/ui/screen/screens/game/component/Item.d.ts +0 -2
- package/definitions/game/utilities/collection/map/PriorityMap.d.ts +1 -2
- package/package.json +1 -1
|
@@ -43,6 +43,10 @@ type UndefinedFromVoid<V> = V extends void ? undefined : V;
|
|
|
43
43
|
export interface IEventEmitter<H = any, E = any> {
|
|
44
44
|
event: IEventEmitter<this, IEventEmitterEvents<H, E>>;
|
|
45
45
|
emit<K extends keyof E>(event: K, ...args: ArgsOf<E[K]>): H;
|
|
46
|
+
/**
|
|
47
|
+
* Emit an event only to the subscribers of this emitter instance.
|
|
48
|
+
*/
|
|
49
|
+
emitSelf<K extends keyof E>(event: K, ...args: ArgsOf<E[K]>): H;
|
|
46
50
|
emitFirst<K extends keyof E>(event: K, ...args: ArgsOf<E[K]>): UndefinedFromVoid<ReturnOf<E[K]>> | undefined;
|
|
47
51
|
emitFirstDefault<K extends keyof E, D>(event: K, generateDefault: () => D, ...args: ArgsOf<E[K]>): Exclude<ReturnOf<E[K]>, null | undefined> | D;
|
|
48
52
|
emitCollect<K extends keyof E>(event: K, ...args: ArgsOf<E[K]>): Array<ReturnOf<E[K]>>;
|
|
@@ -75,6 +79,7 @@ declare class EventEmitter<H, E> implements IEventEmitter<H, E> {
|
|
|
75
79
|
get event(): IEventEmitter<this, IEventEmitterEvents<H, E>>;
|
|
76
80
|
constructor(host: H);
|
|
77
81
|
raw(): IEventEmitter<H, E>;
|
|
82
|
+
emitSelf<K extends keyof E>(event: K, ...args: ArgsOf<E[K]>): H;
|
|
78
83
|
emit<K extends keyof E>(event: K, ...args: ArgsOf<E[K]>): H;
|
|
79
84
|
emitFirst<K extends keyof E>(event: K, ...args: ArgsOf<E[K]>): any;
|
|
80
85
|
emitFirstDefault<K extends keyof E, D>(event: K, generateDefault: () => D, ...args: ArgsOf<E[K]>): any;
|
|
@@ -89,7 +94,7 @@ declare class EventEmitter<H, E> implements IEventEmitter<H, E> {
|
|
|
89
94
|
until(promise: Promise<any>): IUntilSubscriber<H, E>;
|
|
90
95
|
hasHandlersForEvent(...events: Array<keyof E>): boolean;
|
|
91
96
|
private copyFrom;
|
|
92
|
-
|
|
97
|
+
protected handlersForEvent<K extends keyof E>(event: K, ignoreClassSubscriptions?: true): (string | Handler<any, any>)[];
|
|
93
98
|
}
|
|
94
99
|
declare module EventEmitter {
|
|
95
100
|
class Host<E> implements IEventEmitterHost<E> {
|
|
@@ -72,7 +72,7 @@ export interface IDoodadEvents extends IEntityEvents {
|
|
|
72
72
|
durabilityChange(durability: number, oldDurability: number): any;
|
|
73
73
|
durabilityMaxChange(durability: number, oldDurability: number): any;
|
|
74
74
|
}
|
|
75
|
-
export default class Doodad extends Entity<DoodadType, DoodadTag> implements IUnserializedCallback, IObject<DoodadType>, IDoodadOptions, Partial<IContainer>, IHasInsulation, IHasBuilder, IHasMagic {
|
|
75
|
+
export default class Doodad extends Entity<IDoodadDescription, DoodadType, DoodadTag> implements IUnserializedCallback, IObject<DoodadType>, IDoodadOptions, Partial<IContainer>, IHasInsulation, IHasBuilder, IHasMagic {
|
|
76
76
|
static is(value: any): value is Doodad;
|
|
77
77
|
get constructorFunction(): typeof Doodad;
|
|
78
78
|
static getRegistrarId(): number;
|
|
@@ -104,7 +104,6 @@ export default class Doodad extends Entity<DoodadType, DoodadTag> implements IUn
|
|
|
104
104
|
stillContainer?: Item;
|
|
105
105
|
tradedFrom?: string[];
|
|
106
106
|
weight?: number;
|
|
107
|
-
private _description?;
|
|
108
107
|
private _tileId?;
|
|
109
108
|
/**
|
|
110
109
|
* Separate property just for wells because isInGroup is still expensive for processWell()
|
|
@@ -133,7 +132,7 @@ export default class Doodad extends Entity<DoodadType, DoodadTag> implements IUn
|
|
|
133
132
|
* - `doodad.getName(undefined, 3)` // "stone furnaces"
|
|
134
133
|
*/
|
|
135
134
|
getName(article?: false | "definite" | "indefinite", count?: number): import("../../language/impl/TranslationImpl").default;
|
|
136
|
-
|
|
135
|
+
protected getDescription(): IDoodadDescription | undefined;
|
|
137
136
|
updateTile(tileUpdateType: TileUpdateType): void;
|
|
138
137
|
changeType(doodadType: DoodadType): void;
|
|
139
138
|
isValid(): boolean;
|
|
@@ -34,7 +34,7 @@ import type EntityWithStats from "game/entity/EntityWithStats";
|
|
|
34
34
|
import type Tile from "game/tile/Tile";
|
|
35
35
|
import type EntityMovable from "game/entity/EntityMovable";
|
|
36
36
|
import type { RenderSource, UpdateRenderFlag } from "renderer/IRenderer";
|
|
37
|
-
export default abstract class Entity<TypeType extends number = number, TagType = unknown, CounterType = unknown> extends EventEmitter.Host<IEntityEvents> implements IReferenceable, IInspector, ITemperatureSource, INotificationLocation, IVector3 {
|
|
37
|
+
export default abstract class Entity<DescriptionType = unknown, TypeType extends number = number, TagType = unknown, CounterType = unknown> extends EventEmitter.Host<IEntityEvents> implements IReferenceable, IInspector, ITemperatureSource, INotificationLocation, IVector3 {
|
|
38
38
|
abstract readonly entityType: EntityType;
|
|
39
39
|
abstract readonly tileUpdateType: TileUpdateType;
|
|
40
40
|
id: number;
|
|
@@ -58,14 +58,23 @@ export default abstract class Entity<TypeType extends number = number, TagType =
|
|
|
58
58
|
* This should be cleared when x,y,z is changing.
|
|
59
59
|
*/
|
|
60
60
|
private _tilesAround;
|
|
61
|
+
protected _description?: DescriptionType;
|
|
61
62
|
constructor(entityOptions?: IEntityConstructorOptions<TypeType>);
|
|
62
63
|
get island(): import("../island/Island").default;
|
|
63
64
|
get reference(): Reference | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Get the entities description
|
|
67
|
+
*/
|
|
68
|
+
get description(): DescriptionType | undefined;
|
|
64
69
|
/**
|
|
65
70
|
* Adds a referenceId to the entity if it doesn't already have one
|
|
66
71
|
*/
|
|
67
72
|
addReferenceId(): void;
|
|
68
73
|
abstract getName(): Translation;
|
|
74
|
+
/**
|
|
75
|
+
* Called when filling out the entities description for the first time
|
|
76
|
+
*/
|
|
77
|
+
protected abstract getDescription(): DescriptionType | undefined;
|
|
69
78
|
toString(): string;
|
|
70
79
|
getInspectionId(): string;
|
|
71
80
|
/**
|
|
@@ -81,7 +90,7 @@ export default abstract class Entity<TypeType extends number = number, TagType =
|
|
|
81
90
|
get tilesAround(): Tile[] | undefined;
|
|
82
91
|
protected setCachedTile(tile: Tile): void;
|
|
83
92
|
clearTileCache(): void;
|
|
84
|
-
isNearby(entity: Entity): boolean;
|
|
93
|
+
isNearby(entity: Entity<DescriptionType>): boolean;
|
|
85
94
|
isInFov(): boolean;
|
|
86
95
|
setInFov(inFov: boolean): void;
|
|
87
96
|
isOnFire(): FireType;
|
|
@@ -96,9 +105,9 @@ export default abstract class Entity<TypeType extends number = number, TagType =
|
|
|
96
105
|
addTag(tag: TagType): void;
|
|
97
106
|
removeTag(tag: TagType): void;
|
|
98
107
|
abstract isValid(): boolean;
|
|
99
|
-
get asEntity(): Entity<TypeType, TagType>;
|
|
100
|
-
get asEntityMovable(): EntityMovable<TypeType, TagType> | undefined;
|
|
101
|
-
get asEntityWithStats(): EntityWithStats<TypeType, TagType> | undefined;
|
|
108
|
+
get asEntity(): Entity<DescriptionType, TypeType, TagType>;
|
|
109
|
+
get asEntityMovable(): EntityMovable<DescriptionType, TypeType, TagType> | undefined;
|
|
110
|
+
get asEntityWithStats(): EntityWithStats<DescriptionType, TypeType, TagType> | undefined;
|
|
102
111
|
abstract get asCorpse(): Corpse | undefined;
|
|
103
112
|
abstract get asCreature(): Creature | undefined;
|
|
104
113
|
abstract get asDoodad(): Doodad | undefined;
|
|
@@ -39,7 +39,7 @@ export interface IEntityMovableEvents extends IEntityEvents {
|
|
|
39
39
|
/**
|
|
40
40
|
* Entity class that allows movement
|
|
41
41
|
*/
|
|
42
|
-
export default abstract class EntityMovable<TypeType extends number = number, TagType = unknown, CounterType = unknown> extends Entity<TypeType, TagType, CounterType> implements IRendererOrigin {
|
|
42
|
+
export default abstract class EntityMovable<DescriptionType = unknown, TypeType extends number = number, TagType = unknown, CounterType = unknown> extends Entity<DescriptionType, TypeType, TagType, CounterType> implements IRendererOrigin {
|
|
43
43
|
event: IEventEmitter<this, IEntityMovableEvents>;
|
|
44
44
|
/**
|
|
45
45
|
* Not guaranteed to be synced between the server and client for Human entities
|
|
@@ -83,7 +83,7 @@ export default abstract class EntityMovable<TypeType extends number = number, Ta
|
|
|
83
83
|
* @returns False to block the move
|
|
84
84
|
*/
|
|
85
85
|
protected abstract updateTile(fromTile: Tile, toTile: Tile): boolean;
|
|
86
|
-
get asEntityMovable(): EntityMovable<TypeType, TagType>;
|
|
86
|
+
get asEntityMovable(): EntityMovable<DescriptionType, TypeType, TagType>;
|
|
87
87
|
/**
|
|
88
88
|
* Regular entities don't have a direction so this will be the same as getTile()
|
|
89
89
|
*/
|
|
@@ -31,7 +31,7 @@ export interface IEntityWithStatsEvents extends IEntityMovableEvents, IStatEvent
|
|
|
31
31
|
* Entity class that includes stats/status system.
|
|
32
32
|
* Note: We're assuming something with stats is also movable!
|
|
33
33
|
*/
|
|
34
|
-
export default abstract class EntityWithStats<TypeType extends number = number, TagType = unknown> extends EntityMovable<TypeType, TagType> implements IStatHost {
|
|
34
|
+
export default abstract class EntityWithStats<DescriptionType = unknown, TypeType extends number = number, TagType = unknown> extends EntityMovable<DescriptionType, TypeType, TagType> implements IStatHost {
|
|
35
35
|
event: IEventEmitter<this, IEntityWithStatsEvents>;
|
|
36
36
|
stats: IStats;
|
|
37
37
|
status: IStatus;
|
|
@@ -39,7 +39,7 @@ export default abstract class EntityWithStats<TypeType extends number = number,
|
|
|
39
39
|
private readonly statusHandlers;
|
|
40
40
|
constructor(entityOptions?: IEntityConstructorOptions<TypeType>);
|
|
41
41
|
protected getApplicableStatusEffects(): Set<StatusType> | undefined;
|
|
42
|
-
get asEntityWithStats(): EntityWithStats<TypeType, TagType>;
|
|
42
|
+
get asEntityWithStats(): EntityWithStats<DescriptionType, TypeType, TagType>;
|
|
43
43
|
/**
|
|
44
44
|
* Returns whether the entity has the given `StatusType`
|
|
45
45
|
* @param status The status to check
|
|
@@ -20,7 +20,7 @@ import { EquipType, RestCancelReason, SkillType } from "game/entity/IHuman";
|
|
|
20
20
|
import type { IStat } from "game/entity/IStats";
|
|
21
21
|
import { Stat } from "game/entity/IStats";
|
|
22
22
|
import type { IMessageManager } from "game/entity/player/IMessageManager";
|
|
23
|
-
import type {
|
|
23
|
+
import type { IMovementIntent, IWalkPath } from "game/entity/player/IPlayer";
|
|
24
24
|
import { PlayerState, TurnTypeFlag, WeightStatus } from "game/entity/player/IPlayer";
|
|
25
25
|
import type { INoteManager } from "game/entity/player/note/NoteManager";
|
|
26
26
|
import PlayerDefense from "game/entity/player/PlayerDefense";
|
|
@@ -30,7 +30,7 @@ import type { StatChangeTimerFactory } from "game/entity/StatFactory";
|
|
|
30
30
|
import { StatChangeCurrentTimerStrategy } from "game/entity/StatFactory";
|
|
31
31
|
import { FireType } from "game/IGame";
|
|
32
32
|
import type { Quality } from "game/IObject";
|
|
33
|
-
import type { IMoveToIslandOptions, IslandId } from "game/island/IIsland";
|
|
33
|
+
import type { IMobCheck, IMoveToIslandOptions, IslandId } from "game/island/IIsland";
|
|
34
34
|
import type Island from "game/island/Island";
|
|
35
35
|
import type { EquipEffectByType, EquipEffects, IContainer, IRanged, RecipeLevel } from "game/item/IItem";
|
|
36
36
|
import { EquipEffect, ItemType, ItemTypeGroup } from "game/item/IItem";
|
|
@@ -55,7 +55,7 @@ import type { IVector2, IVector3 } from "utilities/math/IVector";
|
|
|
55
55
|
import Vector2 from "utilities/math/Vector2";
|
|
56
56
|
import type { IVector4 } from "utilities/math/Vector4";
|
|
57
57
|
export declare const REPUTATION_MAX = 64000;
|
|
58
|
-
export default abstract class Human<TypeType extends number = number> extends EntityWithStats<TypeType> implements IHasInsulation {
|
|
58
|
+
export default abstract class Human<TypeType extends number = number> extends EntityWithStats<unknown, TypeType> implements IHasInsulation {
|
|
59
59
|
static getNameTranslation(): import("../../language/impl/TranslationImpl").default;
|
|
60
60
|
event: IEventEmitter<this, IHumanEvents>;
|
|
61
61
|
anim: number;
|
|
@@ -119,6 +119,7 @@ export default abstract class Human<TypeType extends number = number> extends En
|
|
|
119
119
|
protected gameOptionsCached?: IGameOptionsPlayer;
|
|
120
120
|
protected cachedMovementPenalty?: number;
|
|
121
121
|
constructor(entityOptions?: IEntityConstructorOptions<TypeType>);
|
|
122
|
+
protected getDescription(): void;
|
|
122
123
|
abstract createNoteManager(): INoteManager;
|
|
123
124
|
abstract createMessageManager(): IMessageManager;
|
|
124
125
|
abstract createQuestManager(): IQuestManager;
|
|
@@ -30,7 +30,7 @@ export default class ActionExecutor<A extends Array<ActionArgument | ActionArgum
|
|
|
30
30
|
* Note: Prefer `IActionApi.get` if you're calling this from within another action.
|
|
31
31
|
*/
|
|
32
32
|
static get<D extends AnyActionDescription>(action: D): D extends IActionDescription<infer A, infer E, infer R, infer CU, infer AV> ? ActionExecutor<A, E, R, CU, AV> : never;
|
|
33
|
-
static executeMultiplayer(packet: ActionPacket, executor?: Entity<number, unknown, unknown> | undefined, nonMpActionExecutor?: ActionExecutor<Array<ActionArgument | ActionArgument[]>, Entity, any, any, any[]>): any;
|
|
33
|
+
static executeMultiplayer(packet: ActionPacket, executor?: Entity<unknown, number, unknown, unknown> | undefined, nonMpActionExecutor?: ActionExecutor<Array<ActionArgument | ActionArgument[]>, Entity, any, any, any[]>): any;
|
|
34
34
|
get executor(): E;
|
|
35
35
|
get actionStack(): ActionType[];
|
|
36
36
|
get lastAction(): ActionType;
|
|
@@ -26,7 +26,7 @@ import type { IUnserializedCallback } from "save/serializer/ISerializer";
|
|
|
26
26
|
import { Direction } from "utilities/math/Direction";
|
|
27
27
|
import type { IVector3 } from "utilities/math/IVector";
|
|
28
28
|
import Vector2 from "utilities/math/Vector2";
|
|
29
|
-
export default class Creature extends EntityWithStats<CreatureType> implements IUnserializedCallback, IObject<CreatureType> {
|
|
29
|
+
export default class Creature extends EntityWithStats<ICreatureDescription, CreatureType> implements IUnserializedCallback, IObject<CreatureType> {
|
|
30
30
|
static is(value: any): value is Creature;
|
|
31
31
|
get entityType(): EntityType.Creature;
|
|
32
32
|
get tileUpdateType(): TileUpdateType;
|
|
@@ -57,7 +57,6 @@ export default class Creature extends EntityWithStats<CreatureType> implements I
|
|
|
57
57
|
respawned?: number;
|
|
58
58
|
shouldSkipNextUpdate?: true;
|
|
59
59
|
tameTime?: number;
|
|
60
|
-
private _description;
|
|
61
60
|
spawnAnimationTime: IMovementTime | undefined;
|
|
62
61
|
constructor(entityOptions?: IEntityConstructorOptions<CreatureType>, aberrant?: boolean);
|
|
63
62
|
/**
|
|
@@ -74,7 +73,7 @@ export default class Creature extends EntityWithStats<CreatureType> implements I
|
|
|
74
73
|
* - `creature.getName(undefined, 3)` // "acid spitter demons"
|
|
75
74
|
*/
|
|
76
75
|
getName(article?: false | "definite" | "indefinite", count?: number): Translation;
|
|
77
|
-
|
|
76
|
+
protected getDescription(): ICreatureDescription | undefined;
|
|
78
77
|
hasAi(aiType: AiType): boolean;
|
|
79
78
|
isHidden(): boolean;
|
|
80
79
|
isRetaliator(): boolean;
|
|
@@ -35,7 +35,7 @@ export interface ICorpseEvents extends IEntityEvents {
|
|
|
35
35
|
/**
|
|
36
36
|
* TODO: extends Entity?
|
|
37
37
|
*/
|
|
38
|
-
export default class Corpse extends Entity<CreatureType> implements IObject<CreatureType> {
|
|
38
|
+
export default class Corpse extends Entity<ICorpseDescription, CreatureType> implements IObject<CreatureType> {
|
|
39
39
|
static is(value: any): value is Corpse;
|
|
40
40
|
get entityType(): EntityType.Corpse;
|
|
41
41
|
get tileUpdateType(): TileUpdateType;
|
|
@@ -46,7 +46,6 @@ export default class Corpse extends Entity<CreatureType> implements IObject<Crea
|
|
|
46
46
|
respawned?: number;
|
|
47
47
|
startingDecay?: number;
|
|
48
48
|
step?: number | undefined;
|
|
49
|
-
private _description;
|
|
50
49
|
private _creatureDescription;
|
|
51
50
|
constructor(entityOptions?: IEntityConstructorOptions<CreatureType>, decay?: number);
|
|
52
51
|
get asCorpse(): Corpse | undefined;
|
|
@@ -71,7 +70,7 @@ export default class Corpse extends Entity<CreatureType> implements IObject<Crea
|
|
|
71
70
|
* - `corpse.getName(undefined, 3)` // "acid spitter demons"
|
|
72
71
|
*/
|
|
73
72
|
getName(article?: false | "definite" | "indefinite", count?: number): Translation;
|
|
74
|
-
|
|
73
|
+
protected getDescription(): ICorpseDescription | undefined;
|
|
75
74
|
creatureDescription(): ICreatureDescription | undefined;
|
|
76
75
|
isValid(): boolean;
|
|
77
76
|
getDecayAtStart(): number;
|
|
@@ -10,10 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { Events } from "event/EventEmitter";
|
|
12
12
|
import type Doodad from "game/doodad/Doodad";
|
|
13
|
-
import type Creature from "game/entity/creature/Creature";
|
|
14
13
|
import type Human from "game/entity/Human";
|
|
15
14
|
import type { HairColor, HairStyle, SkinColor } from "game/entity/IHuman";
|
|
16
|
-
import type NPC from "game/entity/npc/NPC";
|
|
17
15
|
import type { IMessage } from "game/entity/player/IMessageManager";
|
|
18
16
|
import type MessageManager from "game/entity/player/MessageManager";
|
|
19
17
|
import type { INote } from "game/entity/player/note/NoteManager";
|
|
@@ -21,7 +19,6 @@ import type Player from "game/entity/player/Player";
|
|
|
21
19
|
import { ItemType } from "game/item/IItem";
|
|
22
20
|
import type { Prompt } from "game/meta/prompt/IPrompt";
|
|
23
21
|
import type { Milestone } from "game/milestones/IMilestone";
|
|
24
|
-
import type Tile from "game/tile/Tile";
|
|
25
22
|
import type InterruptChoice from "language/dictionary/InterruptChoice";
|
|
26
23
|
import { Direction } from "utilities/math/Direction";
|
|
27
24
|
import type { IVector2, IVector3 } from "utilities/math/IVector";
|
|
@@ -177,20 +174,6 @@ export interface IStatOld {
|
|
|
177
174
|
regen: number;
|
|
178
175
|
regenBase: number;
|
|
179
176
|
}
|
|
180
|
-
export interface IMobCheck extends IVector3 {
|
|
181
|
-
tile: Tile;
|
|
182
|
-
creature?: Creature;
|
|
183
|
-
player?: Human;
|
|
184
|
-
npc?: NPC;
|
|
185
|
-
obstacle?: boolean;
|
|
186
|
-
water?: boolean;
|
|
187
|
-
freshWater?: boolean;
|
|
188
|
-
shallowWater?: boolean;
|
|
189
|
-
swampWater?: boolean;
|
|
190
|
-
noTile?: boolean;
|
|
191
|
-
waterTiles?: number;
|
|
192
|
-
voidTiles?: number;
|
|
193
|
-
}
|
|
194
177
|
export declare const setupSpawnItems: ItemType[];
|
|
195
178
|
export declare const setupWaterItems: ItemType[];
|
|
196
179
|
export declare const setupToolItems: ItemType[];
|
|
@@ -23,9 +23,9 @@ export interface IDescribed {
|
|
|
23
23
|
referenceId?: number;
|
|
24
24
|
quality?: Quality;
|
|
25
25
|
island: Island;
|
|
26
|
-
description
|
|
26
|
+
description: any;
|
|
27
27
|
}
|
|
28
|
-
export type DescribedDescription<T extends IDescribed> = Exclude<
|
|
28
|
+
export type DescribedDescription<T extends IDescribed> = Exclude<T["description"], undefined>;
|
|
29
29
|
export interface IUseInfoBase<T extends IDescribed, A extends ActionType> {
|
|
30
30
|
entityType: T["entityType"];
|
|
31
31
|
value?: T;
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { BiomeType } from "game/biome/IBiome";
|
|
12
12
|
import type Doodad from "game/doodad/Doodad";
|
|
13
|
+
import type Creature from "game/entity/creature/Creature";
|
|
13
14
|
import type Human from "game/entity/Human";
|
|
15
|
+
import type NPC from "game/entity/npc/NPC";
|
|
14
16
|
import type { IIslandTemplate, TickFlag, TileUpdateType } from "game/IGame";
|
|
15
17
|
import type { MultiplayerLoadingDescription } from "game/meta/Loading";
|
|
16
18
|
import type { TerrainType } from "game/tile/ITerrain";
|
|
@@ -157,3 +159,17 @@ export interface IIslandPort {
|
|
|
157
159
|
name: string | ISerializedTranslation;
|
|
158
160
|
position: IVector3;
|
|
159
161
|
}
|
|
162
|
+
export interface IMobCheck extends IVector3 {
|
|
163
|
+
tile: Tile;
|
|
164
|
+
creature?: Creature;
|
|
165
|
+
player?: Human;
|
|
166
|
+
npc?: NPC;
|
|
167
|
+
obstacle?: boolean;
|
|
168
|
+
water?: boolean;
|
|
169
|
+
freshWater?: boolean;
|
|
170
|
+
shallowWater?: boolean;
|
|
171
|
+
swampWater?: boolean;
|
|
172
|
+
noTile?: boolean;
|
|
173
|
+
waterTiles?: number;
|
|
174
|
+
voidTiles?: number;
|
|
175
|
+
}
|
|
@@ -25,7 +25,7 @@ import type { Game } from "game/Game";
|
|
|
25
25
|
import type { IGameOld } from "game/IGame";
|
|
26
26
|
import { TickFlag, TileUpdateType } from "game/IGame";
|
|
27
27
|
import { Quality } from "game/IObject";
|
|
28
|
-
import type { IIslandEvents, IIslandLoadOptions, IIslandPort, ISeeds, IslandId, IWaterContamination, IWaterFill, IWell } from "game/island/IIsland";
|
|
28
|
+
import type { IIslandEvents, IIslandLoadOptions, IIslandPort, IMobCheck, ISeeds, IslandId, IWaterContamination, IWaterFill, IWell } from "game/island/IIsland";
|
|
29
29
|
import { WaterType } from "game/island/IIsland";
|
|
30
30
|
import type { ILiquidGather } from "game/item/IItem";
|
|
31
31
|
import type { IRequirementInfo } from "game/item/IItemManager";
|
|
@@ -216,6 +216,7 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
|
|
|
216
216
|
*/
|
|
217
217
|
calculateTileLightLevel(tile: Tile): number;
|
|
218
218
|
getLightSourceAt(x: number, y: number, z: number): number;
|
|
219
|
+
checkForTargetInRange(tile: Tile, direction: Direction.Cardinal, range: number, includePlayers?: boolean): IMobCheck;
|
|
219
220
|
fireBreath(x: number, y: number, z: number, facingDirection: Direction, itemName?: Translation, player?: boolean): void;
|
|
220
221
|
coolFires(requirements: IRequirementInfo, human: Human): void;
|
|
221
222
|
/**
|
|
@@ -73,11 +73,16 @@ export interface IContainable {
|
|
|
73
73
|
containerType?: ContainerType;
|
|
74
74
|
[SYMBOL_CONTAINER_CACHED_REFERENCE]?: ContainerReference;
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
containedItems: Item[];
|
|
76
|
+
interface IBaseContainer extends IContainable {
|
|
78
77
|
transientItems?: Item[];
|
|
79
78
|
itemOrders?: number[];
|
|
80
79
|
}
|
|
80
|
+
export interface IContainer extends IBaseContainer {
|
|
81
|
+
containedItems: Item[];
|
|
82
|
+
}
|
|
83
|
+
export interface IMaybeContainer extends IBaseContainer {
|
|
84
|
+
containedItems?: Item[];
|
|
85
|
+
}
|
|
81
86
|
export interface IItemDisassembleResult {
|
|
82
87
|
items: IItemDisassembly[];
|
|
83
88
|
itemsBroken: number;
|
|
@@ -69,7 +69,7 @@ export interface IItemEvents extends IEntityMovableEvents {
|
|
|
69
69
|
durabilityChange(durability: number, oldDurability: number): any;
|
|
70
70
|
durabilityMaxChange(durabilityMax: number, oldDurabilityMax: number): any;
|
|
71
71
|
}
|
|
72
|
-
export default class Item extends EntityMovable<ItemType, ItemTag, ItemCounter> implements Partial<IContainer>, IContainable, IUnserializedCallback, IObject<ItemType>, IObjectOptions, IContainable, Partial<IContainer>, IHasInsulation, IHasMagic {
|
|
72
|
+
export default class Item extends EntityMovable<IItemDescription, ItemType, ItemTag, ItemCounter> implements Partial<IContainer>, IContainable, IUnserializedCallback, IObject<ItemType>, IObjectOptions, IContainable, Partial<IContainer>, IHasInsulation, IHasMagic {
|
|
73
73
|
get entityType(): EntityType.Item;
|
|
74
74
|
get tileUpdateType(): TileUpdateType;
|
|
75
75
|
readonly event: IEventEmitter<this, IItemEvents>;
|
|
@@ -107,7 +107,6 @@ export default class Item extends EntityMovable<ItemType, ItemTag, ItemCounter>
|
|
|
107
107
|
offsetY?: number;
|
|
108
108
|
[SYMBOL_CONTAINER_CACHED_REFERENCE]?: ContainerReference;
|
|
109
109
|
private _movementOptions?;
|
|
110
|
-
private _description;
|
|
111
110
|
constructor(itemType?: ItemType | undefined, islandId?: IslandId, quality?: Quality, human?: Human);
|
|
112
111
|
get asCorpse(): undefined;
|
|
113
112
|
get asCreature(): undefined;
|
|
@@ -162,7 +161,7 @@ export default class Item extends EntityMovable<ItemType, ItemTag, ItemCounter>
|
|
|
162
161
|
* - `item.getName(undefined, 3)` // "stone axes"
|
|
163
162
|
*/
|
|
164
163
|
getName(article?: false | "definite" | "indefinite", count?: number, showCount?: boolean, showQuality?: boolean, showRenamedQuotes?: boolean, showMagicalType?: boolean): import("../../language/impl/TranslationImpl").default;
|
|
165
|
-
|
|
164
|
+
protected getDescription(): IItemDescription | undefined;
|
|
166
165
|
isTransient(): boolean;
|
|
167
166
|
isValid(): boolean;
|
|
168
167
|
isProtected(): boolean;
|
|
@@ -48,7 +48,7 @@ export default class Crafter {
|
|
|
48
48
|
* @param includeCrafterTile Whether the tile the crafter is on should be included. Defaults to `true`.
|
|
49
49
|
*/
|
|
50
50
|
tilesAroundCrafter(includeCrafterTile?: boolean): Stream<any>;
|
|
51
|
-
getCrafter(): Entity<number, unknown, unknown>;
|
|
51
|
+
getCrafter(): Entity<unknown, number, unknown, unknown>;
|
|
52
52
|
getUsable<R extends RecipeRequirementType>(type: R, requirement: InstanceType<RecipeRequirementClass<R>>): Set<RecipeInputType<R>>;
|
|
53
53
|
getUsed<R extends RecipeRequirementType>(type: R, requirement?: InstanceType<RecipeRequirementClass<R>>): Stream<RecipeInputType<R>>;
|
|
54
54
|
/**
|
|
@@ -33,7 +33,14 @@ import Vector2 from "utilities/math/Vector2";
|
|
|
33
33
|
export declare const TEMPERATURE_BOUNDARY_MIN_VEC2: Vector2;
|
|
34
34
|
export declare const TEMPERATURE_INVALID = 255;
|
|
35
35
|
export interface ITemperatureManagerEvents {
|
|
36
|
+
/**
|
|
37
|
+
* Note: This event can only be listened for by subscribing directly to `temperatureManager.event`
|
|
38
|
+
*/
|
|
36
39
|
updateProducedTile(tile: Tile, invalidateRange?: number): any;
|
|
40
|
+
/**
|
|
41
|
+
* Note: This event can only be listened for by subscribing directly to `temperatureManager.event`
|
|
42
|
+
*/
|
|
43
|
+
recalculate(x: number, y: number, z: number, type: TempType): any;
|
|
37
44
|
}
|
|
38
45
|
export default class TemperatureManager extends EventEmitter.Host<ITemperatureManagerEvents> implements IPreSerializeCallback {
|
|
39
46
|
private readonly island;
|
|
@@ -16,7 +16,7 @@ import type { SkillType } from "game/entity/IHuman";
|
|
|
16
16
|
import type { IDecayTemperatureRange } from "game/IGame";
|
|
17
17
|
import type { Quality } from "game/IObject";
|
|
18
18
|
import type { WaterType } from "game/island/IIsland";
|
|
19
|
-
import type { IContainer, ItemType } from "game/item/IItem";
|
|
19
|
+
import type { IContainer, IMaybeContainer, ItemType } from "game/item/IItem";
|
|
20
20
|
import type Item from "game/item/Item";
|
|
21
21
|
import type MagicalPropertyManager from "game/magic/MagicalPropertyManager";
|
|
22
22
|
import type { MapTile } from "game/mapping/IMapTile";
|
|
@@ -146,6 +146,7 @@ export interface ITileOld {
|
|
|
146
146
|
event?: TileEvent[];
|
|
147
147
|
}
|
|
148
148
|
export type ITileContainer = IContainer & IVector3;
|
|
149
|
+
export type IMaybeTileContainer = IMaybeContainer & IVector3;
|
|
149
150
|
export interface ITileData {
|
|
150
151
|
type: TerrainType;
|
|
151
152
|
minDur?: number;
|
|
@@ -18,9 +18,8 @@ import type { IMessageManager } from "game/entity/player/IMessageManager";
|
|
|
18
18
|
import { FireType } from "game/IGame";
|
|
19
19
|
import { Quality } from "game/IObject";
|
|
20
20
|
import type { IslandId } from "game/island/IIsland";
|
|
21
|
-
import type { IContainer } from "game/item/IItem";
|
|
22
21
|
import type Item from "game/item/Item";
|
|
23
|
-
import type { IOverlayInfo, ITerrainDescription, ITileContainer, ITileData } from "game/tile/ITerrain";
|
|
22
|
+
import type { IMaybeTileContainer, IOverlayInfo, ITerrainDescription, ITileContainer, ITileData } from "game/tile/ITerrain";
|
|
24
23
|
import { TerrainType } from "game/tile/ITerrain";
|
|
25
24
|
import type TileEvent from "game/tile/TileEvent";
|
|
26
25
|
import { WorldZ } from "game/WorldZ";
|
|
@@ -82,7 +81,7 @@ export default class Tile implements IVector4, Partial<ITileContainer>, IFieldOf
|
|
|
82
81
|
*/
|
|
83
82
|
constructor(island: Island, x: number, y: number, z: number, id: number);
|
|
84
83
|
get point(): IVector3;
|
|
85
|
-
description(): ITerrainDescription | undefined;
|
|
84
|
+
get description(): ITerrainDescription | undefined;
|
|
86
85
|
toString(): string;
|
|
87
86
|
get type(): TerrainType;
|
|
88
87
|
/**
|
|
@@ -103,10 +102,19 @@ export default class Tile implements IVector4, Partial<ITileContainer>, IFieldOf
|
|
|
103
102
|
set doodadAnimationDisabled(value: boolean);
|
|
104
103
|
get variation(): number;
|
|
105
104
|
get isMapEdge(): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Check if this Tile containers some items
|
|
107
|
+
*/
|
|
108
|
+
get hasTileContainer(): boolean;
|
|
106
109
|
/**
|
|
107
110
|
* Gets/creates tile container
|
|
108
111
|
*/
|
|
109
|
-
get tileContainer():
|
|
112
|
+
get tileContainer(): ITileContainer;
|
|
113
|
+
/**
|
|
114
|
+
* Gets a tile container.
|
|
115
|
+
* It will not create one when called.
|
|
116
|
+
*/
|
|
117
|
+
get maybeTileContainer(): IMaybeTileContainer;
|
|
110
118
|
/**
|
|
111
119
|
* Checks for:
|
|
112
120
|
* Passable
|
|
@@ -28,7 +28,7 @@ export interface ITileEventEvents extends IEntityMovableEvents {
|
|
|
28
28
|
*/
|
|
29
29
|
fireUpdate(tile: Tile, stage: FireStage | undefined): any;
|
|
30
30
|
}
|
|
31
|
-
export default class TileEvent extends EntityMovable<TileEventType> implements IObject<TileEventType> {
|
|
31
|
+
export default class TileEvent extends EntityMovable<ITileEventDescription, TileEventType> implements IObject<TileEventType> {
|
|
32
32
|
static is(value: any): value is TileEvent;
|
|
33
33
|
get entityType(): EntityType.TileEvent;
|
|
34
34
|
get tileUpdateType(): TileUpdateType;
|
|
@@ -48,7 +48,6 @@ export default class TileEvent extends EntityMovable<TileEventType> implements I
|
|
|
48
48
|
*/
|
|
49
49
|
fuel?: number;
|
|
50
50
|
private fireStage?;
|
|
51
|
-
private _description;
|
|
52
51
|
constructor(entityOptions?: IEntityConstructorOptions<TileEventType>);
|
|
53
52
|
isValid(): boolean;
|
|
54
53
|
get asCorpse(): undefined;
|
|
@@ -63,7 +62,7 @@ export default class TileEvent extends EntityMovable<TileEventType> implements I
|
|
|
63
62
|
get point(): IVector3;
|
|
64
63
|
get tile(): Tile;
|
|
65
64
|
toString(): string;
|
|
66
|
-
|
|
65
|
+
protected getDescription(): ITileEventDescription | undefined;
|
|
67
66
|
getName(article?: false | "definite" | "indefinite", count?: number): import("../../language/impl/TranslationImpl").default;
|
|
68
67
|
getProducedTemperature(): number | undefined;
|
|
69
68
|
updateFire(tile: Tile): void;
|
|
@@ -11,10 +11,9 @@
|
|
|
11
11
|
import type { ILootItem } from "game/ILoot";
|
|
12
12
|
import type { Quality } from "game/IObject";
|
|
13
13
|
import type Island from "game/island/Island";
|
|
14
|
-
import type { IContainer } from "game/item/IItem";
|
|
15
14
|
import { ItemType } from "game/item/IItem";
|
|
16
15
|
import type Item from "game/item/Item";
|
|
17
|
-
import type
|
|
16
|
+
import type Tile from "game/tile/Tile";
|
|
18
17
|
import type TileEvent from "game/tile/TileEvent";
|
|
19
18
|
export declare enum FireStage {
|
|
20
19
|
Extinguished = 0,
|
|
@@ -33,7 +32,7 @@ export declare module FireStage {
|
|
|
33
32
|
function getTemperature(stage: FireStage, min: number, max: number): number;
|
|
34
33
|
}
|
|
35
34
|
export declare module IFire {
|
|
36
|
-
function dissassemblyBurn(island: Island, item: Item,
|
|
37
|
-
function harvestGatherBurn(step: number, resources: ILootItem[] | undefined,
|
|
38
|
-
function burnsLike(burnsLikeItem: ItemType, tileEvent: TileEvent,
|
|
35
|
+
function dissassemblyBurn(island: Island, item: Item, tile: Tile, disassembly: boolean): Item[];
|
|
36
|
+
function harvestGatherBurn(step: number, resources: ILootItem[] | undefined, tile: Tile, quality: Quality | undefined, tileEvent: TileEvent): void;
|
|
37
|
+
function burnsLike(burnsLikeItem: ItemType, tileEvent: TileEvent, tile: Tile, quality: Quality | undefined): Item[];
|
|
39
38
|
}
|
|
@@ -99,7 +99,8 @@ export declare enum MusicPlaylist {
|
|
|
99
99
|
export declare enum TooltipVisibilityOption {
|
|
100
100
|
HiddenUnlessBind = 0,
|
|
101
101
|
ShowMoreInformationWithBind = 1,
|
|
102
|
-
AlwaysShowMoreInformation = 2
|
|
102
|
+
AlwaysShowMoreInformation = 2,
|
|
103
|
+
Default = 1
|
|
103
104
|
}
|
|
104
105
|
export type IOptionsOld = Partial<Pick<IOptions, "bindings">> & Partial<{
|
|
105
106
|
alwaysShowMoreInformation: boolean;
|
|
@@ -42,7 +42,6 @@ export declare enum ItemDetailIconLocation {
|
|
|
42
42
|
export declare enum ItemClasses {
|
|
43
43
|
Main = "item-component",
|
|
44
44
|
Icon = "item-component-icon",
|
|
45
|
-
ItemIcon = "item-component-icon-item",
|
|
46
45
|
ItemIconIsReal = "item-component-icon-item-is-real",
|
|
47
46
|
ActionIcon = "item-component-icon-action",
|
|
48
47
|
ActionIconHasItem = "item-component-icon-action-has-item",
|
|
@@ -90,7 +89,6 @@ export default class ItemComponent extends Component {
|
|
|
90
89
|
protected readonly handler: IItemHandler;
|
|
91
90
|
static registerSlot(slot: ItemSlot): void;
|
|
92
91
|
event: IEventEmitter<this, Events<IDraggableComponent> & IItemSlotEvents>;
|
|
93
|
-
readonly itemIcon: Component<HTMLElement>;
|
|
94
92
|
readonly magicalIcon: Component<HTMLElement>;
|
|
95
93
|
readonly protectedIcon: Component<HTMLElement>;
|
|
96
94
|
readonly actionIcon: Component<HTMLElement> | undefined;
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
* Used for ordering a list of items by "priority". Higher priorities come before lower priorities.
|
|
13
13
|
*/
|
|
14
14
|
export declare class PriorityMap<T> {
|
|
15
|
-
static orderMultiple2<T extends Iterable<any>>(lists: Array<PriorityMap<T>>): T[];
|
|
16
15
|
static orderMultiple<T extends Iterable<any>>(lists: Array<PriorityMap<T>>): T[];
|
|
17
16
|
private readonly priorities;
|
|
18
17
|
private readonly map;
|
|
@@ -38,7 +37,7 @@ export declare class PriorityMap<T> {
|
|
|
38
37
|
* Returns an iterator of the items in this list.
|
|
39
38
|
*/
|
|
40
39
|
stream(direction?: PriorityListStreamDirection): import("@wayward/goodstream").default<T>;
|
|
41
|
-
array(
|
|
40
|
+
array(direction?: PriorityListStreamDirection): T[];
|
|
42
41
|
getInternalMap(): Record<number, T>;
|
|
43
42
|
}
|
|
44
43
|
export declare enum PriorityListStreamDirection {
|
package/package.json
CHANGED