@wayward/types 2.13.3-beta.dev.20230702.1 → 2.13.4-beta

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 (31) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +27 -27
  3. package/definitions/game/game/IGame.d.ts +1 -1
  4. package/definitions/game/game/entity/EntityMovable.d.ts +9 -6
  5. package/definitions/game/game/entity/Human.d.ts +8 -3
  6. package/definitions/game/game/entity/IHuman.d.ts +4 -0
  7. package/definitions/game/game/entity/action/usable/actions/UsableActionsMain.d.ts +1 -1
  8. package/definitions/game/game/entity/action/usable/actions/item/UsableActionsItemMove.d.ts +9 -2
  9. package/definitions/game/game/entity/creature/ICreature.d.ts +2 -0
  10. package/definitions/game/game/entity/player/IPlayer.d.ts +1 -1
  11. package/definitions/game/game/entity/player/Player.d.ts +5 -1
  12. package/definitions/game/game/item/IItem.d.ts +4 -0
  13. package/definitions/game/game/magic/MagicalPropertyManager.d.ts +11 -0
  14. package/definitions/game/game/magic/MagicalPropertyType.d.ts +60 -0
  15. package/definitions/game/game/tile/Tile.d.ts +2 -4
  16. package/definitions/game/multiplayer/IMultiplayer.d.ts +22 -23
  17. package/definitions/game/renderer/context/RendererOrigin.d.ts +2 -9
  18. package/definitions/game/ui/input/InputManager.d.ts +1 -0
  19. package/definitions/game/ui/screen/screens/GameScreen.d.ts +1 -1
  20. package/definitions/game/ui/screen/screens/game/component/ItemComponent.d.ts +4 -3
  21. package/definitions/game/ui/screen/screens/game/static/ActionBar.d.ts +7 -4
  22. package/definitions/game/ui/screen/screens/game/static/actions/IActionBar.d.ts +9 -0
  23. package/definitions/game/ui/screen/screens/game/util/movement/MovementHandler.d.ts +0 -3
  24. package/definitions/game/ui/screen/screens/game/util/movement/WalkToTileHandler.d.ts +0 -2
  25. package/definitions/game/ui/util/Draggable.d.ts +3 -0
  26. package/definitions/game/utilities/math/IVector.d.ts +2 -1
  27. package/definitions/game/utilities/math/Math2.d.ts +6 -0
  28. package/definitions/hosts/shared/globals.d.ts +1 -1
  29. package/package.json +24 -24
  30. package/tsconfig.json +7 -7
  31. package/tsconfig.mod.base.json +44 -44
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2019 Wayward
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Wayward
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,27 +1,27 @@
1
- # [Wayward Modding Guide](https://github.com/WaywardGame/types/wiki)
2
- Learn how to mod Wayward.
3
-
4
- ## **[➡ New Modders Start Here! ⬅](https://github.com/WaywardGame/types/wiki)**
5
-
6
- ## Documentation
7
- - [`+mod create` & `+mod update`](https://github.com/WaywardGame/types/wiki/mod-create-&-update) — Documentation on the commands used to generate starter files for modding, and updating script mods.
8
- - [`mod.json`](https://github.com/WaywardGame/types/wiki/mod.json) — Documentation on what all can be declared in the main mod metadata file.
9
- - [Extracting assets](https://github.com/WaywardGame/types/wiki/Extracting-Wayward-Assets) — A guide on extracting textures, sounds, and more from Wayward.
10
-
11
- ## Mod Content
12
- - [Scripts](https://github.com/WaywardGame/types/wiki/Script-Mods) — Create mods that change the functionality of the game, or add new content
13
- - [Languages & Extensions](https://github.com/WaywardGame/types/wiki/Languages-&-Extensions) — Adding new languages to Wayward, or adding translatable strings to mods.
14
- - [Customizations](https://github.com/WaywardGame/types/wiki/Customizations) — Adding new hair styles, hair colours, and skin tones
15
- - [Image Overrides](https://github.com/WaywardGame/types/wiki/Image-Overrides) — Replacing default sprites & textures
16
- - [Stylesheets](https://github.com/WaywardGame/types/wiki/Stylesheets) — Changing the appearance of the UI
17
-
18
- # Other Useful Links
19
-
20
- ## [Wayward Types Viewer](https://waywardgame.github.io/)
21
- A pretty, searchable list of all the type definitions in Wayward. This `types` repository is actually the same stuff you can find on this website, but it's the *raw* form of it!
22
-
23
- ## [Modding Examples](https://github.com/WaywardGame)
24
- Every official mod created for Wayward, and some other Wayward-related projects.
25
-
26
- ## [Steam Workshop](http://steamcommunity.com/app/379210/workshop/)
27
- Where Wayward mods are published.
1
+ # [Wayward Modding Guide](https://github.com/WaywardGame/types/wiki)
2
+ Learn how to mod Wayward.
3
+
4
+ ## **[➡ New Modders Start Here! ⬅](https://github.com/WaywardGame/types/wiki)**
5
+
6
+ ## Documentation
7
+ - [`+mod create` & `+mod update`](https://github.com/WaywardGame/types/wiki/mod-create-&-update) — Documentation on the commands used to generate starter files for modding, and updating script mods.
8
+ - [`mod.json`](https://github.com/WaywardGame/types/wiki/mod.json) — Documentation on what all can be declared in the main mod metadata file.
9
+ - [Extracting assets](https://github.com/WaywardGame/types/wiki/Extracting-Wayward-Assets) — A guide on extracting textures, sounds, and more from Wayward.
10
+
11
+ ## Mod Content
12
+ - [Scripts](https://github.com/WaywardGame/types/wiki/Script-Mods) — Create mods that change the functionality of the game, or add new content
13
+ - [Languages & Extensions](https://github.com/WaywardGame/types/wiki/Languages-&-Extensions) — Adding new languages to Wayward, or adding translatable strings to mods.
14
+ - [Customizations](https://github.com/WaywardGame/types/wiki/Customizations) — Adding new hair styles, hair colours, and skin tones
15
+ - [Image Overrides](https://github.com/WaywardGame/types/wiki/Image-Overrides) — Replacing default sprites & textures
16
+ - [Stylesheets](https://github.com/WaywardGame/types/wiki/Stylesheets) — Changing the appearance of the UI
17
+
18
+ # Other Useful Links
19
+
20
+ ## [Wayward Types Viewer](https://waywardgame.github.io/)
21
+ A pretty, searchable list of all the type definitions in Wayward. This `types` repository is actually the same stuff you can find on this website, but it's the *raw* form of it!
22
+
23
+ ## [Modding Examples](https://github.com/WaywardGame)
24
+ Every official mod created for Wayward, and some other Wayward-related projects.
25
+
26
+ ## [Steam Workshop](http://steamcommunity.com/app/379210/workshop/)
27
+ Where Wayward mods are published.
@@ -242,7 +242,7 @@ export declare enum PauseSource {
242
242
  Generic = 0,
243
243
  IslandLoad = 1,
244
244
  Mod = 2,
245
- PlayerMoveToIsland = 3,
245
+ HumanMoveToIsland = 3,
246
246
  SyncGameState = 4,
247
247
  WebGlContextLost = 5,
248
248
  MultiplayerConnect = 6,
@@ -24,7 +24,6 @@ import type { CanASeeBType } from "renderer/fieldOfView/IFieldOfView";
24
24
  import type { Direction } from "utilities/math/Direction";
25
25
  import type { IVector2 } from "utilities/math/IVector";
26
26
  import type Vector2 from "utilities/math/Vector2";
27
- import type { IVector4 } from "utilities/math/Vector4";
28
27
  export interface IEntityMovableEvents extends IEntityEvents {
29
28
  /**
30
29
  * Called before moving.
@@ -43,10 +42,16 @@ export interface IEntityMovableEvents extends IEntityEvents {
43
42
  export default abstract class EntityMovable<DescriptionType = unknown, TypeType extends number = number, TagType = unknown, CounterType = unknown> extends Entity<DescriptionType, TypeType, TagType, CounterType> implements IRendererOrigin {
44
43
  event: IEventEmitter<this, IEntityMovableEvents>;
45
44
  /**
46
- * Not guaranteed to be synced between the server and client for Human entities
45
+ * Note: This might not be a whole number.
47
46
  */
48
47
  fromX?: number;
48
+ /**
49
+ * Note: This might not be a whole number.
50
+ */
49
51
  fromY?: number;
52
+ /**
53
+ * Not guaranteed to be synced between the server and client for Human entities
54
+ */
50
55
  isMoving?: boolean;
51
56
  /**
52
57
  * Only used for Human entities
@@ -90,10 +95,7 @@ export default abstract class EntityMovable<DescriptionType = unknown, TypeType
90
95
  * Regular entities don't have a direction so this will be the same as getTile()
91
96
  */
92
97
  get facingTile(): Tile;
93
- canSeeObject(type: CanASeeBType, object: IVector4 & {
94
- fromX: number;
95
- fromY: number;
96
- }, fieldOfView?: FieldOfView, customRadius?: number): boolean;
98
+ canSeeObject(type: CanASeeBType, object: IRendererOrigin, fieldOfView?: FieldOfView, customRadius?: number): boolean;
97
99
  canSeeTile(type: CanASeeBType, tile: Tile, fieldOfView?: FieldOfView, customRadius?: number): boolean;
98
100
  canSeePosition(type: CanASeeBType, islandId: IslandId, x: number, y: number, z: number, fieldOfView?: FieldOfView | undefined, customRadius?: number): boolean;
99
101
  queueSoundEffectInFront(type: SfxType, delay?: number, speed?: number): void;
@@ -117,6 +119,7 @@ export default abstract class EntityMovable<DescriptionType = unknown, TypeType
117
119
  */
118
120
  animateBumpTowards(tile: Tile): void;
119
121
  protected setMoving(fromX: number, fromY: number, toZ?: number, options?: IMoveToOptions): void;
122
+ protected setFromPosition(fromX?: number, fromY?: number): void;
120
123
  animateAttack(damageType: DamageType[] | undefined): void;
121
124
  getMovementPoint(timeStamp: number): IVector2;
122
125
  /**
@@ -30,6 +30,7 @@ import type { ISkillAttribute } from "game/entity/skill/ISkills";
30
30
  import SkillManager from "game/entity/skill/SkillManager";
31
31
  import type { StatChangeTimerFactory } from "game/entity/StatFactory";
32
32
  import { StatChangeCurrentTimerStrategy } from "game/entity/StatFactory";
33
+ import StatusEffect from "game/entity/status/StatusEffect";
33
34
  import { FireType } from "game/IGame";
34
35
  import type { Quality } from "game/IObject";
35
36
  import type { IMobCheck, IMoveToIslandOptions, IslandId } from "game/island/IIsland";
@@ -65,11 +66,11 @@ export default abstract class Human<TypeType extends number = number> extends En
65
66
  direction: Vector2;
66
67
  facingDirection: Direction.Cardinal;
67
68
  /**
68
- * Not guaranteed to be synced between the server and client for Human entities
69
+ * Note: This might not be a whole number.
69
70
  */
70
71
  fromX: number;
71
72
  /**
72
- * Not guaranteed to be synced between the server and client for Human entities
73
+ * Note: This might not be a whole number.
73
74
  */
74
75
  fromY: number;
75
76
  crafted: Record<number, ICrafted>;
@@ -194,7 +195,10 @@ export default abstract class Human<TypeType extends number = number> extends En
194
195
  private getAttackSkillBonus;
195
196
  private getAttackSkill;
196
197
  damage(damageInfoOrAmount: IDamageInfo | number): number | undefined;
197
- damage(damageInfoOrAmount: IDamageInfo | number, damageMessage?: Message | Translation, soundDelay?: number, causesBlood?: boolean): number | undefined;
198
+ /**
199
+ * @deprecated provide a full IDamageInfo object yourself you lazy fiend
200
+ */
201
+ damage(damageInfoOrAmount: IDamageInfo | number, damageMessage?: Message | Translation, soundDelay?: number, causesBlood?: boolean, statusEffect?: StatusEffect): number | undefined;
198
202
  getEquippedItems(includeDisabled?: true): Item[];
199
203
  getEquippedItem(slot: EquipType, includeDisabled?: true): Item | undefined;
200
204
  isOffHandDisabled(): boolean;
@@ -251,6 +255,7 @@ export default abstract class Human<TypeType extends number = number> extends En
251
255
  updateMovementIntent(movementIntent: IMovementIntent): boolean;
252
256
  hasWalkPath(): boolean;
253
257
  setWalkPath(path: IVector2[] | undefined, force?: boolean): void;
258
+ protected onDie(): void;
254
259
  checkUnder(inFacingDirection?: boolean, options?: ICheckUnderOptions): ICheckUnderOptions;
255
260
  trampleFire(fireEvent: TileEvent): void;
256
261
  damageByInteractingWith(thing: Doodad | TileEvent, options: ICheckUnderOptions | undefined, damageLocation: EquipType): ICheckUnderOptions;
@@ -257,6 +257,10 @@ export interface IHumanEvents extends Events<EntityWithStats>, ISkillEvents {
257
257
  * @return `false` to stop the human from dying
258
258
  */
259
259
  shouldDie(): false | void;
260
+ /**
261
+ * Called when the human is killed.
262
+ */
263
+ die(): any;
260
264
  /**
261
265
  * Called when the human position is set, from a teleport type of movement
262
266
  * @param tile Tile the human is now on
@@ -61,7 +61,7 @@ export declare const usableActionSets: {
61
61
  16: UsableActionGenerator<[]>;
62
62
  17: UsableActionGenerator<[]>;
63
63
  18: UsableActionGenerator<[]>;
64
- 19: UsableActionGenerator<[]>;
64
+ 19: UsableActionGenerator<[moveTarget?: import("game/entity/action/usable/actions/item/UsableActionsItemMove").UsableActionsItemMoveTarget | undefined]>;
65
65
  20: UsableActionGenerator<[isDropMenu?: true | undefined]>;
66
66
  21: UsableActionGenerator<[]>;
67
67
  22: UsableActionGenerator<[]>;
@@ -9,5 +9,12 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import { UsableActionGenerator } from "game/entity/action/usable/UsableActionRegistrar";
12
- declare const UsableActionsItemMoveMenus: UsableActionGenerator<[]>;
13
- export default UsableActionsItemMoveMenus;
12
+ export declare enum UsableActionsItemMoveTarget {
13
+ None = 0,
14
+ Inventory = 1,
15
+ ActiveNonTradingContainer = 2,
16
+ TradeContainer = 3,
17
+ FacingContainer = 4
18
+ }
19
+ declare const UsableActionsItemMove: UsableActionGenerator<[moveTarget?: UsableActionsItemMoveTarget | undefined]>;
20
+ export default UsableActionsItemMove;
@@ -18,6 +18,7 @@ import type { DamageType, Defense, ICausesStatusEffect, IStatChangeInfo, MoveTyp
18
18
  import { AiType } from "game/entity/IEntity";
19
19
  import type { IStat } from "game/entity/IStats";
20
20
  import type { IPackedMessage } from "game/entity/player/IMessageManager";
21
+ import type StatusEffect from "game/entity/status/StatusEffect";
21
22
  import type { ItemType, ItemTypeGroup } from "game/item/IItem";
22
23
  import type Item from "game/item/Item";
23
24
  import type { LootGroupType } from "game/item/LootGroups";
@@ -325,6 +326,7 @@ export interface IDamageInfo {
325
326
  damageMessage?: Message | Translation;
326
327
  soundDelay?: number;
327
328
  surpressAttackAnimation?: boolean;
329
+ statusEffect?: StatusEffect;
328
330
  }
329
331
  export interface IDamageOutcomeInput {
330
332
  human?: Human;
@@ -44,7 +44,7 @@ export interface IPlayerEvents extends Events<Human> {
44
44
  * Called when the player is killed.
45
45
  * @param showingGameEndScreen True if the game end screen will be shown
46
46
  */
47
- die(showingGameEndScreen: boolean): any;
47
+ die(showingGameEndScreen?: boolean): any;
48
48
  /**
49
49
  * Called when the player will be respawned. If any handlers return `false` to stop the player from respawning,
50
50
  * no further handlers will be called.
@@ -8,11 +8,12 @@
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 { IEventEmitter } from "event/EventEmitter";
11
+ import { type IEventEmitter } from "event/EventEmitter";
12
12
  import { TileUpdateType } from "game/IGame";
13
13
  import Human from "game/entity/Human";
14
14
  import { EntityType } from "game/entity/IEntity";
15
15
  import { SkillType } from "game/entity/IHuman";
16
+ import type { IDamageInfo } from "game/entity/creature/ICreature";
16
17
  import { CreatureType } from "game/entity/creature/ICreature";
17
18
  import type { IMovementIntent, IPlayerEvents } from "game/entity/player/IPlayer";
18
19
  import MessageManager from "game/entity/player/MessageManager";
@@ -68,7 +69,10 @@ export default class Player extends Human implements IPreSerializeCallback, IUns
68
69
  */
69
70
  addItemMilestones(item: Item): void;
70
71
  checkSkillMilestones(): void;
72
+ private getUsableAction;
73
+ protected onGetMovementIntent(): IMovementIntent | undefined;
71
74
  protected onCanMove(direction: Direction.Cardinal): false | undefined;
75
+ protected onDamage(damageInfo: IDamageInfo): void;
72
76
  addMilestone(milestone: Milestone, data?: number | string, update?: boolean): void;
73
77
  updateMovementIntent(movementIntent: IMovementIntent): boolean;
74
78
  load(): void;
@@ -282,6 +282,10 @@ export interface IItemDescription extends IObjectDescription, IModdable, ITemper
282
282
  * The amount of civilization score to give when placing item in a bookcase.
283
283
  */
284
284
  civilizationContainerScore?: number;
285
+ /**
286
+ * Whether magical properties have no effect on this item.
287
+ */
288
+ magicInert?: true;
285
289
  /**
286
290
  * The item name to display instead of the item's default translation
287
291
  */
@@ -105,8 +105,10 @@ export default class MagicalPropertyManager extends EventEmitter.Host<IMagicalPr
105
105
  private cachedNormalTypes?;
106
106
  private cachedSubTypes?;
107
107
  private cachedHash?;
108
+ private inert?;
108
109
  static inherit(source: IHasMagic | MagicalPropertyManager | undefined, target: IHasMagic): void;
109
110
  constructor(properties?: Partial<Record<MagicalPropertyType, AnyMagicalProperty>>);
111
+ setInert(inert?: boolean): this;
110
112
  /**
111
113
  * @returns the number of magical properties on this object
112
114
  */
@@ -128,6 +130,15 @@ export default class MagicalPropertyManager extends EventEmitter.Host<IMagicalPr
128
130
  */
129
131
  has<T extends MagicalSubPropertyTypes>(type: T, subType: MagicalPropertyTypeSubTypeMap[T]): boolean;
130
132
  has(...identity: MagicalPropertyIdentity): boolean;
133
+ /**
134
+ * @returns a magical property on this object, if it exists
135
+ */
136
+ getInert<T extends MagicalNormalPropertyTypes>(type: T): number | undefined;
137
+ /**
138
+ * @returns a magical sub-property on this object, if it exists
139
+ */
140
+ getInert<T extends MagicalSubPropertyTypes>(type: T, subType: MagicalPropertyTypeSubTypeMap[T]): number | undefined;
141
+ getInert(...identity: MagicalPropertyIdentity): number | undefined;
131
142
  /**
132
143
  * @returns a magical property on this object, if it exists
133
144
  */
@@ -14,25 +14,82 @@ import { Stat } from "game/entity/IStats";
14
14
  import type { IItemDescription, IMagicalPropertyInfo } from "game/item/IItem";
15
15
  import type Item from "game/item/Item";
16
16
  export declare enum MagicalPropertyType {
17
+ /**
18
+ * Increases attack value (for weapons and ammo).
19
+ */
17
20
  Attack = 0,
21
+ /**
22
+ * Increases defense value for anything equippable.
23
+ */
18
24
  Defense = 1,
25
+ /**
26
+ * Increases the illumination strength of torches/candles.
27
+ */
19
28
  Illumination = 2,
29
+ /**
30
+ * Increases the amount of weight/items that can be contained.
31
+ */
20
32
  WeightCapacity = 3,
33
+ /**
34
+ * Decreases item weight to a minimum of 0.1.
35
+ */
21
36
  ItemWeight = 4,
37
+ /**
38
+ * Increases a stat when equipped.
39
+ */
22
40
  Stat = 5,
41
+ /**
42
+ * Increases a skill when equipped.
43
+ */
23
44
  Skill = 6,
45
+ /**
46
+ * Increases malignity or benignity when equipped (and past the normal cap).
47
+ */
24
48
  Reputation = 7,
25
49
  Unused = 8,
50
+ /**
51
+ * Increases the range in which a weapon can shoot a projectile or fishing pole/net can be thrown.
52
+ */
26
53
  Range = 9,
54
+ /**
55
+ * Increases the stats normally gained when consuming/using an item.
56
+ */
27
57
  UseBenefits = 10,
58
+ /**
59
+ * Increases the merchant sell value on an item.
60
+ */
28
61
  Worth = 11,
62
+ /**
63
+ * Increases a trap's damage.
64
+ */
29
65
  TrapDamage = 12,
66
+ /**
67
+ * Increases the player's max weight when equipped.
68
+ */
30
69
  MaxWeight = 13,
70
+ /**
71
+ * Reduces the weight of each item contained within by a certain percentage.
72
+ */
31
73
  ContainerWeight = 14,
74
+ /**
75
+ * Increases the preservation rate of a container of all contained items.
76
+ */
32
77
  PreservationRate = 15,
78
+ /**
79
+ * Increases an item's decay value, making it last longer.
80
+ */
33
81
  MaxDecay = 16,
82
+ /**
83
+ * Adds a chance in which an item does reduce in durability when taking damage.
84
+ */
34
85
  ItemDamage = 17,
86
+ /**
87
+ * Increases the stoking value of an item, adding more decay to a fire source.
88
+ */
35
89
  StokeValue = 18,
90
+ /**
91
+ * Increases the insulation effect of any equippable item or container.
92
+ */
36
93
  Insulation = 19,
37
94
  /**
38
95
  * Adds damage, range, and reduces stamina used when throwing items. It also removes the heavy item reduction when calculating the range.
@@ -66,6 +123,9 @@ export declare enum MagicalPropertyType {
66
123
  * Adds a property that emits skill bonus to anybody within range (3x3 square) of the doodad.
67
124
  */
68
125
  DoodadSkill = 27,
126
+ /**
127
+ * Adds a cold or fire damage type to a weapon.
128
+ */
69
129
  ElementalDamage = 28
70
130
  }
71
131
  export interface IMagicalPropertyDescription {
@@ -27,6 +27,7 @@ import { TerrainType } from "game/tile/ITerrain";
27
27
  import type TileEvent from "game/tile/TileEvent";
28
28
  import Translation from "language/Translation";
29
29
  import Message from "language/dictionary/Message";
30
+ import type { IRendererOrigin } from "renderer/context/RendererOrigin";
30
31
  import FieldOfView from "renderer/fieldOfView/FieldOfView";
31
32
  import type { IFieldOfViewOrigin } from "renderer/fieldOfView/IFieldOfView";
32
33
  import { CanASeeBType } from "renderer/fieldOfView/IFieldOfView";
@@ -283,10 +284,7 @@ export default class Tile implements IVector4, Partial<ITileContainer>, IFieldOf
283
284
  createPuddles(): void;
284
285
  addOrUpdateOverlay(overlay: IOverlayInfo): void;
285
286
  removeOverlay(overlay: IOverlayInfo): void;
286
- canSeeObject(type: CanASeeBType, object: IVector4 & {
287
- fromX: number;
288
- fromY: number;
289
- }, fieldOfView?: FieldOfView, customRadius?: number): boolean;
287
+ canSeeObject(type: CanASeeBType, object: IRendererOrigin, fieldOfView?: FieldOfView, customRadius?: number): boolean;
290
288
  canSeeTile(type: CanASeeBType, tile: Tile, fieldOfView?: FieldOfView, customRadius?: number): boolean;
291
289
  canSeePosition(type: CanASeeBType, islandId: IslandId, x: number, y: number, z: number, fieldOfView?: FieldOfView | undefined, customRadius?: number): boolean;
292
290
  messageIfVisible(callback: (manager: IMessageManager) => boolean): void;
@@ -82,29 +82,28 @@ export declare enum MultiplayerSyncCheck {
82
82
  PenaltyFieldHashCode = 42,
83
83
  PlaceOnTile = 43,
84
84
  PlayerManager = 44,
85
- PlayerPositions = 45,
86
- Players = 46,
87
- PlayerSetup = 47,
88
- Random = 48,
89
- Reputation = 49,
90
- Seed = 50,
91
- SeededGenerator = 51,
92
- SetPosition = 52,
93
- SetZ = 53,
94
- SkillGain = 54,
95
- StaminaChanges = 55,
96
- StatChange = 56,
97
- Stats = 57,
98
- StatusChange = 58,
99
- StatusEffect = 59,
100
- TemperatureManager = 60,
101
- Temporary = 61,
102
- Tick = 62,
103
- TileEvent = 63,
104
- Time = 64,
105
- UpdateDirection = 65,
106
- Weight = 66,
107
- WorldUpdateTile = 67
85
+ Players = 45,
86
+ PlayerSetup = 46,
87
+ Random = 47,
88
+ Reputation = 48,
89
+ Seed = 49,
90
+ SeededGenerator = 50,
91
+ SetPosition = 51,
92
+ SetZ = 52,
93
+ SkillGain = 53,
94
+ StaminaChanges = 54,
95
+ StatChange = 55,
96
+ Stats = 56,
97
+ StatusChange = 57,
98
+ StatusEffect = 58,
99
+ TemperatureManager = 59,
100
+ Temporary = 60,
101
+ Tick = 61,
102
+ TileEvent = 62,
103
+ Time = 63,
104
+ UpdateDirection = 64,
105
+ Weight = 65,
106
+ WorldUpdateTile = 66
108
107
  }
109
108
  export declare const maxPlayers = 32;
110
109
  export declare const packetTickRate = 16;
@@ -16,7 +16,6 @@ import type { IslandId } from "game/island/IIsland";
16
16
  import type Island from "game/island/Island";
17
17
  import FieldOfView from "renderer/fieldOfView/FieldOfView";
18
18
  import type { CanASeeBType, IFieldOfViewOrigin } from "renderer/fieldOfView/IFieldOfView";
19
- import type { IVector4 } from "utilities/math/Vector4";
20
19
  export interface IRendererOrigin extends IFieldOfViewOrigin {
21
20
  readonly fromX?: number;
22
21
  readonly fromY?: number;
@@ -24,10 +23,7 @@ export interface IRendererOrigin extends IFieldOfViewOrigin {
24
23
  readonly asEntity: Entity;
25
24
  readonly asPlayer: Player | undefined;
26
25
  readonly asHuman: Human | undefined;
27
- canSeeObject(type: CanASeeBType, object: IVector4 & {
28
- fromX: number;
29
- fromY: number;
30
- }, fieldOfView: FieldOfView | undefined): boolean;
26
+ canSeeObject(type: CanASeeBType, object: IRendererOrigin, fieldOfView: FieldOfView | undefined): boolean;
31
27
  canSeePosition(type: CanASeeBType, islandId: IslandId, x: number, y: number, z: number, fieldOfView: FieldOfView | undefined): boolean;
32
28
  getMovementProgress(timeStamp: number): number;
33
29
  }
@@ -46,9 +42,6 @@ export declare class RendererOrigin implements IRendererOrigin {
46
42
  constructor(islandId: IslandId, x: number, y: number, z: number);
47
43
  get island(): Island;
48
44
  getMovementProgress(_timeStamp: number): number;
49
- canSeeObject(type: CanASeeBType, object: IVector4 & {
50
- fromX: number;
51
- fromY: number;
52
- }, fieldOfView: FieldOfView | undefined): boolean;
45
+ canSeeObject(type: CanASeeBType, object: IRendererOrigin, fieldOfView: FieldOfView | undefined): boolean;
53
46
  canSeePosition(type: CanASeeBType, islandId: IslandId, x: number, y: number, z: number, fieldOfView: FieldOfView | undefined): boolean;
54
47
  }
@@ -96,6 +96,7 @@ export interface IInputManagerEvents {
96
96
  enabled(): any;
97
97
  rising(catalyst: InputCatalyst, info: InputInfo, modifiers: Set<Modifier>): any;
98
98
  falling(catalyst: InputCatalyst, info: InputInfo, modifiers: Set<Modifier>): any;
99
+ loop(): any;
99
100
  }
100
101
  declare class InputManager extends EventEmitter.Host<IInputManagerEvents> {
101
102
  readonly mouse: GlobalMouseInfo;
@@ -94,7 +94,7 @@ export default class GameScreen extends Screen {
94
94
  onOpenBook(human: Human, item: Item): void;
95
95
  protected onReadMap1(map: DrawnMap, item: Item, reader: Human): void;
96
96
  protected onSailOffMapEdge(player: Player, direction: Direction): void;
97
- protected onDie(player: Player, showingGameEndScreen: boolean): void;
97
+ protected onDie(player: Player, showingGameEndScreen?: boolean): void;
98
98
  protected onRespawn(): void;
99
99
  protected onItemMenu(api: IBindHandlerApi): boolean;
100
100
  protected onZoom(api: IBindHandlerApi): boolean;
@@ -19,13 +19,13 @@ import type ContextMenu from "ui/component/ContextMenu";
19
19
  import Bindable from "ui/input/Bindable";
20
20
  import type ActionBar from "ui/screen/screens/game/static/ActionBar";
21
21
  import type { ActionSlot } from "ui/screen/screens/game/static/ActionBar";
22
- import type { IDraggableComponent } from "ui/util/Draggable";
22
+ import type { IDraggableEvents } from "ui/util/Draggable";
23
23
  import Draggable from "ui/util/Draggable";
24
24
  import Vector2 from "utilities/math/Vector2";
25
25
  export type ItemSlot = Omit<Component, "event"> & {
26
26
  event: IEventEmitter<Component, IItemSlotEvents>;
27
27
  };
28
- export interface IItemSlotEvents extends Events<Component> {
28
+ export interface IItemSlotEvents extends Events<Component>, IDraggableEvents {
29
29
  pickUp(api: IItemPickUpApi): any;
30
30
  drop(api: IItemDropApi, intoSlot?: ItemSlot): any;
31
31
  }
@@ -89,7 +89,7 @@ export declare enum ItemRefreshType {
89
89
  export default class ItemComponent extends Component {
90
90
  protected readonly handler: IItemHandler;
91
91
  static registerSlot(slot: ItemSlot): void;
92
- event: IEventEmitter<this, Events<IDraggableComponent> & IItemSlotEvents>;
92
+ event: IEventEmitter<this, IItemSlotEvents>;
93
93
  readonly magicalIcon: Component<HTMLElement>;
94
94
  readonly protectedIcon: Component<HTMLElement>;
95
95
  readonly actionIcon: Component<HTMLElement> | undefined;
@@ -129,4 +129,5 @@ export default class ItemComponent extends Component {
129
129
  private refreshDurabilityBar;
130
130
  private lastActionIcon?;
131
131
  private refreshActionIcon;
132
+ protected onHoldingNotMoving(time: number): void;
132
133
  }
@@ -30,7 +30,7 @@ import ItemComponent from "ui/screen/screens/game/component/ItemComponent";
30
30
  import QuadrantComponent from "ui/screen/screens/game/component/QuadrantComponent";
31
31
  import ActionsConfigurationDrawer from "ui/screen/screens/game/static/actions/ActionsDrawer";
32
32
  import ActionSlotTooltipHandler from "ui/screen/screens/game/static/actions/ActionSlotTooltip";
33
- import { IActionBarSlotData } from "ui/screen/screens/game/static/actions/IActionBar";
33
+ import { ActionSlotUpdateReason, IActionBarSlotData } from "ui/screen/screens/game/static/actions/IActionBar";
34
34
  import type TooltipLocationHandler from "ui/tooltip/TooltipLocationHandler";
35
35
  export declare const MAX_SLOTS = 48;
36
36
  export declare enum ActionBarClasses {
@@ -89,7 +89,7 @@ export default class ActionBar extends QuadrantComponent {
89
89
  configure(number: number): void;
90
90
  protected onResize(): void;
91
91
  endConfiguration(): void;
92
- hasFilledSlot(): boolean;
92
+ hasFilledSlot(predicate?: (slot: IActionBarSlotData) => any): boolean;
93
93
  protected getContextMenuDescription(api: IBindHandlerApi): ContextMenuDescriptions;
94
94
  protected onClearActionSlot(api: IBindHandlerApi): boolean;
95
95
  protected onToggleUseWhileMoving(api: IBindHandlerApi): boolean;
@@ -108,7 +108,7 @@ declare class ActionSlotSlottedContainer extends ItemComponent {
108
108
  protected onEnter(reason: "mouse" | "focus"): void;
109
109
  }
110
110
  export interface IActionSlotEvents extends Events<Button>, IItemSlotEvents {
111
- update(item?: Item, oldItem?: Item): any;
111
+ update(item: Item | undefined, oldItem: Item | undefined, reason: ActionSlotUpdateReason): any;
112
112
  unequipItem(): any;
113
113
  }
114
114
  export declare class ActionSlot extends Button implements IRefreshable {
@@ -123,7 +123,10 @@ export declare class ActionSlot extends Button implements IRefreshable {
123
123
  private lastQuality?;
124
124
  usability: ReturnableUsableActionUsability;
125
125
  constructor(number: number, slotData: IActionBarSlotData);
126
- refresh(): this;
126
+ private skipNextClick;
127
+ private lastActivate;
128
+ protected onHoldingNotDragging(time: number): void;
129
+ refresh(_?: any, newItem?: Item, oldItem?: Item, reason?: ActionSlotUpdateReason): this;
127
130
  private onItemTransformed;
128
131
  private isUsable;
129
132
  clear(): void;
@@ -55,3 +55,12 @@ export declare class ActionSlotContext extends InfoProviderContext {
55
55
  getActionType(): ActionType | undefined;
56
56
  displayLevelExtraUnlessActionType(actionType: ActionType): InfoDisplayLevel.Always | InfoDisplayLevel.Extra;
57
57
  }
58
+ export declare enum ActionSlotUpdateReason {
59
+ AutoUseToggle = 0,
60
+ Replace = 1,
61
+ Using = 2,
62
+ Verify = 3,
63
+ Used = 4,
64
+ ActionsDrawer = 5,
65
+ LoadOrUpdateDirection = 6
66
+ }
@@ -9,7 +9,6 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import EventEmitter from "event/EventEmitter";
12
- import type { IDamageInfo } from "game/entity/creature/ICreature";
13
12
  import type Component from "ui/component/Component";
14
13
  import type { IBindHandlerApi } from "ui/input/Bind";
15
14
  import WalkToTileHandler from "ui/screen/screens/game/util/movement/WalkToTileHandler";
@@ -32,8 +31,6 @@ export default class MovementHandler extends EventEmitter.Host<IMovementHandlerE
32
31
  deregister(): this;
33
32
  protected onMoveStart(): void;
34
33
  protected onMoveComplete(): void;
35
- protected onPlayerDamage(_: any, damageInfo: IDamageInfo): void;
36
- protected onPlayerDeath(): void;
37
34
  protected onFaceDown(api: IBindHandlerApi): boolean;
38
35
  faceTowardsMouse(api?: Pick<IBindHandlerApi, "mouse">): void;
39
36
  protected onFaceDirection(api?: Pick<IBindHandlerApi, "mouse" | "input">): boolean;
@@ -9,7 +9,6 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import EventEmitter from "event/EventEmitter";
12
- import type { IStat } from "game/entity/IStats";
13
12
  import type Player from "game/entity/player/Player";
14
13
  import type Tile from "game/tile/Tile";
15
14
  import type Component from "ui/component/Component";
@@ -50,7 +49,6 @@ export default class WalkToTileHandler extends EventEmitter.Host<IWalkToTileHand
50
49
  protected onCancelMoveToTile(_api: IBindHandlerApi): boolean;
51
50
  protected onHoldMoveToTilePreview(api: IBindHandlerApi): boolean;
52
51
  protected onReleaseMoveToTilePreview(): void;
53
- protected onStatChanged(player: Player, stat: IStat): void;
54
52
  protected onPostMove(player: Player, fromTile: Tile, toTile: Tile): void;
55
53
  protected onWalkPathChange(player: Player, walkPath: IVector2[] | undefined): void;
56
54
  private resetToMouse;
@@ -30,6 +30,7 @@ export interface IDraggableEvents {
30
30
  moveStart(mouse: Vector2): false | void;
31
31
  move(offset: Vector2, mouse: Vector2): any;
32
32
  moveEnd(offset: Vector2, mouse: Vector2, bindable?: Bindable): any;
33
+ holdingNotMoving(time: number): any;
33
34
  }
34
35
  export type WithDraggableEvents<EVENTS_OF> = Events<EVENTS_OF> & IDraggableEvents;
35
36
  export interface IDraggableComponent extends Component {
@@ -38,6 +39,7 @@ export interface IDraggableComponent extends Component {
38
39
  export default class Draggable {
39
40
  private mouseStartPosition?;
40
41
  private dragStage;
42
+ private dragStartTime?;
41
43
  private readonly hostRef;
42
44
  get host(): IDraggableComponent;
43
45
  constructor(host: IDraggableComponent, ...bindables: Bindable[]);
@@ -58,5 +60,6 @@ export default class Draggable {
58
60
  dragStart(event: IDraggableInputEvent): boolean;
59
61
  private drag;
60
62
  dragEnd(event?: IDraggableInputEvent): boolean;
63
+ private onInputLoop;
61
64
  private getMousePosition;
62
65
  }
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import type Tile from "game/tile/Tile";
12
12
  import type { WorldZ } from "game/WorldZ";
13
+ import type { IRendererOrigin } from "renderer/context/RendererOrigin";
13
14
  export interface IVector2 {
14
15
  x: number;
15
16
  y: number;
@@ -26,4 +27,4 @@ export declare module IVector3 {
26
27
  export declare function objectIsOrWasInTile(tile: Tile, object: IVector3 & {
27
28
  fromX?: number;
28
29
  fromY?: number;
29
- }): boolean;
30
+ } | IRendererOrigin): boolean;
@@ -30,6 +30,12 @@ declare module Math2 {
30
30
  * Example: `roundNumber(1.24999999, 2): 1.25`
31
31
  */
32
32
  function roundNumber(num: number, places: number): number;
33
+ /**
34
+ * Returns a number floored to a certain number of decimal places.
35
+ *
36
+ * Example: `roundNumber(1.24999999, 2): 1.24`
37
+ */
38
+ function floorNumber(num: number, places: number): number;
33
39
  /**
34
40
  * Returns a number rounded to a multiple
35
41
  *
@@ -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
- export declare const gameVersionStage = "beta", gameVersionMajor = 2, gameVersionMinor = 13, gameVersionPatch = 3, gameVersionName = "Beacon's Call";
11
+ export declare const gameVersionStage = "beta", gameVersionMajor = 2, gameVersionMinor = 13, gameVersionPatch = 4, gameVersionName = "Beacon's Call";
12
12
  export declare const gameVersion: string;
13
13
  export declare const gameVersionTitleMajor: string;
14
14
  export declare const gameVersionTitleMinor: string;
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
- {
2
- "name": "@wayward/types",
3
- "description": "TypeScript declarations for Wayward, used for modding.",
4
- "version": "2.13.3-beta.dev.20230702.1",
5
- "license": "MIT",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/WaywardGame/types.git"
9
- },
10
- "scripts": {
11
- "clean": "rimraf ./definitions ./*.tsbuildinfo",
12
- "build": "tsc --build",
13
- "build:mods": "tsc --build",
14
- "watch": "tsc --build"
15
- },
16
- "dependencies": {
17
- "@types/fs-extra": "^9.0.13",
18
- "@types/node": "^17.0.5",
19
- "@wayward/goodstream": "0.7.1"
20
- },
21
- "devDependencies": {
22
- "@wayward/game": "^1.0.0"
23
- }
24
- }
1
+ {
2
+ "name": "@wayward/types",
3
+ "description": "TypeScript declarations for Wayward, used for modding.",
4
+ "version": "2.13.4-beta",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/WaywardGame/types.git"
9
+ },
10
+ "scripts": {
11
+ "clean": "rimraf ./definitions ./*.tsbuildinfo",
12
+ "build": "tsc --build",
13
+ "build:mods": "tsc --build",
14
+ "watch": "tsc --build"
15
+ },
16
+ "dependencies": {
17
+ "@types/fs-extra": "^9.0.13",
18
+ "@types/node": "^17.0.5",
19
+ "@wayward/goodstream": "0.7.1"
20
+ },
21
+ "devDependencies": {
22
+ "@wayward/game": "^1.0.0"
23
+ }
24
+ }
package/tsconfig.json CHANGED
@@ -1,8 +1,8 @@
1
- {
2
- "files": [],
3
- "references": [
4
- {
5
- "path": "../../src"
6
- }
7
- ]
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "../../src"
6
+ }
7
+ ]
8
8
  }
@@ -1,45 +1,45 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2021",
4
- "module": "AMD",
5
- "composite": true,
6
- "experimentalDecorators": true,
7
- "forceConsistentCasingInFileNames": true,
8
- "inlineSourceMap": true,
9
- "noImplicitOverride": true,
10
- "noUnusedLocals": true,
11
- "preserveConstEnums": true,
12
- "removeComments": true,
13
- "strict": true,
14
- "strictPropertyInitialization": false,
15
- // classic is required for auto imports to use the shortest path in vscode
16
- "moduleResolution": "classic",
17
- "paths": {
18
- "*": [
19
- "node_modules/@wayward/types/definitions/game/*"
20
- ],
21
- "@cplusplus/*": [
22
- "node_modules/@wayward/types/definitions/cplusplus/*"
23
- ],
24
- "@hosts/*": [
25
- "node_modules/@wayward/types/definitions/hosts/*"
26
- ],
27
- // required when using classic module resolution
28
- "@wayward/goodstream": [
29
- "node_modules/@wayward/goodstream/Stream",
30
- "node_modules/@wayward/types/node_modules/@wayward/goodstream/Stream"
31
- ],
32
- "@wayward/goodstream/*": [
33
- "node_modules/@wayward/goodstream/*",
34
- "node_modules/@wayward/types/node_modules/@wayward/goodstream/*"
35
- ]
36
- },
37
- "types": [],
38
- "lib": [
39
- "DOM",
40
- "DOM.Iterable",
41
- "ES2021",
42
- "WebWorker.ImportScripts",
43
- ]
44
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2021",
4
+ "module": "AMD",
5
+ "composite": true,
6
+ "experimentalDecorators": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "inlineSourceMap": true,
9
+ "noImplicitOverride": true,
10
+ "noUnusedLocals": true,
11
+ "preserveConstEnums": true,
12
+ "removeComments": true,
13
+ "strict": true,
14
+ "strictPropertyInitialization": false,
15
+ // classic is required for auto imports to use the shortest path in vscode
16
+ "moduleResolution": "classic",
17
+ "paths": {
18
+ "*": [
19
+ "node_modules/@wayward/types/definitions/game/*"
20
+ ],
21
+ "@cplusplus/*": [
22
+ "node_modules/@wayward/types/definitions/cplusplus/*"
23
+ ],
24
+ "@hosts/*": [
25
+ "node_modules/@wayward/types/definitions/hosts/*"
26
+ ],
27
+ // required when using classic module resolution
28
+ "@wayward/goodstream": [
29
+ "node_modules/@wayward/goodstream/Stream",
30
+ "node_modules/@wayward/types/node_modules/@wayward/goodstream/Stream"
31
+ ],
32
+ "@wayward/goodstream/*": [
33
+ "node_modules/@wayward/goodstream/*",
34
+ "node_modules/@wayward/types/node_modules/@wayward/goodstream/*"
35
+ ]
36
+ },
37
+ "types": [],
38
+ "lib": [
39
+ "DOM",
40
+ "DOM.Iterable",
41
+ "ES2021",
42
+ "WebWorker.ImportScripts",
43
+ ]
44
+ }
45
45
  }