@wayward/types 2.14.3-beta.dev.20241227.1 → 2.14.4-beta.dev.20241229.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.
Files changed (30) hide show
  1. package/definitions/game/game/Game.d.ts +5 -5
  2. package/definitions/game/game/IGame.d.ts +15 -0
  3. package/definitions/game/game/entity/action/usable/IUsableAction.d.ts +17 -1
  4. package/definitions/game/game/entity/player/Player.d.ts +9 -0
  5. package/definitions/game/game/island/Island.d.ts +1 -1
  6. package/definitions/game/game/magic/MagicalPropertyManager.d.ts +2 -2
  7. package/definitions/game/game/magic/MagicalPropertyType.d.ts +22 -4
  8. package/definitions/game/game/options/GameOptions.d.ts +1 -1
  9. package/definitions/game/language/Dictionary.d.ts +59 -58
  10. package/definitions/game/language/DictionaryMap.d.ts +116 -114
  11. package/definitions/game/language/ITranslation.d.ts +2 -0
  12. package/definitions/game/language/MagicAffix.d.ts +17 -0
  13. package/definitions/game/language/dictionary/Misc.d.ts +4 -0
  14. package/definitions/game/language/english/item/MagicalPropertyAffixes.d.ts +13 -0
  15. package/definitions/game/language/impl/TranslationImpl.d.ts +8 -2
  16. package/definitions/game/multiplayer/IMultiplayer.d.ts +10 -8
  17. package/definitions/game/multiplayer/SyncRegion.d.ts +22 -0
  18. package/definitions/game/multiplayer/packets/IPacket.d.ts +3 -1
  19. package/definitions/game/save/upgrade/UpgradePlayer.d.ts +1 -1
  20. package/definitions/game/save/upgrade/UpgradeVersionRegistry.d.ts +1 -0
  21. package/definitions/game/steamworks/Steamworks.d.ts +2 -1
  22. package/definitions/game/utilities/Version.d.ts +0 -1
  23. package/definitions/game/utilities/object/PrettyJsonStringify.d.ts +23 -0
  24. package/definitions/hosts/shared/globals.d.ts +2 -2
  25. package/definitions/utilities/Errors.d.ts +4 -0
  26. package/definitions/utilities/random/IRandom.d.ts +1 -1
  27. package/definitions/utilities/random/Random.d.ts +1 -1
  28. package/definitions/utilities/random/RandomUtilities.d.ts +2 -2
  29. package/definitions/utilities/random/SeededGenerator.d.ts +1 -1
  30. package/package.json +1 -1
@@ -10,7 +10,7 @@
10
10
  */
11
11
  import { Uninit } from "@wayward/game/Uninit";
12
12
  import CommandManager from "@wayward/game/command/CommandManager";
13
- import type { IGameEvents, IMovementTime, IPlayOptions, ISynchronizeState } from "@wayward/game/game/IGame";
13
+ import type { IGameEvents, IGameUpgradeState, IMovementTime, IPlayOptions, ISynchronizeState } from "@wayward/game/game/IGame";
14
14
  import { PauseSource, SaveType, TurnMode } from "@wayward/game/game/IGame";
15
15
  import { TickHelper } from "@wayward/game/game/TickHelper";
16
16
  import type { BiomeTypes } from "@wayward/game/game/biome/IBiome";
@@ -51,7 +51,6 @@ import type { IVector2 } from "@wayward/game/utilities/math/IVector";
51
51
  import { WebWorkerManager } from "@wayward/game/webWorker/WebWorkerManager";
52
52
  import EventEmitter from "@wayward/utilities/event/EventEmitter";
53
53
  import type { Random } from "@wayward/utilities/random/Random";
54
- import type { IBuildId } from "@wayward/hosts/shared/globalTypes";
55
54
  export declare class Game extends EventEmitter.Host<IGameEvents> {
56
55
  get isChallenge(): boolean;
57
56
  private difficultyOptions;
@@ -71,9 +70,10 @@ export declare class Game extends EventEmitter.Host<IGameEvents> {
71
70
  * The version the save was originally created on
72
71
  */
73
72
  version: Version.String;
74
- lastSaveVersion?: Version.String;
75
- lastSaveBuildTime?: number;
76
- lastSaveBuildId?: IBuildId;
73
+ /**
74
+ * Set when a game save upgrade is running
75
+ */
76
+ upgradeState?: IGameUpgradeState;
77
77
  readonly interval = 16.6666;
78
78
  readonly autoSave: AutoSave;
79
79
  readonly commandManager: CommandManager;
@@ -31,6 +31,7 @@ import type { IReplayLogEntry } from "@wayward/game/replay/IReplayLogEntry";
31
31
  import type { IHighscoreOld, IOptions } from "@wayward/game/save/data/ISaveDataGlobal";
32
32
  import type Version from "@wayward/game/utilities/Version";
33
33
  import type { IVector2, IVector3 } from "@wayward/game/utilities/math/IVector";
34
+ import type { IBuildId } from "@wayward/hosts/shared/globalTypes";
34
35
  import type { IRange } from "@wayward/utilities/math/Range";
35
36
  export interface IGameEvents {
36
37
  /**
@@ -303,6 +304,20 @@ export interface IMovementTime {
303
304
  start: number;
304
305
  end: number;
305
306
  }
307
+ export interface IGameUpgradeState {
308
+ /**
309
+ * Current state of the upgrade. Set based on what is upgrading at the time.
310
+ */
311
+ state: GameUpgradeState;
312
+ readonly lastSaveVersion: Version.String;
313
+ readonly lastSaveBuildTime: number;
314
+ readonly lastSaveBuildId: IBuildId | undefined;
315
+ }
316
+ export declare enum GameUpgradeState {
317
+ None = 0,
318
+ Game = 1,
319
+ Island = 2
320
+ }
306
321
  export declare const LINE_OF_SIGHT_RADIUS = 15;
307
322
  export declare const LINE_OF_SIGHT_RADIUS_MAX = 20;
308
323
  export declare const LINE_OF_SIGHT_DETAIL = 4;
@@ -57,6 +57,7 @@ export interface IUsableActionItemRequirement extends Omit<IUsableActionRequirem
57
57
  finder?: false | ((player: Player, defaultOptions?: IItemFinderOptions, provided?: Omit<IUsableActionPossibleUsing, "item">) => ItemFinder | undefined);
58
58
  requiresQuality?: true;
59
59
  requiresType?: true;
60
+ cannotDamageItem?: true;
60
61
  }
61
62
  export declare namespace IUsableActionItemRequirement {
62
63
  function hasFinder(requirements?: IUsableActionRequirements): boolean;
@@ -107,6 +108,8 @@ export interface IUsableActionUsing<REQUIREMENTS extends IUsableActionRequiremen
107
108
  targetTile: Tile;
108
109
  fromTile: Tile;
109
110
  item: ((REQUIREMENTS["item"] extends true ? Item : never) | (undefined extends REQUIREMENTS["item"] ? undefined : never) | (REQUIREMENTS["item"] extends {
111
+ cannotDamageItem: true;
112
+ } ? Item : never) | (REQUIREMENTS["item"] extends {
110
113
  allowNone: true;
111
114
  } ? Item | undefined : never) | (REQUIREMENTS["item"] extends {
112
115
  validate(player: Player, value: Item): boolean;
@@ -117,7 +120,9 @@ export interface IUsableActionUsing<REQUIREMENTS extends IUsableActionRequiremen
117
120
  } ? Item : never) | (REQUIREMENTS["item"] extends {
118
121
  allowOnlyItemType(player: Player, type: ItemType): boolean;
119
122
  } ? undefined : never));
120
- itemType: ((REQUIREMENTS["item"] extends true ? ItemType : never) | (undefined extends REQUIREMENTS["item"] ? undefined : never) | (REQUIREMENTS["item"] extends {
123
+ itemType: ((REQUIREMENTS["item"] extends true ? ItemType : never) | (REQUIREMENTS["item"] extends {
124
+ cannotDamageItem: true;
125
+ } ? ItemType : never) | (undefined extends REQUIREMENTS["item"] ? undefined : never) | (REQUIREMENTS["item"] extends {
121
126
  allowOnlyItemType(player: Player, type: ItemType): boolean;
122
127
  } ? ItemType : never) | (REQUIREMENTS["item"] extends {
123
128
  requiresType: true;
@@ -132,6 +137,17 @@ export interface IUsableActionUsing<REQUIREMENTS extends IUsableActionRequiremen
132
137
  } ? REQUIREMENTS["item"] extends {
133
138
  requiresType: true;
134
139
  } ? never : undefined : never));
140
+ container?: ((REQUIREMENTS["item"] extends true ? IContainer : never) | (REQUIREMENTS["item"] extends {
141
+ allowOnlyItemType(player: Player, type: ItemType): boolean;
142
+ } ? IContainer : never) | (REQUIREMENTS["item"] extends {
143
+ requiresType: true;
144
+ } ? IContainer : ((REQUIREMENTS["item"] extends {
145
+ validate(player: Player, value: Item): boolean;
146
+ } ? IContainer : never) | (REQUIREMENTS["item"] extends {
147
+ validateType(player: Player, value: ItemType, description?: IItemDescription): boolean;
148
+ } ? IContainer : never))) | (REQUIREMENTS["item"] extends {
149
+ finder: ItemFinder;
150
+ } ? IContainer : never));
135
151
  itemQuality: ((REQUIREMENTS["item"] extends true ? ArrayOr<Quality> : never) | (undefined extends REQUIREMENTS["item"] ? undefined : never) | (REQUIREMENTS["item"] extends {
136
152
  allowNone: true;
137
153
  } ? undefined : never) | (REQUIREMENTS["item"] extends {
@@ -92,6 +92,15 @@ export default class Player extends Human<undefined, number, ReferenceType.Playe
92
92
  */
93
93
  private onLoadOrUnload;
94
94
  setup(spawnTile: Tile, respawn: boolean): void;
95
+ private setupEquipment;
96
+ private setupStats;
97
+ private setupSkills;
98
+ private setupRandomInventory;
99
+ private setupStatuses;
100
+ private setupItemsFromGroups;
101
+ private setupAdditionalItemsFromOptions;
102
+ private setupEquipmentFromOptions;
103
+ private setupSkillsFromOptions;
95
104
  protected onNoInput(): void;
96
105
  updateTables(source: string, options?: Partial<{
97
106
  allowCaching: boolean;
@@ -137,7 +137,7 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
137
137
  get isFastForwarding(): boolean;
138
138
  constructor(game?: Game, position?: IVector2, seed?: number, mapSize?: number);
139
139
  toString(): string;
140
- createStaticRandom(seed?: number): Random<PCGSeededGenerator>;
140
+ createStaticRandom(seed?: number, advance?: number): Random<PCGSeededGenerator>;
141
141
  private registerMemoryLeakDetector;
142
142
  preSerializeObject(serializer: ISerializer): void;
143
143
  postSerializeObject(serializer: ISerializer): void;
@@ -225,11 +225,11 @@ export default class MagicalPropertyManager extends EventEmitter.Host<IMagicalPr
225
225
  /**
226
226
  * @returns a list of all the magical properties on this object
227
227
  */
228
- all(): MagicalPropertyEntry[];
228
+ all(): readonly MagicalPropertyEntry[];
229
229
  /**
230
230
  * @returns a list of all the magical properties on this object,
231
231
  */
232
- all(intersectionType: true): MagicalPropertyEntryIntersection[];
232
+ all(intersectionType: true): readonly MagicalPropertyEntryIntersection[];
233
233
  /**
234
234
  * Translates a list of the magical properties on this object, including sub-properties
235
235
  * @param ender The way to end this list translation, ie and/or
@@ -12,7 +12,7 @@ import Deity from "@wayward/game/game/deity/Deity";
12
12
  import { DamageType } from "@wayward/game/game/entity/IEntity";
13
13
  import { SkillType } from "@wayward/game/game/entity/IHuman";
14
14
  import { Stat } from "@wayward/game/game/entity/IStats";
15
- import type { IItemDescription, IMagicalPropertyInfo } from "@wayward/game/game/item/IItem";
15
+ import type { IItemDescription, IMagicalPropertyInfo, ItemType } from "@wayward/game/game/item/IItem";
16
16
  import type Item from "@wayward/game/game/item/Item";
17
17
  import type { MagicalPropertyIdentity } from "@wayward/game/game/magic/MagicalPropertyManager";
18
18
  import type { TranslationArg } from "@wayward/game/language/ITranslation";
@@ -25,7 +25,7 @@ declare enum MagicalPropertyType {
25
25
  Illumination_LightItemLightBonus = 2,
26
26
  /** Increases the amount of weight/items that can be contained */
27
27
  Magnitude_WeightCapacity = 3,
28
- /** Decreases item weight to a minimum of 0.1 */
28
+ /** Decreases item weight (minimum weight is 0.1) */
29
29
  Featherweight = 4,
30
30
  /** Increases a stat when equipped */
31
31
  Stat = 5,
@@ -38,7 +38,7 @@ declare enum MagicalPropertyType {
38
38
  Range = 9,
39
39
  /** Increases the stats normally gained when consuming/using an item */
40
40
  Potency_ImproveConsumableStats = 10,
41
- /** Increases the merchant sell value on an item */
41
+ /** Increases the credit awarded by merchants when selling this item */
42
42
  Worth = 11,
43
43
  /** Increases a trap's damage */
44
44
  Ensnaring_TrapDamage = 12,
@@ -94,7 +94,7 @@ export interface IMagicalPropertyDescription {
94
94
  /**
95
95
  * Generates the magical property value when added.
96
96
  */
97
- getInfo(item: Item, description: IItemDescription): IMagicalPropertyInfo | undefined;
97
+ getInfo(item: Item | ItemType, description: IItemDescription): IMagicalPropertyInfo | undefined;
98
98
  /**
99
99
  * By default, all magical property types can be inscribed. This allows disabling that feature for this magical property type.
100
100
  */
@@ -111,4 +111,22 @@ export interface MagicalPropertyTypeSubTypeMap {
111
111
  [MagicalPropertyType.ElementalDamage]: DamageType;
112
112
  [MagicalPropertyType.StatPotency_EquipmentImproveConsumableStats]: Stat;
113
113
  }
114
+ export declare namespace MagicalPropertyInfoHelper {
115
+ /**
116
+ * Creates a partial `IMagicalPropertyDescription` that generates an integer value from min (inclusive) to max (exclusive),
117
+ * with an *actual* max for the magical property using `max`. (1 higher)
118
+ */
119
+ function intRange(item: Item | ItemType, min: number, max: number, generatedMax?: number): {
120
+ min: number;
121
+ max: number;
122
+ value: () => number;
123
+ };
124
+ function randomInt(item: Item | ItemType, maxExclusive: number): number;
125
+ function randomInt(item: Item | ItemType, min: number, maxExclusive: number): number;
126
+ function randomIntInRange(item: Item | ItemType, max: number): number;
127
+ function randomIntInRange(item: Item | ItemType, min: number, maxInclusive: number): number;
128
+ function randomFloat(item: Item | ItemType, maxExclusive: number): number;
129
+ function randomFloat(item: Item | ItemType, min: number, maxExclusive: number): number;
130
+ function functionRequiringItem<T>(item: Item | ItemType, fn: (item: Item) => T): () => T;
131
+ }
114
132
  export declare const magicalPropertyDescriptions: PartialRecord<MagicalPropertyType, IMagicalPropertyDescription>;
@@ -12,7 +12,7 @@ import type { SkillType } from "@wayward/game/game/entity/IHuman";
12
12
  import type { ItemType } from "@wayward/game/game/item/IItem";
13
13
  import type { IGameOptions, IGameOptionsSkill } from "@wayward/game/game/options/IGameOptions";
14
14
  import { GameMode } from "@wayward/game/game/options/IGameOptions";
15
- import Version from "@wayward/game/utilities/Version";
15
+ import type Version from "@wayward/game/utilities/Version";
16
16
  export declare const CREATURE_SPAWN_LIMIT = 15;
17
17
  declare namespace GameOptions {
18
18
  export function getDefault(difficulty?: GameMode, seed?: number): IGameOptions;
@@ -81,63 +81,64 @@ declare enum Dictionary {
81
81
  LighthouseName = 69,
82
82
  Loading = 70,
83
83
  Macro = 71,
84
- MagicalPropertyType = 72,
85
- MapQuality = 73,
86
- MenuBarButton = 74,
87
- Message = 75,
88
- MessagesDefaultFilter = 76,
89
- MessagesTimestampMode = 77,
90
- Milestone = 78,
91
- MilestoneModifierGroup = 79,
92
- MilestoneSort = 80,
93
- Misc = 81,
94
- ModLoadError = 82,
95
- ModLoadFailureReason = 83,
96
- ModProvide = 84,
97
- ModSort = 85,
98
- ModType = 86,
99
- MultiplayerCompatibility = 87,
100
- MultiplayerDisconnectReason = 88,
101
- MusicPlaylist = 89,
102
- Note = 90,
103
- Npc = 91,
104
- Number = 92,
105
- PartOfDay = 93,
106
- Prompt = 94,
107
- QuadrantComponent = 95,
108
- QuadrantComponentContextMenuAction = 96,
109
- Quality = 97,
110
- Quest = 98,
111
- QuestRequirement = 99,
112
- RecipeLevel = 100,
113
- Region = 101,
114
- Riddle = 102,
115
- RunekeeperDomain = 103,
116
- RunekeeperDomainEvent = 104,
117
- SaveImportErrorReason = 105,
118
- SaveSlotSort = 106,
119
- Skill = 107,
120
- SkillsSort = 108,
121
- Source = 109,
122
- Stat = 110,
123
- Status = 111,
124
- StatusEffect = 112,
125
- StatusThreatLevel = 113,
126
- SteamInputKeyboardPosition = 114,
127
- TeamMemberResponsibility = 115,
128
- TemperatureType = 116,
129
- Term = 117,
130
- Terrain = 118,
131
- ThirstLevel = 119,
132
- TileEvent = 120,
133
- TooltipVisibilityOption = 121,
134
- Ui = 122,
135
- UiQuadrant = 123,
136
- UnableToJoinReason = 124,
137
- UnlockedRecipesStrategy = 125,
138
- UsableActionType = 126,
139
- Website = 127,
140
- WeightStatus = 128,
141
- WorldLayer = 129
84
+ MagicalPropertyAffix = 72,
85
+ MagicalPropertyType = 73,
86
+ MapQuality = 74,
87
+ MenuBarButton = 75,
88
+ Message = 76,
89
+ MessagesDefaultFilter = 77,
90
+ MessagesTimestampMode = 78,
91
+ Milestone = 79,
92
+ MilestoneModifierGroup = 80,
93
+ MilestoneSort = 81,
94
+ Misc = 82,
95
+ ModLoadError = 83,
96
+ ModLoadFailureReason = 84,
97
+ ModProvide = 85,
98
+ ModSort = 86,
99
+ ModType = 87,
100
+ MultiplayerCompatibility = 88,
101
+ MultiplayerDisconnectReason = 89,
102
+ MusicPlaylist = 90,
103
+ Note = 91,
104
+ Npc = 92,
105
+ Number = 93,
106
+ PartOfDay = 94,
107
+ Prompt = 95,
108
+ QuadrantComponent = 96,
109
+ QuadrantComponentContextMenuAction = 97,
110
+ Quality = 98,
111
+ Quest = 99,
112
+ QuestRequirement = 100,
113
+ RecipeLevel = 101,
114
+ Region = 102,
115
+ Riddle = 103,
116
+ RunekeeperDomain = 104,
117
+ RunekeeperDomainEvent = 105,
118
+ SaveImportErrorReason = 106,
119
+ SaveSlotSort = 107,
120
+ Skill = 108,
121
+ SkillsSort = 109,
122
+ Source = 110,
123
+ Stat = 111,
124
+ Status = 112,
125
+ StatusEffect = 113,
126
+ StatusThreatLevel = 114,
127
+ SteamInputKeyboardPosition = 115,
128
+ TeamMemberResponsibility = 116,
129
+ TemperatureType = 117,
130
+ Term = 118,
131
+ Terrain = 119,
132
+ ThirstLevel = 120,
133
+ TileEvent = 121,
134
+ TooltipVisibilityOption = 122,
135
+ Ui = 123,
136
+ UiQuadrant = 124,
137
+ UnableToJoinReason = 125,
138
+ UnlockedRecipesStrategy = 126,
139
+ UsableActionType = 127,
140
+ Website = 128,
141
+ WeightStatus = 129,
142
+ WorldLayer = 130
142
143
  }
143
144
  export default Dictionary;
@@ -1830,63 +1830,64 @@ declare const dictionaryMap: {
1830
1830
  70: typeof Load;
1831
1831
  71: symbol;
1832
1832
  72: typeof MagicalPropertyType;
1833
- 73: typeof MapQuality;
1834
- 74: typeof MenuBarButtonType;
1835
- 75: typeof Message;
1836
- 76: typeof MessageFilterDefault;
1837
- 77: typeof MessageTimestamp;
1838
- 78: typeof Milestone;
1839
- 79: typeof MilestoneModifierGroup;
1840
- 80: typeof MilestoneSort;
1841
- 81: typeof MiscTranslation;
1842
- 82: typeof CanLoadState;
1843
- 83: typeof ModLoadFailureReason;
1844
- 84: typeof ModProvide;
1845
- 85: typeof ModSort;
1846
- 86: typeof ModType;
1847
- 87: typeof MultiplayerCompatibility;
1848
- 88: typeof DisconnectReason;
1849
- 89: typeof MusicPlaylist;
1850
- 90: typeof Note;
1851
- 91: typeof NPCType;
1852
- 92: symbol;
1853
- 93: typeof PartOfDay;
1854
- 94: typeof Prompt;
1855
- 95: typeof QuadrantComponentId;
1856
- 96: typeof QuadrantComponentContextMenuAction;
1857
- 97: typeof Quality;
1858
- 98: typeof QuestType;
1859
- 99: typeof QuestRequirementType;
1860
- 100: typeof RecipeLevel;
1861
- 101: typeof Direction;
1862
- 102: typeof Riddle;
1863
- 103: typeof Runekeeper.Domain;
1864
- 104: typeof Runekeeper.Event;
1865
- 105: typeof SaveImportErrorReason;
1866
- 106: typeof SaveSort;
1867
- 107: typeof SkillType;
1868
- 108: typeof SkillSort;
1869
- 109: typeof Source;
1870
- 110: typeof Stat;
1871
- 111: typeof StatusType;
1872
- 112: typeof StatusEffectType;
1873
- 113: typeof StatusThreatLevel;
1874
- 114: typeof SteamInputKeyboardPosition;
1875
- 115: typeof Responsibility;
1876
- 116: typeof TempType;
1877
- 117: typeof Term;
1878
- 118: typeof TerrainType;
1879
- 119: typeof ThirstLevel;
1880
- 120: typeof TileEventType;
1881
- 121: typeof TooltipVisibilityOption;
1882
- 122: typeof UiTranslation;
1883
- 123: typeof Quadrant;
1884
- 124: typeof UnableToJoinReason;
1885
- 125: typeof UnlockedRecipesStrategy;
1886
- 126: typeof UsableActionType;
1887
- 127: typeof Website;
1888
- 128: typeof WeightStatus;
1889
- 129: typeof WorldZ;
1833
+ 73: typeof MagicalPropertyType;
1834
+ 74: typeof MapQuality;
1835
+ 75: typeof MenuBarButtonType;
1836
+ 76: typeof Message;
1837
+ 77: typeof MessageFilterDefault;
1838
+ 78: typeof MessageTimestamp;
1839
+ 79: typeof Milestone;
1840
+ 80: typeof MilestoneModifierGroup;
1841
+ 81: typeof MilestoneSort;
1842
+ 82: typeof MiscTranslation;
1843
+ 83: typeof CanLoadState;
1844
+ 84: typeof ModLoadFailureReason;
1845
+ 85: typeof ModProvide;
1846
+ 86: typeof ModSort;
1847
+ 87: typeof ModType;
1848
+ 88: typeof MultiplayerCompatibility;
1849
+ 89: typeof DisconnectReason;
1850
+ 90: typeof MusicPlaylist;
1851
+ 91: typeof Note;
1852
+ 92: typeof NPCType;
1853
+ 93: symbol;
1854
+ 94: typeof PartOfDay;
1855
+ 95: typeof Prompt;
1856
+ 96: typeof QuadrantComponentId;
1857
+ 97: typeof QuadrantComponentContextMenuAction;
1858
+ 98: typeof Quality;
1859
+ 99: typeof QuestType;
1860
+ 100: typeof QuestRequirementType;
1861
+ 101: typeof RecipeLevel;
1862
+ 102: typeof Direction;
1863
+ 103: typeof Riddle;
1864
+ 104: typeof Runekeeper.Domain;
1865
+ 105: typeof Runekeeper.Event;
1866
+ 106: typeof SaveImportErrorReason;
1867
+ 107: typeof SaveSort;
1868
+ 108: typeof SkillType;
1869
+ 109: typeof SkillSort;
1870
+ 110: typeof Source;
1871
+ 111: typeof Stat;
1872
+ 112: typeof StatusType;
1873
+ 113: typeof StatusEffectType;
1874
+ 114: typeof StatusThreatLevel;
1875
+ 115: typeof SteamInputKeyboardPosition;
1876
+ 116: typeof Responsibility;
1877
+ 117: typeof TempType;
1878
+ 118: typeof Term;
1879
+ 119: typeof TerrainType;
1880
+ 120: typeof ThirstLevel;
1881
+ 121: typeof TileEventType;
1882
+ 122: typeof TooltipVisibilityOption;
1883
+ 123: typeof UiTranslation;
1884
+ 124: typeof Quadrant;
1885
+ 125: typeof UnableToJoinReason;
1886
+ 126: typeof UnlockedRecipesStrategy;
1887
+ 127: typeof UsableActionType;
1888
+ 128: typeof Website;
1889
+ 129: typeof WeightStatus;
1890
+ 130: typeof WorldZ;
1890
1891
  };
1891
1892
  export declare const strictDictionaries: {
1892
1893
  0: typeof ActionType;
@@ -3620,63 +3621,64 @@ export declare const strictDictionaries: {
3620
3621
  70: typeof Load;
3621
3622
  71: symbol;
3622
3623
  72: typeof MagicalPropertyType;
3623
- 73: typeof MapQuality;
3624
- 74: typeof MenuBarButtonType;
3625
- 75: typeof Message;
3626
- 76: typeof MessageFilterDefault;
3627
- 77: typeof MessageTimestamp;
3628
- 78: typeof Milestone;
3629
- 79: typeof MilestoneModifierGroup;
3630
- 80: typeof MilestoneSort;
3631
- 81: typeof MiscTranslation;
3632
- 82: typeof CanLoadState;
3633
- 83: typeof ModLoadFailureReason;
3634
- 84: typeof ModProvide;
3635
- 85: typeof ModSort;
3636
- 86: typeof ModType;
3637
- 87: typeof MultiplayerCompatibility;
3638
- 88: typeof DisconnectReason;
3639
- 89: typeof MusicPlaylist;
3640
- 90: typeof Note;
3641
- 91: typeof NPCType;
3642
- 92: symbol;
3643
- 93: typeof PartOfDay;
3644
- 94: typeof Prompt;
3645
- 95: typeof QuadrantComponentId;
3646
- 96: typeof QuadrantComponentContextMenuAction;
3647
- 97: typeof Quality;
3648
- 98: typeof QuestType;
3649
- 99: typeof QuestRequirementType;
3650
- 100: typeof RecipeLevel;
3651
- 101: typeof Direction;
3652
- 102: typeof Riddle;
3653
- 103: typeof Runekeeper.Domain;
3654
- 104: typeof Runekeeper.Event;
3655
- 105: typeof SaveImportErrorReason;
3656
- 106: typeof SaveSort;
3657
- 107: typeof SkillType;
3658
- 108: typeof SkillSort;
3659
- 109: typeof Source;
3660
- 110: typeof Stat;
3661
- 111: typeof StatusType;
3662
- 112: typeof StatusEffectType;
3663
- 113: typeof StatusThreatLevel;
3664
- 114: typeof SteamInputKeyboardPosition;
3665
- 115: typeof Responsibility;
3666
- 116: typeof TempType;
3667
- 117: typeof Term;
3668
- 118: typeof TerrainType;
3669
- 119: typeof ThirstLevel;
3670
- 120: typeof TileEventType;
3671
- 121: typeof TooltipVisibilityOption;
3672
- 122: typeof UiTranslation;
3673
- 123: typeof Quadrant;
3674
- 124: typeof UnableToJoinReason;
3675
- 125: typeof UnlockedRecipesStrategy;
3676
- 126: typeof UsableActionType;
3677
- 127: typeof Website;
3678
- 128: typeof WeightStatus;
3679
- 129: typeof WorldZ;
3624
+ 73: typeof MagicalPropertyType;
3625
+ 74: typeof MapQuality;
3626
+ 75: typeof MenuBarButtonType;
3627
+ 76: typeof Message;
3628
+ 77: typeof MessageFilterDefault;
3629
+ 78: typeof MessageTimestamp;
3630
+ 79: typeof Milestone;
3631
+ 80: typeof MilestoneModifierGroup;
3632
+ 81: typeof MilestoneSort;
3633
+ 82: typeof MiscTranslation;
3634
+ 83: typeof CanLoadState;
3635
+ 84: typeof ModLoadFailureReason;
3636
+ 85: typeof ModProvide;
3637
+ 86: typeof ModSort;
3638
+ 87: typeof ModType;
3639
+ 88: typeof MultiplayerCompatibility;
3640
+ 89: typeof DisconnectReason;
3641
+ 90: typeof MusicPlaylist;
3642
+ 91: typeof Note;
3643
+ 92: typeof NPCType;
3644
+ 93: symbol;
3645
+ 94: typeof PartOfDay;
3646
+ 95: typeof Prompt;
3647
+ 96: typeof QuadrantComponentId;
3648
+ 97: typeof QuadrantComponentContextMenuAction;
3649
+ 98: typeof Quality;
3650
+ 99: typeof QuestType;
3651
+ 100: typeof QuestRequirementType;
3652
+ 101: typeof RecipeLevel;
3653
+ 102: typeof Direction;
3654
+ 103: typeof Riddle;
3655
+ 104: typeof Runekeeper.Domain;
3656
+ 105: typeof Runekeeper.Event;
3657
+ 106: typeof SaveImportErrorReason;
3658
+ 107: typeof SaveSort;
3659
+ 108: typeof SkillType;
3660
+ 109: typeof SkillSort;
3661
+ 110: typeof Source;
3662
+ 111: typeof Stat;
3663
+ 112: typeof StatusType;
3664
+ 113: typeof StatusEffectType;
3665
+ 114: typeof StatusThreatLevel;
3666
+ 115: typeof SteamInputKeyboardPosition;
3667
+ 116: typeof Responsibility;
3668
+ 117: typeof TempType;
3669
+ 118: typeof Term;
3670
+ 119: typeof TerrainType;
3671
+ 120: typeof ThirstLevel;
3672
+ 121: typeof TileEventType;
3673
+ 122: typeof TooltipVisibilityOption;
3674
+ 123: typeof UiTranslation;
3675
+ 124: typeof Quadrant;
3676
+ 125: typeof UnableToJoinReason;
3677
+ 126: typeof UnlockedRecipesStrategy;
3678
+ 127: typeof UsableActionType;
3679
+ 128: typeof Website;
3680
+ 129: typeof WeightStatus;
3681
+ 130: typeof WorldZ;
3680
3682
  };
3681
3683
  export type DictionaryEnum = (typeof dictionaryMap)[Dictionary];
3682
3684
  type ExtractEnumString<E> = E extends Record<string, infer V> ? V : never;
@@ -12,6 +12,7 @@ import type { InfoProviderContext } from "@wayward/game/game/inspection/InfoProv
12
12
  import type { Reference } from "@wayward/game/game/reference/IReferenceManager";
13
13
  import type Translation from "@wayward/game/language/Translation";
14
14
  import type TranslationImplImport from "@wayward/game/language/impl/TranslationImpl";
15
+ import type { IRandomDefinition } from "@wayward/game/language/impl/TranslationImpl";
15
16
  import type { Segment } from "@wayward/game/language/segment/Segments";
16
17
  import type { IInterpolationOptions, IStringSection } from "@wayward/game/utilities/string/Interpolator";
17
18
  import type { Random } from "@wayward/utilities/random/Random";
@@ -43,6 +44,7 @@ export interface ISerializedTranslation {
43
44
  tooltipWide?: true;
44
45
  interpolator?: ISerializedInterpolator;
45
46
  classes?: string[];
47
+ randomDefinition?: IRandomDefinition;
46
48
  }
47
49
  export declare namespace ISerializedTranslation {
48
50
  function is(value: unknown): value is ISerializedTranslation;
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * Copyright 2011-2024 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 { ItemType } from "@wayward/game/game/item/IItem";
12
+ import type MagicalPropertyManager from "@wayward/game/game/magic/MagicalPropertyManager";
13
+ import Translation from "@wayward/game/language/Translation";
14
+ declare namespace MagicAffix {
15
+ function get(id: number, itemType: ItemType, magic?: MagicalPropertyManager): Translation | undefined;
16
+ }
17
+ export default MagicAffix;
@@ -121,6 +121,10 @@ export declare enum DamageTypeTranslation {
121
121
  Name = 0,
122
122
  Description = 1
123
123
  }
124
+ export declare enum MagicalPropertyAffixTranslation {
125
+ Adjective = 0,
126
+ Name = 1
127
+ }
124
128
  export declare enum MiscTranslation {
125
129
  AAndB = 0,
126
130
  Aberrant = 1,
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * Copyright 2011-2024 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 MagicalPropertyType from "@wayward/game/game/magic/MagicalPropertyType";
12
+ declare const magicalPropertyAffixes: Descriptions<MagicalPropertyType, [adjective: string, noun: string]>;
13
+ export default magicalPropertyAffixes;
@@ -20,7 +20,7 @@ import type { ISerializable } from "@wayward/game/save/serializer/ISerializer";
20
20
  import type { TranslationGenerator } from "@wayward/game/ui/component/IComponent";
21
21
  import type { ISegment, IStringSection } from "@wayward/game/utilities/string/Interpolator";
22
22
  import Interpolator from "@wayward/game/utilities/string/Interpolator";
23
- import type { Random } from "@wayward/utilities/random/Random";
23
+ import { Random } from "@wayward/utilities/random/Random";
24
24
  export interface ITranslationConfig {
25
25
  segments: Record<number, ISegment>;
26
26
  invertedSegmentMap: Map<ISegment, number>;
@@ -29,6 +29,11 @@ export interface ITranslationConfig {
29
29
  }
30
30
  export type TranslationReformatter = TranslationImpl | Falsy;
31
31
  type TranslationStringRenderer = (section: IStringSection) => string | undefined;
32
+ export interface IRandomDefinition {
33
+ seed: number;
34
+ /** number of times to advance the seed */
35
+ advance?: number;
36
+ }
32
37
  export default class TranslationImpl implements Omit<ISerializable, "deserializeObject"> {
33
38
  private static defaultInterpolatorSegmentIds?;
34
39
  private static _config?;
@@ -59,6 +64,7 @@ export default class TranslationImpl implements Omit<ISerializable, "deserialize
59
64
  private normalize;
60
65
  private failWith?;
61
66
  private random;
67
+ private randomDefinition?;
62
68
  private languageLoadId;
63
69
  private cachedSections?;
64
70
  private cachedString?;
@@ -115,7 +121,7 @@ export default class TranslationImpl implements Omit<ISerializable, "deserialize
115
121
  *
116
122
  * Note: If this translation is an argument to another translation, it will use the random of the parent translation.
117
123
  */
118
- setRandom(random?: Random): this;
124
+ setRandom(random?: Random | IRandomDefinition): this;
119
125
  hasTranslation(): boolean;
120
126
  orElse(translation: GetterOfOr<TranslationImpl>): TranslationImpl;
121
127
  orElse(translation?: GetterOfOr<TranslationImpl | undefined>): TranslationImpl | undefined;
@@ -105,14 +105,16 @@ export declare enum MultiplayerSyncCheck {
105
105
  Stats = 65,
106
106
  Status = 66,
107
107
  StatusChange = 67,
108
- TemperatureManager = 68,
109
- Temporary = 69,
110
- Tick = 70,
111
- TileEvent = 71,
112
- Time = 72,
113
- UpdateDirection = 73,
114
- Weight = 74,
115
- WorldUpdateTile = 75
108
+ "START REGION" = 68,
109
+ "END REGION" = 69,
110
+ TemperatureManager = 70,
111
+ Temporary = 71,
112
+ Tick = 72,
113
+ TileEvent = 73,
114
+ Time = 74,
115
+ UpdateDirection = 75,
116
+ Weight = 76,
117
+ WorldUpdateTile = 77
116
118
  }
117
119
  export declare const maxPlayers = 32;
118
120
  export declare const packetTickRate = 16.6666;
@@ -0,0 +1,22 @@
1
+ /*!
2
+ * Copyright 2011-2024 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
+ type Decorator = (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
12
+ /**
13
+ * **Note:** Do not intentionally throw errors through this decorated function. It does not close the region if an error is thrown.
14
+ */
15
+ export default function SyncRegion(target: any, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;
16
+ /**
17
+ * **Note:** Do not intentionally throw errors through this decorated function. It does not close the region if an error is thrown.
18
+ *
19
+ * **Warning:** Do not combine this with other decorators.
20
+ */
21
+ export default function SyncRegion<T>(detailProvider: (target: T) => string): Decorator;
22
+ export {};
@@ -29,8 +29,10 @@ export interface ISyncCheck {
29
29
  }
30
30
  export type SyncChecks = ISyncCheck[];
31
31
  export interface IHashedSyncCheck {
32
- hash: number;
32
+ hashServer: number;
33
+ hashClient: number;
33
34
  syncCheck: SyncChecks;
35
+ type: "enabled" | "universal";
34
36
  }
35
37
  export interface IPacket<T = any> {
36
38
  getAllowedStates(): ConnectionState;
@@ -11,7 +11,7 @@
11
11
  import type { Game } from "@wayward/game/game/Game";
12
12
  import type Player from "@wayward/game/game/entity/player/Player";
13
13
  import UpgradesArray from "@wayward/game/save/upgrade/UpgradesArray";
14
- import Version from "@wayward/game/utilities/Version";
14
+ import type Version from "@wayward/game/utilities/Version";
15
15
  export default function upgradePlayer(game: Game, player: Player, saveVersion: Version.Info, isLocalPlayer: boolean): UpgradesArray;
16
16
  /**
17
17
  * Called after loading item & tile references
@@ -11,6 +11,7 @@
11
11
  import type { IUpgradeVersion, UpgradeParameters, UpgradeType } from "@wayward/game/save/upgrade/UpgradeVersion";
12
12
  import type UpgradesArray from "@wayward/game/save/upgrade/UpgradesArray";
13
13
  import type Version from "@wayward/game/utilities/Version";
14
+ export declare const BUILD_TIME_INTRODUCED_TIME: Date;
14
15
  declare namespace UpgradeVersionRegistry {
15
16
  function getAll(): readonly IUpgradeVersion[];
16
17
  function run<TYPE extends UpgradeType>(version: Version.Info, messages: UpgradesArray, which: TYPE, ...params: UpgradeParameters<TYPE>): void;
@@ -89,7 +89,8 @@ export default class Steamworks extends EventEmitter.Host<ISteamworksEvents> {
89
89
  getMatchmakingServer(): IMatchmakingServer | undefined;
90
90
  getMatchmakingServerPort(): number;
91
91
  getSteamNetworking(): ISteamworksNetworking | undefined;
92
- setBuildId(id?: string): void;
92
+ /** @deprecated For console use */
93
+ protected setBuildId(id?: string): void;
93
94
  initialize(): Promise<IWaywardPreload | undefined>;
94
95
  enableSafePaths(): void;
95
96
  onUnload(): void;
@@ -77,7 +77,6 @@ declare namespace Version {
77
77
  pt: string;
78
78
  build: string;
79
79
  };
80
- export function isTimeBefore(date: Date, dateStr: DateString, timezone: keyof typeof timezones): boolean;
81
80
  export interface Info extends IVersionInfo {
82
81
  }
83
82
  export class Info {
@@ -8,4 +8,27 @@
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
+ /**
12
+ * Formats a JSON string with custom pretty-printing rules.
13
+ * This function first stringifies the data with tabs as indentation, then applies several formatting improvements:
14
+ *
15
+ * 1. Removes unnecessary tabbing before values in arrays
16
+ * 2. Reduces multiple spaces between comma-separated values to a single space
17
+ * 3. Removes unnecessary whitespace after opening brackets
18
+ * 4. Ensures consistent spacing after commas in arrays and objects
19
+ *
20
+ * @param data - The data to be stringified. Can be any JSON-serializable value
21
+ * @returns A formatted JSON string with customized pretty-printing
22
+ *
23
+ * @example
24
+ * const data = { arr: [1, 2, 3], obj: { a: 1 } };
25
+ * console.log(prettyJsonStringify(data));
26
+ * // Output:
27
+ * // {
28
+ * // "arr": [1, 2, 3],
29
+ * // "obj": {
30
+ * // "a": 1
31
+ * // }
32
+ * // }
33
+ */
11
34
  export default function prettyJsonStringify(data: any): string;
@@ -9,8 +9,8 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import type { IWaywardTitle } from "@wayward/hosts/shared/globalTypes";
12
- export declare const gameVersionStage = "beta", gameVersionMajor = 2, gameVersionMinor = 14, gameVersionPatch = 3, gameVersionName = "Runekeeper", gameVersionColor = 11015763;
13
- export declare const gameVersion = "beta2.14.3";
12
+ export declare const gameVersionStage = "beta", gameVersionMajor = 2, gameVersionMinor = 14, gameVersionPatch = 4, gameVersionName = "Runekeeper", gameVersionColor = 11015763;
13
+ export declare const gameVersion = "beta2.14.4";
14
14
  export declare const gameVersionTitleMajor = "Wayward: Runekeeper";
15
15
  export declare const gameVersionTitleMinor: string;
16
16
  export declare const gameVersionTitle: string;
@@ -24,6 +24,10 @@ declare namespace Errors {
24
24
  * Returns the Error callsite string for the caller of the current function.
25
25
  */
26
26
  function caller(skip?: number): string;
27
+ /**
28
+ * Returns the filename of the caller of the current function.
29
+ */
30
+ function callerFileBasename(skip?: number): string;
27
31
  }
28
32
  export default Errors;
29
33
  export declare function ensureExhaustive(value: never): never;
@@ -23,7 +23,7 @@ export interface IRandomGenerator<T = any> {
23
23
  pushSeed(seed?: T): void;
24
24
  popSeed(): T;
25
25
  get(): number;
26
- advance?(): this;
26
+ advance?(times?: number): this;
27
27
  asPCG?: PCGSeededGenerator;
28
28
  }
29
29
  export declare enum RandomInstance {
@@ -97,5 +97,5 @@ export declare class Random<G extends IRandomGenerator = IRandomGenerator> {
97
97
  * @returns number between provided min/max, rounded.
98
98
  */
99
99
  intInRangeExponential(min: number, max: number, steepness?: number): number;
100
- advance(): this;
100
+ advance(times?: number): this;
101
101
  }
@@ -21,7 +21,7 @@ export declare function convertStringToSeed(seed: string | number): number;
21
21
  /**
22
22
  * Creates a seeded random generator with the latest one available
23
23
  */
24
- export declare function createLatestSeededRandom(requiresSynchronization: RandomSychronizationCheck, seed?: Uint16Array | number): Random<PCGSeededGenerator> | Random<LegacySeededGenerator>;
24
+ export declare function createLatestSeededRandom(requiresSynchronization: RandomSychronizationCheck, seed?: Uint16Array | number, advance?: number): Random<PCGSeededGenerator> | Random<LegacySeededGenerator>;
25
25
  interface SeededGeneratorMap {
26
26
  [SeedType.PCG]: PCGSeededGenerator;
27
27
  [SeedType.Legacy]: LegacySeededGenerator;
@@ -29,7 +29,7 @@ interface SeededGeneratorMap {
29
29
  /**
30
30
  * Creates seeded random generator for the given type
31
31
  */
32
- export declare function createSeededRandom<TYPE extends SeedType = SeedType>(seedType: TYPE, requiresSynchronization: RandomSychronizationCheck, seed?: Uint16Array | number): Random<SeededGeneratorMap[TYPE]>;
32
+ export declare function createSeededRandom<TYPE extends SeedType = SeedType>(seedType: TYPE, requiresSynchronization: RandomSychronizationCheck, seed?: Uint16Array | number, advance?: number): Random<SeededGeneratorMap[TYPE]>;
33
33
  /**
34
34
  * Random without seeds
35
35
  */
@@ -40,5 +40,5 @@ export declare abstract class SeededGenerator<T> implements IRandomGenerator {
40
40
  getHistory(): Array<IRandomHistory<T>> | undefined;
41
41
  takeHistory(): Array<IRandomHistory<T>> | undefined;
42
42
  stopHistory(): Array<IRandomHistory<T>>;
43
- advance(): this;
43
+ advance(times?: number): this;
44
44
  }
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.14.3-beta.dev.20241227.1",
4
+ "version": "2.14.4-beta.dev.20241229.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",