@wayward/types 2.13.2-beta.dev.20230527.1 → 2.13.2-beta.dev.20230528.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.
@@ -33,4 +33,5 @@ export default class ActionInspection extends Inspection<ActionId | undefined> {
33
33
  private getActionDiscovered;
34
34
  private getActionTier;
35
35
  private getActionUsability;
36
+ private getActionExample;
36
37
  }
@@ -112,6 +112,7 @@ export interface IIslandLoadOptions {
112
112
  * Set to true when the island load is happening for everyone eveywhere all at once
113
113
  */
114
114
  isSynced: boolean;
115
+ isTransient?: boolean;
115
116
  travelTime?: number;
116
117
  pauseAndShowLoadingScreen?: boolean;
117
118
  multiplayerLoadingDescription?: MultiplayerLoadingDescription;
@@ -169,6 +170,7 @@ export declare enum LiquidType {
169
170
  export declare const ISLAND_NAME_MAX_LENGTH = 32;
170
171
  export declare const DEFAULT_ISLAND_ID = "0,0";
171
172
  export declare const DEFAULT_ISLAND_MAP_SIZE = 512;
173
+ export declare const GENERIC_TRANSIENT_ISLAND_ID_START: IslandId;
172
174
  export declare const TRAVEL_ANIMATION_ISLAND_ID: IslandId;
173
175
  export interface IIslandPort {
174
176
  id: number;
@@ -189,3 +191,14 @@ export interface IMobCheck extends IVector3 {
189
191
  waterTiles?: number;
190
192
  voidTiles?: number;
191
193
  }
194
+ /**
195
+ * Allows choosing what to copy from the human.
196
+ * All options default to true
197
+ */
198
+ export interface ICopyHumanOptions {
199
+ human: Human;
200
+ copyCustomizations?: false;
201
+ copyItemsAndEquipment?: false;
202
+ copyStats?: false;
203
+ copyStatus?: false;
204
+ }
@@ -134,6 +134,7 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
134
134
  */
135
135
  get isActive(): boolean;
136
136
  get isDefaultIsland(): boolean;
137
+ get isTransient(): boolean;
137
138
  getDetails(): IIslandDetails;
138
139
  /**
139
140
  * Activates the island.
@@ -9,7 +9,7 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import type Human from "game/entity/Human";
12
- import type { IIslandLoadOptions, IslandId } from "game/island/IIsland";
12
+ import { type ICopyHumanOptions, type IIslandLoadOptions, type IslandId } from "game/island/IIsland";
13
13
  import type Island from "game/island/Island";
14
14
  import type { Direction } from "utilities/math/Direction";
15
15
  import type { IVector3 } from "utilities/math/IVector";
@@ -18,7 +18,8 @@ import type { IVector3 } from "utilities/math/IVector";
18
18
  */
19
19
  export declare class TransientIsland {
20
20
  readonly island: Island;
21
- static create(islandId: IslandId, islandOptions?: Partial<IIslandLoadOptions>): Promise<TransientIsland>;
21
+ static createIslandId(): IslandId;
22
+ static create(islandId?: IslandId, islandOptions?: Partial<IIslandLoadOptions>): Promise<TransientIsland>;
22
23
  private deleted;
23
24
  private constructor();
24
25
  delete(): void;
@@ -26,8 +27,8 @@ export declare class TransientIsland {
26
27
  * Creates a human you can do stuff with
27
28
  * @param spawnPoint Spawn point. Set to undefined to use the default island spawn point
28
29
  * @param facingDirection Direction they should face when spawing
29
- * @param copyFromHuman Human object to copy customizations, items, and vehicles from
30
+ * @param copyFromHumanOptions Human object to copy customizations, items, and vehicles from
30
31
  * @returns Human
31
32
  */
32
- createHuman(spawnPoint?: IVector3, facingDirection?: Direction.Cardinal, copyFromHuman?: Human): Human;
33
+ createHuman(spawnPoint?: IVector3, facingDirection?: Direction.Cardinal, copyFromHumanOptions?: ICopyHumanOptions): Human;
33
34
  }
@@ -0,0 +1,28 @@
1
+ /*!
2
+ * Copyright 2011-2023 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 Human from "game/entity/Human";
12
+ import type { AutomationStep } from "game/island/automation/AutomationStep";
13
+ import type { IAutomationInitialState } from "game/island/automation/IAutomation";
14
+ export declare class Automation {
15
+ private running;
16
+ private repeat;
17
+ private repeatDelay;
18
+ private initialState;
19
+ private readonly steps;
20
+ private readonly resetSteps;
21
+ setRepeat(repeat: boolean, delay?: number): this;
22
+ setInitialState(initialState: IAutomationInitialState): this;
23
+ addStep(step: AutomationStep): this;
24
+ start(human: Human): Promise<void>;
25
+ stop(): void;
26
+ private execute;
27
+ private reset;
28
+ }
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Copyright 2011-2023 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 { IAutomationContextState } from "game/island/automation/IAutomation";
12
+ export declare abstract class AutomationStep {
13
+ abstract execute(context: IAutomationContextState): Promise<void>;
14
+ }
@@ -0,0 +1,29 @@
1
+ /*!
2
+ * Copyright 2011-2023 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 Human from "game/entity/Human";
12
+ import type { IslandId } from "game/island/IIsland";
13
+ import type { ItemType, ItemTypeGroup } from "game/item/IItem";
14
+ import type Item from "game/item/Item";
15
+ export interface IAutomationInitialState {
16
+ items?: Array<ItemType | ItemTypeGroup>;
17
+ /**
18
+ * Delay before executing steps
19
+ */
20
+ delay?: number;
21
+ }
22
+ export interface IAutomationContextState {
23
+ human: Human;
24
+ islandId: IslandId;
25
+ /**
26
+ * Items created via initial state
27
+ */
28
+ items: Item[];
29
+ }
@@ -0,0 +1,20 @@
1
+ /*!
2
+ * Copyright 2011-2023 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 { ActionArguments, AnyActionDescription } from "game/entity/action/IAction";
12
+ import { AutomationStep } from "game/island/automation/AutomationStep";
13
+ import type { IAutomationContextState } from "game/island/automation/IAutomation";
14
+ export type GetActionArguments<T extends AnyActionDescription, AV = ActionArguments<T>> = AV | ((context: IAutomationContextState) => Promise<AV>);
15
+ export declare class ExecuteActionStep<T extends AnyActionDescription> extends AutomationStep {
16
+ private readonly action;
17
+ private readonly args;
18
+ constructor(action: T, args: GetActionArguments<T>);
19
+ execute(context: IAutomationContextState): Promise<void>;
20
+ }
@@ -344,6 +344,10 @@ export interface IItemBuild {
344
344
  * When defined, allows the build to work only on these tile types
345
345
  */
346
346
  allowedTileTypes?: Set<TerrainType>;
347
+ /**
348
+ * Skill to gain 0.1 of when building the item
349
+ */
350
+ skillGain?: SkillType;
347
351
  }
348
352
  export interface ISummon {
349
353
  /**
@@ -105,24 +105,25 @@ export declare enum ModRegistrationType {
105
105
  NPC = 32,
106
106
  OptionsSection = 33,
107
107
  Overlay = 34,
108
- Packet = 35,
109
- Prompt = 36,
110
- QuadrantComponent = 37,
111
- Quest = 38,
112
- QuestRequirement = 39,
113
- Registry = 40,
114
- Skill = 41,
115
- SoundEffect = 42,
116
- Stat = 43,
117
- StatusEffect = 44,
118
- Terrain = 45,
119
- TerrainDecoration = 46,
120
- TileEvent = 47,
121
- TileLayerType = 48,
122
- UsableActions = 49,
123
- UsableActionType = 50,
124
- UsableActionTypePlaceholder = 51,
125
- WorldLayer = 52
108
+ Override = 35,
109
+ Packet = 36,
110
+ Prompt = 37,
111
+ QuadrantComponent = 38,
112
+ Quest = 39,
113
+ QuestRequirement = 40,
114
+ Registry = 41,
115
+ Skill = 42,
116
+ SoundEffect = 43,
117
+ Stat = 44,
118
+ StatusEffect = 45,
119
+ Terrain = 46,
120
+ TerrainDecoration = 47,
121
+ TileEvent = 48,
122
+ TileLayerType = 49,
123
+ UsableActions = 50,
124
+ UsableActionType = 51,
125
+ UsableActionTypePlaceholder = 52,
126
+ WorldLayer = 53
126
127
  }
127
128
  export interface ILanguageRegistration extends IBaseModRegistration {
128
129
  type: ModRegistrationType.Language;
@@ -375,10 +376,19 @@ export interface IEntityTagRegistration extends IBaseModRegistration {
375
376
  type: ModRegistrationType.EntityTag;
376
377
  name: string;
377
378
  }
379
+ export interface IOverrideDescription<OBJECT extends object, PROPERTY extends keyof OBJECT> {
380
+ object: OBJECT;
381
+ property: PROPERTY;
382
+ value: OBJECT[PROPERTY];
383
+ }
384
+ export interface IOverrideRegistration<OBJECT extends object, PROPERTY extends keyof OBJECT> extends IBaseModRegistration {
385
+ type: ModRegistrationType.Override;
386
+ overrider: () => IOverrideDescription<OBJECT, PROPERTY>;
387
+ }
378
388
  export interface IInheritsRegistrationTime {
379
389
  useRegistrationTime: ModRegistrationType;
380
390
  }
381
- export type ModRegistration = IActionRegistration | IBindableRegistration | IBiomeRegistration | IBulkRegistration | ICommandRegistration | ICreatureRegistration | IDialogRegistration | IDictionaryRegistration | IDoodadGroupRegistration | IDoodadRegistration | IDoodadTagRegistration | IEntityTagRegistration | IHelpArticleRegistration | IInspectionTypeRegistration | IInterModRegistration | IInterModRegistryRegistration | IInterruptChoiceRegistration | IInterruptRegistration | IItemGroupRegistration | IItemRegistration | IItemTagRegistration | 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 | IUsableActionTypePlaceholderRegistration | IUsableActionTypeRegistration;
391
+ export type ModRegistration = IActionRegistration | IBindableRegistration | IBiomeRegistration | IBulkRegistration | ICommandRegistration | ICreatureRegistration | IDialogRegistration | IDictionaryRegistration | IDoodadGroupRegistration | IDoodadRegistration | IDoodadTagRegistration | IEntityTagRegistration | IHelpArticleRegistration | IInspectionTypeRegistration | IInterModRegistration | IInterModRegistryRegistration | IInterruptChoiceRegistration | IInterruptRegistration | IItemGroupRegistration | IItemRegistration | IItemTagRegistration | ILanguageExtensionRegistration | ILanguageRegistration | ILoadRegistration | IMagicalPropertyRegistration | IMenuBarButtonRegistration | IMessageRegistration | IMessageSourceRegistration | IMusicTrackRegistration | INoteRegistration | INPCRegistration | IOptionsSectionRegistration | IOverlayRegistration | IOverrideRegistration<any, any> | IPacketRegistration | IPromptRegistration | IQuadrantComponentRegistration | IQuestRegistration | IQuestRequirementRegistration | IRegistryRegistration | ISkillRegistration | ISoundEffectRegistration | IStatRegistration | IStatusEffectRegistration | ITerrainDecorationRegistration | ITerrainRegistration | ITileEventRegistration | ITileLayerTypeRegistration | IUsableActionsRegistration | IUsableActionTypePlaceholderRegistration | IUsableActionTypeRegistration;
382
392
  export declare const SYMBOL_SUPER_REGISTRY: unique symbol;
383
393
  declare module Register {
384
394
  /**
@@ -695,6 +705,23 @@ declare module Register {
695
705
  export function usableActionTypePlaceholder(name: string): <K extends string | number | symbol, T extends Record<K, UsableActionType>>(target: T, key: K) => void;
696
706
  export function interModRegistry<V>(name: string): <K extends string | number | symbol, T extends Record<K, InterModRegistry<V>>>(target: T, key: K) => void;
697
707
  export function interModRegistration<V>(modName: string, registryName: string, value: V): <K extends string | number | symbol, T extends Record<K, InterModRegistration<V>>>(target: T, key: K) => void;
708
+ /**
709
+ * Register custom values that will replace default values in a vanilla object.
710
+ *
711
+ * For example, say you want to change the number of planks to dismantle from a log from 2 to 4. That would look like this:
712
+ * ```ts
713
+ * @Register.override(() => ({
714
+ * object: itemDescriptions[ItemType.Log].dismantle!,
715
+ * property: "items",
716
+ * value: [
717
+ * { type: ItemType.TreeBark, amount: 2 },
718
+ * { type: ItemType.WoodenPlank, amount: 4 }
719
+ * ],
720
+ * }))
721
+ * public itemDescriptionLogDismantle: IDismantleDescription;
722
+ * ```
723
+ */
724
+ export function override<OBJECT extends object, PROPERTY extends keyof OBJECT>(overrider: () => IOverrideDescription<OBJECT, PROPERTY>): <K extends string | number | symbol, T extends Record<K, OBJECT>>(target: T, key: K) => void;
698
725
  type ExtractRegisteredType<F> = F extends (...args: any) => infer F2 ? F2 extends (t: infer T, k: infer K) => any ? T[Extract<K, keyof T>] : never : never;
699
726
  /**
700
727
  * Registers any number of registrations of a single type. Any other registration type can be used.
@@ -63,61 +63,62 @@ export declare enum RenderSource {
63
63
  ActionsMenu = 1,
64
64
  AmbientLightLevelUpdate = 2,
65
65
  AttackAnimationStart = 3,
66
- DoodadChangeType = 4,
67
- FadeIn = 5,
68
- FovTransition = 6,
69
- FovUpdate = 7,
70
- FovUpdateRadius = 8,
71
- GameAnimating = 9,
72
- GamePassTurn = 10,
73
- GameResumed = 11,
74
- GameTick = 12,
75
- GenericOverlay = 13,
76
- HiddenMob = 14,
77
- HumanRest = 15,
78
- HumanRestStart = 16,
79
- HumanRestStop = 17,
80
- HumanSetPosition = 18,
81
- HumanVehicle = 19,
82
- InspectOverlay = 20,
83
- IslandLoad = 21,
84
- IslandTravel = 22,
85
- ItemEquip = 23,
86
- ItemEquipEffect = 24,
87
- ItemMovement = 25,
88
- ItemUnequip = 26,
89
- Mod = 27,
90
- MovementPlayerPost = 28,
91
- MovementPlayerZPost = 29,
92
- MultiplayerDisconnect = 30,
93
- Notifier = 31,
94
- NotifierAddCreature = 32,
95
- NotifierAddItem = 33,
96
- NotifierAddNotifierIcon = 34,
97
- NotifierAddStat = 35,
98
- NotifierAddStatusType = 36,
99
- OptionEquipment = 37,
100
- OptionVisionMode = 38,
101
- OptionZoomLevel = 39,
102
- Particles = 40,
103
- PlayerAdd = 41,
104
- PlayerKill = 42,
105
- PlayerNoclip = 43,
106
- PlayerProcessMovement = 44,
107
- PlayerReady = 45,
108
- PlayerRemove = 46,
109
- PlayerRespawn = 47,
110
- PlayerWalkToTilePath = 48,
111
- PlayerWalkToTilePathOverburdened = 49,
112
- PlayerWalkToTilePathPreview = 50,
113
- PlayerWalkToTilePathReset = 51,
114
- Resize = 52,
115
- SetupGl = 53,
116
- SpawnAnimationStart = 54,
117
- StartGame = 55,
118
- Steamworks = 56,
119
- Thumbnail = 57,
120
- WorldLayerRendererFlush = 58
66
+ Automation = 4,
67
+ DoodadChangeType = 5,
68
+ FadeIn = 6,
69
+ FovTransition = 7,
70
+ FovUpdate = 8,
71
+ FovUpdateRadius = 9,
72
+ GameAnimating = 10,
73
+ GamePassTurn = 11,
74
+ GameResumed = 12,
75
+ GameTick = 13,
76
+ GenericOverlay = 14,
77
+ HiddenMob = 15,
78
+ HumanRest = 16,
79
+ HumanRestStart = 17,
80
+ HumanRestStop = 18,
81
+ HumanSetPosition = 19,
82
+ HumanVehicle = 20,
83
+ InspectOverlay = 21,
84
+ IslandLoad = 22,
85
+ IslandTravel = 23,
86
+ ItemEquip = 24,
87
+ ItemEquipEffect = 25,
88
+ ItemMovement = 26,
89
+ ItemUnequip = 27,
90
+ Mod = 28,
91
+ MovementPlayerPost = 29,
92
+ MovementPlayerZPost = 30,
93
+ MultiplayerDisconnect = 31,
94
+ Notifier = 32,
95
+ NotifierAddCreature = 33,
96
+ NotifierAddItem = 34,
97
+ NotifierAddNotifierIcon = 35,
98
+ NotifierAddStat = 36,
99
+ NotifierAddStatusType = 37,
100
+ OptionEquipment = 38,
101
+ OptionVisionMode = 39,
102
+ OptionZoomLevel = 40,
103
+ Particles = 41,
104
+ PlayerAdd = 42,
105
+ PlayerKill = 43,
106
+ PlayerNoclip = 44,
107
+ PlayerProcessMovement = 45,
108
+ PlayerReady = 46,
109
+ PlayerRemove = 47,
110
+ PlayerRespawn = 48,
111
+ PlayerWalkToTilePath = 49,
112
+ PlayerWalkToTilePathOverburdened = 50,
113
+ PlayerWalkToTilePathPreview = 51,
114
+ PlayerWalkToTilePathReset = 52,
115
+ Resize = 53,
116
+ SetupGl = 54,
117
+ SpawnAnimationStart = 55,
118
+ StartGame = 56,
119
+ Steamworks = 57,
120
+ Thumbnail = 58,
121
+ WorldLayerRendererFlush = 59
121
122
  }
122
123
  export declare function calculateAmbientLightLevel(origin: IFieldOfViewOrigin, z: number): number;
123
124
  export declare const ZOOM_LEVEL_MIN = 1;
@@ -14,7 +14,7 @@ export default class ByteGrid implements IByteGrid {
14
14
  readonly height: number;
15
15
  readonly size: number;
16
16
  readonly data: Uint8Array;
17
- constructor(width: number, height?: number);
17
+ constructor(width: number, height: number);
18
18
  get(x: number, y: number): number;
19
19
  set(x: number, y: number, value: number): void;
20
20
  rawSet(i: number, value: number): void;
@@ -0,0 +1,29 @@
1
+ /*!
2
+ * Copyright 2011-2023 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 { IIslandTemplate } from "game/IGame";
12
+ import type { Automation } from "game/island/automation/Automation";
13
+ import Component from "ui/component/Component";
14
+ export default class TransientIslandComponent extends Component {
15
+ private readonly template;
16
+ private readonly automation?;
17
+ private canvas?;
18
+ private renderer?;
19
+ private transientIsland?;
20
+ private transientHuman?;
21
+ private readonly zoomLevel;
22
+ constructor(template: IIslandTemplate, automation?: Automation | undefined);
23
+ protected onAppend(): void;
24
+ protected onDispose(): void;
25
+ initialize(template: IIslandTemplate): Promise<void>;
26
+ private createViewport;
27
+ private resize;
28
+ private rerender;
29
+ }
@@ -12,7 +12,7 @@ import type { Source } from "game/entity/player/IMessageManager";
12
12
  import { ThreeStateButtonState } from "ui/component/IThreeStateButton";
13
13
  export declare const DEFAULT_MAX_MESSAGES = 15;
14
14
  export declare const MESSAGES_MAX_PINNED = 3;
15
- export type IFilters = Record<string, IFilter>;
15
+ export type IFilters = PartialRecord<string, IFilter>;
16
16
  export type IFilter = {
17
17
  -readonly [K in keyof typeof Source]?: ThreeStateButtonState;
18
18
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wayward/types",
3
3
  "description": "TypeScript declarations for Wayward, used for modding.",
4
- "version": "2.13.2-beta.dev.20230527.1",
4
+ "version": "2.13.2-beta.dev.20230528.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",