@wayward/types 2.11.4-beta.dev.20220129.1 → 2.11.4-beta.dev.20220203.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 +6 -6
- package/definitions/game/game/entity/Human.d.ts +13 -3
- package/definitions/game/game/entity/IHuman.d.ts +25 -1
- package/definitions/game/game/entity/action/Actions.d.ts +1 -1
- package/definitions/game/game/entity/action/actions/Till.d.ts +1 -1
- package/definitions/game/game/entity/creature/Creature.d.ts +6 -3
- package/definitions/game/game/entity/creature/CreatureManager.d.ts +1 -1
- package/definitions/game/game/entity/creature/Pathing.d.ts +2 -2
- package/definitions/game/game/entity/npc/NPC.d.ts +3 -6
- package/definitions/game/game/entity/player/IPlayer.d.ts +0 -20
- package/definitions/game/game/entity/player/MessageManager.d.ts +2 -2
- package/definitions/game/game/entity/player/Player.d.ts +7 -14
- package/definitions/game/game/inspection/inspections/IslandInspection.d.ts +3 -3
- package/definitions/game/game/inspection/inspections/NPCInspection.d.ts +2 -1
- package/definitions/game/game/item/Item.d.ts +9 -10
- package/definitions/game/game/item/ItemManager.d.ts +3 -3
- package/definitions/game/game/reference/ReferenceManager.d.ts +1 -1
- package/definitions/game/multiplayer/IMultiplayer.d.ts +48 -47
- package/definitions/game/renderer/IRenderer.d.ts +39 -38
- package/definitions/game/renderer/context/RendererOrigin.d.ts +6 -5
- package/definitions/game/renderer/fieldOfView/FieldOfView.d.ts +2 -1
- package/definitions/game/renderer/notifier/INotifier.d.ts +2 -1
- package/definitions/game/renderer/particle/Particle.d.ts +1 -1
- package/definitions/game/utilities/math/Vector4.d.ts +20 -0
- package/package.json +1 -1
|
@@ -20,8 +20,7 @@ import type NPC from "game/entity/npc/NPC";
|
|
|
20
20
|
import type Player from "game/entity/player/Player";
|
|
21
21
|
import Stats from "game/entity/Stats";
|
|
22
22
|
import type StatusEffect from "game/entity/status/StatusEffect";
|
|
23
|
-
import type { FireType } from "game/IGame";
|
|
24
|
-
import { TileUpdateType } from "game/IGame";
|
|
23
|
+
import type { FireType, TileUpdateType } from "game/IGame";
|
|
25
24
|
import type { IInspector } from "game/inspection/IInfoProvider";
|
|
26
25
|
import type { IslandId } from "game/island/IIsland";
|
|
27
26
|
import type { ItemType, RecipeLevel } from "game/item/IItem";
|
|
@@ -36,6 +35,7 @@ import type { ItemNotifierType, StatNotificationType } from "renderer/notifier/I
|
|
|
36
35
|
import { Direction } from "utilities/math/Direction";
|
|
37
36
|
import type { IVector2, IVector3 } from "utilities/math/IVector";
|
|
38
37
|
import Vector2 from "utilities/math/Vector2";
|
|
38
|
+
import type { IVector4 } from "utilities/math/Vector4";
|
|
39
39
|
export default abstract class Entity extends EventEmitter.Host<IEntityEvents> implements IReferenceable, IInspector, ITemperatureSource, IVector3 {
|
|
40
40
|
readonly stat: Stats<this>;
|
|
41
41
|
entityType: EntityType;
|
|
@@ -100,7 +100,6 @@ export default abstract class Entity extends EventEmitter.Host<IEntityEvents> im
|
|
|
100
100
|
getActiveStatuses(): StatusEffect[];
|
|
101
101
|
abstract damage(damageInfoOrAmount: IDamageInfo | number): number | undefined;
|
|
102
102
|
getCraftingDifficulty(level: RecipeLevel): number;
|
|
103
|
-
getTileUpdateType(): TileUpdateType;
|
|
104
103
|
getTile(): ITile;
|
|
105
104
|
getPoint(): IVector3;
|
|
106
105
|
getFacingPoint(): IVector3;
|
|
@@ -120,11 +119,11 @@ export default abstract class Entity extends EventEmitter.Host<IEntityEvents> im
|
|
|
120
119
|
isInFov(): boolean;
|
|
121
120
|
setInFov(inFov: boolean): void;
|
|
122
121
|
isOnFire(): FireType;
|
|
123
|
-
|
|
124
|
-
canSeeObject(type: CanASeeBType, object: IVector3 & {
|
|
122
|
+
canSeeObject(type: CanASeeBType, object: IVector4 & {
|
|
125
123
|
fromX: number;
|
|
126
124
|
fromY: number;
|
|
127
|
-
}, fieldOfView?: FieldOfView): boolean;
|
|
125
|
+
}, fieldOfView?: FieldOfView, customRadius?: number): boolean;
|
|
126
|
+
canSeePosition(type: CanASeeBType, islandId: IslandId, x: number, y: number, z: number, fieldOfView?: FieldOfView | undefined, customRadius?: number): boolean;
|
|
128
127
|
queueSoundEffect(type: SfxType, delay?: number, speed?: number, noPosition?: boolean): void;
|
|
129
128
|
queueSoundEffectInFront(type: SfxType, delay?: number, speed?: number, noPosition?: boolean): void;
|
|
130
129
|
notifyItem(itemNotifierType: ItemNotifierType, type: ItemType): void;
|
|
@@ -134,6 +133,7 @@ export default abstract class Entity extends EventEmitter.Host<IEntityEvents> im
|
|
|
134
133
|
getProperty<T>(property: Property): T | undefined;
|
|
135
134
|
removeProperty(property: Property): boolean;
|
|
136
135
|
getProducedTemperature(): number | undefined;
|
|
136
|
+
abstract readonly tileUpdateType: TileUpdateType;
|
|
137
137
|
get asEntity(): Entity;
|
|
138
138
|
abstract get asCreature(): Creature | undefined;
|
|
139
139
|
abstract get asHuman(): Human | undefined;
|
|
@@ -16,7 +16,7 @@ import type { ICausesDamage } from "game/entity/IEntity";
|
|
|
16
16
|
import type { ICheckUnderOptions, ICrafted, ICustomizations, IHumanEvents, IRestData, RestCancelReason } from "game/entity/IHuman";
|
|
17
17
|
import { EquipType, SkillType } from "game/entity/IHuman";
|
|
18
18
|
import { Stat } from "game/entity/IStats";
|
|
19
|
-
import type { IAttackHand, IMobCheck } from "game/entity/player/IPlayer";
|
|
19
|
+
import type { IAttackHand, IMobCheck, IMovementIntent, IWalkPath } from "game/entity/player/IPlayer";
|
|
20
20
|
import { WeightStatus, PlayerState } from "game/entity/player/IPlayer";
|
|
21
21
|
import PlayerDefense from "game/entity/player/PlayerDefense";
|
|
22
22
|
import SkillManager from "game/entity/skill/SkillManager";
|
|
@@ -36,7 +36,7 @@ import type TileEvent from "game/tile/TileEvent";
|
|
|
36
36
|
import Message from "language/dictionary/Message";
|
|
37
37
|
import Translation from "language/Translation";
|
|
38
38
|
import type { IOptions } from "save/data/ISaveDataGlobal";
|
|
39
|
-
import type { IVector3 } from "utilities/math/IVector";
|
|
39
|
+
import type { IVector2, IVector3 } from "utilities/math/IVector";
|
|
40
40
|
export declare const REPUTATION_MAX = 64000;
|
|
41
41
|
export default abstract class Human extends Entity implements IHasInsulation {
|
|
42
42
|
static getNameTranslation(): import("../../language/impl/TranslationImpl").default;
|
|
@@ -50,14 +50,16 @@ export default abstract class Human extends Entity implements IHasInsulation {
|
|
|
50
50
|
equippedReferences: Map<EquipType, ItemReference>;
|
|
51
51
|
handToUse: EquipType | undefined;
|
|
52
52
|
inventory: IContainer;
|
|
53
|
-
islandId: IslandId;
|
|
54
53
|
options: Readonly<IOptions>;
|
|
54
|
+
islandId: IslandId;
|
|
55
55
|
readonly equipEffects: Map<EquipEffect, EquipEffects>;
|
|
56
56
|
restData: IRestData | undefined;
|
|
57
57
|
score: number;
|
|
58
58
|
state: PlayerState;
|
|
59
59
|
swimming: boolean;
|
|
60
60
|
vehicleItemReference: ItemReference | undefined;
|
|
61
|
+
readonly movementIntent: IMovementIntent;
|
|
62
|
+
walkPath: IWalkPath | undefined;
|
|
61
63
|
identifier: string;
|
|
62
64
|
skill: SkillManager;
|
|
63
65
|
private readonly privateStore;
|
|
@@ -107,6 +109,10 @@ export default abstract class Human extends Entity implements IHasInsulation {
|
|
|
107
109
|
burn(fireType: FireType, skipMessage?: boolean, skipParry?: boolean, equipType?: EquipType, fromCombat?: boolean): number | undefined;
|
|
108
110
|
setPosition(point: IVector3): void;
|
|
109
111
|
setZ(z: number, updateFlowField?: boolean): void;
|
|
112
|
+
getMovementIntent(): IMovementIntent;
|
|
113
|
+
updateMovementIntent(movementIntent: IMovementIntent): boolean;
|
|
114
|
+
hasWalkPath(): boolean;
|
|
115
|
+
walkAlongPath(path: IVector2[] | undefined, force?: boolean): void;
|
|
110
116
|
checkUnder(inFacingDirection?: boolean, options?: ICheckUnderOptions): ICheckUnderOptions;
|
|
111
117
|
damageByInteractingWith(thing: Doodad | TileEvent, options: ICheckUnderOptions | undefined, damageLocation: EquipType): ICheckUnderOptions;
|
|
112
118
|
equip(item: Item, slot: EquipType): boolean;
|
|
@@ -137,6 +143,10 @@ export default abstract class Human extends Entity implements IHasInsulation {
|
|
|
137
143
|
isSwimming(): boolean;
|
|
138
144
|
updateSwimming(): void;
|
|
139
145
|
updatePaddling(): void;
|
|
146
|
+
/**
|
|
147
|
+
* Returns the bartering bonus for a given credit value
|
|
148
|
+
*/
|
|
149
|
+
getBarteringBonus(baseCredits: number): number;
|
|
140
150
|
getInsulation(type: TempType): number;
|
|
141
151
|
protected resetStatTimers(type?: StatChangeCurrentTimerStrategy): void;
|
|
142
152
|
protected getBaseStatBonuses(): OptionalDescriptions<Stat, number>;
|
|
@@ -17,7 +17,7 @@ import type { AttackType } from "game/entity/IEntity";
|
|
|
17
17
|
import type { WeightStatus } from "game/entity/player/IPlayer";
|
|
18
18
|
import type { ISkillEvents } from "game/entity/skill/SkillManager";
|
|
19
19
|
import type { IHasImagePath, Quality } from "game/IObject";
|
|
20
|
-
import type { ItemType } from "game/item/IItem";
|
|
20
|
+
import type { IContainer, ItemType } from "game/item/IItem";
|
|
21
21
|
import { RecipeLevel } from "game/item/IItem";
|
|
22
22
|
import type Item from "game/item/Item";
|
|
23
23
|
import { TempType } from "game/temperature/ITemperature";
|
|
@@ -25,8 +25,28 @@ import type { ITile } from "game/tile/ITerrain";
|
|
|
25
25
|
import type { IModdable } from "mod/ModRegistry";
|
|
26
26
|
import type { IRGB } from "utilities/Color";
|
|
27
27
|
import type { Direction } from "utilities/math/Direction";
|
|
28
|
+
import type { IVector2 } from "utilities/math/IVector";
|
|
28
29
|
import type { IRange } from "utilities/math/Range";
|
|
29
30
|
export interface IHumanEvents extends Events<Entity>, ISkillEvents {
|
|
31
|
+
/**
|
|
32
|
+
* Called when an item is added to the player's inventory
|
|
33
|
+
* @param item The item object
|
|
34
|
+
* @param container The container object the item was added to. This container might be inventory or a container within the inventory.
|
|
35
|
+
*/
|
|
36
|
+
inventoryItemAdd(item: Item, container: IContainer): any;
|
|
37
|
+
/**
|
|
38
|
+
* Called when an item is removed from the players inventory
|
|
39
|
+
* @param item The item object
|
|
40
|
+
* @param container The container object the item was moved to.
|
|
41
|
+
*/
|
|
42
|
+
inventoryItemRemove(item: Item, container: IContainer): any;
|
|
43
|
+
/**
|
|
44
|
+
* Called when an item is moved from one container to another, while still in the players inventory.
|
|
45
|
+
* @param item The item object
|
|
46
|
+
* @param container The container object the item was moved to. This container might be inventory or a container within the inventory.
|
|
47
|
+
* @param previousContainer The container object the item was moved from. This container might be inventory or a container within the inventory.
|
|
48
|
+
*/
|
|
49
|
+
inventoryItemUpdate(item: Item, container: IContainer, previousContainer?: IContainer): any;
|
|
30
50
|
/**
|
|
31
51
|
* Called when the human faces a different direction
|
|
32
52
|
* @param direction The direction the player is now facing
|
|
@@ -67,6 +87,10 @@ export interface IHumanEvents extends Events<Entity>, ISkillEvents {
|
|
|
67
87
|
* @returns True if the human should be swimming, false if they should not be swimming, or undefined to use the default logic
|
|
68
88
|
*/
|
|
69
89
|
isSwimming(isSwimming: boolean): boolean | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Called when the walk path of the player changes.
|
|
92
|
+
*/
|
|
93
|
+
walkPathChange(walkPath: IVector2[] | undefined): any;
|
|
70
94
|
/**
|
|
71
95
|
* Called when a book is opened by a player
|
|
72
96
|
* @param book The book that was opened
|
|
@@ -100,7 +100,7 @@ declare const actionDescriptions: {
|
|
|
100
100
|
32: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
|
|
101
101
|
82: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemInventory, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../player/Player").default, void, [(import("../../item/Item").default | undefined)?]>;
|
|
102
102
|
2: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemInventory, import("game/entity/action/IAction").ActionArgument.Undefined], [import("game/entity/action/IAction").ActionArgument.AttackType, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../player/Player").default | import("../npc/NPC").default, void, [(import("../../item/Item").default | undefined)?, (import("../IEntity").AttackType | undefined)?]>;
|
|
103
|
-
67: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemInventory]], import("../player/Player").default, void, [import("../../item/Item").default]>;
|
|
103
|
+
67: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemInventory]], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
|
|
104
104
|
103: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.Container, import("game/entity/action/IAction").ActionArgument.Undefined], [import("game/entity/action/IAction").ActionArgument.Boolean, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../player/Player").default | import("../npc/NPC").default, void, [(import("../../item/IItem").IContainer | undefined)?, (boolean | undefined)?]>;
|
|
105
105
|
102: import("./Action").Action<[], import("../player/Player").default | import("../npc/NPC").default, boolean, []>;
|
|
106
106
|
101: import("./Action").Action<[], import("../player/Player").default | import("../npc/NPC").default, void, []>;
|
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { Action } from "game/entity/action/Action";
|
|
12
12
|
import { ActionArgument } from "game/entity/action/IAction";
|
|
13
|
-
declare const _default: Action<[[ActionArgument.ItemInventory]], import("../../player/Player").default, void, [import("../../../item/Item").default]>;
|
|
13
|
+
declare const _default: Action<[[ActionArgument.ItemInventory]], import("../../player/Player").default | import("../../npc/NPC").default, void, [import("../../../item/Item").default]>;
|
|
14
14
|
export default _default;
|
|
@@ -13,11 +13,13 @@ import type { IEventEmitter } from "event/EventEmitter";
|
|
|
13
13
|
import type { ICreatureDescription, ICreatureEvents, IDamageInfo } from "game/entity/creature/ICreature";
|
|
14
14
|
import { CreatureType } from "game/entity/creature/ICreature";
|
|
15
15
|
import Entity from "game/entity/Entity";
|
|
16
|
+
import type Human from "game/entity/Human";
|
|
16
17
|
import type { IStatChangeInfo } from "game/entity/IEntity";
|
|
17
18
|
import { AiType, EntityType, MoveType, StatusType } from "game/entity/IEntity";
|
|
18
19
|
import type { IStat } from "game/entity/IStats";
|
|
19
20
|
import type Player from "game/entity/player/Player";
|
|
20
21
|
import type { CreationId } from "game/IGame";
|
|
22
|
+
import { TileUpdateType } from "game/IGame";
|
|
21
23
|
import type { IObject } from "game/IObject";
|
|
22
24
|
import type Item from "game/item/Item";
|
|
23
25
|
import type { ITile } from "game/tile/ITerrain";
|
|
@@ -29,6 +31,7 @@ export default class Creature extends Entity implements IUnserializedCallback, I
|
|
|
29
31
|
readonly objectType: CreationId.Creature;
|
|
30
32
|
event: IEventEmitter<this, ICreatureEvents>;
|
|
31
33
|
readonly entityType: EntityType.Creature;
|
|
34
|
+
readonly tileUpdateType = TileUpdateType.Creature;
|
|
32
35
|
aberrant?: boolean;
|
|
33
36
|
ai: AiType;
|
|
34
37
|
enemy?: number;
|
|
@@ -79,10 +82,10 @@ export default class Creature extends Entity implements IUnserializedCallback, I
|
|
|
79
82
|
checkUnder(x?: number, y?: number): boolean;
|
|
80
83
|
/**
|
|
81
84
|
* Check if this creature can swap with the player in the event that the player is moving into them
|
|
82
|
-
* @param
|
|
85
|
+
* @param human Human object
|
|
83
86
|
* @param source Source string. Set to undefined if this is being called from the clientside
|
|
84
87
|
*/
|
|
85
|
-
canSwapWith(
|
|
88
|
+
canSwapWith(human: Human, source: string | undefined): boolean;
|
|
86
89
|
getOwner(): Player | undefined;
|
|
87
90
|
damage(damageInfo: IDamageInfo): number | undefined;
|
|
88
91
|
damage(damageInfo: IDamageInfo, creatureX?: number, creatureY?: number, creatureZ?: number): number | undefined;
|
|
@@ -101,7 +104,7 @@ export default class Creature extends Entity implements IUnserializedCallback, I
|
|
|
101
104
|
protected updateDoodadOverHiddenStateForCurrentTile(hidden?: boolean): void;
|
|
102
105
|
protected preMove(fromX: number, fromY: number, fromZ: number, fromTile: ITile, toX: number, toY: number, toZ: number, toTile: ITile): boolean | void | undefined;
|
|
103
106
|
protected onStatChange(stat: IStat, oldValue: number, info: IStatChangeInfo): void;
|
|
104
|
-
findPath(target: IVector2, maxNodesChecked?: number,
|
|
107
|
+
findPath(target: IVector2, maxNodesChecked?: number, ignoreHuman?: Human): IVector2[] | undefined;
|
|
105
108
|
/**
|
|
106
109
|
* Check creature move with a multiplayer sync check
|
|
107
110
|
* @param source Provided when the check is running in a sync environment (NOT CLIENTSIDE)
|
|
@@ -72,7 +72,7 @@ export default class CreatureManager extends EntityManager<Creature> {
|
|
|
72
72
|
* @param willMove Set to true if the object is about to move to this tile. This method will confirm if theres an existing npc/creature there and return false if so
|
|
73
73
|
* @return Blocked penalty - Do no return 0!
|
|
74
74
|
*/
|
|
75
|
-
getMovePenalty(moveType: MoveType, tile: ITile, willMove: boolean): number;
|
|
75
|
+
getMovePenalty(moveType: MoveType, tile: ITile, willMove: boolean, ignoreHuman?: Human): number;
|
|
76
76
|
/**
|
|
77
77
|
* wasm calls this when calculating penalties for flow fields
|
|
78
78
|
*/
|
|
@@ -8,7 +8,7 @@
|
|
|
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
|
|
11
|
+
import type Human from "game/entity/Human";
|
|
12
12
|
import type Island from "game/island/Island";
|
|
13
13
|
import type { ITile } from "game/tile/ITerrain";
|
|
14
14
|
import type { IVector2 } from "utilities/math/IVector";
|
|
@@ -24,7 +24,7 @@ declare const _default: {
|
|
|
24
24
|
/**
|
|
25
25
|
* Returns whether the tile is blocked (completely impassible)
|
|
26
26
|
*/
|
|
27
|
-
isWalkToTileBlocked(
|
|
27
|
+
isWalkToTileBlocked(human: Human, tile: ITile, pos: IVector2, clientSide: boolean): boolean;
|
|
28
28
|
readonly event: import("event/EventEmitter").IEventEmitter<any, IPathingEvents>;
|
|
29
29
|
};
|
|
30
30
|
export default _default;
|
|
@@ -17,7 +17,7 @@ import { AiType, EntityType, MoveType } from "game/entity/IEntity";
|
|
|
17
17
|
import type { ICustomizations } from "game/entity/IHuman";
|
|
18
18
|
import { EquipType } from "game/entity/IHuman";
|
|
19
19
|
import type { NPCType } from "game/entity/npc/INPCs";
|
|
20
|
-
import { CreationId } from "game/IGame";
|
|
20
|
+
import { CreationId, TileUpdateType } from "game/IGame";
|
|
21
21
|
import type { ItemType } from "game/item/IItem";
|
|
22
22
|
import type Item from "game/item/Item";
|
|
23
23
|
import type { ITile } from "game/tile/ITerrain";
|
|
@@ -50,6 +50,7 @@ export default abstract class NPC extends Human {
|
|
|
50
50
|
readonly objectType = CreationId.NPC;
|
|
51
51
|
readonly event: IEventEmitter<this, INPCEvents>;
|
|
52
52
|
readonly entityType: EntityType.NPC;
|
|
53
|
+
readonly tileUpdateType = TileUpdateType.NPC;
|
|
53
54
|
get constructorFunction(): typeof NPC;
|
|
54
55
|
ai: AiType;
|
|
55
56
|
seen: number;
|
|
@@ -88,10 +89,6 @@ export default abstract class NPC extends Human {
|
|
|
88
89
|
* Sets the default weightCapacity of an NPC (based on their equipment and starting items).
|
|
89
90
|
*/
|
|
90
91
|
generateWeightCapacity(): void;
|
|
91
|
-
/**
|
|
92
|
-
* Returns the bartering bonus for a given credit value
|
|
93
|
-
*/
|
|
94
|
-
getBarteringBonus(baseCredits: number): number;
|
|
95
92
|
getName(): import("../../../language/impl/TranslationImpl").default;
|
|
96
93
|
protected getApplicableStatusEffects(): Set<StatusType>;
|
|
97
94
|
/**
|
|
@@ -128,7 +125,7 @@ export default abstract class NPC extends Human {
|
|
|
128
125
|
protected autoScaleStats(): void;
|
|
129
126
|
protected preMove(fromX: number, fromY: number, fromZ: number, fromTile: ITile, toX: number, toY: number, toZ: number, toTile: ITile): boolean | void | undefined;
|
|
130
127
|
protected postMove(): void;
|
|
131
|
-
|
|
128
|
+
protected checkMove(moveType: MoveType, tileX: number, tileY: number, tileZ: number): 0 | -1 | -2 | -3 | -4 | -5;
|
|
132
129
|
get asNPC(): NPC;
|
|
133
130
|
get asPlayer(): undefined;
|
|
134
131
|
get asLocalPlayer(): undefined;
|
|
@@ -21,7 +21,6 @@ import type { INote } from "game/entity/player/note/NoteManager";
|
|
|
21
21
|
import type Player from "game/entity/player/Player";
|
|
22
22
|
import type { IslandId } from "game/island/IIsland";
|
|
23
23
|
import type Island from "game/island/Island";
|
|
24
|
-
import type { IContainer } from "game/item/IItem";
|
|
25
24
|
import { ItemType } from "game/item/IItem";
|
|
26
25
|
import type Item from "game/item/Item";
|
|
27
26
|
import type { Prompt } from "game/meta/prompt/IPrompt";
|
|
@@ -115,25 +114,6 @@ export interface IPlayerEvents extends Events<Human> {
|
|
|
115
114
|
* Called when the player attempts to sail off the edge of the map
|
|
116
115
|
*/
|
|
117
116
|
sailOffMapEdge(direction: Direction): any;
|
|
118
|
-
/**
|
|
119
|
-
* Called when an item is added to the player's inventory
|
|
120
|
-
* @param item The item object
|
|
121
|
-
* @param container The container object the item was added to. This container might be inventory or a container within the inventory.
|
|
122
|
-
*/
|
|
123
|
-
inventoryItemAdd(item: Item, container: IContainer): any;
|
|
124
|
-
/**
|
|
125
|
-
* Called when an item is removed from the players inventory
|
|
126
|
-
* @param item The item object
|
|
127
|
-
* @param container The container object the item was moved to.
|
|
128
|
-
*/
|
|
129
|
-
inventoryItemRemove(item: Item, container: IContainer): any;
|
|
130
|
-
/**
|
|
131
|
-
* Called when an item is moved from one container to another, while still in the players inventory.
|
|
132
|
-
* @param item The item object
|
|
133
|
-
* @param container The container object the item was moved to. This container might be inventory or a container within the inventory.
|
|
134
|
-
* @param previousContainer The container object the item was moved from. This container might be inventory or a container within the inventory.
|
|
135
|
-
*/
|
|
136
|
-
inventoryItemUpdate(item: Item, container: IContainer, previousContainer?: IContainer): any;
|
|
137
117
|
/**
|
|
138
118
|
* Called when the player equips an item to a slot
|
|
139
119
|
* @param player The player object
|
|
@@ -15,7 +15,7 @@ import type Player from "game/entity/player/Player";
|
|
|
15
15
|
import type Island from "game/island/Island";
|
|
16
16
|
import Message from "language/dictionary/Message";
|
|
17
17
|
import Translation from "language/Translation";
|
|
18
|
-
import type {
|
|
18
|
+
import type { IVector4 } from "utilities/math/Vector4";
|
|
19
19
|
export declare class MessageManagerNoOp implements IMessageManager {
|
|
20
20
|
saveNoProperties: undefined;
|
|
21
21
|
getMessageHistory(): Stream<IMessage>;
|
|
@@ -86,7 +86,7 @@ export default class MessageManager implements IMessageManager {
|
|
|
86
86
|
/**
|
|
87
87
|
* If the position is not visible to this human, the message won't be sent.
|
|
88
88
|
*/
|
|
89
|
-
ifVisible(canSee?:
|
|
89
|
+
ifVisible(canSee?: IVector4): this;
|
|
90
90
|
/**
|
|
91
91
|
* If this human is not on the given island, the message won't be sent.
|
|
92
92
|
*/
|
|
@@ -19,12 +19,13 @@ import type { ICheckUnderOptions, IRestData } from "game/entity/IHuman";
|
|
|
19
19
|
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
|
-
import type { ILoadOnIslandOptions, IMovementIntent, IPlayerEvents
|
|
22
|
+
import type { ILoadOnIslandOptions, IMovementIntent, IPlayerEvents } from "game/entity/player/IPlayer";
|
|
23
23
|
import { TurnType } from "game/entity/player/IPlayer";
|
|
24
24
|
import MessageManager from "game/entity/player/MessageManager";
|
|
25
25
|
import NoteManager from "game/entity/player/note/NoteManager";
|
|
26
26
|
import QuestManager from "game/entity/player/quest/QuestManager";
|
|
27
27
|
import type { StatChangeCurrentTimerStrategy, StatChangeTimerFactory } from "game/entity/StatFactory";
|
|
28
|
+
import { TileUpdateType } from "game/IGame";
|
|
28
29
|
import type { IMoveToIslandOptions, IslandId } from "game/island/IIsland";
|
|
29
30
|
import type Island from "game/island/Island";
|
|
30
31
|
import type { IContainer, RecipeLevel } from "game/item/IItem";
|
|
@@ -42,9 +43,11 @@ import type { IUnserializedCallback } from "save/serializer/ISerializer";
|
|
|
42
43
|
import type { IContainerSortInfo, IContextMenuAction, IDialogInfo, IQuickSlotInfo } from "ui/old/IOldUi";
|
|
43
44
|
import { Direction } from "utilities/math/Direction";
|
|
44
45
|
import type { IVector2, IVector3 } from "utilities/math/IVector";
|
|
46
|
+
import type { IVector4 } from "utilities/math/Vector4";
|
|
45
47
|
export default class Player extends Human implements IUnserializedCallback {
|
|
46
48
|
event: IEventEmitter<this, IPlayerEvents>;
|
|
47
49
|
readonly entityType: EntityType.Player;
|
|
50
|
+
readonly tileUpdateType = TileUpdateType.Player;
|
|
48
51
|
absentLastUsedTime: number;
|
|
49
52
|
containerSortInfo: Record<string, IContainerSortInfo>;
|
|
50
53
|
dialogContainerInfo: Record<number, IDialogInfo>;
|
|
@@ -60,9 +63,7 @@ export default class Player extends Human implements IUnserializedCallback {
|
|
|
60
63
|
quickSlotInfo: IQuickSlotInfo[];
|
|
61
64
|
realTimeTickActionDelay: number;
|
|
62
65
|
revealedItems: Record<number, boolean>;
|
|
63
|
-
respawnPoint:
|
|
64
|
-
islandId: IslandId;
|
|
65
|
-
} & IVector3 | undefined;
|
|
66
|
+
respawnPoint: IVector4 | undefined;
|
|
66
67
|
tamedCreatures: Map<string, number[]>;
|
|
67
68
|
turns: number;
|
|
68
69
|
walkSoundCounter: number;
|
|
@@ -70,7 +71,6 @@ export default class Player extends Human implements IUnserializedCallback {
|
|
|
70
71
|
quests: QuestManager;
|
|
71
72
|
messages: MessageManager;
|
|
72
73
|
notes: NoteManager;
|
|
73
|
-
walkPath: IWalkPath | undefined;
|
|
74
74
|
exploredMap: ExploreMap[] | undefined;
|
|
75
75
|
finishedMovingClientside: boolean;
|
|
76
76
|
nextX: number;
|
|
@@ -80,7 +80,6 @@ export default class Player extends Human implements IUnserializedCallback {
|
|
|
80
80
|
nextMoveTime: number;
|
|
81
81
|
nextMoveDirection: Direction.Cardinal | Direction.None | undefined;
|
|
82
82
|
displayCreature?: CreatureType;
|
|
83
|
-
private readonly _movementIntent;
|
|
84
83
|
private readonly milestonesCollection;
|
|
85
84
|
private gameOptionsCached?;
|
|
86
85
|
private handEquippedToLast;
|
|
@@ -121,8 +120,7 @@ export default class Player extends Human implements IUnserializedCallback {
|
|
|
121
120
|
equip(item: Item, slot: EquipType, internal?: boolean, switchingHands?: boolean): boolean;
|
|
122
121
|
unequip(item: Item, internal?: boolean, skipMessage?: boolean, skipRevertItem?: boolean): void;
|
|
123
122
|
unequipAll(): void;
|
|
124
|
-
|
|
125
|
-
updateMovementIntent(movementIntent: IMovementIntent): void;
|
|
123
|
+
updateMovementIntent(movementIntent: IMovementIntent): boolean;
|
|
126
124
|
resetStatTimers(type?: StatChangeCurrentTimerStrategy): void;
|
|
127
125
|
/**
|
|
128
126
|
* Gets the max health of the player.
|
|
@@ -177,7 +175,7 @@ export default class Player extends Human implements IUnserializedCallback {
|
|
|
177
175
|
isServer(): boolean;
|
|
178
176
|
isMultiplayerHost(): boolean;
|
|
179
177
|
getName(): import("../../../language/impl/TranslationImpl").default;
|
|
180
|
-
canSeePosition(type: CanASeeBType,
|
|
178
|
+
canSeePosition(type: CanASeeBType, islandId: IslandId, x: number, y: number, z: number, fieldOfView?: FieldOfView, customRadius?: number): boolean;
|
|
181
179
|
markAsExplored(points: IVector2[]): boolean | undefined;
|
|
182
180
|
updateQuickSlotInfo(quickSlot: number, itemType?: ItemType, action?: IContextMenuAction, contextActionSlot?: number, contextActionType?: ActionType, canUseProtected?: boolean): void;
|
|
183
181
|
updateDialogInfo(dialogIndex: string | number): void;
|
|
@@ -188,7 +186,6 @@ export default class Player extends Human implements IUnserializedCallback {
|
|
|
188
186
|
respawn(reset: boolean): Promise<void>;
|
|
189
187
|
getMovementProgress(): number;
|
|
190
188
|
checkUnder(inFacingDirection?: boolean, options?: ICheckUnderOptions): ICheckUnderOptions;
|
|
191
|
-
hasWalkPath(): boolean;
|
|
192
189
|
walkAlongPath(path: IVector2[] | undefined, force?: boolean): void;
|
|
193
190
|
/**
|
|
194
191
|
* This is only ran on the server
|
|
@@ -209,10 +206,6 @@ export default class Player extends Human implements IUnserializedCallback {
|
|
|
209
206
|
* 2. If a mod is using the `GetPlayerStrength` hook and the calculation needs to be refreshed.
|
|
210
207
|
*/
|
|
211
208
|
updateStrength(): void;
|
|
212
|
-
/**
|
|
213
|
-
* Returns the bartering bonus for a given credit value
|
|
214
|
-
*/
|
|
215
|
-
getBarteringBonus(baseCredits: number): number;
|
|
216
209
|
/**
|
|
217
210
|
* Check if a position is marked as explored
|
|
218
211
|
* Only use this clientside
|
|
@@ -13,13 +13,13 @@ import type { InfoProviderContext } from "game/inspection/InfoProviderContext";
|
|
|
13
13
|
import LabelledValue from "game/inspection/infoProviders/LabelledValue";
|
|
14
14
|
import Inspection from "game/inspection/Inspection";
|
|
15
15
|
import Island from "game/island/Island";
|
|
16
|
-
import
|
|
17
|
-
export default class IslandInspection extends Inspection<
|
|
16
|
+
import type { IVector2 } from "utilities/math/IVector";
|
|
17
|
+
export default class IslandInspection extends Inspection<IVector2> {
|
|
18
18
|
private readonly title;
|
|
19
19
|
static getIslandName(island?: Island, useGenerated?: boolean): import("../../../language/impl/TranslationImpl").default;
|
|
20
20
|
static handles(type: InspectType, island: unknown): boolean;
|
|
21
21
|
get island(): Island | undefined;
|
|
22
|
-
constructor(island: Island |
|
|
22
|
+
constructor(island: Island | IVector2, title?: boolean);
|
|
23
23
|
getId(): string;
|
|
24
24
|
get(context: InfoProviderContext): (import("game/inspection/InfoProvider").SimpleInfoProvider | LabelledValue)[];
|
|
25
25
|
private getTreasureMaps;
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import NPC from "game/entity/npc/NPC";
|
|
12
|
+
import { InspectType } from "game/inspection/IInspection";
|
|
12
13
|
import HumanInspection from "game/inspection/inspections/HumanInspection";
|
|
13
14
|
import type { IVector3 } from "utilities/math/IVector";
|
|
14
15
|
export default class NPCInspection extends HumanInspection<NPC> {
|
|
15
16
|
static getFromTile(position: IVector3): never[] | NPCInspection;
|
|
16
|
-
static handles(npc: unknown): boolean;
|
|
17
|
+
static handles(type: InspectType, npc: unknown): boolean;
|
|
17
18
|
constructor(npc: NPC);
|
|
18
19
|
getBorder(): string;
|
|
19
20
|
}
|
|
@@ -17,7 +17,6 @@ import type Entity from "game/entity/Entity";
|
|
|
17
17
|
import type Human from "game/entity/Human";
|
|
18
18
|
import { DamageType, EntityType } from "game/entity/IEntity";
|
|
19
19
|
import { EquipType, SkillType } from "game/entity/IHuman";
|
|
20
|
-
import type NPC from "game/entity/npc/NPC";
|
|
21
20
|
import type Player from "game/entity/player/Player";
|
|
22
21
|
import { CreationId } from "game/IGame";
|
|
23
22
|
import type { IObject, IObjectOptions } from "game/IObject";
|
|
@@ -202,22 +201,22 @@ export default class Item extends EventEmitter.Host<IItemEvents> implements IRef
|
|
|
202
201
|
rerollMagicalPropertyValues(): void;
|
|
203
202
|
addMagicalProperty(type: MagicalPropertyType, subType?: MagicalSubPropertySubTypes): boolean;
|
|
204
203
|
getMagicalPropertyInfo(type: MagicalPropertyType): IMagicalPropertyInfo | undefined;
|
|
205
|
-
acquireNotify(
|
|
204
|
+
acquireNotify(human: Human): void;
|
|
206
205
|
getStokeFireValue(): number | undefined;
|
|
207
206
|
getStokeFireBonusValue(): number;
|
|
208
207
|
getOnUseBonus(): number;
|
|
209
208
|
/**
|
|
210
209
|
* Gets the worth of an item used for merchant trading. Does not consider batering or modifiers bonuses; use Item.getTraderSellPrice for that.
|
|
211
|
-
* @param
|
|
210
|
+
* @param human The human that is trading the item for its worth (used for durability calculations).
|
|
212
211
|
* @param magicalWorth Include the value of `MagicalPropertyType.Worth`, defaults to true
|
|
213
212
|
*/
|
|
214
|
-
getWorth(
|
|
213
|
+
getWorth(human: Human | undefined, magicalWorth?: boolean): number;
|
|
215
214
|
/**
|
|
216
|
-
* The full price the item will go for when traded to a merchant NPC. Considers modifiers and a
|
|
217
|
-
* @param
|
|
215
|
+
* The full price the item will go for when traded to a merchant NPC. Considers modifiers and a human's bartering skill.
|
|
216
|
+
* @param human The human that is trading the item.
|
|
218
217
|
* @param magicalWorth Include the value of `MagicalPropertyType.Worth`, defaults to true
|
|
219
218
|
*/
|
|
220
|
-
getTraderSellPrice(
|
|
219
|
+
getTraderSellPrice(human: Human | undefined, magicalWorth?: boolean): number;
|
|
221
220
|
canBurnPlayer(): boolean;
|
|
222
221
|
getBaseDefense(): number;
|
|
223
222
|
getDurabilityCharge(): number;
|
|
@@ -259,12 +258,12 @@ export default class Item extends EventEmitter.Host<IItemEvents> implements IRef
|
|
|
259
258
|
* @returns A number (possibly 0 if no quality or action level).
|
|
260
259
|
*/
|
|
261
260
|
getItemUseBonus(action: ActionType): number;
|
|
262
|
-
getRangedWeapon(
|
|
261
|
+
getRangedWeapon(human: Human): Item | boolean;
|
|
263
262
|
/**
|
|
264
263
|
* Extinguishes to item if it is lit.
|
|
265
|
-
* @param
|
|
264
|
+
* @param human Human entity that is carrying the item to extinguish.
|
|
266
265
|
*/
|
|
267
|
-
extinguish(
|
|
266
|
+
extinguish(human: Human | undefined): void;
|
|
268
267
|
/**
|
|
269
268
|
* Get the maximum durability for an item based on many factors.
|
|
270
269
|
* @param human Player that we checking to get the maximum item durability (as game options can affect this).
|
|
@@ -200,7 +200,7 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
|
|
|
200
200
|
isItemInContainer(container: IContainer, itemTypeSearch: ItemType, options?: Partial<IGetItemOptions>): boolean;
|
|
201
201
|
isContainableInContainer(containable: IContainable, container: IContainer): boolean;
|
|
202
202
|
getAdjacentContainers(humanOrPosition: Human | IVector3, includeNpcs?: boolean, ignoreOptions?: boolean): IContainer[];
|
|
203
|
-
isContainableInAdjacentContainer(
|
|
203
|
+
isContainableInAdjacentContainer(human: Human, containable: IContainable, includeNpcs?: boolean, ignoreOptions?: boolean): boolean;
|
|
204
204
|
isInInventory(containable: IContainable): boolean;
|
|
205
205
|
isTileContainer(container: IContainer | undefined): boolean;
|
|
206
206
|
/**
|
|
@@ -253,11 +253,11 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
|
|
|
253
253
|
/**
|
|
254
254
|
* Summons a void dweller based on item worth and chance or provides a hint message.
|
|
255
255
|
* @param item Item to get the worth of.
|
|
256
|
-
* @param
|
|
256
|
+
* @param human The human that is dropping the item.
|
|
257
257
|
* @param point The point in which we are dropping the item.
|
|
258
258
|
* @returns True or false based on if we get a message or not.
|
|
259
259
|
*/
|
|
260
|
-
summonVoidDweller(item: Item,
|
|
260
|
+
summonVoidDweller(item: Item, human: Human, point: IVector3): boolean;
|
|
261
261
|
/**
|
|
262
262
|
* Note: don't print items to the console because the console will hold the item indefinitely
|
|
263
263
|
*/
|
|
@@ -44,7 +44,7 @@ interface IReferenceTypeMap {
|
|
|
44
44
|
export declare type Referenceable = IReferenceTypeMap[ReferenceableReferenceTypes];
|
|
45
45
|
export default class ReferenceManager {
|
|
46
46
|
static isEnumReference(type: ReferenceType): type is EnumReferenceTypes;
|
|
47
|
-
static getList(type: ReferenceType, gameIsland?: Island): import("../entity/creature/corpse/CorpseManager").default | import("../entity/creature/CreatureManager").default | import("../doodad/DoodadManager").default | import("../item/ItemManager").default | import("../entity/npc/NPCManager").default | import("../tile/TileEventManager").default | Player[] | readonly Milestone[] | readonly
|
|
47
|
+
static getList(type: ReferenceType, gameIsland?: Island): import("../entity/creature/corpse/CorpseManager").default | import("../entity/creature/CreatureManager").default | import("../doodad/DoodadManager").default | import("../item/ItemManager").default | import("../entity/npc/NPCManager").default | import("../tile/TileEventManager").default | Player[] | readonly Milestone[] | readonly SkillType[] | readonly ItemType[] | IterableIterator<Island> | readonly Stat[];
|
|
48
48
|
private referenceCursor;
|
|
49
49
|
create(): number;
|
|
50
50
|
get(thing: Referenceable): Reference | undefined;
|
|
@@ -54,53 +54,54 @@ export declare enum MultiplayerSyncCheck {
|
|
|
54
54
|
Doodad = 15,
|
|
55
55
|
DoodadManager = 16,
|
|
56
56
|
EncumberedStatus = 17,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
57
|
+
Entity = 18,
|
|
58
|
+
ExhaustedPreMove = 19,
|
|
59
|
+
FlowFieldHashCode = 20,
|
|
60
|
+
FlowFieldPenalty = 21,
|
|
61
|
+
FlowFieldUpdate = 22,
|
|
62
|
+
FlowFieldUpdateTile = 23,
|
|
63
|
+
FlowFieldValue = 24,
|
|
64
|
+
HandToUse = 25,
|
|
65
|
+
HealthChange = 26,
|
|
66
|
+
InventoryCount = 27,
|
|
67
|
+
Island = 28,
|
|
68
|
+
IslandCivilizationScore = 29,
|
|
69
|
+
Islands = 30,
|
|
70
|
+
IsTileEmpty = 31,
|
|
71
|
+
Item = 32,
|
|
72
|
+
ItemCraft = 33,
|
|
73
|
+
ItemDamage = 34,
|
|
74
|
+
ItemOrder = 35,
|
|
75
|
+
LastCreationIds = 36,
|
|
76
|
+
Merchant = 37,
|
|
77
|
+
MilestoneSeed = 38,
|
|
78
|
+
Misc = 39,
|
|
79
|
+
Modifier = 40,
|
|
80
|
+
MoveToTile = 41,
|
|
81
|
+
PenaltyFieldHashCode = 42,
|
|
82
|
+
PlaceOnTile = 43,
|
|
83
|
+
PlayerManager = 44,
|
|
84
|
+
PlayerPositions = 45,
|
|
85
|
+
Players = 46,
|
|
86
|
+
PlayerSetup = 47,
|
|
87
|
+
Random = 48,
|
|
88
|
+
Reputation = 49,
|
|
89
|
+
Seed = 50,
|
|
90
|
+
SeededGenerator = 51,
|
|
91
|
+
SkillGain = 52,
|
|
92
|
+
StaminaChanges = 53,
|
|
93
|
+
StatChange = 54,
|
|
94
|
+
Stats = 55,
|
|
95
|
+
StatusChange = 56,
|
|
96
|
+
StatusEffect = 57,
|
|
97
|
+
SyncChecks = 58,
|
|
98
|
+
TemperatureManager = 59,
|
|
99
|
+
Temporary = 60,
|
|
100
|
+
Tick = 61,
|
|
101
|
+
TileEvent = 62,
|
|
102
|
+
Time = 63,
|
|
103
|
+
UpdateDirection = 64,
|
|
104
|
+
Weight = 65
|
|
104
105
|
}
|
|
105
106
|
export declare const maxPlayers = 32;
|
|
106
107
|
export declare const packetTickRate = 16;
|
|
@@ -64,43 +64,44 @@ export declare enum RenderSource {
|
|
|
64
64
|
Mod = 20,
|
|
65
65
|
MovementCreature = 21,
|
|
66
66
|
MovementNPC = 22,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
67
|
+
MovementPlayer = 23,
|
|
68
|
+
MovementPlayerPost = 24,
|
|
69
|
+
MovementPlayerPre = 25,
|
|
70
|
+
MovementPlayerZPost = 26,
|
|
71
|
+
MovementPlayerZPre = 27,
|
|
72
|
+
MovementTileEvent = 28,
|
|
73
|
+
MultiplayerDisconnect = 29,
|
|
74
|
+
Notifier = 30,
|
|
75
|
+
NotifierAddCreature = 31,
|
|
76
|
+
NotifierAddItem = 32,
|
|
77
|
+
NotifierAddNotifierIcon = 33,
|
|
78
|
+
NotifierAddStat = 34,
|
|
79
|
+
NotifierAddStatusType = 35,
|
|
80
|
+
OptionHeadgear = 36,
|
|
81
|
+
OptionVisionMode = 37,
|
|
82
|
+
OptionZoomLevel = 38,
|
|
83
|
+
Particles = 39,
|
|
84
|
+
ParticleSpawn = 40,
|
|
85
|
+
PlayerAdd = 41,
|
|
86
|
+
PlayerKill = 42,
|
|
87
|
+
PlayerProcessMovement = 43,
|
|
88
|
+
PlayerReady = 44,
|
|
89
|
+
PlayerRemove = 45,
|
|
90
|
+
PlayerRespawn = 46,
|
|
91
|
+
PlayerRest = 47,
|
|
92
|
+
PlayerRestStart = 48,
|
|
93
|
+
PlayerRestStop = 49,
|
|
94
|
+
PlayerVehicle = 50,
|
|
95
|
+
PlayerWalkToTilePath = 51,
|
|
96
|
+
PlayerWalkToTilePathOverburdened = 52,
|
|
97
|
+
PlayerWalkToTilePathPreview = 53,
|
|
98
|
+
PlayerWalkToTilePathReset = 54,
|
|
99
|
+
RemoveBlood = 55,
|
|
100
|
+
Resize = 56,
|
|
101
|
+
SetupGl = 57,
|
|
102
|
+
StartGame = 58,
|
|
103
|
+
Steamworks = 59,
|
|
104
|
+
Thumbnail = 60,
|
|
105
|
+
WorldLayerRendererFlush = 61
|
|
105
106
|
}
|
|
106
107
|
export declare function calculateAmbientLightLevel(origin: IRendererOrigin, z: number): number;
|
|
@@ -16,6 +16,7 @@ import type Island from "game/island/Island";
|
|
|
16
16
|
import FieldOfView from "renderer/fieldOfView/FieldOfView";
|
|
17
17
|
import type { CanASeeBType } from "renderer/fieldOfView/IFieldOfView";
|
|
18
18
|
import type { IVector3 } from "utilities/math/IVector";
|
|
19
|
+
import type { IVector4 } from "utilities/math/Vector4";
|
|
19
20
|
export interface IRendererOrigin {
|
|
20
21
|
readonly islandId: IslandId;
|
|
21
22
|
readonly island: Island;
|
|
@@ -28,11 +29,11 @@ export interface IRendererOrigin {
|
|
|
28
29
|
readonly asEntity: Entity | undefined;
|
|
29
30
|
readonly asPlayer: Player | undefined;
|
|
30
31
|
readonly asHuman: Human | undefined;
|
|
31
|
-
|
|
32
|
-
canSeeObject(type: CanASeeBType, object: IVector3 & {
|
|
32
|
+
canSeeObject(type: CanASeeBType, object: IVector4 & {
|
|
33
33
|
fromX: number;
|
|
34
34
|
fromY: number;
|
|
35
35
|
}, fieldOfView: FieldOfView | undefined): boolean;
|
|
36
|
+
canSeePosition(type: CanASeeBType, islandId: IslandId, x: number, y: number, z: number, fieldOfView: FieldOfView | undefined): boolean;
|
|
36
37
|
getMovementProgress(timeStamp: number): number;
|
|
37
38
|
}
|
|
38
39
|
export declare class RendererOrigin implements IRendererOrigin {
|
|
@@ -47,13 +48,13 @@ export declare class RendererOrigin implements IRendererOrigin {
|
|
|
47
48
|
readonly isMovingClientside: boolean;
|
|
48
49
|
readonly asEntity: Entity | undefined;
|
|
49
50
|
readonly asPlayer: Player | undefined;
|
|
50
|
-
readonly asHuman:
|
|
51
|
+
readonly asHuman: Human | undefined;
|
|
51
52
|
private constructor();
|
|
52
53
|
get island(): Island;
|
|
53
54
|
getMovementProgress(_timeStamp: number): number;
|
|
54
|
-
canSeeObject(type: CanASeeBType, object:
|
|
55
|
+
canSeeObject(type: CanASeeBType, object: IVector4 & {
|
|
55
56
|
fromX: number;
|
|
56
57
|
fromY: number;
|
|
57
58
|
}, fieldOfView: FieldOfView | undefined): boolean;
|
|
58
|
-
canSeePosition(type: CanASeeBType, x: number, y: number, z: number, fieldOfView: FieldOfView | undefined): boolean;
|
|
59
|
+
canSeePosition(type: CanASeeBType, islandId: IslandId, x: number, y: number, z: number, fieldOfView: FieldOfView | undefined): boolean;
|
|
59
60
|
}
|
|
@@ -21,6 +21,7 @@ import type { IBound3 } from "utilities/math/Bound3";
|
|
|
21
21
|
import type { IVector2, IVector3 } from "utilities/math/IVector";
|
|
22
22
|
import Vector2 from "utilities/math/Vector2";
|
|
23
23
|
import type { IRendererOrigin } from "renderer/context/RendererOrigin";
|
|
24
|
+
import type { IslandId } from "game/island/IIsland";
|
|
24
25
|
export default class FieldOfView extends EventEmitter.Host<IFieldOfViewEvents> {
|
|
25
26
|
protected readonly context: RendererContext;
|
|
26
27
|
private readonly worldRenderer;
|
|
@@ -50,7 +51,7 @@ export default class FieldOfView extends EventEmitter.Host<IFieldOfViewEvents> {
|
|
|
50
51
|
private transitionFinishTime;
|
|
51
52
|
private lastComputedIslandId;
|
|
52
53
|
static initializePrograms(webGlContext: WebGlContext): Promise<void>;
|
|
53
|
-
static canSeePosition(origin: IRendererOrigin, type: CanASeeBType, tileX: number, tileY: number, tileZ: number, fieldOfView?: FieldOfView | undefined, customRadius?: number): boolean;
|
|
54
|
+
static canSeePosition(origin: IRendererOrigin, type: CanASeeBType, islandId: IslandId, tileX: number, tileY: number, tileZ: number, fieldOfView?: FieldOfView | undefined, customRadius?: number): boolean;
|
|
54
55
|
static getBounds(origin: IVector3, radius: number): IBound3;
|
|
55
56
|
/**
|
|
56
57
|
* Updates the explored tiles around players
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import type { SfxType } from "audio/IAudio";
|
|
12
|
+
import type { IslandId } from "game/island/IIsland";
|
|
12
13
|
import type { IVector2, IVector3 } from "utilities/math/IVector";
|
|
13
14
|
export interface INotificationLocation extends IVector3 {
|
|
14
|
-
readonly islandId:
|
|
15
|
+
readonly islandId: IslandId;
|
|
15
16
|
getMovementPoint?(timeStamp: number): IVector2;
|
|
16
17
|
queueSoundEffect?(soundEffect: SfxType): void;
|
|
17
18
|
}
|
|
@@ -32,7 +32,7 @@ export default class Particle {
|
|
|
32
32
|
constructor(context: RendererContext, worldRenderer: WorldRenderer, maxParticles?: number);
|
|
33
33
|
delete(): void;
|
|
34
34
|
create(island: Island, tileX: number, tileY: number, tileZ: number, particle: IRGB): void;
|
|
35
|
-
createMultiple(island: Island, tileX: number, tileY: number, tileZ: number, particle: IRGB, count: number, intensity?: number
|
|
35
|
+
createMultiple(island: Island, tileX: number, tileY: number, tileZ: number, particle: IRGB, count: number, intensity?: number): void;
|
|
36
36
|
clear(): void;
|
|
37
37
|
update(timeStamp: number): void;
|
|
38
38
|
render(x: number, y: number): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2021 Unlok
|
|
3
|
+
* https://www.unlok.ca
|
|
4
|
+
*
|
|
5
|
+
* Credits & Thanks:
|
|
6
|
+
* https://www.unlok.ca/credits-thanks/
|
|
7
|
+
*
|
|
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
|
+
* https://github.com/WaywardGame/types/wiki
|
|
10
|
+
*/
|
|
11
|
+
import type { IslandId } from "game/island/IIsland";
|
|
12
|
+
import type { IVector3 } from "utilities/math/IVector";
|
|
13
|
+
import Vector3 from "utilities/math/Vector3";
|
|
14
|
+
export interface IVector4 extends IVector3 {
|
|
15
|
+
readonly islandId: IslandId;
|
|
16
|
+
}
|
|
17
|
+
export default class Vector4 extends Vector3 implements IVector4 {
|
|
18
|
+
readonly islandId: IslandId;
|
|
19
|
+
constructor(islandId: IslandId, x: number, y: number, z: number);
|
|
20
|
+
}
|
package/package.json
CHANGED