@wayward/types 2.11.4-beta.dev.20220127.1 → 2.11.4-beta.dev.20220201.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/EntityManager.d.ts +2 -6
- package/definitions/game/game/entity/Human.d.ts +10 -3
- package/definitions/game/game/entity/IEntityManager.d.ts +5 -6
- package/definitions/game/game/entity/IHuman.d.ts +16 -0
- package/definitions/game/game/entity/action/Actions.d.ts +4 -4
- package/definitions/game/game/entity/action/actions/Butcher.d.ts +1 -1
- package/definitions/game/game/entity/action/actions/Equip.d.ts +1 -1
- package/definitions/game/game/entity/action/actions/Idle.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/ICreatureManager.d.ts +0 -5
- package/definitions/game/game/entity/creature/Pathing.d.ts +2 -2
- package/definitions/game/game/entity/npc/NPC.d.ts +3 -2
- package/definitions/game/game/entity/player/IPlayer.d.ts +0 -10
- package/definitions/game/game/entity/player/MessageManager.d.ts +2 -2
- package/definitions/game/game/entity/player/Player.d.ts +14 -12
- package/definitions/game/game/island/Island.d.ts +7 -1
- package/definitions/game/game/item/ItemManager.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 +3 -2
- package/definitions/game/renderer/notifier/INotifier.d.ts +2 -1
- package/definitions/game/renderer/particle/Particle.d.ts +1 -1
- package/definitions/game/utilities/SearchParams.d.ts +15 -0
- package/definitions/game/utilities/math/Vector4.d.ts +20 -0
- package/package.json +1 -1
- package/tsconfig.mod.base.json +3 -6
|
@@ -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;
|
|
@@ -8,11 +8,9 @@
|
|
|
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 { IMoveTypeZ } from "game/entity/creature/ICreatureManager";
|
|
12
11
|
import type Entity from "game/entity/Entity";
|
|
13
|
-
import type { IEntityManager } from "game/entity/IEntityManager";
|
|
12
|
+
import type { IEntityManager, IPlayerBound } from "game/entity/IEntityManager";
|
|
14
13
|
import { ObjectManager } from "game/ObjectManager";
|
|
15
|
-
import Bound3 from "utilities/math/Bound3";
|
|
16
14
|
export interface IEntityManagerEvents<T extends Entity> {
|
|
17
15
|
spawn(entity: T): any;
|
|
18
16
|
remove(entity: T): any;
|
|
@@ -25,10 +23,8 @@ export interface IEntityCanCreateOptions {
|
|
|
25
23
|
chanceOfScarecrowScare?: number;
|
|
26
24
|
}
|
|
27
25
|
export default abstract class EntityManager<T extends Entity> extends ObjectManager<T, IEntityManagerEvents<T>> implements IEntityManager<T> {
|
|
28
|
-
private readonly moveTypesInFov;
|
|
29
26
|
remove(entity: T): void;
|
|
30
|
-
updateFov(
|
|
31
|
-
getMoveTypesInFov(): IMoveTypeZ[];
|
|
27
|
+
updateFov(playerBounds: IPlayerBound[]): void;
|
|
32
28
|
/**
|
|
33
29
|
* Checks if the target position is a good spot for a new entity
|
|
34
30
|
*/
|
|
@@ -16,8 +16,8 @@ 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";
|
|
20
|
-
import { PlayerState } from "game/entity/player/IPlayer";
|
|
19
|
+
import type { IAttackHand, IMobCheck, IMovementIntent, IWalkPath } from "game/entity/player/IPlayer";
|
|
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";
|
|
23
23
|
import { StatChangeCurrentTimerStrategy } from "game/entity/StatFactory";
|
|
@@ -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;
|
|
@@ -53,11 +53,13 @@ export default abstract class Human extends Entity implements IHasInsulation {
|
|
|
53
53
|
islandId: IslandId;
|
|
54
54
|
options: Readonly<IOptions>;
|
|
55
55
|
readonly equipEffects: Map<EquipEffect, EquipEffects>;
|
|
56
|
+
readonly movementIntent: IMovementIntent;
|
|
56
57
|
restData: IRestData | undefined;
|
|
57
58
|
score: number;
|
|
58
59
|
state: PlayerState;
|
|
59
60
|
swimming: boolean;
|
|
60
61
|
vehicleItemReference: ItemReference | undefined;
|
|
62
|
+
walkPath: IWalkPath | undefined;
|
|
61
63
|
identifier: string;
|
|
62
64
|
skill: SkillManager;
|
|
63
65
|
private readonly privateStore;
|
|
@@ -89,6 +91,7 @@ export default abstract class Human extends Entity implements IHasInsulation {
|
|
|
89
91
|
updateReputation(reputation: number): void;
|
|
90
92
|
capReputation(): void;
|
|
91
93
|
setPaddling(item: Item | undefined, extinguishTorches?: boolean): void;
|
|
94
|
+
getWeightStatus(): WeightStatus;
|
|
92
95
|
/**
|
|
93
96
|
* Extinguishes all torches the player is holding.
|
|
94
97
|
*/
|
|
@@ -106,6 +109,10 @@ export default abstract class Human extends Entity implements IHasInsulation {
|
|
|
106
109
|
burn(fireType: FireType, skipMessage?: boolean, skipParry?: boolean, equipType?: EquipType, fromCombat?: boolean): number | undefined;
|
|
107
110
|
setPosition(point: IVector3): void;
|
|
108
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;
|
|
109
116
|
checkUnder(inFacingDirection?: boolean, options?: ICheckUnderOptions): ICheckUnderOptions;
|
|
110
117
|
damageByInteractingWith(thing: Doodad | TileEvent, options: ICheckUnderOptions | undefined, damageLocation: EquipType): ICheckUnderOptions;
|
|
111
118
|
equip(item: Item, slot: EquipType): boolean;
|
|
@@ -9,15 +9,14 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import type Entity from "game/entity/Entity";
|
|
12
|
-
import type
|
|
12
|
+
import type Player from "game/entity/player/Player";
|
|
13
13
|
import type { IBound3 } from "utilities/math/Bound3";
|
|
14
14
|
export interface IEntityManager<T extends Entity> {
|
|
15
15
|
remove(entity: T): void;
|
|
16
|
-
updateFov(
|
|
17
|
-
getMoveTypesInFov(): IMoveTypeZ[];
|
|
16
|
+
updateFov(playerBounds: IPlayerBound[]): void;
|
|
18
17
|
}
|
|
19
18
|
export default IEntityManager;
|
|
20
|
-
export interface
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
export interface IPlayerBound {
|
|
20
|
+
player: Player;
|
|
21
|
+
bound: IBound3;
|
|
23
22
|
}
|
|
@@ -14,6 +14,7 @@ import type { ActionType } from "game/entity/action/IAction";
|
|
|
14
14
|
import type Entity from "game/entity/Entity";
|
|
15
15
|
import type Human from "game/entity/Human";
|
|
16
16
|
import type { AttackType } from "game/entity/IEntity";
|
|
17
|
+
import type { WeightStatus } from "game/entity/player/IPlayer";
|
|
17
18
|
import type { ISkillEvents } from "game/entity/skill/SkillManager";
|
|
18
19
|
import type { IHasImagePath, Quality } from "game/IObject";
|
|
19
20
|
import type { ItemType } from "game/item/IItem";
|
|
@@ -24,6 +25,7 @@ import type { ITile } from "game/tile/ITerrain";
|
|
|
24
25
|
import type { IModdable } from "mod/ModRegistry";
|
|
25
26
|
import type { IRGB } from "utilities/Color";
|
|
26
27
|
import type { Direction } from "utilities/math/Direction";
|
|
28
|
+
import type { IVector2 } from "utilities/math/IVector";
|
|
27
29
|
import type { IRange } from "utilities/math/Range";
|
|
28
30
|
export interface IHumanEvents extends Events<Entity>, ISkillEvents {
|
|
29
31
|
/**
|
|
@@ -55,12 +57,21 @@ export interface IHumanEvents extends Events<Entity>, ISkillEvents {
|
|
|
55
57
|
*/
|
|
56
58
|
canAttack(weapon: Item | undefined, attackType: AttackType): boolean | undefined;
|
|
57
59
|
calculateEquipmentStats(): any;
|
|
60
|
+
/**
|
|
61
|
+
* Called when getting the players weight status
|
|
62
|
+
* @returns The weight status of the player or undefined to use the default logic
|
|
63
|
+
*/
|
|
64
|
+
getWeightStatus(): WeightStatus | undefined;
|
|
58
65
|
/**
|
|
59
66
|
* Called when checking if a human is swimming
|
|
60
67
|
* @param isSwimming True if the human is swimming
|
|
61
68
|
* @returns True if the human should be swimming, false if they should not be swimming, or undefined to use the default logic
|
|
62
69
|
*/
|
|
63
70
|
isSwimming(isSwimming: boolean): boolean | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Called when the walk path of the player changes.
|
|
73
|
+
*/
|
|
74
|
+
walkPathChange(walkPath: IVector2[] | undefined): any;
|
|
64
75
|
/**
|
|
65
76
|
* Called when a book is opened by a player
|
|
66
77
|
* @param book The book that was opened
|
|
@@ -229,3 +240,8 @@ export interface IHumanOld extends Partial<Human> {
|
|
|
229
240
|
core: number;
|
|
230
241
|
}>;
|
|
231
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* At this weight or more, you are encumbered.
|
|
245
|
+
* Defaults to 90% (0.9)
|
|
246
|
+
*/
|
|
247
|
+
export declare const WEIGHT_ENCUMBERED = 0.9;
|
|
@@ -16,7 +16,7 @@ declare const actionDescriptions: {
|
|
|
16
16
|
78: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
|
|
17
17
|
3: 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)?]>;
|
|
18
18
|
27: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
|
|
19
|
-
5: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory], import("../player/Player").default, void, [import("../../item/Item").default]>;
|
|
19
|
+
5: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
|
|
20
20
|
15: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
|
|
21
21
|
99: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemInventory, 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/Item").default | undefined)?, (boolean | undefined)?]>;
|
|
22
22
|
71: 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)?]>;
|
|
@@ -35,7 +35,7 @@ declare const actionDescriptions: {
|
|
|
35
35
|
7: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
|
|
36
36
|
83: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby, [import("game/entity/action/IAction").ActionArgument.ItemNearby, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default, (import("../../item/Item").default | undefined)?]>;
|
|
37
37
|
93: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory, [import("game/entity/action/IAction").ActionArgument.ItemInventory, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default, (import("../../item/Item").default | undefined)?]>;
|
|
38
|
-
63: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby, import("game/entity/action/IAction").ActionArgument.EquipType, [import("game/entity/action/IAction").ActionArgument.Boolean, 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, void, [import("../../item/Item").default, import("../IHuman").EquipType, (boolean | undefined)?, (boolean | undefined)?]>;
|
|
38
|
+
63: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby, import("game/entity/action/IAction").ActionArgument.EquipType, [import("game/entity/action/IAction").ActionArgument.Boolean, 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/Item").default, import("../IHuman").EquipType, (boolean | undefined)?, (boolean | undefined)?]>;
|
|
39
39
|
37: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
|
|
40
40
|
35: 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)?]>;
|
|
41
41
|
21: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemInventory, 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/Item").default | undefined)?, (boolean | undefined)?]>;
|
|
@@ -46,7 +46,7 @@ declare const actionDescriptions: {
|
|
|
46
46
|
11: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
|
|
47
47
|
45: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
|
|
48
48
|
76: import("./Action").Action<[], import("../player/Player").default | import("../npc/NPC").default, void, []>;
|
|
49
|
-
60: import("./Action").Action<[], import("../player/Player").default, void, []>;
|
|
49
|
+
60: import("./Action").Action<[], import("../player/Player").default | import("../npc/NPC").default, void, []>;
|
|
50
50
|
26: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory], import("../player/Player").default | import("../npc/NPC").default, void, [import("../../item/Item").default]>;
|
|
51
51
|
91: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.Integer32, [import("game/entity/action/IAction").ActionArgument.Boolean, import("game/entity/action/IAction").ActionArgument.Integer32], [import("game/entity/action/IAction").ActionArgument.Object, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../player/Player").default, void, [number, number | boolean, any?]>;
|
|
52
52
|
56: import("./Action").Action<[], import("../player/Player").default | import("../npc/NPC").default, void, []>;
|
|
@@ -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;
|
|
@@ -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.ItemNearby, ActionArgument.EquipType, [ActionArgument.Boolean, ActionArgument.Undefined], [ActionArgument.Boolean, ActionArgument.Undefined]], import("../../player/Player").default, void, [import("../../../item/Item").default, import("game/entity/IHuman").EquipType, (boolean | undefined)?, (boolean | undefined)?]>;
|
|
13
|
+
declare const _default: Action<[ActionArgument.ItemNearby, ActionArgument.EquipType, [ActionArgument.Boolean, ActionArgument.Undefined], [ActionArgument.Boolean, ActionArgument.Undefined]], import("../../player/Player").default | import("../../npc/NPC").default, void, [import("../../../item/Item").default, import("game/entity/IHuman").EquipType, (boolean | undefined)?, (boolean | undefined)?]>;
|
|
14
14
|
export default _default;
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import { Action } from "game/entity/action/Action";
|
|
12
|
-
declare const _default: Action<[], import("../../player/Player").default, void, []>;
|
|
12
|
+
declare const _default: Action<[], import("../../player/Player").default | import("../../npc/NPC").default, void, []>;
|
|
13
13
|
export default _default;
|
|
@@ -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
|
*/
|
|
@@ -9,12 +9,7 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import type { CreatureType } from "game/entity/creature/ICreature";
|
|
12
|
-
import type { MoveType } from "game/entity/IEntity";
|
|
13
12
|
export interface ISpawnableCreatures {
|
|
14
13
|
pool: CreatureType[];
|
|
15
14
|
aberrantChance: number;
|
|
16
15
|
}
|
|
17
|
-
export interface IMoveTypeZ {
|
|
18
|
-
moveType: MoveType;
|
|
19
|
-
z: number;
|
|
20
|
-
}
|
|
@@ -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;
|
|
@@ -128,7 +129,7 @@ export default abstract class NPC extends Human {
|
|
|
128
129
|
protected autoScaleStats(): void;
|
|
129
130
|
protected preMove(fromX: number, fromY: number, fromZ: number, fromTile: ITile, toX: number, toY: number, toZ: number, toTile: ITile): boolean | void | undefined;
|
|
130
131
|
protected postMove(): void;
|
|
131
|
-
|
|
132
|
+
protected checkMove(moveType: MoveType, tileX: number, tileY: number, tileZ: number): 0 | -1 | -2 | -3 | -4 | -5;
|
|
132
133
|
get asNPC(): NPC;
|
|
133
134
|
get asPlayer(): undefined;
|
|
134
135
|
get asLocalPlayer(): undefined;
|
|
@@ -183,11 +183,6 @@ export interface IPlayerEvents extends Events<Human> {
|
|
|
183
183
|
* @returns A number to set the player weight to or undefined to use the default logic
|
|
184
184
|
*/
|
|
185
185
|
updateWeight(newWeight: number): number | undefined;
|
|
186
|
-
/**
|
|
187
|
-
* Called when getting the players weight status
|
|
188
|
-
* @returns The weight status of the player or undefined to use the default logic
|
|
189
|
-
*/
|
|
190
|
-
getWeightStatus(): WeightStatus | undefined;
|
|
191
186
|
/**
|
|
192
187
|
* Called when getting the players weight or stamina movement penalty
|
|
193
188
|
* @returns The weight/stamina movement penalty for the player or undefined to use the default logic
|
|
@@ -376,11 +371,6 @@ export declare enum WeightStatus {
|
|
|
376
371
|
* The amount of extra weight the player can hold (added to max health)
|
|
377
372
|
*/
|
|
378
373
|
export declare const STRENGTH_BONUS = 25;
|
|
379
|
-
/**
|
|
380
|
-
* At this weight or more, you are encumbered.
|
|
381
|
-
* Defaults to 90% (0.9)
|
|
382
|
-
*/
|
|
383
|
-
export declare const WEIGHT_ENCUMBERED = 0.9;
|
|
384
374
|
export interface IWalkPath {
|
|
385
375
|
path: IVector2[];
|
|
386
376
|
force?: boolean;
|
|
@@ -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
|
|
23
|
-
import { TurnType
|
|
22
|
+
import type { ILoadOnIslandOptions, IMovementIntent, IPlayerEvents } from "game/entity/player/IPlayer";
|
|
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.
|
|
@@ -144,7 +142,6 @@ export default class Player extends Human implements IUnserializedCallback {
|
|
|
144
142
|
load(): void;
|
|
145
143
|
setup(spawnPoint: IVector3): void;
|
|
146
144
|
updateReputation(reputation: number): void;
|
|
147
|
-
getWeightStatus(): WeightStatus;
|
|
148
145
|
getWeightOrStaminaMovementPenalty(): number;
|
|
149
146
|
/**
|
|
150
147
|
* Check if there is a still in front of the player.
|
|
@@ -178,7 +175,7 @@ export default class Player extends Human implements IUnserializedCallback {
|
|
|
178
175
|
isServer(): boolean;
|
|
179
176
|
isMultiplayerHost(): boolean;
|
|
180
177
|
getName(): import("../../../language/impl/TranslationImpl").default;
|
|
181
|
-
canSeePosition(type: CanASeeBType,
|
|
178
|
+
canSeePosition(type: CanASeeBType, islandId: IslandId, x: number, y: number, z: number, fieldOfView?: FieldOfView, customRadius?: number): boolean;
|
|
182
179
|
markAsExplored(points: IVector2[]): boolean | undefined;
|
|
183
180
|
updateQuickSlotInfo(quickSlot: number, itemType?: ItemType, action?: IContextMenuAction, contextActionSlot?: number, contextActionType?: ActionType, canUseProtected?: boolean): void;
|
|
184
181
|
updateDialogInfo(dialogIndex: string | number): void;
|
|
@@ -189,7 +186,6 @@ export default class Player extends Human implements IUnserializedCallback {
|
|
|
189
186
|
respawn(reset: boolean): Promise<void>;
|
|
190
187
|
getMovementProgress(): number;
|
|
191
188
|
checkUnder(inFacingDirection?: boolean, options?: ICheckUnderOptions): ICheckUnderOptions;
|
|
192
|
-
hasWalkPath(): boolean;
|
|
193
189
|
walkAlongPath(path: IVector2[] | undefined, force?: boolean): void;
|
|
194
190
|
/**
|
|
195
191
|
* This is only ran on the server
|
|
@@ -219,6 +215,12 @@ export default class Player extends Human implements IUnserializedCallback {
|
|
|
219
215
|
* Only use this clientside
|
|
220
216
|
*/
|
|
221
217
|
isExploredClientSide(x: number, y: number, z: number): boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Multiply the reputation amount with whatever is set via milestone modifiers or custom game options for this player.
|
|
220
|
+
* @param reputation A number or undefined to be mutiplied.
|
|
221
|
+
* @returns A number or undefined if a reputation number was not passed.
|
|
222
|
+
*/
|
|
223
|
+
getReputationMultiplier(reputation: number | undefined): number | undefined;
|
|
222
224
|
/**
|
|
223
225
|
* @deprecated Do not call this with players.
|
|
224
226
|
*/
|
|
@@ -20,7 +20,8 @@ import type Human from "game/entity/Human";
|
|
|
20
20
|
import { SkillType } from "game/entity/IHuman";
|
|
21
21
|
import NPCManager from "game/entity/npc/NPCManager";
|
|
22
22
|
import Player from "game/entity/player/Player";
|
|
23
|
-
import {
|
|
23
|
+
import type { IGameOld } from "game/IGame";
|
|
24
|
+
import { CreationId, FireType, TickFlag, TileUpdateType } from "game/IGame";
|
|
24
25
|
import { Quality } from "game/IObject";
|
|
25
26
|
import type { IIslandEvents, IIslandLoadOptions, ISeeds, IWaterContamination, IWaterFill, IWell } from "game/island/IIsland";
|
|
26
27
|
import { WaterType } from "game/island/IIsland";
|
|
@@ -95,6 +96,11 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
|
|
|
95
96
|
* Set of players on this island
|
|
96
97
|
*/
|
|
97
98
|
readonly players: Set<Player>;
|
|
99
|
+
/**
|
|
100
|
+
* Entity move types in fov on this island
|
|
101
|
+
* `${z}-${moveType}` -> Players
|
|
102
|
+
*/
|
|
103
|
+
readonly moveTypesInFov: Map<string, Set<Player>>;
|
|
98
104
|
previousSaveVersion: IVersionInfo | undefined;
|
|
99
105
|
brokenReferencesCount: number;
|
|
100
106
|
civilizationScore: number;
|
|
@@ -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
|
/**
|
|
@@ -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
|
|
@@ -62,7 +63,7 @@ export default class FieldOfView extends EventEmitter.Host<IFieldOfViewEvents> {
|
|
|
62
63
|
/**
|
|
63
64
|
* Gets the field of view radius based on either the field of view object, player, or the default value
|
|
64
65
|
*/
|
|
65
|
-
|
|
66
|
+
static getRadius(fieldOfView: FieldOfView | undefined, player: Player | undefined): number;
|
|
66
67
|
/**
|
|
67
68
|
* Marks a set of tiles as exploreed
|
|
68
69
|
*/
|
|
@@ -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,15 @@
|
|
|
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
|
+
declare module SearchParams {
|
|
12
|
+
function hasSwitch(switchName: string): boolean;
|
|
13
|
+
function getSwitchValue(switchName: string): string | undefined;
|
|
14
|
+
}
|
|
15
|
+
export default SearchParams;
|
|
@@ -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
package/tsconfig.mod.base.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
3
|
+
"target": "ES2021",
|
|
4
4
|
"module": "AMD",
|
|
5
5
|
"composite": true,
|
|
6
6
|
"experimentalDecorators": true,
|
|
@@ -36,13 +36,10 @@
|
|
|
36
36
|
},
|
|
37
37
|
"types": [],
|
|
38
38
|
"lib": [
|
|
39
|
-
"WebWorker.ImportScripts",
|
|
40
39
|
"DOM",
|
|
41
40
|
"DOM.Iterable",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"ES2020.String",
|
|
45
|
-
"ES2021.WeakRef"
|
|
41
|
+
"ES2021",
|
|
42
|
+
"WebWorker.ImportScripts",
|
|
46
43
|
]
|
|
47
44
|
}
|
|
48
45
|
}
|