@wayward/types 2.12.0-beta.dev.20220907.9 → 2.12.0-beta.dev.20220908.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/IObject.d.ts +2 -2
- package/definitions/game/game/doodad/Doodad.d.ts +2 -2
- package/definitions/game/game/entity/action/usable/UsableAction.d.ts +9 -0
- package/definitions/game/game/entity/action/usable/actions/UsableActionsWorld.d.ts +1 -1
- package/definitions/game/game/entity/creature/Creature.d.ts +1 -2
- package/definitions/game/game/inspection/IInspection.d.ts +11 -11
- package/definitions/game/game/inspection/InfoProvider.d.ts +1 -1
- package/definitions/game/game/inspection/Inspection.d.ts +1 -2
- package/definitions/game/game/inspection/InspectionTypeMap.d.ts +11 -11
- package/definitions/game/game/inspection/InspectionsHandler.d.ts +2 -2
- package/definitions/game/game/inspection/infoProviders/item/ItemDetails.d.ts +1 -1
- package/definitions/game/game/inspection/infoProviders/stat/AttackInfo.d.ts +1 -1
- package/definitions/game/game/inspection/inspections/ActionInspection.d.ts +1 -1
- package/definitions/game/game/inspection/inspections/CorpseInspection.d.ts +1 -1
- package/definitions/game/game/inspection/inspections/EquipSlotInspection.d.ts +1 -1
- package/definitions/game/game/island/Island.d.ts +1 -1
- package/definitions/game/game/item/IItemManager.d.ts +7 -0
- package/definitions/game/game/item/Item.d.ts +8 -4
- package/definitions/game/game/item/ItemManager.d.ts +3 -2
- package/definitions/game/game/reference/IReferenceManager.d.ts +48 -0
- package/definitions/game/game/reference/ReferenceManager.d.ts +3 -38
- package/definitions/game/language/ITranslation.d.ts +1 -1
- package/definitions/game/language/dictionary/UiTranslation.d.ts +752 -755
- package/definitions/game/language/impl/TranslationImpl.d.ts +1 -1
- package/definitions/game/ui/screen/screens/game/InspectionHandlers.d.ts +1 -1
- package/definitions/game/ui/screen/screens/game/ReferenceIconRenderer.d.ts +2 -1
- package/definitions/game/ui/screen/screens/game/ReferenceTooltipHandler.d.ts +1 -1
- package/definitions/game/ui/screen/screens/game/dialog/BookDialog.d.ts +1 -1
- package/definitions/game/ui/screen/screens/game/dialog/InspectDialog.d.ts +1 -1
- package/definitions/game/ui/screen/screens/game/static/actions/ActionBarBindableManager.d.ts +4 -1
- package/definitions/game/ui/screen/screens/game/static/actions/IActionBar.d.ts +1 -2
- package/definitions/game/ui/screen/screens/game/static/stats/IStatDisplayDescription.d.ts +1 -1
- package/definitions/game/utilities/Version.d.ts +1 -1
- package/definitions/game/utilities/string/Interpolator.d.ts +1 -1
- package/package.json +1 -1
|
@@ -22,6 +22,7 @@ import { PauseSource, SaveType, TickFlag, TurnMode } from "game/IGame";
|
|
|
22
22
|
import type Island from "game/island/Island";
|
|
23
23
|
import IslandManager from "game/island/IslandManager";
|
|
24
24
|
import type { MultiplayerLoadingDescription } from "game/meta/Loading";
|
|
25
|
+
import SaveLoad from "game/meta/SaveLoad";
|
|
25
26
|
import type { Milestone } from "game/milestones/IMilestone";
|
|
26
27
|
import type { IGameOptions } from "game/options/IGameOptions";
|
|
27
28
|
import { GameMode } from "game/options/IGameOptions";
|
|
@@ -86,6 +87,7 @@ export declare class Game extends EventEmitter.Host<IGameEvents> {
|
|
|
86
87
|
private gameOptionsCached?;
|
|
87
88
|
private synchronizeStateId;
|
|
88
89
|
protected stringTokenizer: StringTokenizer | undefined;
|
|
90
|
+
readonly saveLoad: typeof SaveLoad;
|
|
89
91
|
toString(): string;
|
|
90
92
|
get isPaused(): boolean;
|
|
91
93
|
getPlayingHumans(includeGhosts?: boolean, includeConnecting?: boolean, includeServer?: boolean): Human[];
|
|
@@ -85,8 +85,8 @@ export default class Doodad extends EventEmitter.Host<IDoodadEvents> implements
|
|
|
85
85
|
id: number;
|
|
86
86
|
referenceId?: number;
|
|
87
87
|
itemOrders?: number[];
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
durabilityMax: number;
|
|
89
|
+
durability: number;
|
|
90
90
|
orientation?: DoorOrientation | Direction.Cardinal;
|
|
91
91
|
crafterIdentifier?: string;
|
|
92
92
|
builderIdentifier?: string;
|
|
@@ -16,7 +16,9 @@ import { UsableActionType } from "game/entity/action/usable/UsableActionType";
|
|
|
16
16
|
import type Creature from "game/entity/creature/Creature";
|
|
17
17
|
import type NPC from "game/entity/npc/NPC";
|
|
18
18
|
import type Player from "game/entity/player/Player";
|
|
19
|
+
import type { InspectType } from "game/inspection/IInspection";
|
|
19
20
|
import type { IIcon } from "game/inspection/InfoProvider";
|
|
21
|
+
import type Inspection from "game/inspection/Inspection";
|
|
20
22
|
import type { ItemType } from "game/item/IItem";
|
|
21
23
|
import type { IGetBestItemsOptions } from "game/item/IItemManager";
|
|
22
24
|
import type Item from "game/item/Item";
|
|
@@ -27,6 +29,7 @@ import Translation from "language/Translation";
|
|
|
27
29
|
import type Bindable from "ui/input/Bindable";
|
|
28
30
|
import type { ItemDetailIconLocation } from "ui/screen/screens/game/component/Item";
|
|
29
31
|
import type { HighlightSelector } from "ui/util/IHighlight";
|
|
32
|
+
import type HashSet from "utilities/collection/set/HashSet";
|
|
30
33
|
export interface IUsableActionRequirement<TYPE> {
|
|
31
34
|
allowNone?: true;
|
|
32
35
|
validate?(player: Player, value: TYPE): boolean;
|
|
@@ -160,6 +163,8 @@ export interface IUsableActionDefinitionBase<REQUIREMENTS extends IUsableActionR
|
|
|
160
163
|
* Allows for a dynamically generated bindable based on what this action is using — item, doodad, etc.
|
|
161
164
|
*/
|
|
162
165
|
bindable?: Bindable | ((using: IUsableActionUsing<REQUIREMENTS>) => Bindable | undefined);
|
|
166
|
+
inspectTypes?: InspectType[];
|
|
167
|
+
inspect?(type: InspectType, using: IUsableActionPossibleUsing): HashSet<Inspection<any>> | Inspection<any> | undefined;
|
|
163
168
|
/**
|
|
164
169
|
* The contexts this action appears in.
|
|
165
170
|
* - "Always" means whenever an action of this type is shown, it will be. For example, the "item actions" menu.
|
|
@@ -209,6 +214,10 @@ export interface IUsableActionDefinitionBase<REQUIREMENTS extends IUsableActionR
|
|
|
209
214
|
* Marks this usable action as only executable client-side. This disables support for "use when moving" in action slots.
|
|
210
215
|
*/
|
|
211
216
|
clientSide?: true;
|
|
217
|
+
/**
|
|
218
|
+
* Marks this usable action as, when slotted in the action bar on an item, the item should be ignored and instead the type should be used.
|
|
219
|
+
*/
|
|
220
|
+
onlySlotItemType?: true;
|
|
212
221
|
}
|
|
213
222
|
export interface IUsableActionDefinitionSubmenu<REQUIREMENTS extends IUsableActionRequirements = IUsableActionRequirements> extends IUsableActionDefinitionBase<REQUIREMENTS> {
|
|
214
223
|
submenu(registrar: UsableActionRegistrar, using: IUsableActionUsing<REQUIREMENTS>): UsableActionRegistrar | void;
|
|
@@ -17,7 +17,7 @@ export declare enum WorldContextMenuClasses {
|
|
|
17
17
|
OptionText = "world-context-menu-option-text"
|
|
18
18
|
}
|
|
19
19
|
export declare namespace WorldContextMenuClasses {
|
|
20
|
-
const OptionSpecific: (enumValue: UsableActionType) => "world-context-menu-option-actions" | "world-context-menu-option-use" | "world-context-menu-option-move" | "world-context-menu-option-
|
|
20
|
+
const OptionSpecific: (enumValue: UsableActionType) => "world-context-menu-option-actions" | "world-context-menu-option-use" | "world-context-menu-option-move" | "world-context-menu-option-digwithhands" | "world-context-menu-option-dropall" | "world-context-menu-option-dropallofsamequality" | "world-context-menu-option-gatherwithhands" | "world-context-menu-option-harvestwithhands" | "world-context-menu-option-movetoinventory" | "world-context-menu-option-pickupexcrementwithhands" | "world-context-menu-option-tillwithhands" | "world-context-menu-option-quickslotremove" | "world-context-menu-option-quickslotadd" | "world-context-menu-option-quickslotaddtofree" | "world-context-menu-option-quickslotaddtoslot" | "world-context-menu-option-dropmenu" | "world-context-menu-option-repairwithitem" | "world-context-menu-option-reinforcewithitem" | "world-context-menu-option-enhancewithitem" | "world-context-menu-option-enchantwithitem" | "world-context-menu-option-transmogrifywithitem" | "world-context-menu-option-upgradewithitem" | "world-context-menu-option-alterwithitem" | "world-context-menu-option-refinewithitem" | "world-context-menu-option-preservewithitem" | "world-context-menu-option-addfuelwithitem" | "world-context-menu-option-ignitewithitem" | "world-context-menu-option-absorbwithitem" | "world-context-menu-option-exudewithitem" | "world-context-menu-option-movetoinventorymenu" | "world-context-menu-option-movetoactivecontainermenu" | "world-context-menu-option-movetofacingcontainermenu" | "world-context-menu-option-moveall" | "world-context-menu-option-moveallofsamequality" | "world-context-menu-option-tradetradersell" | "world-context-menu-option-tradetraderbuy" | "world-context-menu-option-itemactions" | "world-context-menu-option-equipheld" | "world-context-menu-option-equiplegs" | "world-context-menu-option-equipchest" | "world-context-menu-option-equiphead" | "world-context-menu-option-equipbelt" | "world-context-menu-option-equipfeet" | "world-context-menu-option-equipneck" | "world-context-menu-option-equiphands" | "world-context-menu-option-equipback" | "world-context-menu-option-equipmainhand" | "world-context-menu-option-equipoffhand";
|
|
21
21
|
}
|
|
22
22
|
export declare const UsableActionsWorldActions: UsableActionGenerator<[]>;
|
|
23
23
|
export declare const UsableActionsWorldItemActions: UsableActionGenerator<[]>;
|
|
@@ -17,8 +17,7 @@ import type Human from "game/entity/Human";
|
|
|
17
17
|
import type { IStatChangeInfo } from "game/entity/IEntity";
|
|
18
18
|
import { AiType, EntityType, MoveType, StatusType } from "game/entity/IEntity";
|
|
19
19
|
import type { IStat } from "game/entity/IStats";
|
|
20
|
-
import { CreationId } from "game/IGame";
|
|
21
|
-
import { TileUpdateType } from "game/IGame";
|
|
20
|
+
import { CreationId, TileUpdateType } from "game/IGame";
|
|
22
21
|
import type { IObject } from "game/IObject";
|
|
23
22
|
import type Island from "game/island/Island";
|
|
24
23
|
import type Item from "game/item/Item";
|
|
@@ -18,17 +18,17 @@ export declare enum InspectType {
|
|
|
18
18
|
Ghost = 6,
|
|
19
19
|
EquipSlot = 7,
|
|
20
20
|
Item = 8,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
Recipe = 9,
|
|
22
|
+
Dismantle = 10,
|
|
23
|
+
ItemType = 11,
|
|
24
|
+
Action = 12,
|
|
25
|
+
Items = 13,
|
|
26
|
+
Corpse = 14,
|
|
27
|
+
Corpses = 15,
|
|
28
|
+
TileEventMinor = 16,
|
|
29
|
+
Tile = 17,
|
|
30
|
+
Skill = 18,
|
|
31
|
+
Milestone = 19,
|
|
32
32
|
Stat = 20,
|
|
33
33
|
Island = 21
|
|
34
34
|
}
|
|
@@ -133,7 +133,7 @@ export declare class SimpleInfoProvider extends InfoProvider {
|
|
|
133
133
|
private readonly contents;
|
|
134
134
|
private childComponentClass;
|
|
135
135
|
constructor(...translations: Array<TranslationGenerator | InfoProvider>);
|
|
136
|
-
get(): (import("../../language/ITranslation").ISerializedTranslation | import("../../language/impl/TranslationImpl").default | import("../../language/dictionary/UiTranslation").default | (() => import("../../language/ITranslation").ISerializedTranslation | import("../../language/impl/TranslationImpl").default |
|
|
136
|
+
get(): (import("../../language/ITranslation").ISerializedTranslation | import("../../language/impl/TranslationImpl").default | import("../../language/dictionary/UiTranslation").default | (() => import("../../language/ITranslation").ISerializedTranslation | import("../../language/impl/TranslationImpl").default | import("../../language/dictionary/UiTranslation").default | Iterable<import("../../utilities/string/Interpolator").IStringSection> | undefined) | InfoProvider)[];
|
|
137
137
|
add(...translations: Array<TranslationGenerator | InfoProvider | Falsy>): this;
|
|
138
138
|
onlyIfHasContents(): this | undefined;
|
|
139
139
|
addInfoGetter(provider: () => InfoProvider | undefined): this;
|
|
@@ -12,8 +12,7 @@ import { InspectType } from "game/inspection/IInspection";
|
|
|
12
12
|
import { InfoProvider } from "game/inspection/InfoProvider";
|
|
13
13
|
import type { InfoProviderContext } from "game/inspection/InfoProviderContext";
|
|
14
14
|
import type { InspectionClass } from "game/inspection/InspectionTypeMap";
|
|
15
|
-
import type { ReferenceType } from "game/reference/IReferenceManager";
|
|
16
|
-
import type { EnumReferenceResolved, EnumReferenceTypes } from "game/reference/ReferenceManager";
|
|
15
|
+
import type { EnumReferenceResolved, EnumReferenceTypes, ReferenceType } from "game/reference/IReferenceManager";
|
|
17
16
|
import type { TranslationGenerator } from "ui/component/IComponent";
|
|
18
17
|
import type Text from "ui/component/Text";
|
|
19
18
|
import type { IVector3 } from "utilities/math/IVector";
|
|
@@ -43,28 +43,28 @@ export declare type InspectionClass = Class<Inspection<any>> & {
|
|
|
43
43
|
getDefaultPriority(type: InspectType): number;
|
|
44
44
|
};
|
|
45
45
|
declare const _default: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
12: typeof ActionInspection;
|
|
47
|
+
14: typeof CorpseInspection;
|
|
48
|
+
15: typeof CorpsesInspection;
|
|
49
49
|
3: typeof CreatureInspection;
|
|
50
|
-
|
|
50
|
+
10: typeof ItemInspection;
|
|
51
51
|
4: typeof DoodadInspection;
|
|
52
52
|
7: typeof EquipSlotInspection;
|
|
53
53
|
6: typeof PlayerInspection;
|
|
54
54
|
21: typeof IslandInspection;
|
|
55
55
|
8: typeof ItemInspection;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
13: typeof ItemsInspection;
|
|
57
|
+
11: typeof ItemInspection;
|
|
58
|
+
19: typeof MilestoneInspection;
|
|
59
59
|
2: typeof NPCInspection;
|
|
60
60
|
1: typeof PlayerInspection;
|
|
61
|
-
|
|
61
|
+
9: typeof RecipeInspection;
|
|
62
62
|
0: typeof SelfInspection;
|
|
63
|
-
|
|
63
|
+
18: typeof SkillInspection;
|
|
64
64
|
20: typeof StatInspection;
|
|
65
|
-
|
|
65
|
+
17: typeof TileInspection;
|
|
66
66
|
5: typeof TileEventInspection;
|
|
67
|
-
|
|
67
|
+
16: typeof TileEventInspection.Minors;
|
|
68
68
|
} & Record<InspectType, InspectionClass>;
|
|
69
69
|
export default _default;
|
|
70
70
|
export declare module Inspections {
|
|
@@ -19,7 +19,7 @@ export interface IInspectionsHandlerEvents {
|
|
|
19
19
|
export default abstract class InspectionsHandler extends EventEmitter.Host<IInspectionsHandlerEvents> {
|
|
20
20
|
protected readonly context: InfoProviderContext;
|
|
21
21
|
protected readonly inspectionsMap: Map<InspectType, HashSet<Inspection<any>>>;
|
|
22
|
-
static makeInspectionsSet(values: IterableOr<Inspection<any>>): HashSet<Inspection<any>>;
|
|
22
|
+
static makeInspectionsSet(...values: Array<IterableOr<Inspection<any> | undefined>>): HashSet<Inspection<any>>;
|
|
23
23
|
constructor(context: InfoProviderContext, inspectionsMap?: Map<InspectType, HashSet<Inspection<any>>>);
|
|
24
24
|
get(inspectType: InspectType): HashSet<Inspection<any>> | undefined;
|
|
25
25
|
set(inspectType: InspectType, inspections: HashSet<Inspection<any>>): Map<InspectType, HashSet<Inspection<any>>>;
|
|
@@ -29,7 +29,7 @@ export default abstract class InspectionsHandler extends EventEmitter.Host<IInsp
|
|
|
29
29
|
register(): void;
|
|
30
30
|
deregister(): void;
|
|
31
31
|
protected getInspections?(inspectType: InspectType): HashSet<Inspection<any>>;
|
|
32
|
-
protected createInspectionSet(...values: Array<
|
|
32
|
+
protected createInspectionSet(...values: Array<IterableOr<Inspection<any> | undefined>>): HashSet<Inspection<any>>;
|
|
33
33
|
protected updateInspections(...inspectTypes: InspectType[]): void;
|
|
34
34
|
protected updateInspectionsForType(inspectType: InspectType, inspections: HashSet<Inspection<any>>): void;
|
|
35
35
|
}
|
|
@@ -19,7 +19,7 @@ export default class ItemDetailsInfoProvider extends InfoProvider {
|
|
|
19
19
|
private readonly description;
|
|
20
20
|
constructor(item: Item | ItemType);
|
|
21
21
|
getClass(): string[];
|
|
22
|
-
get(): (0 | import("game/inspection/InfoProvider").SimpleInfoProvider |
|
|
22
|
+
get(): (0 | LabelledValue | import("game/inspection/InfoProvider").SimpleInfoProvider | ItemWorthInfoProvider)[];
|
|
23
23
|
private getInsulation;
|
|
24
24
|
private getPreservation;
|
|
25
25
|
private getGroupings;
|
|
@@ -15,7 +15,7 @@ export default class AttackInfo extends InfoProvider {
|
|
|
15
15
|
private readonly human?;
|
|
16
16
|
constructor(human?: Human | undefined);
|
|
17
17
|
getClass(): string[];
|
|
18
|
-
get(): (import("game/inspection/InfoProvider").SimpleInfoProvider
|
|
18
|
+
get(): (LabelledValue | import("game/inspection/InfoProvider").SimpleInfoProvider)[];
|
|
19
19
|
private getTactics;
|
|
20
20
|
private getMainHand;
|
|
21
21
|
private getOffHand;
|
|
@@ -14,8 +14,8 @@ import { InspectType } from "game/inspection/IInspection";
|
|
|
14
14
|
import { InfoProvider } from "game/inspection/InfoProvider";
|
|
15
15
|
import type { InfoProviderContext } from "game/inspection/InfoProviderContext";
|
|
16
16
|
import Inspection from "game/inspection/Inspection";
|
|
17
|
+
import type { EnumReferenceResolved } from "game/reference/IReferenceManager";
|
|
17
18
|
import { ReferenceType } from "game/reference/IReferenceManager";
|
|
18
|
-
import type { EnumReferenceResolved } from "game/reference/ReferenceManager";
|
|
19
19
|
import type { TranslationGenerator } from "ui/component/IComponent";
|
|
20
20
|
import type { ActionSlot } from "ui/screen/screens/game/static/ActionBar";
|
|
21
21
|
export default class ActionInspection extends Inspection<ActionType | string | undefined> {
|
|
@@ -19,7 +19,7 @@ export default class CorpseInspection extends Inspection<Corpse> {
|
|
|
19
19
|
static getFromTile(position: IVector3): CorpseInspection[];
|
|
20
20
|
static handles(type: InspectType, corpse: unknown): boolean;
|
|
21
21
|
constructor(corpse: Corpse);
|
|
22
|
-
get(context: InfoProviderContext): (0 | import("game/inspection/InfoProvider").SimpleInfoProvider
|
|
22
|
+
get(context: InfoProviderContext): (0 | LabelledValue | import("game/inspection/InfoProvider").SimpleInfoProvider)[];
|
|
23
23
|
private getDecay;
|
|
24
24
|
private decay;
|
|
25
25
|
private shouldRefreshDecay;
|
|
@@ -13,8 +13,8 @@ import { InspectType } from "game/inspection/IInspection";
|
|
|
13
13
|
import { InfoProvider } from "game/inspection/InfoProvider";
|
|
14
14
|
import type { InfoProviderContext } from "game/inspection/InfoProviderContext";
|
|
15
15
|
import Inspection from "game/inspection/Inspection";
|
|
16
|
+
import type { EnumReferenceResolved } from "game/reference/IReferenceManager";
|
|
16
17
|
import { ReferenceType } from "game/reference/IReferenceManager";
|
|
17
|
-
import type { EnumReferenceResolved } from "game/reference/ReferenceManager";
|
|
18
18
|
import type { TranslationGenerator } from "ui/component/IComponent";
|
|
19
19
|
export default class EquipSlotInspection extends Inspection<EquipType | undefined> {
|
|
20
20
|
static handles: (type: InspectType, value: unknown, context?: InfoProviderContext | undefined) => any;
|
|
@@ -42,9 +42,9 @@ import World from "renderer/world/World";
|
|
|
42
42
|
import type { IPreSerializeCallback, ISerializer } from "save/serializer/ISerializer";
|
|
43
43
|
import { Direction } from "utilities/math/Direction";
|
|
44
44
|
import type { IVector2, IVector3 } from "utilities/math/IVector";
|
|
45
|
+
import Vector3 from "utilities/math/Vector3";
|
|
45
46
|
import type { Random, SeededGenerator } from "utilities/random/Random";
|
|
46
47
|
import type { IVersionInfo } from "utilities/Version";
|
|
47
|
-
import Vector3 from "utilities/math/Vector3";
|
|
48
48
|
export interface IIslandDetails {
|
|
49
49
|
seed: number;
|
|
50
50
|
random: Random;
|
|
@@ -114,3 +114,10 @@ export declare enum ContainerReferenceSource {
|
|
|
114
114
|
Serializer = 11,
|
|
115
115
|
WriteContainer = 12
|
|
116
116
|
}
|
|
117
|
+
export interface ICraftResultChances {
|
|
118
|
+
success: number;
|
|
119
|
+
quality: number;
|
|
120
|
+
}
|
|
121
|
+
export declare namespace ICraftResultChances {
|
|
122
|
+
const NEVER: Readonly<ICraftResultChances>;
|
|
123
|
+
}
|
|
@@ -65,6 +65,8 @@ export interface IItemEvents {
|
|
|
65
65
|
*/
|
|
66
66
|
shouldDamage(modifier?: number): number | false | undefined;
|
|
67
67
|
qualityChange(quality: Quality, oldQuality: Quality): any;
|
|
68
|
+
durabilityChange(durability: number, oldDurability: number): any;
|
|
69
|
+
durabilityMaxChange(durabilityMax: number, oldDurabilityMax: number): any;
|
|
68
70
|
}
|
|
69
71
|
export default class Item extends EventEmitter.Host<IItemEvents> implements IReferenceable, Partial<IContainer>, IContainable, IUnserializedCallback, IObject<ItemType>, IObjectOptions, IContainable, Partial<IContainer>, ITemperatureSource, IHasInsulation, IHasMagic {
|
|
70
72
|
readonly objectType = CreationId.Item;
|
|
@@ -83,8 +85,8 @@ export default class Item extends EventEmitter.Host<IItemEvents> implements IRef
|
|
|
83
85
|
fireStage?: FireStage;
|
|
84
86
|
id: number;
|
|
85
87
|
itemOrders?: number[];
|
|
86
|
-
maxDur
|
|
87
|
-
minDur
|
|
88
|
+
private maxDur;
|
|
89
|
+
private minDur;
|
|
88
90
|
pid: number | null | undefined;
|
|
89
91
|
protected?: boolean;
|
|
90
92
|
quality: Quality | undefined;
|
|
@@ -108,10 +110,13 @@ export default class Item extends EventEmitter.Host<IItemEvents> implements IRef
|
|
|
108
110
|
private _movementTime?;
|
|
109
111
|
private _movementOptions?;
|
|
110
112
|
private _description;
|
|
111
|
-
private _minDur;
|
|
112
113
|
constructor(itemType?: ItemType | undefined, islandId?: IslandId, quality?: Quality, human?: Human);
|
|
113
114
|
get island(): import("../island/Island").default;
|
|
114
115
|
toString(): string;
|
|
116
|
+
get durability(): number;
|
|
117
|
+
set durability(value: number);
|
|
118
|
+
get durabilityMax(): number;
|
|
119
|
+
set durabilityMax(value: number);
|
|
115
120
|
/**
|
|
116
121
|
* Gets the owner of this item.
|
|
117
122
|
* This will be the human who crafted it.
|
|
@@ -310,7 +315,6 @@ export default class Item extends EventEmitter.Host<IItemEvents> implements IRef
|
|
|
310
315
|
getCivilizationScore(actionType: ActionType.Build | ActionType.SetDown): number;
|
|
311
316
|
getVehicle(): import("game/item/IItem").IItemVehicle | undefined;
|
|
312
317
|
isVehicleAllowedOnTile(tile: ITile): boolean;
|
|
313
|
-
private setupDurabilityHandlers;
|
|
314
318
|
private checkIfItemsMatch;
|
|
315
319
|
private checkIfItemArraysMatch;
|
|
316
320
|
}
|
|
@@ -19,7 +19,7 @@ import { Quality } from "game/IObject";
|
|
|
19
19
|
import type { ContainerReference, IContainable, IContainer, IItemDescription, IItemWeightComponent, IRecipe } from "game/item/IItem";
|
|
20
20
|
import { CraftResult, ItemType, ItemTypeGroup } from "game/item/IItem";
|
|
21
21
|
import type { IAddToContainerOptions, IDoodadsUsed, IGetBestItemsOptions, IGetItemOptions, IGetItemsOptions, IRequirementInfo } from "game/item/IItemManager";
|
|
22
|
-
import { ContainerReferenceSource, CraftStatus, WeightType } from "game/item/IItemManager";
|
|
22
|
+
import { ContainerReferenceSource, CraftStatus, ICraftResultChances, WeightType } from "game/item/IItemManager";
|
|
23
23
|
import Item from "game/item/Item";
|
|
24
24
|
import type ItemRecipeRequirementChecker from "game/item/ItemRecipeRequirementChecker";
|
|
25
25
|
import { ObjectManager } from "game/ObjectManager";
|
|
@@ -313,6 +313,7 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
|
|
|
313
313
|
private onItemMoveOrRemove;
|
|
314
314
|
private getCraftTierBonus;
|
|
315
315
|
computeCraftQualityBonus(itemType: ItemType, itemsToRequire: Item[], itemsToConsume: Item[], doodadsUsed: IDoodadsUsed[] | undefined): number;
|
|
316
|
-
getCraftChance(human: Human, recipe: IRecipe, qualityBonus: number, returnQuality?: boolean
|
|
316
|
+
getCraftChance(human: Human, recipe: IRecipe, qualityBonus: number, returnQuality?: boolean): number;
|
|
317
|
+
getCraftResultChances(human: Human, recipe: IRecipe, qualityBonus: number): Readonly<ICraftResultChances>;
|
|
317
318
|
isCraftSuccessful(human: Human, recipe: IRecipe, qualityBonus: number): CraftResult;
|
|
318
319
|
}
|
|
@@ -8,6 +8,20 @@
|
|
|
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 Doodad from "game/doodad/Doodad";
|
|
12
|
+
import type { ActionType } from "game/entity/action/IAction";
|
|
13
|
+
import type Corpse from "game/entity/creature/corpse/Corpse";
|
|
14
|
+
import type Creature from "game/entity/creature/Creature";
|
|
15
|
+
import type { EquipType, SkillType } from "game/entity/IHuman";
|
|
16
|
+
import type { Stat } from "game/entity/IStats";
|
|
17
|
+
import type NPC from "game/entity/npc/NPC";
|
|
18
|
+
import type Player from "game/entity/player/Player";
|
|
19
|
+
import type Island from "game/island/Island";
|
|
20
|
+
import type { ItemType } from "game/item/IItem";
|
|
21
|
+
import type Item from "game/item/Item";
|
|
22
|
+
import type { Milestone } from "game/milestones/IMilestone";
|
|
23
|
+
import type ReferenceManager from "game/reference/ReferenceManager";
|
|
24
|
+
import type TileEvent from "game/tile/TileEvent";
|
|
11
25
|
export interface IReferenceable {
|
|
12
26
|
/**
|
|
13
27
|
* Do not use this property directly, instead use `game.references.getReference()
|
|
@@ -32,3 +46,37 @@ export declare enum ReferenceType {
|
|
|
32
46
|
Action = 14,
|
|
33
47
|
EquipSlot = 15
|
|
34
48
|
}
|
|
49
|
+
export declare const enumRefTypes: Set<ReferenceType.Skill | ReferenceType.Milestone | ReferenceType.Recipe | ReferenceType.ItemType | ReferenceType.Dismantle | ReferenceType.Stat | ReferenceType.Action | ReferenceType.EquipSlot>;
|
|
50
|
+
export declare type EnumReferenceTypes = (typeof enumRefTypes) extends Set<infer R> ? R : never;
|
|
51
|
+
export declare type ReferenceableReferenceTypes = Exclude<ReferenceType, EnumReferenceTypes>;
|
|
52
|
+
export declare const referenceableRefTypes: Set<ReferenceableReferenceTypes>;
|
|
53
|
+
export interface IReferenceTypeMap {
|
|
54
|
+
[ReferenceType.Item]: Item;
|
|
55
|
+
[ReferenceType.Creature]: Creature;
|
|
56
|
+
[ReferenceType.Doodad]: Doodad;
|
|
57
|
+
[ReferenceType.NPC]: NPC;
|
|
58
|
+
[ReferenceType.Player]: Player;
|
|
59
|
+
[ReferenceType.TileEvent]: TileEvent;
|
|
60
|
+
[ReferenceType.Island]: Island;
|
|
61
|
+
[ReferenceType.Corpse]: Corpse;
|
|
62
|
+
[ReferenceType.Skill]: [ReferenceType.Skill, SkillType];
|
|
63
|
+
[ReferenceType.Milestone]: [ReferenceType.Milestone, Milestone];
|
|
64
|
+
[ReferenceType.Recipe]: [ReferenceType.Recipe, ItemType];
|
|
65
|
+
[ReferenceType.ItemType]: [ReferenceType.ItemType, ItemType];
|
|
66
|
+
[ReferenceType.Dismantle]: [ReferenceType.Dismantle, ItemType];
|
|
67
|
+
[ReferenceType.Stat]: [ReferenceType.Stat, Stat];
|
|
68
|
+
[ReferenceType.Action]: [ReferenceType.Action, ActionType | string, Item?];
|
|
69
|
+
[ReferenceType.EquipSlot]: [ReferenceType.EquipSlot, EquipType];
|
|
70
|
+
}
|
|
71
|
+
declare type ReferenceId<REFTYPE extends ReferenceType> = IReferenceTypeMap[REFTYPE] extends [REFTYPE, infer IdType, any?] ? IdType : number;
|
|
72
|
+
export declare type Reference<REFTYPE extends ReferenceType | undefined = ReferenceType | undefined> = REFTYPE extends ReferenceType ? [id: ReferenceId<REFTYPE>, type: REFTYPE, context?: [number, ReferenceType?]] : [number];
|
|
73
|
+
export declare type Referenceable = IReferenceTypeMap[ReferenceableReferenceTypes];
|
|
74
|
+
export declare type ResolveReference<REFTYPE extends ReferenceType> = IReferenceTypeMap[REFTYPE];
|
|
75
|
+
export declare type EnumReferenceResolved<REFTYPE extends EnumReferenceTypes = EnumReferenceTypes> = IReferenceTypeMap[REFTYPE];
|
|
76
|
+
export declare module Reference {
|
|
77
|
+
function setReferenceResolver(resolver: typeof ReferenceManager.get): void;
|
|
78
|
+
function create(id: number): Reference;
|
|
79
|
+
function create<REFTYPE extends ReferenceType>(id: ReferenceId<REFTYPE>, type: REFTYPE, context?: Referenceable | number | [number, ReferenceType?]): Reference;
|
|
80
|
+
function context(reference?: Reference): [number] | [id: number, type: ReferenceType.Item, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: number, type: ReferenceType.Creature, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: number, type: ReferenceType.Doodad, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: number, type: ReferenceType.NPC, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: number, type: ReferenceType.Player, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: number, type: ReferenceType.TileEvent, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: number, type: ReferenceType.Island, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: number, type: ReferenceType.Corpse, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: SkillType, type: ReferenceType.Skill, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: Milestone, type: ReferenceType.Milestone, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: ItemType, type: ReferenceType.Recipe, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: ItemType, type: ReferenceType.ItemType, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: ItemType, type: ReferenceType.Dismantle, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: Stat, type: ReferenceType.Stat, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: string | ActionType, type: ReferenceType.Action, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: EquipType, type: ReferenceType.EquipSlot, context?: [number, (ReferenceType | undefined)?] | undefined] | undefined;
|
|
81
|
+
}
|
|
82
|
+
export {};
|
|
@@ -10,56 +10,22 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import Doodad from "game/doodad/Doodad";
|
|
12
12
|
import { ActionType } from "game/entity/action/IAction";
|
|
13
|
-
import Corpse from "game/entity/creature/corpse/Corpse";
|
|
14
13
|
import Creature from "game/entity/creature/Creature";
|
|
15
|
-
import type { EquipType } from "game/entity/IHuman";
|
|
16
14
|
import { SkillType } from "game/entity/IHuman";
|
|
17
15
|
import { Stat } from "game/entity/IStats";
|
|
18
|
-
import NPC from "game/entity/npc/NPC";
|
|
19
16
|
import Player from "game/entity/player/Player";
|
|
20
17
|
import type Inspection from "game/inspection/Inspection";
|
|
21
18
|
import Island from "game/island/Island";
|
|
22
19
|
import { ItemType } from "game/item/IItem";
|
|
23
20
|
import Item from "game/item/Item";
|
|
24
21
|
import { Milestone } from "game/milestones/IMilestone";
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
22
|
+
import type { EnumReferenceTypes, IReferenceTypeMap, Referenceable } from "game/reference/IReferenceManager";
|
|
23
|
+
import { Reference, ReferenceType } from "game/reference/IReferenceManager";
|
|
27
24
|
import ReferenceTooltipHandler from "ui/screen/screens/game/ReferenceTooltipHandler";
|
|
28
25
|
import type Tooltip from "ui/tooltip/Tooltip";
|
|
29
|
-
declare const enumRefTypes: Set<ReferenceType.Skill | ReferenceType.Milestone | ReferenceType.Recipe | ReferenceType.ItemType | ReferenceType.Dismantle | ReferenceType.Stat | ReferenceType.Action | ReferenceType.EquipSlot>;
|
|
30
|
-
export declare type EnumReferenceTypes = (typeof enumRefTypes) extends Set<infer R> ? R : never;
|
|
31
|
-
export declare type ReferenceableReferenceTypes = Exclude<ReferenceType, EnumReferenceTypes>;
|
|
32
|
-
interface IReferenceTypeMap {
|
|
33
|
-
[ReferenceType.Item]: Item;
|
|
34
|
-
[ReferenceType.Creature]: Creature;
|
|
35
|
-
[ReferenceType.Doodad]: Doodad;
|
|
36
|
-
[ReferenceType.NPC]: NPC;
|
|
37
|
-
[ReferenceType.Player]: Player;
|
|
38
|
-
[ReferenceType.TileEvent]: TileEvent;
|
|
39
|
-
[ReferenceType.Island]: Island;
|
|
40
|
-
[ReferenceType.Corpse]: Corpse;
|
|
41
|
-
[ReferenceType.Skill]: [ReferenceType.Skill, SkillType];
|
|
42
|
-
[ReferenceType.Milestone]: [ReferenceType.Milestone, Milestone];
|
|
43
|
-
[ReferenceType.Recipe]: [ReferenceType.Recipe, ItemType];
|
|
44
|
-
[ReferenceType.ItemType]: [ReferenceType.ItemType, ItemType];
|
|
45
|
-
[ReferenceType.Dismantle]: [ReferenceType.Dismantle, ItemType];
|
|
46
|
-
[ReferenceType.Stat]: [ReferenceType.Stat, Stat];
|
|
47
|
-
[ReferenceType.Action]: [ReferenceType.Action, ActionType | string, Item?];
|
|
48
|
-
[ReferenceType.EquipSlot]: [ReferenceType.EquipSlot, EquipType];
|
|
49
|
-
}
|
|
50
|
-
declare type ReferenceId<REFTYPE extends ReferenceType> = IReferenceTypeMap[REFTYPE] extends [REFTYPE, infer IdType, any?] ? IdType : number;
|
|
51
|
-
export declare type Reference<REFTYPE extends ReferenceType | undefined = ReferenceType | undefined> = REFTYPE extends ReferenceType ? [id: ReferenceId<REFTYPE>, type: REFTYPE, context?: [number, ReferenceType?]] : [number];
|
|
52
|
-
export declare type Referenceable = IReferenceTypeMap[ReferenceableReferenceTypes];
|
|
53
|
-
export declare type ResolveReference<REFTYPE extends ReferenceType> = IReferenceTypeMap[REFTYPE];
|
|
54
|
-
export declare type EnumReferenceResolved<REFTYPE extends EnumReferenceTypes = EnumReferenceTypes> = IReferenceTypeMap[REFTYPE];
|
|
55
|
-
export declare module Reference {
|
|
56
|
-
function create(id: number): Reference;
|
|
57
|
-
function create<REFTYPE extends ReferenceType>(id: ReferenceId<REFTYPE>, type: REFTYPE, context?: Referenceable | number | [number, ReferenceType?]): Reference;
|
|
58
|
-
function context(reference?: Reference): [number] | [id: number, type: ReferenceType.Item, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: number, type: ReferenceType.Creature, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: number, type: ReferenceType.Doodad, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: number, type: ReferenceType.NPC, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: number, type: ReferenceType.Player, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: number, type: ReferenceType.TileEvent, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: number, type: ReferenceType.Island, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: number, type: ReferenceType.Corpse, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: SkillType, type: ReferenceType.Skill, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: Milestone, type: ReferenceType.Milestone, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: ItemType, type: ReferenceType.Recipe, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: ItemType, type: ReferenceType.ItemType, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: ItemType, type: ReferenceType.Dismantle, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: Stat, type: ReferenceType.Stat, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: string | ActionType, type: ReferenceType.Action, context?: [number, (ReferenceType | undefined)?] | undefined] | [id: EquipType, type: ReferenceType.EquipSlot, context?: [number, (ReferenceType | undefined)?] | undefined] | undefined;
|
|
59
|
-
}
|
|
60
26
|
export default class ReferenceManager {
|
|
61
27
|
static isEnumReference(type: ReferenceType): type is EnumReferenceTypes;
|
|
62
|
-
static getList(type: ReferenceType, gameIsland?: Island): import("../entity/creature/corpse/CorpseManager").default | import("../entity/creature/CreatureManager").default | import("../doodad/DoodadManager").default | import("../item/ItemManager").default | import("../entity/npc/NPCManager").default | import("../tile/TileEventManager").default | (Player | undefined)[] | readonly Milestone[] | readonly SkillType[] |
|
|
28
|
+
static getList(type: ReferenceType, gameIsland?: Island): import("../entity/creature/corpse/CorpseManager").default | import("../entity/creature/CreatureManager").default | import("../doodad/DoodadManager").default | import("../item/ItemManager").default | import("../entity/npc/NPCManager").default | import("../tile/TileEventManager").default | (Player | undefined)[] | readonly Milestone[] | readonly SkillType[] | import("game/entity/IHuman").EquipType[] | readonly ItemType[] | IterableIterator<Island> | readonly Stat[] | (string | ActionType)[];
|
|
63
29
|
static get(thing: Referenceable): Reference | undefined;
|
|
64
30
|
static getReferenceType(thing: Value<IReferenceTypeMap>): ReferenceType;
|
|
65
31
|
private referenceCursor;
|
|
@@ -75,4 +41,3 @@ export default class ReferenceManager {
|
|
|
75
41
|
inspect(reference: Reference, ...args: any[]): Inspection<any> | undefined;
|
|
76
42
|
tooltip(reference: Reference, initializer?: (tooltip: Tooltip, handler: ReferenceTooltipHandler) => any): (tooltip: Tooltip) => Promise<void>;
|
|
77
43
|
}
|
|
78
|
-
export {};
|
|
@@ -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 { Reference } from "game/reference/
|
|
11
|
+
import type { Reference } from "game/reference/IReferenceManager";
|
|
12
12
|
import type { Segment } from "language/segment/Segments";
|
|
13
13
|
import type { IInterpolationOptions, IStringSection } from "utilities/string/Interpolator";
|
|
14
14
|
export declare enum ListEnder {
|