@wayward/types 2.12.0-beta.dev.20220827.4 → 2.12.0-beta.dev.20220830.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.
@@ -153,7 +153,7 @@ export default abstract class Human extends Entity implements IHasInsulation {
153
153
  getDamageModifier(): number;
154
154
  calculateDamageAmount(attackType: AttackType, weapon?: Item, ammoItem?: Item): number;
155
155
  isDualWielding(): boolean;
156
- getAttack(attack?: AttackType): IAttack;
156
+ getAttack(attack?: AttackType, weapon?: Item): IAttack;
157
157
  private getAttackType;
158
158
  private getAttackSkillBonus;
159
159
  private getAttackSkill;
@@ -11,9 +11,7 @@
11
11
  import { Action } from "game/entity/action/Action";
12
12
  import type { IActionUsable } from "game/entity/action/IAction";
13
13
  import { ActionArgument } from "game/entity/action/IAction";
14
- import type Island from "game/island/Island";
15
14
  export interface ISailToIslandCanUse extends IActionUsable {
16
- newIsland?: Island;
17
15
  distanceFromEdge?: number;
18
16
  }
19
17
  declare const _default: Action<[ActionArgument.Integer32, ActionArgument.Integer32], import("../../Human").default, void, ISailToIslandCanUse, [number, number]>;
@@ -17,7 +17,7 @@ import type Human from "game/entity/Human";
17
17
  import type { IStatChangeInfo } from "game/entity/IEntity";
18
18
  import { AiType, EntityType, MoveType, StatusType } from "game/entity/IEntity";
19
19
  import type { IStat } from "game/entity/IStats";
20
- import type { CreationId } from "game/IGame";
20
+ import { CreationId } from "game/IGame";
21
21
  import { TileUpdateType } from "game/IGame";
22
22
  import type { IObject } from "game/IObject";
23
23
  import type Island from "game/island/Island";
@@ -28,7 +28,7 @@ import type { IUnserializedCallback } from "save/serializer/ISerializer";
28
28
  import type { IVector2, IVector3 } from "utilities/math/IVector";
29
29
  export default class Creature extends Entity implements IUnserializedCallback, IObject<CreatureType> {
30
30
  static is(value: any): value is Creature;
31
- readonly objectType: CreationId.Creature;
31
+ readonly objectType = CreationId.Creature;
32
32
  event: IEventEmitter<this, ICreatureEvents>;
33
33
  readonly entityType: EntityType.Creature;
34
34
  readonly tileUpdateType = TileUpdateType.Creature;
@@ -40,7 +40,7 @@ export default class Creature extends Entity implements IUnserializedCallback, I
40
40
  attacks: number;
41
41
  attempts: number;
42
42
  };
43
- respawned?: boolean;
43
+ respawned?: number;
44
44
  shouldSkipNextUpdate: boolean;
45
45
  type: CreatureType;
46
46
  originalMoveType: MoveType | undefined;
@@ -150,7 +150,6 @@ export interface ICreatureDescription extends IModdable, ITemperatureDescription
150
150
  lootGroup?: LootGroupType;
151
151
  jumpOver?: boolean;
152
152
  noCorpse?: boolean;
153
- respawn?: boolean;
154
153
  reputation: number;
155
154
  waterAnimations?: boolean;
156
155
  tamingDifficulty?: number;
@@ -32,6 +32,7 @@ export default class Corpse extends EventEmitter.Host<ICorpseEvents> implements
32
32
  referenceId?: number;
33
33
  renamed?: string | ISerializedTranslation | undefined;
34
34
  step?: number | undefined;
35
+ respawned?: number;
35
36
  type: CreatureType;
36
37
  x: number;
37
38
  y: number;
@@ -21,7 +21,7 @@ export interface ICorpseManagerEvents {
21
21
  export default class CorpseManager extends ObjectManager<Corpse, ICorpseManagerEvents> {
22
22
  protected readonly creationId: CreationId;
23
23
  load(): void;
24
- create(type: CreatureType, x: number, y: number, z: number, decay?: number, aberrant?: boolean, name?: string, qualityBonus?: number): Corpse | undefined;
24
+ create(type: CreatureType, x: number, y: number, z: number, decay?: number, aberrant?: boolean, name?: string, qualityBonus?: number, respawned?: number): Corpse | undefined;
25
25
  updateAll(): void;
26
26
  remove(corpse: Corpse): void;
27
27
  getName(typeOrCorpse: CreatureType | Corpse, article?: false | "definite" | "indefinite", count?: number, showCount?: boolean): import("../../../../language/impl/TranslationImpl").default;
@@ -23,6 +23,7 @@ export interface ICorpseDescription extends IModdable {
23
23
  lightColor?: IRGB;
24
24
  animated?: boolean;
25
25
  isFlammable?: boolean;
26
+ respawns?: boolean;
26
27
  }
27
28
  export interface ICorpseResourceDrop {
28
29
  item: ItemType;
@@ -23,7 +23,7 @@ import type { IslandId } from "game/island/IIsland";
23
23
  import type Island from "game/island/Island";
24
24
  import type { IContainer } from "game/item/IItem";
25
25
  import { ItemType } from "game/item/IItem";
26
- import type { Prompt } from "game/meta/prompt/IPrompt";
26
+ import { Prompt } from "game/meta/prompt/IPrompt";
27
27
  import { Milestone } from "game/milestones/IMilestone";
28
28
  import type InterruptChoice from "language/dictionary/InterruptChoice";
29
29
  import type IClientStore from "save/clientStore/IClientStore";
@@ -42,7 +42,7 @@ import World from "renderer/world/World";
42
42
  import type { IPreSerializeCallback, ISerializer } from "save/serializer/ISerializer";
43
43
  import { Direction } from "utilities/math/Direction";
44
44
  import type { IVector2, IVector3 } from "utilities/math/IVector";
45
- import { Random, SeededGenerator } from "utilities/random/Random";
45
+ import type { Random, SeededGenerator } from "utilities/random/Random";
46
46
  import type { IVersionInfo } from "utilities/Version";
47
47
  import Vector3 from "utilities/math/Vector3";
48
48
  export interface IIslandDetails {
@@ -11,6 +11,7 @@
11
11
  import type Doodad from "game/doodad/Doodad";
12
12
  import type { DoodadType, DoodadTypeGroup } from "game/doodad/IDoodad";
13
13
  import type { ActionType, IActionNotUsable } from "game/entity/action/IAction";
14
+ import type Creature from "game/entity/creature/Creature";
14
15
  import type { ItemType, ItemTypeGroup } from "game/item/IItem";
15
16
  import type Item from "game/item/Item";
16
17
  import type TileEvent from "game/tile/TileEvent";
@@ -49,6 +50,8 @@ export interface IGetBestItemsOptions extends IGetItemsOptions {
49
50
  filterType: ItemType;
50
51
  filterGroup: ItemTypeGroup;
51
52
  filterConsumable: true;
53
+ targetCreature: Creature;
54
+ ammoItem: Item;
52
55
  filter(item: Item): any;
53
56
  }
54
57
  export declare enum CraftStatus {
@@ -276,7 +276,7 @@ export default class Item extends EventEmitter.Host<IItemEvents> implements IRef
276
276
  * @returns A number (possibly 0 if no quality or action level).
277
277
  */
278
278
  getItemUseBonus(action?: ActionType): number;
279
- getRangedWeapon(human: Human): Item | undefined;
279
+ getBestRangedWeapon(human: Human): Item | undefined;
280
280
  /**
281
281
  * Extinguishes to item if it is lit.
282
282
  * @param human Human entity that is carrying the item to extinguish.
@@ -214,13 +214,13 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
214
214
  countItemsInContainer(containers: IContainer | IContainer[], itemTypeSearch: ItemType, ignoreItem?: Item): number;
215
215
  countItemsInContainerByGroup(containers: IContainer | IContainer[], itemTypeGroupSearch: ItemTypeGroup, ignoreItem?: Item): number;
216
216
  /**
217
- * Get the best tier items sorted by how good they are
217
+ * Get the best items sorted by how good they are
218
218
  */
219
- getBestSafeItems(container: IContainer, options?: Partial<IGetBestItemsOptions>): Item[];
219
+ getBestSafeItems(human: Human, container: IContainer, options?: Partial<IGetBestItemsOptions>): Item[];
220
220
  /**
221
- * Get the best tier item
221
+ * Get the best item
222
222
  */
223
- getBestSafeItem(container: IContainer, options?: Partial<IGetBestItemsOptions>): Item | undefined;
223
+ getBestSafeItem(human: Human, container: IContainer, options?: Partial<IGetBestItemsOptions>): Item | undefined;
224
224
  getItemInContainer(container: IContainer, itemTypeSearch: ItemType, options?: Partial<IGetItemOptions>): Item | undefined;
225
225
  getItemForHuman(human: Human, search: ItemType | ItemTypeGroup, options?: Partial<IGetItemOptions>): Item | undefined;
226
226
  getItemInContainerByGroup(container: IContainer, itemTypeGroupSearch: ItemTypeGroup, options?: Partial<IGetItemOptions>): Item | undefined;
@@ -59,7 +59,7 @@ export declare module Reference {
59
59
  }
60
60
  export default class ReferenceManager {
61
61
  static isEnumReference(type: ReferenceType): type is EnumReferenceTypes;
62
- static getList(type: ReferenceType, gameIsland?: Island): import("../entity/creature/corpse/CorpseManager").default | import("../entity/creature/CreatureManager").default | import("../doodad/DoodadManager").default | import("../item/ItemManager").default | import("../entity/npc/NPCManager").default | import("../tile/TileEventManager").default | readonly Milestone[] | readonly SkillType[] | (Player | undefined)[] | readonly ItemType[] | EquipType[] | IterableIterator<Island> | readonly Stat[] | (string | ActionType)[];
62
+ static getList(type: ReferenceType, gameIsland?: Island): import("../entity/creature/corpse/CorpseManager").default | import("../entity/creature/CreatureManager").default | import("../doodad/DoodadManager").default | import("../item/ItemManager").default | import("../entity/npc/NPCManager").default | import("../tile/TileEventManager").default | (Player | undefined)[] | readonly Milestone[] | readonly SkillType[] | readonly ItemType[] | EquipType[] | IterableIterator<Island> | readonly Stat[] | (string | ActionType)[];
63
63
  static get(thing: Referenceable): Reference | undefined;
64
64
  static getReferenceType(thing: Value<IReferenceTypeMap>): ReferenceType;
65
65
  private referenceCursor;
@@ -61,10 +61,10 @@ export default class Multiplayer extends EventEmitter.Host<IMultiplayerEvents> {
61
61
  private readonly _matchmakingSecret;
62
62
  constructor();
63
63
  isConnected(): boolean;
64
- isReady(): boolean;
64
+ isPacketProcessingPaused(): boolean;
65
+ isProcessingPacket(): boolean;
65
66
  isServer(): boolean;
66
67
  isClient(): boolean;
67
- isProcessingPacket(): boolean;
68
68
  getPlayerIdentifier(): string;
69
69
  getOptions(): IMultiplayerOptions;
70
70
  setOptions(options: IMultiplayerOptions, updateGame?: boolean): void;
@@ -65,5 +65,6 @@ export default class OldUi {
65
65
  openDialogs(): void;
66
66
  cancelSorting(): void;
67
67
  logErrorEvent(event: ErrorEvent | (Partial<ErrorEvent> & Error)): void;
68
+ private loggingRejection;
68
69
  private logPromiseRejectionEvent;
69
70
  }
@@ -208,7 +208,6 @@ export default class InGameScreen extends BaseScreen {
208
208
  onItemRename(api: IBindHandlerApi): boolean;
209
209
  onDropItem(api: IBindHandlerApi): boolean;
210
210
  onReleaseDrop(): void;
211
- onCloseAllDialogs(): boolean;
212
211
  onMoreInformation(api: IBindHandlerApi): boolean;
213
212
  onDismantleTab(): boolean;
214
213
  private isOverlayVisible;
@@ -104,6 +104,7 @@ export default class GameScreen extends Screen {
104
104
  protected create(): void;
105
105
  protected onHide(): void;
106
106
  protected onResize(): void;
107
+ protected onCloseAllDialogs(): boolean;
107
108
  /**
108
109
  * Adds a quadrant element to the screen.
109
110
  *
@@ -25,8 +25,8 @@ export default class DialogManager {
25
25
  open<ID extends DialogId>(id: ID, subId?: string): DialogById[ID];
26
26
  open<DIALOG extends Dialog>(id: DialogId, subId?: string): DIALOG;
27
27
  isVisible(id: DialogId, subId?: string): boolean | undefined;
28
- close(id: DialogId | `${DialogId}` | `${DialogId},${string}`, subId?: string): Promise<this>;
29
- closeAll(): Promise<void>;
28
+ close(id: DialogId | `${DialogId}` | `${DialogId},${string}`, subId?: string): boolean;
29
+ closeAll(): boolean;
30
30
  toggle<ID extends DialogId>(id: ID, force?: boolean, initializer?: (dialog: DialogById[ID]) => any, subId?: string): this;
31
31
  toggle<DIALOG extends Dialog>(id: DialogId, force?: boolean, initializer?: (dialog: DIALOG) => any, subId?: string): this;
32
32
  toggleAll(states: IDialogStates): this;
@@ -13,6 +13,7 @@ import { ExpectedLifetime } from "utilities/memory/ILifetime";
13
13
  declare module Timer {
14
14
  function apply(): void;
15
15
  function printActiveTimers(expectedLifetime: ExpectedLifetime): void;
16
+ function clearAllTimers(): void;
16
17
  /**
17
18
  * Creates a timeout with the provided expected lifetime
18
19
  */
@@ -99,12 +99,12 @@ export declare class Random<G extends IRandomGenerator = IRandomGenerator> {
99
99
  */
100
100
  export declare function convertStringToSeed(seed: string | number): number;
101
101
  export declare class SeededGenerator implements IRandomGenerator {
102
- private readonly addMultiplayerSyncChecks;
102
+ private readonly requiresSynchronization;
103
103
  private history;
104
104
  private maxHistoryLength;
105
105
  private seed;
106
106
  private readonly pushedSeeds;
107
- constructor(seed?: number, addMultiplayerSyncChecks?: boolean);
107
+ constructor(requiresSynchronization: boolean, seed?: number);
108
108
  tickSeed(s: number): number;
109
109
  getSeed(): number;
110
110
  setSeed(newSeed: number): void;
@@ -128,7 +128,7 @@ export declare module RandomReference {
128
128
  function resolve(reference: RandomInstance | RandomReference): RandomReference;
129
129
  }
130
130
  export declare function getRandom(randomInstance: RandomInstance, islandId?: IslandId): Random<SeededGenerator>;
131
- export declare function createSeededRandom(seed?: number, addMultiplayerSyncChecks?: boolean): Random<SeededGenerator>;
131
+ export declare function createSeededRandom(requiresSynchronization: boolean, seed?: number): Random<SeededGenerator>;
132
132
  export declare const mapGenRandom: Random<SeededGenerator>;
133
133
  export declare const generalRandom: Random<{
134
134
  get: () => number;
@@ -8,6 +8,5 @@
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 { Random, SeededGenerator } from "../../game/utilities/random/Random";
12
- export declare function createRandom(): Random<SeededGenerator>;
11
+ export declare function createRandom(): import("../../game/utilities/random/Random").Random<import("../../game/utilities/random/Random").SeededGenerator>;
13
12
  export declare function getSeed(): number | undefined;
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.12.0-beta.dev.20220827.4",
4
+ "version": "2.12.0-beta.dev.20220830.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",