@wayward/types 2.13.3-beta.dev.20230620.1 → 2.13.3-beta.dev.20230622.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.
@@ -11,11 +11,9 @@
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 { ISummon } from "game/item/IItem";
15
14
  import type Tile from "game/tile/Tile";
16
15
  export interface ISummonAction extends IActionUsable {
17
16
  tile: Tile;
18
- creatureSummon: ISummon;
19
17
  }
20
18
  /**
21
19
  * Summon a creature (golem) from an item.
@@ -24,6 +24,7 @@ import type { Quality } from "game/IObject";
24
24
  import type { ItemType } from "game/item/IItem";
25
25
  import type Item from "game/item/Item";
26
26
  import type ItemFinder from "game/item/ItemFinder";
27
+ import type { IItemFinderOptions } from "game/item/ItemFinder";
27
28
  import type Message from "language/dictionary/Message";
28
29
  import Translation from "language/Translation";
29
30
  import type Bindable from "ui/input/Bindable";
@@ -39,8 +40,9 @@ export interface IUsableActionRequirement<TYPE> {
39
40
  }
40
41
  export interface IUsableActionItemRequirement extends Omit<IUsableActionRequirement<Item>, "find"> {
41
42
  allowOnlyItemType?(player: Player, type: ItemType): boolean;
42
- finder?(player: Player): ItemFinder | undefined;
43
+ finder?(player: Player, defaultOptions?: IItemFinderOptions, provided?: Omit<IUsableActionPossibleUsing, "item">): ItemFinder | undefined;
43
44
  requiresQuality?: true;
45
+ requiresType?: true;
44
46
  }
45
47
  export declare namespace IUsableActionRequirement {
46
48
  interface Maybe<TYPE> {
@@ -16,6 +16,7 @@ import type { ActionWhichTranslation } from "game/entity/action/usable/UsableAct
16
16
  import type Player from "game/entity/player/Player";
17
17
  import type { IIcon } from "game/inspection/InfoProvider";
18
18
  import type Item from "game/item/Item";
19
+ import Message from "language/dictionary/Message";
19
20
  import type Translation from "language/Translation";
20
21
  import type { HighlightSelector } from "ui/util/IHighlight";
21
22
  export declare const USABLE_ACTION_USE_ON_MOVE_UNLOCK_AT = 20;
@@ -44,7 +45,7 @@ declare class UsableAction<REQUIREMENTS extends IUsableActionRequirements = IUsa
44
45
  constructor(requirements: REQUIREMENTS, definition: DEFINITION);
45
46
  isExecutable(): this is UsableAction<REQUIREMENTS, IUsableActionDefinitionExecutable<REQUIREMENTS>>;
46
47
  execute(player: Player, provided: IUsableActionUsing<REQUIREMENTS>, context: UsableActionExecutionContext | IUsableActionExecutionContext): boolean;
47
- resolveUsing(player: Player, using: IUsableActionUsing<REQUIREMENTS>): false | IUsableActionUsing<REQUIREMENTS>;
48
+ resolveUsing(player: Player, using: IUsableActionUsing<REQUIREMENTS>): Message.UiActionCannotUseRequiresCreature | Message.UiActionCannotUseRequiresDoodad | Message.UiActionCannotUseRequiresItem | Message.UiActionCannotUseRequiresNPC | IUsableActionUsing<REQUIREMENTS>;
48
49
  isUsable(player: Player, provided: IUsableActionUsing<REQUIREMENTS>, context: UsableActionExecutionContext | IUsableActionExecutionContext): UsableActionUsability<REQUIREMENTS>;
49
50
  isApplicable(player: Player, provided?: IUsableActionPossibleUsing, fullUsabilityCheck?: boolean): provided is IUsableActionUsing<REQUIREMENTS>;
50
51
  private isItemApplicable;
@@ -56,6 +57,7 @@ declare class UsableAction<REQUIREMENTS extends IUsableActionRequirements = IUsa
56
57
  getItem(player: Player, provided?: IUsableActionPossibleUsing, fullUsabilityCheck?: boolean): Item | false | undefined;
57
58
  private requirementsItemFinders?;
58
59
  private getItemFinder;
60
+ private createItemFinder;
59
61
  private itemFinderFullCheck?;
60
62
  private itemFinderSimpleCheck?;
61
63
  private getItemByType;
@@ -15,9 +15,11 @@ import type { ActionId, IUsableActionPossibleUsing, IUsableActionRequirements }
15
15
  import type UsableAction from "game/entity/action/usable/UsableAction";
16
16
  import ContextMenu from "ui/component/ContextMenu";
17
17
  export default class UsableActionRegistrar {
18
+ private readonly id;
18
19
  readonly actions: Array<[string, UsableAction]>;
19
20
  readonly actionIndices: Record<string, number>;
20
21
  readonly actionIds: string[];
22
+ constructor(id: string);
21
23
  byId(id?: ActionId): UsableAction | undefined;
22
24
  filter(filter: (action: UsableAction, id: string) => any): UsableActionRegistrar;
23
25
  private contextMenuInitializer?;
@@ -70,8 +72,8 @@ export declare class UsableActionGenerator<ARGS extends any[] = []> extends Even
70
72
  * Forcibly regenerates and returns a new action registrar from this generator.
71
73
  * If this generator is marked for persistence, the generated registrar will be cached and accessible thereafter by `get()`.
72
74
  */
73
- generate(...args: ARGS): UsableActionRegistrar;
74
- private activePersistences;
75
+ private generate;
76
+ private existingPersistenceId?;
75
77
  /**
76
78
  * Marks this generator for persistence when the "when" event occurs,
77
79
  * and unmarks this generator for persistence when the "until" event occurs.
@@ -18,15 +18,17 @@ import type { IGetBestItemsOptions } from "game/item/IItemManager";
18
18
  import type Item from "game/item/Item";
19
19
  export interface IUseItemAction extends IUsableActionDynamicDefinition {
20
20
  canDamageItem?: true;
21
- allowProtectedItems?: true;
22
21
  allowAnyItems?: true;
23
22
  allowNoItem?: true;
24
23
  hasNoBestItem?: true;
24
+ skipUseCheck?: true;
25
25
  filterFind?(item: Item, player: Player): boolean;
26
26
  validate?(item: Item, player: Player): boolean;
27
27
  initialiseFinder?(finder: UsableActionItemFinder): any;
28
28
  onFinderTrack?(finder: UsableActionItemFinder): any;
29
29
  onFinderDispose?(finder: UsableActionItemFinder): any;
30
+ requiresQuality?: true;
31
+ requiresType?: true;
30
32
  }
31
33
  export declare namespace IUseItemAction {
32
34
  function getGetItemOptions(actionType: ActionType, useItemAction?: Omit<IUseItemAction, keyof IUsableActionDynamicDefinition>): Partial<IGetBestItemsOptions>;
@@ -99,6 +99,8 @@ export interface IItemDisassembly {
99
99
  magic: MagicalPropertyManager | undefined;
100
100
  disassembly: Item[];
101
101
  tradedFrom: string[] | undefined;
102
+ decay: number | undefined;
103
+ startingDecay: number | undefined;
102
104
  }
103
105
  export declare enum ItemDamageResult {
104
106
  NoDamage = 0,
@@ -682,123 +682,124 @@ declare enum Message {
682
682
  UiActionCannotUseRequiresCreature = 670,
683
683
  UiActionCannotUseRequiresDoodad = 671,
684
684
  UiActionCannotUseRequiresItem = 672,
685
- Unhitch = 673,
686
- UnhitchCreature = 674,
687
- Unknown = 675,
688
- Unlimited = 676,
689
- UnlockedChest = 677,
690
- UnpurifiedFreshWater = 678,
691
- UnpurifiedWaterInStill = 679,
692
- Use = 680,
693
- UsingBareHands = 681,
694
- VehicleDefense = 682,
695
- Vulnerable = 683,
696
- Water = 684,
697
- WaterGathering = 685,
698
- WaterPutOutFire = 686,
699
- WellIsDry = 687,
700
- WellIsFull = 688,
701
- WildGoatRefusedToBeMilked = 689,
702
- WillNotTrade = 690,
703
- WorkingYourselfIntoExhaustion = 691,
704
- WorkingYourselfIntoExhaustionAndDrowning = 692,
705
- You = 693,
706
- YouAbsorb = 694,
707
- YouApplied = 695,
708
- YouAreAlready = 696,
709
- YouAte = 697,
710
- YouBeginResting = 698,
711
- YouCannotDoThatYet = 699,
712
- YouCanNowCombatTheTides = 700,
713
- YouCrafted = 701,
714
- YouDoNotFindTreasureYet = 702,
715
- YouDrank = 703,
716
- YouDropTheTorch = 704,
717
- YouEnchant = 705,
718
- YouEquip = 706,
719
- YouExude = 707,
720
- YouExudeSome = 708,
721
- YouExudeSomeReasonConflicting = 709,
722
- YouExudeSomeReasonMax = 710,
723
- YouExudeSomeReasonProperties = 711,
724
- YouFailedTo = 712,
725
- YouFailedToExtinguishedFireFully = 713,
726
- YouFailedToHeal = 714,
727
- YouFailedToHealOther = 715,
728
- YouFire = 716,
729
- YouGathered = 717,
730
- YouGatheredAndDropped = 718,
731
- YouHarvested = 719,
732
- YouHarvestedAndDropped = 720,
733
- YouHave = 721,
734
- YouHaveAlreadyLearned = 722,
735
- YouHaveBeenCut = 723,
736
- YouHaveCaged = 724,
737
- YouHaveCommanded = 725,
738
- YouHaveDied = 726,
739
- YouHaveHealedOther = 727,
740
- YouHaveKilled = 728,
741
- YouHaveReleased = 729,
742
- YouHaveSummoned = 730,
743
- YouHaveTamed = 731,
744
- YouHaveUncaged = 732,
745
- YouNeedMoreCredit = 733,
746
- YouNoticeBarren = 734,
747
- YouNoticeBecomeEnraged = 735,
748
- YouNoticeDying = 736,
749
- YouNoticeFertilityDecreasing = 737,
750
- YouNoticeFertilityIncreasing = 738,
751
- YouNoticeGrowing = 739,
752
- YouNoticeLavaCooling = 740,
753
- YouNoticeLavaHardening = 741,
754
- YouNoticePerish = 742,
755
- YouNoticePlantDamage = 743,
756
- YouNoticePlantRegenerated = 744,
757
- YouNoticeRegrowing = 745,
758
- YouNoticeStumbleInjureItself = 746,
759
- YouNoticeTakeFromGround = 747,
760
- YouNoticeWoundsClosing = 748,
761
- YouNoticeZombieHorde = 749,
762
- YouOfferedToCreature = 750,
763
- YouOfferedToCreatureRejects = 751,
764
- YouOpen = 752,
765
- YouPacked = 753,
766
- YouPickedUp = 754,
767
- YouRefine = 755,
768
- YouReinforce = 756,
769
- YouRepair = 757,
770
- YouReturnFromCivilizationWith = 758,
771
- YourFist = 759,
772
- YourHands = 760,
773
- YourInventory = 761,
774
- YourIsland = 762,
775
- YourRubbingNoEffect = 763,
776
- YouRub = 764,
777
- YouSee = 765,
778
- YouSeeALivingMushroomSpore = 766,
779
- YouSeeASkeletonCollapse = 767,
780
- YouSeeASlimeCombine = 768,
781
- YouSeeAZombieBleeding = 769,
782
- YouSeeCoolDown = 770,
783
- YouSeeDrop = 771,
784
- YouSeeEngulfFire = 772,
785
- YouSeeFireSpread = 773,
786
- YouSeeHelpingPlant = 774,
787
- YouSeeLay = 775,
788
- YouSeeLayingTrap = 776,
789
- YouSeeSpewLava = 777,
790
- YouSeeSpitAcid = 778,
791
- YouSeeSpringForth = 779,
792
- YouSeeSummon = 780,
793
- YouSeeSwampFlood = 781,
794
- YouSeeTrampling = 782,
795
- YouSetTheTrapOff = 783,
796
- YouStokeTheCreature = 784,
797
- YouSwapMainHandAndOffHand = 785,
798
- YouThrew = 786,
799
- YouTilled = 787,
800
- YouUnequip = 788,
801
- YouUsed = 789,
802
- YouWhileTraveling = 790
685
+ UiActionCannotUseRequiresNPC = 673,
686
+ Unhitch = 674,
687
+ UnhitchCreature = 675,
688
+ Unknown = 676,
689
+ Unlimited = 677,
690
+ UnlockedChest = 678,
691
+ UnpurifiedFreshWater = 679,
692
+ UnpurifiedWaterInStill = 680,
693
+ Use = 681,
694
+ UsingBareHands = 682,
695
+ VehicleDefense = 683,
696
+ Vulnerable = 684,
697
+ Water = 685,
698
+ WaterGathering = 686,
699
+ WaterPutOutFire = 687,
700
+ WellIsDry = 688,
701
+ WellIsFull = 689,
702
+ WildGoatRefusedToBeMilked = 690,
703
+ WillNotTrade = 691,
704
+ WorkingYourselfIntoExhaustion = 692,
705
+ WorkingYourselfIntoExhaustionAndDrowning = 693,
706
+ You = 694,
707
+ YouAbsorb = 695,
708
+ YouApplied = 696,
709
+ YouAreAlready = 697,
710
+ YouAte = 698,
711
+ YouBeginResting = 699,
712
+ YouCannotDoThatYet = 700,
713
+ YouCanNowCombatTheTides = 701,
714
+ YouCrafted = 702,
715
+ YouDoNotFindTreasureYet = 703,
716
+ YouDrank = 704,
717
+ YouDropTheTorch = 705,
718
+ YouEnchant = 706,
719
+ YouEquip = 707,
720
+ YouExude = 708,
721
+ YouExudeSome = 709,
722
+ YouExudeSomeReasonConflicting = 710,
723
+ YouExudeSomeReasonMax = 711,
724
+ YouExudeSomeReasonProperties = 712,
725
+ YouFailedTo = 713,
726
+ YouFailedToExtinguishedFireFully = 714,
727
+ YouFailedToHeal = 715,
728
+ YouFailedToHealOther = 716,
729
+ YouFire = 717,
730
+ YouGathered = 718,
731
+ YouGatheredAndDropped = 719,
732
+ YouHarvested = 720,
733
+ YouHarvestedAndDropped = 721,
734
+ YouHave = 722,
735
+ YouHaveAlreadyLearned = 723,
736
+ YouHaveBeenCut = 724,
737
+ YouHaveCaged = 725,
738
+ YouHaveCommanded = 726,
739
+ YouHaveDied = 727,
740
+ YouHaveHealedOther = 728,
741
+ YouHaveKilled = 729,
742
+ YouHaveReleased = 730,
743
+ YouHaveSummoned = 731,
744
+ YouHaveTamed = 732,
745
+ YouHaveUncaged = 733,
746
+ YouNeedMoreCredit = 734,
747
+ YouNoticeBarren = 735,
748
+ YouNoticeBecomeEnraged = 736,
749
+ YouNoticeDying = 737,
750
+ YouNoticeFertilityDecreasing = 738,
751
+ YouNoticeFertilityIncreasing = 739,
752
+ YouNoticeGrowing = 740,
753
+ YouNoticeLavaCooling = 741,
754
+ YouNoticeLavaHardening = 742,
755
+ YouNoticePerish = 743,
756
+ YouNoticePlantDamage = 744,
757
+ YouNoticePlantRegenerated = 745,
758
+ YouNoticeRegrowing = 746,
759
+ YouNoticeStumbleInjureItself = 747,
760
+ YouNoticeTakeFromGround = 748,
761
+ YouNoticeWoundsClosing = 749,
762
+ YouNoticeZombieHorde = 750,
763
+ YouOfferedToCreature = 751,
764
+ YouOfferedToCreatureRejects = 752,
765
+ YouOpen = 753,
766
+ YouPacked = 754,
767
+ YouPickedUp = 755,
768
+ YouRefine = 756,
769
+ YouReinforce = 757,
770
+ YouRepair = 758,
771
+ YouReturnFromCivilizationWith = 759,
772
+ YourFist = 760,
773
+ YourHands = 761,
774
+ YourInventory = 762,
775
+ YourIsland = 763,
776
+ YourRubbingNoEffect = 764,
777
+ YouRub = 765,
778
+ YouSee = 766,
779
+ YouSeeALivingMushroomSpore = 767,
780
+ YouSeeASkeletonCollapse = 768,
781
+ YouSeeASlimeCombine = 769,
782
+ YouSeeAZombieBleeding = 770,
783
+ YouSeeCoolDown = 771,
784
+ YouSeeDrop = 772,
785
+ YouSeeEngulfFire = 773,
786
+ YouSeeFireSpread = 774,
787
+ YouSeeHelpingPlant = 775,
788
+ YouSeeLay = 776,
789
+ YouSeeLayingTrap = 777,
790
+ YouSeeSpewLava = 778,
791
+ YouSeeSpitAcid = 779,
792
+ YouSeeSpringForth = 780,
793
+ YouSeeSummon = 781,
794
+ YouSeeSwampFlood = 782,
795
+ YouSeeTrampling = 783,
796
+ YouSetTheTrapOff = 784,
797
+ YouStokeTheCreature = 785,
798
+ YouSwapMainHandAndOffHand = 786,
799
+ YouThrew = 787,
800
+ YouTilled = 788,
801
+ YouUnequip = 789,
802
+ YouUsed = 790,
803
+ YouWhileTraveling = 791
803
804
  }
804
805
  export default Message;
@@ -44,6 +44,7 @@ export declare enum ItemClasses {
44
44
  Icon = "item-component-icon",
45
45
  ItemIconIsReal = "item-component-icon-item-is-real",
46
46
  ActionIcon = "item-component-icon-action",
47
+ ActionIconAnyItem = "item-component-icon-action-any-item",
47
48
  ActionIconHasItem = "item-component-icon-action-has-item",
48
49
  ActionIconNone = "item-component-icon-action-none",
49
50
  SlottedIcon = "item-component-icon-slotted",
@@ -126,7 +126,9 @@ export default class ActionsConfigurationDrawer extends Component implements IRe
126
126
  protected onNext(): boolean;
127
127
  protected onPrevious(): boolean;
128
128
  protected onLeft(): boolean;
129
- protected onEnterBind(api: IBindHandlerApi | Input): boolean;
129
+ protected onEnterBind(api: IBindHandlerApi | Input, event?: KeyboardEvent): boolean;
130
+ protected onSubmit(): boolean;
131
+ private chooseSelected;
130
132
  protected onSelectionChange(handler: SelectionHandler, component?: Component): void;
131
133
  private selectNext;
132
134
  private selectPrevious;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wayward/types",
3
3
  "description": "TypeScript declarations for Wayward, used for modding.",
4
- "version": "2.13.3-beta.dev.20230620.1",
4
+ "version": "2.13.3-beta.dev.20230622.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",