@wayward/types 2.13.0-beta.dev.20230508.1 → 2.13.0-beta.dev.20230511.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 (40) hide show
  1. package/definitions/game/audio/IAudio.d.ts +36 -37
  2. package/definitions/game/game/IGame.d.ts +2 -1
  3. package/definitions/game/game/entity/Human.d.ts +4 -0
  4. package/definitions/game/game/entity/npc/NPC.d.ts +5 -0
  5. package/definitions/game/game/island/Port.d.ts +3 -1
  6. package/definitions/game/game/temperature/TemperatureManager.d.ts +2 -1
  7. package/definitions/game/game/tile/Tile.d.ts +8 -1
  8. package/definitions/game/language/LanguageManager.d.ts +7 -11
  9. package/definitions/game/language/Translation.d.ts +1 -1
  10. package/definitions/game/language/dictionary/Message.d.ts +667 -663
  11. package/definitions/game/language/dictionary/UiTranslation.d.ts +444 -443
  12. package/definitions/game/mod/ModRegistry.d.ts +1 -0
  13. package/definitions/game/save/SaveManager.d.ts +8 -0
  14. package/definitions/game/steamworks/ISteamworks.d.ts +1 -0
  15. package/definitions/game/ui/component/Button.d.ts +1 -0
  16. package/definitions/game/ui/component/Text.d.ts +2 -0
  17. package/definitions/game/ui/old/OldUi.d.ts +1 -1
  18. package/definitions/game/ui/old/screens/InGameScreen.d.ts +0 -1
  19. package/definitions/game/ui/screen/screens/game/component/Dialog.d.ts +5 -0
  20. package/definitions/game/ui/screen/screens/game/dialog/CraftingDialog.d.ts +4 -0
  21. package/definitions/game/ui/screen/screens/game/dialog/EquipmentDialog.d.ts +4 -0
  22. package/definitions/game/ui/screen/screens/game/dialog/IslandsSailDialog.d.ts +5 -2
  23. package/definitions/game/ui/screen/screens/game/dialog/MessagesDialog.d.ts +4 -0
  24. package/definitions/game/ui/screen/screens/game/dialog/MilestonesDialog.d.ts +4 -0
  25. package/definitions/game/ui/screen/screens/game/dialog/NotesDialog.d.ts +4 -0
  26. package/definitions/game/ui/screen/screens/game/dialog/QuestDialog.d.ts +4 -0
  27. package/definitions/game/ui/screen/screens/game/dialog/QuickSettingsDialog.d.ts +4 -0
  28. package/definitions/game/ui/screen/screens/game/dialog/SkillsDialog.d.ts +4 -0
  29. package/definitions/game/ui/screen/screens/game/dialog/islands/IslandsDialog.d.ts +0 -3
  30. package/definitions/game/ui/screen/screens/game/static/menubar/IMenuBarButton.d.ts +3 -1
  31. package/definitions/game/ui/screen/screens/menu/menus/loadgame/SaveSlot.d.ts +6 -1
  32. package/definitions/game/ui/util/ScaleManager.d.ts +4 -1
  33. package/definitions/game/utilities/math/Math2.d.ts +4 -0
  34. package/definitions/launcher/App.d.ts +4 -0
  35. package/definitions/launcher/ui/LauncherUI.d.ts +7 -1
  36. package/definitions/launcher/ui/launcher/FolderSelector.d.ts +5 -3
  37. package/definitions/launcher/ui/launcher/Saves.d.ts +16 -0
  38. package/definitions/launcher/utilities/Data.d.ts +16 -0
  39. package/definitions/test/suite/unitTests/game/Actions.spec.d.ts +1 -1
  40. package/package.json +1 -1
@@ -12,43 +12,42 @@ export declare enum SfxType {
12
12
  Boat = 0,
13
13
  Bow = 1,
14
14
  Chat = 2,
15
- Click = 3,
16
- Craft = 4,
17
- CreatureHit = 5,
18
- CreatureNoise = 6,
19
- Damaged = 7,
20
- DangerousMove = 8,
21
- Death = 9,
22
- Eating = 10,
23
- Exceptional = 11,
24
- Extinguish = 12,
25
- Fail = 13,
26
- GraniteHit = 14,
27
- Hit = 15,
28
- Hurt = 16,
29
- Minecart = 17,
30
- Miss = 18,
31
- PickUp = 19,
32
- SandstoneHit = 20,
33
- Swim = 21,
34
- Throw = 22,
35
- Trample = 23,
36
- TreeHit = 24,
37
- UiActivate = 25,
38
- UiChoose = 26,
39
- UiClose = 27,
40
- UiDisable = 28,
41
- UiEnable = 29,
42
- UiInput = 30,
43
- UiInputdelete = 31,
44
- UiInvalid = 32,
45
- UiOpen = 33,
46
- UiOpensmall = 34,
47
- UiProtect = 35,
48
- UiSelect = 36,
49
- UiUnprotect = 37,
50
- Walk = 38,
51
- Water = 39
15
+ Craft = 3,
16
+ CreatureHit = 4,
17
+ CreatureNoise = 5,
18
+ Damaged = 6,
19
+ DangerousMove = 7,
20
+ Death = 8,
21
+ Eating = 9,
22
+ Exceptional = 10,
23
+ Extinguish = 11,
24
+ Fail = 12,
25
+ GraniteHit = 13,
26
+ Hit = 14,
27
+ Hurt = 15,
28
+ Minecart = 16,
29
+ Miss = 17,
30
+ PickUp = 18,
31
+ SandstoneHit = 19,
32
+ Swim = 20,
33
+ Throw = 21,
34
+ Trample = 22,
35
+ TreeHit = 23,
36
+ UiActivate = 24,
37
+ UiChoose = 25,
38
+ UiClose = 26,
39
+ UiDisable = 27,
40
+ UiEnable = 28,
41
+ UiInput = 29,
42
+ UiInputdelete = 30,
43
+ UiInvalid = 31,
44
+ UiOpen = 32,
45
+ UiOpensmall = 33,
46
+ UiProtect = 34,
47
+ UiSelect = 35,
48
+ UiUnprotect = 36,
49
+ Walk = 37,
50
+ Water = 38
52
51
  }
53
52
  export type SfxUi = Extract<keyof typeof SfxType, `Ui${string}`> extends `Ui${infer RESULT}` ? Lowercase<RESULT> : never;
54
53
  export declare enum Music {
@@ -192,7 +192,8 @@ export declare enum FireType {
192
192
  Doodad = 1,
193
193
  Fire = 2,
194
194
  Lava = 3,
195
- CoolingLava = 4
195
+ CoolingLava = 4,
196
+ Creature = 5
196
197
  }
197
198
  export declare enum SaveType {
198
199
  InGame = 0,
@@ -356,6 +356,10 @@ export default abstract class Human<TypeType extends number = number> extends En
356
356
  kill(): void;
357
357
  protected resetDefense(skipStatChangedEvent?: boolean): void;
358
358
  protected swimAndSootheCheck(): void;
359
+ /**
360
+ * Chance to stop frostbite when next to a fire
361
+ */
362
+ protected fireSootheCheck(): void;
359
363
  /**
360
364
  * Event handler for when a status effect is applied or removed.
361
365
  */
@@ -36,6 +36,11 @@ export interface INPCEvents extends Events<Human> {
36
36
  * @returns True if the npc can move, false if the npc cannot move, or undefined to use the default logic
37
37
  */
38
38
  canNPCMove(tile: Tile, moveType: MoveType): boolean | undefined;
39
+ /**
40
+ * Called when a npc tries to attack
41
+ * @returns True if the npc can attack, false if the npc cannot attack, or undefined to use the default logic
42
+ */
43
+ canNPCAttack(): boolean | undefined;
39
44
  }
40
45
  export default abstract class NPC extends Human<NPCType> {
41
46
  protected static registrarId: number;
@@ -23,13 +23,14 @@ interface IPort {
23
23
  name: ISerializedTranslation;
24
24
  position: IVector3;
25
25
  doodadRef?: Reference<ReferenceType.Doodad>;
26
+ lit: boolean;
26
27
  }
27
28
  interface Port extends Readonly<IPort> {
28
29
  }
29
30
  declare class Port {
30
31
  static fromDoodad(doodad: Doodad): Port;
31
32
  constructor(port: IPort);
32
- get doodad(): Doodad | undefined;
33
+ getDoodad(): Doodad | undefined;
33
34
  get island(): Island | undefined;
34
35
  getName(): TranslationImpl;
35
36
  }
@@ -40,4 +41,5 @@ export declare class PortManager extends Map<number, Port> implements IUnseriali
40
41
  onUnserialized(serializer: ISerializer): void;
41
42
  register(doodad: Doodad): void;
42
43
  deregister(doodad: Doodad): boolean;
44
+ get litPortCount(): number;
43
45
  }
@@ -30,6 +30,7 @@ import type { IPreSerializeCallback } from "save/serializer/ISerializer";
30
30
  import type { IVector3 } from "utilities/math/IVector";
31
31
  import { IRange } from "utilities/math/Range";
32
32
  import Vector2 from "utilities/math/Vector2";
33
+ export declare const TEMPERATURE_DIFFUSION_RATE: number;
33
34
  export declare const TEMPERATURE_BOUNDARY_MIN_VEC2: Vector2;
34
35
  export declare const TEMPERATURE_INVALID = 255;
35
36
  export interface ITemperatureManagerEvents {
@@ -121,7 +122,7 @@ export default class TemperatureManager extends EventEmitter.Host<ITemperatureMa
121
122
  /**
122
123
  * Returns the temperature of the given tile, produced by combining the temperatures of each type.
123
124
  */
124
- private getTile;
125
+ getTile(tile: Tile, serverSideSource: GetterOfOr<string> | undefined): number;
125
126
  /**
126
127
  * Returns the temperature on the tile of the given type. IE, some things can produce "cold", and some things can produce "heat",
127
128
  * and both of them are cached per-tile.
@@ -89,7 +89,7 @@ export default class Tile implements IVector4, Partial<ITileContainer>, IFieldOf
89
89
  get point(): IVector3;
90
90
  get description(): ITerrainDescription | undefined;
91
91
  toString(): string;
92
- getName(): Translation;
92
+ getName(includeCoordinates?: boolean): Translation;
93
93
  get type(): TerrainType;
94
94
  /**
95
95
  * Use game.changeTile or game.removeTopTile when modifying tiles.
@@ -145,7 +145,14 @@ export default class Tile implements IVector4, Partial<ITileContainer>, IFieldOf
145
145
  * Check is a tile is open
146
146
  */
147
147
  get isOpenTile(): boolean;
148
+ /**
149
+ * Gets the fire type of a fire on the tile if there is one
150
+ */
148
151
  get isOnFire(): FireType;
152
+ /**
153
+ * Gets the source of a fire on the tile if there is one
154
+ */
155
+ get fireSource(): Doodad | TileEvent | Tile | Creature | undefined;
149
156
  /**
150
157
  * Check if the tile can be lit on fire (has terrain/doodad/items that are flammable)
151
158
  */
@@ -9,11 +9,12 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import EventEmitter from "event/EventEmitter";
12
+ import type { IIcon } from "game/inspection/InfoProvider";
12
13
  import Dictionary from "language/Dictionary";
13
14
  import Language from "language/Language";
14
15
  import LanguageExtension from "language/LanguageExtension";
15
- import Translation from "language/Translation";
16
16
  import type TranslationsProvider from "language/TranslationsProvider";
17
+ import type { TranslationGenerator } from "ui/component/IComponent";
17
18
  import type { IStringSection } from "utilities/string/Interpolator";
18
19
  import { CaseStyle } from "utilities/string/Strings";
19
20
  type ArticleRules = Array<[number | {
@@ -95,17 +96,12 @@ export default class LanguageManager extends EventEmitter.Host<ILanguageEvents>
95
96
  private setDebug;
96
97
  private debugFor;
97
98
  private debugLog;
98
- private readonly uiTranslationsToSelector;
99
- private setup;
100
- private addTranslateSelector;
101
- private addTranslateSelectors;
102
99
  private refreshUiTranslation;
103
100
  }
104
- export interface ISelector {
105
- selector: string | string[];
106
- html?: boolean;
107
- attribute?: string;
108
- func?(translation: Translation): string;
101
+ export interface ITranslationInjection {
102
+ selector: string;
103
+ translation: TranslationGenerator;
104
+ type?: "title" | "generic";
105
+ icon?: IIcon;
109
106
  }
110
- export type ISelectorArray = Record<number, ISelector>;
111
107
  export {};
@@ -107,7 +107,7 @@ declare module Translation {
107
107
  const misc: (entry: string | MiscTranslation) => TranslationImpl;
108
108
  const skill: (entry: string | SkillType, color?: boolean) => TranslationImpl;
109
109
  const milestone: (entry: string | Milestone, color?: boolean) => TranslationImpl;
110
- const stat: (entry: string | Stat, color?: boolean) => TranslationImpl;
110
+ const stat: (entry: string | Stat, color?: boolean, ref?: boolean) => TranslationImpl;
111
111
  const equipSlot: (entry: string | EquipType, type?: EquipSlotTranslation) => TranslationImpl;
112
112
  const quality: (entry: string | Quality, color?: boolean) => TranslationImpl;
113
113
  /**