@wayward/types 2.11.0-beta.dev.20211126.1 → 2.11.0-beta.dev.20211130.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/Game.d.ts +2 -0
- package/definitions/game/game/entity/EntityManager.d.ts +11 -0
- package/definitions/game/game/entity/creature/CreatureManager.d.ts +1 -1
- package/definitions/game/game/entity/npc/INPC.d.ts +13 -0
- package/definitions/game/game/entity/npc/NPC.d.ts +9 -0
- package/definitions/game/game/entity/player/IPlayer.d.ts +6 -0
- package/definitions/game/ui/component/dropdown/IslandDropdown.d.ts +1 -0
- package/definitions/game/ui/component/dropdown/NPCDropdown.d.ts +1 -1
- package/definitions/game/ui/input/InputManager.d.ts +2 -0
- package/definitions/game/ui/old/screens/InGameScreen.d.ts +1 -1
- package/package.json +1 -1
|
@@ -8,6 +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
|
+
/// <reference types="node" />
|
|
11
12
|
import EventEmitter from "event/EventEmitter";
|
|
12
13
|
import type Entity from "game/entity/Entity";
|
|
13
14
|
import type { Defense } from "game/entity/IEntity";
|
|
@@ -60,6 +61,7 @@ export declare class Game extends EventEmitter.Host<IGameEvents> {
|
|
|
60
61
|
lastTickTime: number | undefined;
|
|
61
62
|
saveClear: boolean;
|
|
62
63
|
tileDecorations: Uint16Array;
|
|
64
|
+
initialThumbnailTimeout: NodeJS.Timer | undefined;
|
|
63
65
|
mapSize: number;
|
|
64
66
|
mapSizeSq: number;
|
|
65
67
|
readonly itemStylesheetHandler: ItemStylesheetHandler | undefined;
|
|
@@ -17,9 +17,20 @@ export interface IEntityManagerEvents<T extends Entity> {
|
|
|
17
17
|
spawn(entity: T): any;
|
|
18
18
|
remove(entity: T): any;
|
|
19
19
|
}
|
|
20
|
+
export interface IEntityCanCreateOptions {
|
|
21
|
+
allowEdgeSpawning?: boolean;
|
|
22
|
+
allowOnBlockedTiles?: boolean;
|
|
23
|
+
allowOnFire?: boolean;
|
|
24
|
+
allowOverDooadsAndTileEvents?: boolean;
|
|
25
|
+
chanceOfScarecrowScare?: number;
|
|
26
|
+
}
|
|
20
27
|
export default abstract class EntityManager<T extends Entity> extends ObjectManager<T, IEntityManagerEvents<T>> implements IEntityManager<T> {
|
|
21
28
|
private readonly moveTypesInFov;
|
|
22
29
|
remove(entity: T): void;
|
|
23
30
|
updateFov(bounds: Bound3[]): number;
|
|
24
31
|
getMoveTypesInFov(): IMoveTypeZ[];
|
|
32
|
+
/**
|
|
33
|
+
* Checks if the target position is a good spot for a new entity
|
|
34
|
+
*/
|
|
35
|
+
protected canCreateEntity(x: number, y: number, z: number, options?: IEntityCanCreateOptions): boolean;
|
|
25
36
|
}
|
|
@@ -16,7 +16,7 @@ import type Human from "game/entity/Human";
|
|
|
16
16
|
import { MoveType } from "game/entity/IEntity";
|
|
17
17
|
import type Player from "game/entity/player/Player";
|
|
18
18
|
import type { ITile } from "game/tile/ITerrain";
|
|
19
|
-
import Vector3 from "utilities/math/Vector3";
|
|
19
|
+
import type Vector3 from "utilities/math/Vector3";
|
|
20
20
|
export interface ICreatureManagerEvents extends Events<EntityManager<Creature>> {
|
|
21
21
|
/**
|
|
22
22
|
* Called when a creature is about to be spawned
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
export interface INPCOld {
|
|
12
|
+
equipped?: Record<number, number>;
|
|
13
|
+
}
|
|
@@ -74,6 +74,15 @@ export default abstract class NPC extends Human {
|
|
|
74
74
|
*/
|
|
75
75
|
getActions(): ActionType[] | undefined;
|
|
76
76
|
addAiType(ai: AiType): void;
|
|
77
|
+
/**
|
|
78
|
+
* Removes an AiType from an NPC.
|
|
79
|
+
* @param ai The AiType to remove from the NPC.
|
|
80
|
+
*/
|
|
81
|
+
removeAiType(ai: AiType): void;
|
|
82
|
+
/**
|
|
83
|
+
* Closes the merchant trading window for everybody.
|
|
84
|
+
*/
|
|
85
|
+
closeInventory(): void;
|
|
77
86
|
updateDirection(x: number, y: number): void;
|
|
78
87
|
/**
|
|
79
88
|
* Sets the default weightCapacity of an NPC (based on their equipment and starting items).
|
|
@@ -140,6 +140,12 @@ export interface IPlayerEvents extends Events<Human> {
|
|
|
140
140
|
* @param slot The slot
|
|
141
141
|
*/
|
|
142
142
|
equip?(item: Item, slot: EquipType): any;
|
|
143
|
+
/**
|
|
144
|
+
* Called when the players quickslots are updated
|
|
145
|
+
* @param quickslot The quick slot
|
|
146
|
+
* @param itemType The item type
|
|
147
|
+
*/
|
|
148
|
+
updatedQuickslotInfo?(quickslot: number, itemType?: ItemType): any;
|
|
143
149
|
/**
|
|
144
150
|
* Called when input is being processed
|
|
145
151
|
* @param player The player object
|
|
@@ -19,4 +19,5 @@ export default class IslandDropdown<OTHER_OPTIONS extends string = never> extend
|
|
|
19
19
|
protected shouldIncludeOtherOptionsInGroupFilter(): boolean;
|
|
20
20
|
protected isInGroup(islandId: IslandId, biome: BiomeType): boolean;
|
|
21
21
|
protected getGroups(): BiomeType[];
|
|
22
|
+
protected onRefresh(): void;
|
|
22
23
|
}
|
|
@@ -12,5 +12,5 @@ import { NPCType } from "game/entity/npc/INPCs";
|
|
|
12
12
|
import type { IDropdownOption } from "ui/component/Dropdown";
|
|
13
13
|
import EnumDropdown from "ui/component/dropdown/EnumDropdown";
|
|
14
14
|
export default class NPCDropdown<OTHER_OPTIONS extends string = never> extends EnumDropdown<typeof NPCType, OTHER_OPTIONS> {
|
|
15
|
-
constructor(defaultOption: OTHER_OPTIONS | NPCType, options
|
|
15
|
+
constructor(defaultOption: OTHER_OPTIONS | NPCType, options?: Iterable<IDropdownOption<OTHER_OPTIONS>>);
|
|
16
16
|
}
|
|
@@ -111,6 +111,8 @@ declare class InputManager extends EventEmitter.Host<IInputManagerEvents> {
|
|
|
111
111
|
extractModifiers(evt: Event): Set<Modifier> | undefined;
|
|
112
112
|
getCatalyst(evt: Event): InputCatalyst | undefined;
|
|
113
113
|
disableUntil(until: number | Promise<any>, disabler: string): void;
|
|
114
|
+
disable(disabler: string): boolean;
|
|
115
|
+
enable(disabler: string): void;
|
|
114
116
|
isDisabled(): boolean;
|
|
115
117
|
isDisabledBy(disabler: string): boolean;
|
|
116
118
|
private handleRising;
|
|
@@ -163,7 +163,7 @@ export default class InGameScreen extends BaseScreen {
|
|
|
163
163
|
setQuickSlot(quickSlot: number, itemId?: number, internal?: boolean): boolean;
|
|
164
164
|
setQuickSlotByItemType(quickSlot: number, itemType: ItemType, disabled: boolean, item?: Item | undefined): void;
|
|
165
165
|
setQuickSlotByContextAction(quickSlot: number, action: IContextMenuAction): void;
|
|
166
|
-
addItemToFreeQuickSlot(itemId: number):
|
|
166
|
+
addItemToFreeQuickSlot(itemId: number): boolean;
|
|
167
167
|
clearQuickSlot(quickSlot: number, internal?: boolean): void;
|
|
168
168
|
removeItemFromQuickSlot(itemId?: number, skipSync?: boolean): void;
|
|
169
169
|
setItemQuickslot(item: Item, quickSlot: number | undefined): void;
|
package/package.json
CHANGED