@wayward/types 2.12.0-beta.dev.20220910.1 → 2.12.0-beta.dev.20220911.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/doodad/Doodad.d.ts +9 -5
- package/definitions/game/game/entity/IHuman.d.ts +4 -0
- package/definitions/game/game/entity/action/actions/Upgrade.d.ts +0 -2
- package/definitions/game/game/entity/player/IPlayer.d.ts +0 -4
- package/definitions/game/game/inspection/infoProviders/LevelValue.d.ts +2 -1
- package/definitions/game/game/inspection/infoProviders/MagicalPropertyValue.d.ts +2 -1
- package/definitions/game/game/inspection/infoProviders/UseInfo.d.ts +4 -1
- package/definitions/game/game/inspection/infoProviders/item/ItemUses.d.ts +8 -0
- package/definitions/game/game/inspection/infoProviders/item/MagicalSourceTooltip.d.ts +2 -1
- package/definitions/game/game/inspection/infoProviders/item/use/ItemEquipInfo.d.ts +10 -0
- package/definitions/game/game/item/IItem.d.ts +15 -3
- package/definitions/game/game/item/IItemManager.d.ts +2 -1
- package/definitions/game/game/item/ItemManager.d.ts +5 -0
- package/definitions/game/game/magic/MagicalPropertyManager.d.ts +2 -4
- package/definitions/game/game/magic/MagicalPropertyType.d.ts +23 -8
- package/definitions/game/mod/ModRegistry.d.ts +41 -27
- package/definitions/game/multiplayer/packets/client/{EmitPlayerEventPacket.d.ts → EmitHumanEventPacket.d.ts} +5 -4
- package/definitions/game/renderer/IRenderer.d.ts +4 -3
- package/definitions/game/renderer/Renderer.d.ts +1 -1
- package/definitions/game/renderer/Renderers.d.ts +1 -1
- package/definitions/game/renderer/fieldOfView/FieldOfView.d.ts +1 -1
- package/definitions/game/ui/old/OldUi.d.ts +0 -1
- package/definitions/game/ui/old/screens/InGameScreen.d.ts +1 -2
- package/definitions/game/utilities/class/Classes.d.ts +1 -0
- package/definitions/game/utilities/class/Inject.d.ts +7 -8
- package/definitions/game/utilities/enum/IEnum.d.ts +2 -1
- package/definitions/test/core/application.d.ts +0 -4
- package/definitions/test/core/applicationInteractions.d.ts +6 -1
- package/package.json +1 -1
|
@@ -66,6 +66,8 @@ export interface IDoodadEvents {
|
|
|
66
66
|
* Emitted when the doodad's type changes.
|
|
67
67
|
*/
|
|
68
68
|
transformed(newType: DoodadType, oldType: DoodadType): any;
|
|
69
|
+
durabilityChange(durability: number, oldDurability: number): any;
|
|
70
|
+
durabilityMaxChange(durability: number, oldDurability: number): any;
|
|
69
71
|
}
|
|
70
72
|
export default class Doodad extends EventEmitter.Host<IDoodadEvents> implements IReferenceable, IUnserializedCallback, IObject<DoodadType>, IDoodadOptions, IVector3, Partial<IContainer>, ITemperatureSource, IHasInsulation, IHasBuilder, IHasMagic {
|
|
71
73
|
static is(value: any): value is Doodad;
|
|
@@ -85,8 +87,8 @@ export default class Doodad extends EventEmitter.Host<IDoodadEvents> implements
|
|
|
85
87
|
id: number;
|
|
86
88
|
referenceId?: number;
|
|
87
89
|
itemOrders?: number[];
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
maxDur: number;
|
|
91
|
+
minDur: number;
|
|
90
92
|
orientation?: DoorOrientation | Direction.Cardinal;
|
|
91
93
|
crafterIdentifier?: string;
|
|
92
94
|
builderIdentifier?: string;
|
|
@@ -109,7 +111,6 @@ export default class Doodad extends EventEmitter.Host<IDoodadEvents> implements
|
|
|
109
111
|
private _tile;
|
|
110
112
|
private _tileId;
|
|
111
113
|
private readonly _doodadGroupCache;
|
|
112
|
-
private _minDur;
|
|
113
114
|
constructor(type?: DoodadType, islandId?: `${number},${number}`, x?: number, y?: number, z?: number, options?: IDoodadOptions);
|
|
114
115
|
get island(): import("../island/Island").default;
|
|
115
116
|
toString(): string;
|
|
@@ -178,7 +179,7 @@ export default class Doodad extends EventEmitter.Host<IDoodadEvents> implements
|
|
|
178
179
|
getBuilder(): Player | undefined;
|
|
179
180
|
unhitch(): void;
|
|
180
181
|
damage(forceBreak?: boolean, skipDropAsItem?: boolean, skipSound?: boolean, skipResources?: boolean): void;
|
|
181
|
-
getDefaultDurability(): number;
|
|
182
|
+
getDefaultDurability(random?: import("../../utilities/random/Random").Random<import("../../utilities/random/Random").SeededGenerator>): number;
|
|
182
183
|
addTreasureChestLoot(): void;
|
|
183
184
|
attachStillContainer(item: Item): void;
|
|
184
185
|
detachStillContainer(human?: Human): Item | undefined;
|
|
@@ -237,7 +238,10 @@ export default class Doodad extends EventEmitter.Host<IDoodadEvents> implements
|
|
|
237
238
|
*/
|
|
238
239
|
revert(): boolean;
|
|
239
240
|
onUnserialized(): void;
|
|
240
|
-
|
|
241
|
+
get durability(): number;
|
|
242
|
+
set durability(value: number);
|
|
243
|
+
get durabilityMax(): number;
|
|
244
|
+
set durabilityMax(value: number);
|
|
241
245
|
private processSpecials;
|
|
242
246
|
/**
|
|
243
247
|
* Check for items on top of lit/fire doodads, set them on fire
|
|
@@ -168,6 +168,10 @@ export interface IHumanEvents extends Events<Entity>, ISkillEvents {
|
|
|
168
168
|
* Called when the player completes a movement
|
|
169
169
|
*/
|
|
170
170
|
moveComplete(): any;
|
|
171
|
+
/**
|
|
172
|
+
* Called when no input is received
|
|
173
|
+
*/
|
|
174
|
+
noInput(): any;
|
|
171
175
|
/**
|
|
172
176
|
* Called when a book is opened by a player
|
|
173
177
|
* @param book The book that was opened
|
|
@@ -13,7 +13,6 @@ import type { IActionUsable } from "game/entity/action/IAction";
|
|
|
13
13
|
import { ActionArgument } from "game/entity/action/IAction";
|
|
14
14
|
import type { IMagicalPropertyInfo } from "game/item/IItem";
|
|
15
15
|
import type Item from "game/item/Item";
|
|
16
|
-
import type { MagicalSubPropertySubTypes } from "game/magic/MagicalPropertyManager";
|
|
17
16
|
import type { MagicalPropertyType } from "game/magic/MagicalPropertyType";
|
|
18
17
|
export interface IUpgradeCanUse extends IActionUsable {
|
|
19
18
|
upgrade: IUpgradeable;
|
|
@@ -24,6 +23,5 @@ export default _default;
|
|
|
24
23
|
export interface IUpgradeable extends IMagicalPropertyInfo {
|
|
25
24
|
target: Item;
|
|
26
25
|
type: MagicalPropertyType;
|
|
27
|
-
subType?: MagicalSubPropertySubTypes;
|
|
28
26
|
currentValue: number;
|
|
29
27
|
}
|
|
@@ -68,10 +68,6 @@ export interface IPlayerEvents extends Events<Human> {
|
|
|
68
68
|
* @param itemType The item type
|
|
69
69
|
*/
|
|
70
70
|
updatedQuickslotInfo?(quickslot: number, itemType?: ItemType): any;
|
|
71
|
-
/**
|
|
72
|
-
* Called when no input is received
|
|
73
|
-
*/
|
|
74
|
-
noInput(): any;
|
|
75
71
|
/**
|
|
76
72
|
* Called when the player will write a note.
|
|
77
73
|
* @param note The note that will be written.
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import { InfoProvider } from "game/inspection/InfoProvider";
|
|
12
|
-
import type { IHasMagic, MagicalNormalPropertyTypes,
|
|
12
|
+
import type { IHasMagic, MagicalNormalPropertyTypes, MagicalSubPropertyTypes } from "game/magic/MagicalPropertyManager";
|
|
13
|
+
import type { MagicalPropertyTypeSubTypeMap } from "game/magic/MagicalPropertyType";
|
|
13
14
|
import type { DictionaryEnum } from "language/DictionaryMap";
|
|
14
15
|
import type { TextContext } from "language/ITranslation";
|
|
15
16
|
import Translation from "language/Translation";
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
import type { SkillType } from "game/entity/IHuman";
|
|
12
12
|
import { InfoProvider } from "game/inspection/InfoProvider";
|
|
13
13
|
import type { Quality } from "game/IObject";
|
|
14
|
-
import type { IHasMagic, MagicalNormalPropertyTypes,
|
|
14
|
+
import type { IHasMagic, MagicalNormalPropertyTypes, MagicalSubPropertyTypes } from "game/magic/MagicalPropertyManager";
|
|
15
15
|
import { MagicalPropertyIdentity } from "game/magic/MagicalPropertyManager";
|
|
16
|
+
import type { MagicalPropertyTypeSubTypeMap } from "game/magic/MagicalPropertyType";
|
|
16
17
|
import UiTranslation from "language/dictionary/UiTranslation";
|
|
17
18
|
import Translation from "language/Translation";
|
|
18
19
|
import type { TranslationGenerator } from "ui/component/IComponent";
|
|
@@ -61,12 +61,15 @@ export interface IUseInfoFactory<I extends IUseInfoBase<T, A>, T extends IDescri
|
|
|
61
61
|
methods: M;
|
|
62
62
|
}, T, A>): UseInfo<I, A, M, T>;
|
|
63
63
|
}
|
|
64
|
+
export declare type IGetUseInfo<USE_INFO extends UseInfo<any, any, any>> = USE_INFO extends UseInfo<infer I extends IUseInfoBase<any, any>, any, any> ? I : never;
|
|
64
65
|
export default class UseInfo<I extends IUseInfoBase<T, A>, A extends ActionType, M extends Record<string, AnyFunction>, T extends IDescribed = any> {
|
|
65
66
|
readonly predicates: Array<UseInfoPredicate<I, T, A>>;
|
|
66
67
|
readonly handle: UseInfoHandler<I & {
|
|
67
68
|
methods: M;
|
|
68
69
|
}, T, A>;
|
|
69
|
-
readonly methods:
|
|
70
|
+
readonly methods: {
|
|
71
|
+
[KEY in keyof M]: (info: I, ...args: ArgumentsOf<M[KEY]>) => ReturnType<M[KEY]>;
|
|
72
|
+
};
|
|
70
73
|
static of<T extends IDescribed>(): IUseInfoFactory<IUseInfoBase<T, never>, T, never>;
|
|
71
74
|
displayLevel: InfoDisplayLevel | UseInfoDisplayLevelGetter<I, T, A>;
|
|
72
75
|
ownRow?: true;
|
|
@@ -100,6 +100,14 @@ export default class ItemUses extends Uses<Item> {
|
|
|
100
100
|
union: import("../UseInfo").IUseInfoBase<Item, ActionType.Equip>;
|
|
101
101
|
details: Set<symbol>;
|
|
102
102
|
}, ActionType.Equip, {
|
|
103
|
+
getMagicalEquipTypes: () => Set<import("../../../magic/MagicalPropertyType").MagicalPropertyType>;
|
|
104
|
+
} & {
|
|
105
|
+
getMagicalPropertyLabels: () => Map<import("../../../magic/MagicalPropertyType").MagicalPropertyType, import("../../../../language/dictionary/UiTranslation").default>;
|
|
106
|
+
} & {
|
|
107
|
+
isMagicalPropertyPercentage: (property: import("../../../magic/MagicalPropertyType").MagicalPropertyType) => boolean;
|
|
108
|
+
} & {
|
|
109
|
+
isMagicalPropertyPercentagePremultiplied: (property: import("../../../magic/MagicalPropertyType").MagicalPropertyType) => boolean;
|
|
110
|
+
} & {
|
|
103
111
|
getAttack: () => import("../MagicalPropertyValue").default | undefined;
|
|
104
112
|
} & {
|
|
105
113
|
getDefense: () => (import("../../../../language/impl/TranslationImpl").default | import("../MagicalPropertyValue").default)[];
|
|
@@ -8,7 +8,8 @@
|
|
|
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 { MagicalNormalPropertyTypes, MagicalPropertyIdentity,
|
|
11
|
+
import type { MagicalNormalPropertyTypes, MagicalPropertyIdentity, MagicalSubPropertyTypes } from "game/magic/MagicalPropertyManager";
|
|
12
|
+
import type { MagicalPropertyTypeSubTypeMap } from "game/magic/MagicalPropertyType";
|
|
12
13
|
import Translation from "language/Translation";
|
|
13
14
|
declare function MagicalSourceTooltip(type: MagicalNormalPropertyTypes): Translation;
|
|
14
15
|
declare function MagicalSourceTooltip<T extends MagicalSubPropertyTypes>(type: T, subType: MagicalPropertyTypeSubTypeMap[T]): Translation;
|
|
@@ -14,7 +14,9 @@ import MagicalPropertyValue from "game/inspection/infoProviders/MagicalPropertyV
|
|
|
14
14
|
import UseInfo from "game/inspection/infoProviders/UseInfo";
|
|
15
15
|
import type Item from "game/item/Item";
|
|
16
16
|
import { MagicalPropertyEntry } from "game/magic/MagicalPropertyManager";
|
|
17
|
+
import { MagicalPropertyType } from "game/magic/MagicalPropertyType";
|
|
17
18
|
import { TempType } from "game/temperature/ITemperature";
|
|
19
|
+
import UiTranslation from "language/dictionary/UiTranslation";
|
|
18
20
|
declare const _default: UseInfo<{
|
|
19
21
|
equip: import("../../../../entity/IHuman").EquipType;
|
|
20
22
|
objectType: import("../../../../IGame").CreationId.Item;
|
|
@@ -26,6 +28,14 @@ declare const _default: UseInfo<{
|
|
|
26
28
|
union: import("game/inspection/infoProviders/UseInfo").IUseInfoBase<Item, ActionType.Equip>;
|
|
27
29
|
details: Set<symbol>;
|
|
28
30
|
}, ActionType.Equip, {
|
|
31
|
+
getMagicalEquipTypes: () => Set<MagicalPropertyType>;
|
|
32
|
+
} & {
|
|
33
|
+
getMagicalPropertyLabels: () => Map<MagicalPropertyType, UiTranslation>;
|
|
34
|
+
} & {
|
|
35
|
+
isMagicalPropertyPercentage: (property: MagicalPropertyType) => boolean;
|
|
36
|
+
} & {
|
|
37
|
+
isMagicalPropertyPercentagePremultiplied: (property: MagicalPropertyType) => boolean;
|
|
38
|
+
} & {
|
|
29
39
|
getAttack: () => MagicalPropertyValue | undefined;
|
|
30
40
|
} & {
|
|
31
41
|
getDefense: () => (import("../../../../../language/impl/TranslationImpl").default | MagicalPropertyValue)[];
|
|
@@ -22,6 +22,7 @@ import type { IslandId } from "game/island/IIsland";
|
|
|
22
22
|
import type Item from "game/item/Item";
|
|
23
23
|
import type Recipe from "game/item/recipe/Recipe";
|
|
24
24
|
import type MagicalPropertyManager from "game/magic/MagicalPropertyManager";
|
|
25
|
+
import type { MagicalSubPropertySubTypes } from "game/magic/MagicalPropertyManager";
|
|
25
26
|
import type { MagicalPropertyType } from "game/magic/MagicalPropertyType";
|
|
26
27
|
import type { IInsulationDescription, ITemperatureDescription } from "game/temperature/ITemperature";
|
|
27
28
|
import type { TerrainType } from "game/tile/ITerrain";
|
|
@@ -432,11 +433,22 @@ export interface IRanged {
|
|
|
432
433
|
skillType?: SkillType;
|
|
433
434
|
}
|
|
434
435
|
export interface IMagicalPropertyInfo {
|
|
436
|
+
/**
|
|
437
|
+
* The maximum value this magical property can be on this item.
|
|
438
|
+
*/
|
|
435
439
|
max: number;
|
|
436
|
-
|
|
440
|
+
/**
|
|
441
|
+
* Does nothing for integer magical properties. For decimal magical properties, rounds it to the nearest `.1` for calculations and display.
|
|
442
|
+
*/
|
|
443
|
+
roundToNearestTenthPlace?: true;
|
|
444
|
+
/**
|
|
445
|
+
* Generates a random starting value for this magical property.
|
|
446
|
+
*/
|
|
437
447
|
value(): number;
|
|
438
|
-
|
|
439
|
-
|
|
448
|
+
/**
|
|
449
|
+
* Generates the random sub-property to use for this magical property, if this magical property is a magical property with subtypes.
|
|
450
|
+
*/
|
|
451
|
+
subType?: MagicalSubPropertySubTypes | (() => MagicalSubPropertySubTypes);
|
|
440
452
|
}
|
|
441
453
|
export interface IItemUsed {
|
|
442
454
|
usedBy?: string[];
|
|
@@ -112,7 +112,8 @@ export declare enum ContainerReferenceSource {
|
|
|
112
112
|
ResolveContainer = 9,
|
|
113
113
|
ScheduleContainerInvalidation = 10,
|
|
114
114
|
Serializer = 11,
|
|
115
|
-
WriteContainer = 12
|
|
115
|
+
WriteContainer = 12,
|
|
116
|
+
GetContainerName = 13
|
|
116
117
|
}
|
|
117
118
|
export interface ICraftResultChances {
|
|
118
119
|
success: number;
|
|
@@ -146,6 +146,11 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
|
|
|
146
146
|
moveAllFromContainerToContainer(human: Human | undefined, fromContainer: IContainer, toContainer: IContainer, itemType?: ItemType | undefined, ofQuality?: Quality | undefined, checkWeight?: boolean, filterText?: string | undefined, onMoveItem?: (item: Item) => void): Item[];
|
|
147
147
|
moveToContainer(human: Human | undefined, item: Item, container: IContainer): boolean;
|
|
148
148
|
hasRoomInContainer(targetContainer: IContainer, itemToMove: Item): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Gets the name of a container
|
|
151
|
+
* @returns Name of the container or undefined if it's ending up on the ground
|
|
152
|
+
*/
|
|
153
|
+
getContainerName(container: IContainer): Translation | undefined;
|
|
149
154
|
breakContainerOnTile(itemContainer: Item, x: number, y: number, z: number): void;
|
|
150
155
|
/**
|
|
151
156
|
* Drop items in a 3x3 square around the location
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import EventEmitter from "event/EventEmitter";
|
|
12
|
-
import {
|
|
12
|
+
import type { MagicalPropertyTypeSubTypeMap } from "game/magic/MagicalPropertyType";
|
|
13
|
+
import { MagicalPropertyType } from "game/magic/MagicalPropertyType";
|
|
13
14
|
import type { ListEnder } from "language/ITranslation";
|
|
14
15
|
import Translation from "language/Translation";
|
|
15
16
|
export interface IHasMagic {
|
|
@@ -29,9 +30,6 @@ export interface IMagicalSubProperty<T extends number> {
|
|
|
29
30
|
value: number;
|
|
30
31
|
}>;
|
|
31
32
|
}
|
|
32
|
-
export declare type MagicalPropertyTypeSubTypeMap = {
|
|
33
|
-
[K in keyof typeof magicalPropertyTypeSubTypeMap]: Value<(typeof magicalPropertyTypeSubTypeMap)[K]>;
|
|
34
|
-
};
|
|
35
33
|
export declare type MagicalProperty<T extends MagicalPropertyType> = MagicalPropertyTypeSubTypeMap extends {
|
|
36
34
|
[key in T]: any;
|
|
37
35
|
} ? IMagicalSubProperty<MagicalPropertyTypeSubTypeMap[T]> : IMagicalProperty;
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { SkillType } from "game/entity/IHuman";
|
|
12
12
|
import { Stat } from "game/entity/IStats";
|
|
13
|
+
import type { IItemDescription, IMagicalPropertyInfo } from "game/item/IItem";
|
|
14
|
+
import type Item from "game/item/Item";
|
|
13
15
|
export declare enum MagicalPropertyType {
|
|
14
16
|
Attack = 0,
|
|
15
17
|
Defense = 1,
|
|
@@ -56,11 +58,24 @@ export declare enum MagicalPropertyType {
|
|
|
56
58
|
*/
|
|
57
59
|
GrowingSpeed = 25
|
|
58
60
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
export interface IMagicalPropertyDescription {
|
|
62
|
+
/**
|
|
63
|
+
* Whether this magical property is applicable for the given item.
|
|
64
|
+
*/
|
|
65
|
+
isApplicable(item: Item, description: IItemDescription): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Generates the magical property value when added.
|
|
68
|
+
*/
|
|
69
|
+
getInfo(item: Item, description: IItemDescription): IMagicalPropertyInfo | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* By default, all magical property types can be inscribed. This allows disabling that feature for this magical property type.
|
|
72
|
+
*/
|
|
73
|
+
disableInscription?: true;
|
|
74
|
+
subTypeEnum?: any;
|
|
75
|
+
}
|
|
76
|
+
export interface MagicalPropertyTypeSubTypeMap {
|
|
77
|
+
[MagicalPropertyType.Stat]: Stat;
|
|
78
|
+
[MagicalPropertyType.Skill]: SkillType;
|
|
79
|
+
[MagicalPropertyType.Reputation]: Stat;
|
|
80
|
+
}
|
|
81
|
+
export declare const magicalPropertyDescriptions: PartialRecord<MagicalPropertyType, IMagicalPropertyDescription>;
|
|
@@ -35,6 +35,7 @@ import type { StatusEffectClass } from "game/entity/status/StatusEffect";
|
|
|
35
35
|
import type { InspectType } from "game/inspection/IInspection";
|
|
36
36
|
import type { InspectionClass } from "game/inspection/InspectionTypeMap";
|
|
37
37
|
import type { IItemDescription, IItemGroupDescription, ItemType, ItemTypeGroup } from "game/item/IItem";
|
|
38
|
+
import type { IMagicalPropertyDescription, MagicalPropertyType } from "game/magic/MagicalPropertyType";
|
|
38
39
|
import type { ILoadingDescription } from "game/meta/Loading";
|
|
39
40
|
import type { Prompt } from "game/meta/prompt/IPrompt";
|
|
40
41
|
import type { ITerrainDescription, OverlayType, TerrainType } from "game/tile/ITerrain";
|
|
@@ -90,32 +91,33 @@ export declare enum ModRegistrationType {
|
|
|
90
91
|
Language = 18,
|
|
91
92
|
LanguageExtension = 19,
|
|
92
93
|
Load = 20,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
94
|
+
MagicalProperty = 21,
|
|
95
|
+
MenuBarButton = 22,
|
|
96
|
+
Message = 23,
|
|
97
|
+
MessageSource = 24,
|
|
98
|
+
MusicTrack = 25,
|
|
99
|
+
Note = 26,
|
|
100
|
+
NPC = 27,
|
|
101
|
+
OptionsSection = 28,
|
|
102
|
+
Overlay = 29,
|
|
103
|
+
Packet = 30,
|
|
104
|
+
Prompt = 31,
|
|
105
|
+
QuadrantComponent = 32,
|
|
106
|
+
Quest = 33,
|
|
107
|
+
QuestRequirement = 34,
|
|
108
|
+
Registry = 35,
|
|
109
|
+
Skill = 36,
|
|
110
|
+
SoundEffect = 37,
|
|
111
|
+
Stat = 38,
|
|
112
|
+
StatusEffect = 39,
|
|
113
|
+
Terrain = 40,
|
|
114
|
+
TerrainDecoration = 41,
|
|
115
|
+
TileEvent = 42,
|
|
116
|
+
TileLayerType = 43,
|
|
117
|
+
UsableActions = 44,
|
|
118
|
+
UsableActionType = 45,
|
|
119
|
+
UsableActionTypePlaceholder = 46,
|
|
120
|
+
WorldLayer = 47
|
|
119
121
|
}
|
|
120
122
|
export interface ILanguageRegistration extends IBaseModRegistration {
|
|
121
123
|
type: ModRegistrationType.Language;
|
|
@@ -343,10 +345,15 @@ export interface IUsableActionTypePlaceholderRegistration extends IBaseModRegist
|
|
|
343
345
|
type: ModRegistrationType.UsableActionTypePlaceholder;
|
|
344
346
|
name: string;
|
|
345
347
|
}
|
|
348
|
+
export interface IMagicalPropertyRegistration extends IBaseModRegistration {
|
|
349
|
+
type: ModRegistrationType.MagicalProperty;
|
|
350
|
+
name: string;
|
|
351
|
+
description: IMagicalPropertyDescription;
|
|
352
|
+
}
|
|
346
353
|
export interface IInheritsRegistrationTime {
|
|
347
354
|
useRegistrationTime: ModRegistrationType;
|
|
348
355
|
}
|
|
349
|
-
export declare type ModRegistration = IActionRegistration | IBindableRegistration | IBiomeRegistration | IBulkRegistration | ICommandRegistration | ICreatureRegistration | IDialogRegistration | IDictionaryRegistration | IDoodadGroupRegistration | IDoodadRegistration | IHelpArticleRegistration | IInspectionTypeRegistration | IInterModRegistration | IInterModRegistryRegistration | IInterruptChoiceRegistration | IInterruptRegistration | IItemGroupRegistration | IItemRegistration | ILanguageExtensionRegistration | ILanguageRegistration | ILoadRegistration | IMenuBarButtonRegistration | IMessageRegistration | IMessageSourceRegistration | IMusicTrackRegistration | INoteRegistration | INPCRegistration | IOptionsSectionRegistration | IOverlayRegistration | IPacketRegistration | IPromptRegistration | IQuadrantComponentRegistration | IQuestRegistration | IQuestRequirementRegistration | IRegistryRegistration | ISkillRegistration | ISoundEffectRegistration | IStatRegistration | IStatusEffectRegistration | ITerrainDecorationRegistration | ITerrainRegistration | ITileEventRegistration | ITileLayerTypeRegistration | IUsableActionsRegistration | IUsableActionTypeRegistration | IUsableActionTypePlaceholderRegistration;
|
|
356
|
+
export declare type ModRegistration = IActionRegistration | IBindableRegistration | IBiomeRegistration | IBulkRegistration | ICommandRegistration | ICreatureRegistration | IDialogRegistration | IDictionaryRegistration | IDoodadGroupRegistration | IDoodadRegistration | IHelpArticleRegistration | IInspectionTypeRegistration | IInterModRegistration | IInterModRegistryRegistration | IInterruptChoiceRegistration | IInterruptRegistration | IItemGroupRegistration | IItemRegistration | ILanguageExtensionRegistration | ILanguageRegistration | ILoadRegistration | IMagicalPropertyRegistration | IMenuBarButtonRegistration | IMessageRegistration | IMessageSourceRegistration | IMusicTrackRegistration | INoteRegistration | INPCRegistration | IOptionsSectionRegistration | IOverlayRegistration | IPacketRegistration | IPromptRegistration | IQuadrantComponentRegistration | IQuestRegistration | IQuestRequirementRegistration | IRegistryRegistration | ISkillRegistration | ISoundEffectRegistration | IStatRegistration | IStatusEffectRegistration | ITerrainDecorationRegistration | ITerrainRegistration | ITileEventRegistration | ITileLayerTypeRegistration | IUsableActionsRegistration | IUsableActionTypeRegistration | IUsableActionTypePlaceholderRegistration;
|
|
350
357
|
export declare const SYMBOL_SUPER_REGISTRY: unique symbol;
|
|
351
358
|
declare module Register {
|
|
352
359
|
/**
|
|
@@ -613,6 +620,13 @@ declare module Register {
|
|
|
613
620
|
* @param description The definition of this action.
|
|
614
621
|
*/
|
|
615
622
|
export function action(name: string, description?: IActionDescription): <K extends string | number | symbol, T extends { [k in K]: ActionType; }>(target: T, key: K) => void;
|
|
623
|
+
/**
|
|
624
|
+
* Registers a magical property.
|
|
625
|
+
* @param description The definition of this magical property.
|
|
626
|
+
*
|
|
627
|
+
* See — [Adding Magical Properties](https://github.com/WaywardGame/types/wiki/Adding-Magical-Properties)
|
|
628
|
+
*/
|
|
629
|
+
export function magicalProperty(name: string, description: IMagicalPropertyDescription): <K extends string | number | symbol, T extends { [k in K]: MagicalPropertyType; }>(target: T, key: K) => void;
|
|
616
630
|
/**
|
|
617
631
|
* Registers a "usable" action generator — actions that appear in the UI, and can be slotted in the action bar.
|
|
618
632
|
* @param set Where to append the usable actions
|
|
@@ -8,13 +8,14 @@
|
|
|
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
|
|
12
|
-
export declare enum
|
|
11
|
+
import HumanTargetedClientPacket from "multiplayer/packets/HumanTargetedClientPacket";
|
|
12
|
+
export declare enum EmitHumanEventType {
|
|
13
|
+
None = 0,
|
|
13
14
|
NoInput = 1,
|
|
14
15
|
MovementComplete = 2
|
|
15
16
|
}
|
|
16
|
-
export default class
|
|
17
|
-
type:
|
|
17
|
+
export default class EmitHumanEventPacket extends HumanTargetedClientPacket {
|
|
18
|
+
type: EmitHumanEventType;
|
|
18
19
|
getDebugInfo(): string;
|
|
19
20
|
process(): void;
|
|
20
21
|
}
|
|
@@ -35,9 +35,10 @@ export declare enum UpdateRenderFlag {
|
|
|
35
35
|
World = 1,
|
|
36
36
|
FieldOfView = 2,
|
|
37
37
|
FieldOfViewForced = 4,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
FieldOfViewSkipTransition = 8,
|
|
39
|
+
Particles = 16,
|
|
40
|
+
Notifier = 32,
|
|
41
|
+
SteamOverlay = 64,
|
|
41
42
|
All = 255
|
|
42
43
|
}
|
|
43
44
|
export declare enum RenderSource {
|
|
@@ -65,7 +65,7 @@ export default class Renderer extends EventEmitter.Host<IRendererEvents> {
|
|
|
65
65
|
*/
|
|
66
66
|
getAmbientLightLevel(z: number): number;
|
|
67
67
|
updateAmbientLightLevel(z: number): number;
|
|
68
|
-
updateView(source: RenderSource, updateFov: boolean, computeSpritesNow: boolean): void;
|
|
68
|
+
updateView(source: RenderSource, updateFov: boolean | UpdateRenderFlag.FieldOfView | UpdateRenderFlag.FieldOfViewSkipTransition, computeSpritesNow: boolean): void;
|
|
69
69
|
updateThumbnail(): Promise<boolean>;
|
|
70
70
|
update(timeStamp: number): void;
|
|
71
71
|
computeSpritesInViewport(): void;
|
|
@@ -40,6 +40,6 @@ export default class Renderers {
|
|
|
40
40
|
remove(renderer: Renderer): void;
|
|
41
41
|
computeSpritesInViewport(): void;
|
|
42
42
|
update(timeStamp: number): void;
|
|
43
|
-
updateView(/*island: Island,*/ source: RenderSource, updateFov?: boolean, computeSpritesNow?: boolean): void;
|
|
43
|
+
updateView(/*island: Island,*/ source: RenderSource, updateFov?: boolean | UpdateRenderFlag.FieldOfView | UpdateRenderFlag.FieldOfViewSkipTransition, computeSpritesNow?: boolean): void;
|
|
44
44
|
updateRender(/*island: Island,*/ source: RenderSource, flag: UpdateRenderFlag): void;
|
|
45
45
|
}
|
|
@@ -73,7 +73,7 @@ export default class FieldOfView extends EventEmitter.Host<IFieldOfViewEvents> {
|
|
|
73
73
|
startTransition(timeStamp: number): void;
|
|
74
74
|
updateTransitionProgress(timeStamp: number): boolean;
|
|
75
75
|
resetTransitionProgress(): void;
|
|
76
|
-
compute(timeStamp: number, force?: boolean): boolean;
|
|
76
|
+
compute(timeStamp: number, force?: boolean, skipTransition?: boolean): boolean;
|
|
77
77
|
createDebugRenderer(): ITextureDebugRenderer;
|
|
78
78
|
/**
|
|
79
79
|
* Updates the explored tiles around players
|
|
@@ -48,7 +48,6 @@ export default class OldUi {
|
|
|
48
48
|
removeItemFromEquipSlot(equip: EquipType, itemId: number): void;
|
|
49
49
|
shouldRefreshMods(): boolean;
|
|
50
50
|
onGameEnd(): void;
|
|
51
|
-
toggleUIDisplay(hide: boolean): void;
|
|
52
51
|
getSerializationProperties(_: string): string[];
|
|
53
52
|
onMove(): void;
|
|
54
53
|
closeAllContainers(): void;
|
|
@@ -68,7 +68,6 @@ export default class InGameScreen extends BaseScreen {
|
|
|
68
68
|
elementDialogDismantleButton: JQuery;
|
|
69
69
|
elementDialogEquipment: JQuery;
|
|
70
70
|
elementDialogEquipmentContainer: JQuery;
|
|
71
|
-
elementVersion: JQuery;
|
|
72
71
|
elementContainerDialogs: JQuery[];
|
|
73
72
|
elementOtherDialogs: JQuery[];
|
|
74
73
|
private activeContainer;
|
|
@@ -194,7 +193,7 @@ export default class InGameScreen extends BaseScreen {
|
|
|
194
193
|
* Will force an update on crafting and dismantle tables based on dirty variables.
|
|
195
194
|
*/
|
|
196
195
|
updateTablesDirty(which?: "crafting" | "dismantle"): void;
|
|
197
|
-
createSortMenu(
|
|
196
|
+
createSortMenu(container: JQuery, messageType: Message): SortRow<number>;
|
|
198
197
|
getContainerId(containerElement: JQuery): string;
|
|
199
198
|
sortItems(containerElement: JQuery, sortType: SortType, direction: SortDirection, messageType?: Message, activeSort?: boolean): void;
|
|
200
199
|
onUpdateContainer(containerElement: JQuery, activeSort: boolean): void;
|
|
@@ -8,9 +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
|
-
export interface IInjectionApi<T extends {
|
|
12
|
-
[key in K]: AnyFunction;
|
|
13
|
-
}, K extends keyof T> {
|
|
11
|
+
export interface IInjectionApi<T, K extends keyof T> {
|
|
14
12
|
/**
|
|
15
13
|
* The instance that the injected method was called on.
|
|
16
14
|
*/
|
|
@@ -22,7 +20,7 @@ export interface IInjectionApi<T extends {
|
|
|
22
20
|
/**
|
|
23
21
|
* The return value of the method call.
|
|
24
22
|
*/
|
|
25
|
-
returnValue: ReturnType<T[K]> | undefined;
|
|
23
|
+
returnValue: ReturnType<T[K] extends (...args: any[]) => any ? T[K] : never> | undefined;
|
|
26
24
|
/**
|
|
27
25
|
* The arguments given to the method call.
|
|
28
26
|
*/
|
|
@@ -32,9 +30,7 @@ export interface IInjectionApi<T extends {
|
|
|
32
30
|
*/
|
|
33
31
|
cancelled: boolean;
|
|
34
32
|
}
|
|
35
|
-
declare type InjectionMethod<T extends
|
|
36
|
-
[key in K]: AnyFunction;
|
|
37
|
-
}, K extends keyof T> = T[K] extends (...args: infer A) => any ? (api: IInjectionApi<T, K>, ...args: A) => any : never;
|
|
33
|
+
declare type InjectionMethod<T, K extends keyof T> = T[K] extends (...args: infer A) => any ? (api: IInjectionApi<T, K>, ...args: A) => any : never;
|
|
38
34
|
export declare enum InjectionPosition {
|
|
39
35
|
/**
|
|
40
36
|
* This injection will be called before the target method.
|
|
@@ -45,9 +41,12 @@ export declare enum InjectionPosition {
|
|
|
45
41
|
*/
|
|
46
42
|
Post = "post"
|
|
47
43
|
}
|
|
44
|
+
export declare function InjectObject<T extends {
|
|
45
|
+
[key in K]: AnyFunction;
|
|
46
|
+
}, K extends keyof T>(injectInto: T, property: K, position: InjectionPosition, priority?: number): (host: any, property2: string | number | symbol, descriptor: TypedPropertyDescriptor<InjectionMethod<T, K>>) => any;
|
|
48
47
|
export declare function Inject<T extends {
|
|
49
48
|
[key in K]: AnyFunction;
|
|
50
|
-
}, K extends keyof T>(injectInto: AnyClass<T>, property: K, position: InjectionPosition, priority?: number): (host: any, property2: string | number | symbol, descriptor: TypedPropertyDescriptor<InjectionMethod<T, K>>) =>
|
|
49
|
+
}, K extends keyof T>(injectInto: AnyClass<T>, property: K, position: InjectionPosition, priority?: number): (host: any, property2: string | number | symbol, descriptor: TypedPropertyDescriptor<InjectionMethod<T, K>>) => any;
|
|
51
50
|
/**
|
|
52
51
|
* Classes decorated with `Injector` will have their methods automatically injected using `inject`.
|
|
53
52
|
*
|
|
@@ -37,7 +37,6 @@ export interface IApplicationState {
|
|
|
37
37
|
* WebDriver client api: http://webdriver.io/api.html
|
|
38
38
|
*/
|
|
39
39
|
export default class Application extends ApplicationInteractions {
|
|
40
|
-
readonly appId: string;
|
|
41
40
|
private readonly paths;
|
|
42
41
|
private readonly options;
|
|
43
42
|
private static readonly browsers;
|
|
@@ -45,10 +44,8 @@ export default class Application extends ApplicationInteractions {
|
|
|
45
44
|
static stop(): Promise<void>;
|
|
46
45
|
readonly id: string;
|
|
47
46
|
readonly basePath: string;
|
|
48
|
-
readonly userDataDirectory: string;
|
|
49
47
|
private readonly chromeDriver;
|
|
50
48
|
manager: Apps;
|
|
51
|
-
private screenshotPath;
|
|
52
49
|
private heapSnapshotPath;
|
|
53
50
|
private recordVideo;
|
|
54
51
|
private videoPath;
|
|
@@ -61,7 +58,6 @@ export default class Application extends ApplicationInteractions {
|
|
|
61
58
|
clearDirectory(directory: string): Promise<void>;
|
|
62
59
|
getApplicationState(): Promise<IApplicationState>;
|
|
63
60
|
getLogs(): Promise<string[]>;
|
|
64
|
-
requestScreenshot(screenshotPath: string): void;
|
|
65
61
|
requestHeapSnapshot(heapSnapshotPath: string): void;
|
|
66
62
|
requestVideo(videoPath: string): void;
|
|
67
63
|
private recordVideoFrame;
|
|
@@ -17,13 +17,17 @@ import type { IDedicatedServerGameOptions, IJoinServerOptions, INewGameOptions,
|
|
|
17
17
|
import ApplicationDom from "./applicationDom";
|
|
18
18
|
import ApplicationLogger from "./applicationLogger";
|
|
19
19
|
export default class ApplicationInteractions {
|
|
20
|
+
readonly appId: string;
|
|
20
21
|
readonly random: Random<SeededGenerator>;
|
|
21
22
|
readonly logger: ApplicationLogger;
|
|
22
23
|
dom: ApplicationDom;
|
|
23
24
|
protected browser: WebdriverIO.Browser;
|
|
24
25
|
readonly isDedicatedServer: boolean;
|
|
26
|
+
userDataDirectory: string;
|
|
27
|
+
readonly screenshots: string[];
|
|
28
|
+
private returnToTitleScreenCount;
|
|
25
29
|
private readonly savedStates;
|
|
26
|
-
constructor(additionalArgs: string[], random: Random<SeededGenerator>);
|
|
30
|
+
constructor(appId: string, additionalArgs: string[], random: Random<SeededGenerator>);
|
|
27
31
|
waitForInitialStartup(expectedInitialScreen: "title" | "mp_gameplay_modifiers"): Promise<void>;
|
|
28
32
|
waitUntilLoadingIsFinished(options?: Partial<IWaitUntilGameLoadedOptions>): Promise<void>;
|
|
29
33
|
playDedicatedServer(options: IDedicatedServerGameOptions): Promise<void>;
|
|
@@ -90,4 +94,5 @@ export default class ApplicationInteractions {
|
|
|
90
94
|
increaseStat(stat: Stat, value: number): Promise<void>;
|
|
91
95
|
randomInput(count: number): Promise<void>;
|
|
92
96
|
pressKey(key: string, modifier?: string): Promise<void>;
|
|
97
|
+
protected screenshot(suffix: string): Promise<void>;
|
|
93
98
|
}
|
package/package.json
CHANGED