isaacscript-common 8.0.1 → 8.3.0

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.
@@ -50,6 +50,7 @@ function initMap(self)
50
50
  extraConsoleCommandsFunctionMap:set("card", commands.card)
51
51
  extraConsoleCommandsFunctionMap:set("cards", commands.cards)
52
52
  extraConsoleCommandsFunctionMap:set("cc", commands.cc)
53
+ extraConsoleCommandsFunctionMap:set("getChallenge", commands.getChallenge)
53
54
  extraConsoleCommandsFunctionMap:set("chaosCardTears", commands.chaosCardTears)
54
55
  extraConsoleCommandsFunctionMap:set("character", commands.characterCommand)
55
56
  extraConsoleCommandsFunctionMap:set("charge", commands.charge)
@@ -69,6 +69,8 @@ export declare function card(params: string): void;
69
69
  export declare function cards(): void;
70
70
  /** Alias for the "chaosCardTears" command. */
71
71
  export declare function cc(): void;
72
+ /** Displays the current challenge, if any. */
73
+ export declare function getChallenge(): void;
72
74
  /**
73
75
  * Toggles Chaos Card tears for the player. Useful for killing enemies very fast without using
74
76
  * "debug 10".
@@ -1 +1 @@
1
- {"version":3,"file":"listCommands.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/listCommands.ts"],"names":[],"mappings":"AA4GA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA2C/C;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED,gEAAgE;AAChE,wBAAgB,MAAM,IAAI,IAAI,CAK7B;AAED,sEAAsE;AACtE,wBAAgB,OAAO,IAAI,IAAI,CAkB9B;AAED,2CAA2C;AAC3C,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,+CAA+C;AAC/C,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;;GAGG;AACH,wBA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G;AACH,wBAAgB,KAAK,IAAI,IAAI,CAQ5B;AAED,wCAAwC;AACxC,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED,6CAA6C;AAC7C,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,qDAAqD;AACrD,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,yDAAyD;AACzD,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,sFAAsF;AACtF,wBAAgB,MAAM,IAAI,IAAI,CAQ7B;AAED,wFAAwF;AACxF,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA0BzC"}
1
+ {"version":3,"file":"listCommands.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/listCommands.ts"],"names":[],"mappings":"AA6GA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA2C/C;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED,gEAAgE;AAChE,wBAAgB,MAAM,IAAI,IAAI,CAK7B;AAED,sEAAsE;AACtE,wBAAgB,OAAO,IAAI,IAAI,CAkB9B;AAED,2CAA2C;AAC3C,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,+CAA+C;AAC/C,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAcjD;AAED,2CAA2C;AAC3C,wBAAgB,EAAE,IAAI,IAAI,CAEzB;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAczC;AAED;;;GAGG;AACH,wBA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AED,qDAAqD;AACrD,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,yDAAyD;AACzD,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,sFAAsF;AACtF,wBAAgB,MAAM,IAAI,IAAI,CAQ7B;AAED,wFAAwF;AACxF,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA0BzC"}
@@ -8,6 +8,7 @@ local ____exports = {}
8
8
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
9
9
  local ActiveSlot = ____isaac_2Dtypescript_2Ddefinitions.ActiveSlot
10
10
  local CacheFlag = ____isaac_2Dtypescript_2Ddefinitions.CacheFlag
11
+ local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
11
12
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
12
13
  local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
13
14
  local DisplayFlag = ____isaac_2Dtypescript_2Ddefinitions.DisplayFlag
@@ -413,6 +414,14 @@ end
413
414
  function ____exports.cc(self)
414
415
  ____exports.chaosCardTears(nil)
415
416
  end
417
+ --- Displays the current challenge, if any.
418
+ function ____exports.getChallenge(self)
419
+ local challenge = Isaac.GetChallenge()
420
+ printConsole(
421
+ nil,
422
+ ((("The current challenge is: Challenge." .. tostring(Challenge[challenge])) .. " (") .. tostring(challenge)) .. ")"
423
+ )
424
+ end
416
425
  --- Restart as the specified character. Accepts either the character sub-type or the partial name of
417
426
  -- the character.
418
427
  --
@@ -1 +1 @@
1
- {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/functions/map.ts"],"names":[],"mappings":"AAEA,mGAAmG;AACnG,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAO1D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,GAC1B,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,CAuBzB;AAED,4DAA4D;AAC5D,wBAAgB,MAAM,CACpB,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,GACvD,MAAM,CAGR"}
1
+ {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/functions/map.ts"],"names":[],"mappings":"AAGA,mGAAmG;AACnG,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAO1D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,GAC1B,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,CAgBzB;AAED,4DAA4D;AAC5D,wBAAgB,MAAM,CACpB,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,GACvD,MAAM,CAGR"}
@@ -3,13 +3,11 @@ local Map = ____lualib.Map
3
3
  local __TS__New = ____lualib.__TS__New
4
4
  local __TS__Iterator = ____lualib.__TS__Iterator
5
5
  local __TS__Spread = ____lualib.__TS__Spread
6
- local __TS__ArraySort = ____lualib.__TS__ArraySort
7
- local __TS__StringReplaceAll = ____lualib.__TS__StringReplaceAll
8
- local __TS__StringStartsWith = ____lualib.__TS__StringStartsWith
9
- local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
10
6
  local ____exports = {}
11
7
  local ____array = require("functions.array")
12
8
  local sumArray = ____array.sumArray
9
+ local ____string = require("functions.string")
10
+ local getPartialMatch = ____string.getPartialMatch
13
11
  --- Helper function to copy a map. (You can also use a Map constructor to accomplish this task.)
14
12
  function ____exports.copyMap(self, oldMap)
15
13
  local newMap = __TS__New(Map)
@@ -39,24 +37,13 @@ end
39
37
  -- ```
40
38
  function ____exports.getMapPartialMatch(self, searchText, map)
41
39
  local keys = {__TS__Spread(map:keys())}
42
- __TS__ArraySort(keys)
43
- searchText = string.lower(searchText)
44
- searchText = __TS__StringReplaceAll(searchText, " ", "")
45
- local matchingKeys = __TS__ArrayFilter(
46
- keys,
47
- function(____, key) return __TS__StringStartsWith(
48
- string.lower(key),
49
- searchText
50
- ) end
51
- )
52
- __TS__ArraySort(matchingKeys)
53
- local matchingKey = matchingKeys[1]
40
+ local matchingKey = getPartialMatch(nil, searchText, keys)
54
41
  if matchingKey == nil then
55
42
  return nil
56
43
  end
57
44
  local value = map:get(matchingKey)
58
45
  if value == nil then
59
- return nil
46
+ error("Failed to get the map value corresponding to the partial match of: " .. matchingKey)
60
47
  end
61
48
  return {matchingKey, value}
62
49
  end
@@ -279,6 +279,18 @@ export declare function playerAddCollectible(player: EntityPlayer, ...collectibl
279
279
  * check for. Returns true if the player has any of the supplied collectible types.
280
280
  */
281
281
  export declare function playerHasCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): boolean;
282
+ /**
283
+ * Helper function to remove all of the active items from a player. This includes the Schoolbag item
284
+ * and any pocket actives.
285
+ */
286
+ export declare function removeAllActiveItems(player: EntityPlayer): void;
287
+ /**
288
+ * Helper function to remove all of the held trinkets from a player.
289
+ *
290
+ * This will not remove any smelted trinkets, unless the player happens to be holding a trinket that
291
+ * they also have smelted. (In that case, both the held and the smelted trinket will be removed.)
292
+ */
293
+ export declare function removeAllPlayerTrinkets(player: EntityPlayer): void;
282
294
  /**
283
295
  * Helper function to remove a collectible costume from a player. Use this helper function to avoid
284
296
  * having to request the collectible from the item config.
@@ -1 +1 @@
1
- {"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAET,eAAe,EAIf,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA6BjD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GACb,IAAI,CA4CN;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAGT;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAGrE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,kBAAkB,EAAE,UAAU,EAAE,GAAG,OAAO,CAIxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CASjE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAK1E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAKzE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,UAAU,GAAG,SAAS,CAMxB;AAED;;;;;GAKG;AACH,wB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e,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ,GAClB,IAAI,CA6DN;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN;AAED;;;;;;;;;GASG;AACH,wBAAgB,sDAAsD,CACpE,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,KAAK,GAClB,OAAO,CAyBT"}
1
+ {"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAET,eAAe,EAIf,UAAU,EAEV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA6BjD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GACb,IAAI,CA4CN;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAGT;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAGrE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,kBAAkB,EAAE,UAAU,EAAE,GAAG,OAAO,CAIxE;AAED;;;;;;;;GAQG;AACH,wBAAgB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AIT;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAa/D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAalE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAIlE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ,GAClB,IAAI,CA6DN;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN;AAED;;;;;;;;;GASG;AACH,wBAAgB,sDAAsD,CACpE,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,KAAK,GAClB,OAAO,CAyBT"}
@@ -18,6 +18,7 @@ local FamiliarVariant = ____isaac_2Dtypescript_2Ddefinitions.FamiliarVariant
18
18
  local NullItemID = ____isaac_2Dtypescript_2Ddefinitions.NullItemID
19
19
  local PlayerForm = ____isaac_2Dtypescript_2Ddefinitions.PlayerForm
20
20
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
21
+ local TrinketSlot = ____isaac_2Dtypescript_2Ddefinitions.TrinketSlot
21
22
  local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
22
23
  local ____cachedClasses = require("core.cachedClasses")
23
24
  local game = ____cachedClasses.game
@@ -682,6 +683,48 @@ function ____exports.playerHasCollectible(self, player, ...)
682
683
  function(____, collectibleType) return player:HasCollectible(collectibleType) end
683
684
  )
684
685
  end
686
+ --- Helper function to remove all of the active items from a player. This includes the Schoolbag item
687
+ -- and any pocket actives.
688
+ function ____exports.removeAllActiveItems(self, player)
689
+ for ____, activeSlot in ipairs(getEnumValues(nil, ActiveSlot)) do
690
+ do
691
+ local collectibleType = player:GetActiveItem(activeSlot)
692
+ if collectibleType == CollectibleType.NULL then
693
+ goto __continue114
694
+ end
695
+ local hasCollectible
696
+ repeat
697
+ do
698
+ player:RemoveCollectible(collectibleType)
699
+ hasCollectible = player:HasCollectible(collectibleType)
700
+ end
701
+ until not hasCollectible
702
+ end
703
+ ::__continue114::
704
+ end
705
+ end
706
+ --- Helper function to remove all of the held trinkets from a player.
707
+ --
708
+ -- This will not remove any smelted trinkets, unless the player happens to be holding a trinket that
709
+ -- they also have smelted. (In that case, both the held and the smelted trinket will be removed.)
710
+ function ____exports.removeAllPlayerTrinkets(self, player)
711
+ for ____, trinketSlot in ipairs(getEnumValues(nil, TrinketSlot)) do
712
+ do
713
+ local trinketType = player:GetTrinket(trinketSlot)
714
+ if trinketType == TrinketType.NULL then
715
+ goto __continue119
716
+ end
717
+ local hasTrinket
718
+ repeat
719
+ do
720
+ player:TryRemoveTrinket(trinketType)
721
+ hasTrinket = player:HasTrinket(trinketType)
722
+ end
723
+ until not hasTrinket
724
+ end
725
+ ::__continue119::
726
+ end
727
+ end
685
728
  --- Helper function to remove a collectible costume from a player. Use this helper function to avoid
686
729
  -- having to request the collectible from the item config.
687
730
  function ____exports.removeCollectibleCostume(self, player, collectibleType)
@@ -742,9 +785,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
742
785
  itemPool:RemoveCollectible(collectibleType)
743
786
  end
744
787
  repeat
745
- local ____switch122 = activeSlot
746
- local ____cond122 = ____switch122 == ActiveSlot.PRIMARY
747
- if ____cond122 then
788
+ local ____switch132 = activeSlot
789
+ local ____cond132 = ____switch132 == ActiveSlot.PRIMARY
790
+ if ____cond132 then
748
791
  do
749
792
  if primaryCollectibleType ~= CollectibleType.NULL then
750
793
  player:RemoveCollectible(primaryCollectibleType)
@@ -753,8 +796,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
753
796
  break
754
797
  end
755
798
  end
756
- ____cond122 = ____cond122 or ____switch122 == ActiveSlot.SECONDARY
757
- if ____cond122 then
799
+ ____cond132 = ____cond132 or ____switch132 == ActiveSlot.SECONDARY
800
+ if ____cond132 then
758
801
  do
759
802
  if primaryCollectibleType ~= CollectibleType.NULL then
760
803
  player:RemoveCollectible(primaryCollectibleType)
@@ -769,16 +812,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
769
812
  break
770
813
  end
771
814
  end
772
- ____cond122 = ____cond122 or ____switch122 == ActiveSlot.POCKET
773
- if ____cond122 then
815
+ ____cond132 = ____cond132 or ____switch132 == ActiveSlot.POCKET
816
+ if ____cond132 then
774
817
  do
775
818
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
776
819
  player:SetActiveCharge(charge, activeSlot)
777
820
  break
778
821
  end
779
822
  end
780
- ____cond122 = ____cond122 or ____switch122 == ActiveSlot.POCKET_SINGLE_USE
781
- if ____cond122 then
823
+ ____cond132 = ____cond132 or ____switch132 == ActiveSlot.POCKET_SINGLE_USE
824
+ if ____cond132 then
782
825
  do
783
826
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
784
827
  break
@@ -1,4 +1,21 @@
1
1
  export declare function capitalizeFirstLetter(string: string): string;
2
+ /**
3
+ * Helper function to get the closest value from an array of strings based on partial search text.
4
+ * For the purposes of this function, both search text and the array are converted to lowercase
5
+ * before attempting to find a match.
6
+ *
7
+ * For example:
8
+ *
9
+ * ```ts
10
+ * const array = ["foo", "bar"];
11
+ * const searchText = "f";
12
+ * const match = getPartialMatch(array, searchText); // match is now equal to "foo"
13
+ *
14
+ * @returns If a match was found, returns the array element. If a match was not
15
+ * found, returns undefined.
16
+ * ```
17
+ */
18
+ export declare function getPartialMatch(searchText: string, array: string[]): string | undefined;
2
19
  export declare function removeAllCharacters(string: string, character: string): string;
3
20
  /**
4
21
  * Helper function to remove all of the characters in a string before a given substring. Returns the
@@ -1 +1 @@
1
- {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/functions/string.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAM5D;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,MAAM,CAGR;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,GAAG,UAAU,EAAE,MAAM,EAAE,GACtB,MAAM,CAMR;AAED,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMjE;AAED,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOjE"}
1
+ {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/functions/string.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAM5D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EAAE,GACd,MAAM,GAAG,SAAS,CAYpB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,MAAM,CAGR;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,GAAG,UAAU,EAAE,MAAM,EAAE,GACtB,MAAM,CAMR;AAED,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMjE;AAED,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOjE"}
@@ -1,7 +1,9 @@
1
1
  local ____lualib = require("lualib_bundle")
2
+ local __TS__ArraySort = ____lualib.__TS__ArraySort
2
3
  local __TS__StringReplaceAll = ____lualib.__TS__StringReplaceAll
3
- local __TS__StringSlice = ____lualib.__TS__StringSlice
4
4
  local __TS__StringStartsWith = ____lualib.__TS__StringStartsWith
5
+ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
6
+ local __TS__StringSlice = ____lualib.__TS__StringSlice
5
7
  local __TS__StringEndsWith = ____lualib.__TS__StringEndsWith
6
8
  local ____exports = {}
7
9
  function ____exports.capitalizeFirstLetter(self, ____string)
@@ -10,6 +12,34 @@ function ____exports.capitalizeFirstLetter(self, ____string)
10
12
  local restOfString = string.sub(____string, 2)
11
13
  return capitalizedFirstLetter .. restOfString
12
14
  end
15
+ --- Helper function to get the closest value from an array of strings based on partial search text.
16
+ -- For the purposes of this function, both search text and the array are converted to lowercase
17
+ -- before attempting to find a match.
18
+ --
19
+ -- For example:
20
+ --
21
+ -- ```ts
22
+ -- const array = ["foo", "bar"];
23
+ -- const searchText = "f";
24
+ -- const match = getPartialMatch(array, searchText); // match is now equal to "foo"
25
+ --
26
+ -- @returns If a match was found, returns the array element. If a match was not
27
+ -- found, returns undefined.
28
+ -- ```
29
+ function ____exports.getPartialMatch(self, searchText, array)
30
+ __TS__ArraySort(array)
31
+ searchText = string.lower(searchText)
32
+ searchText = __TS__StringReplaceAll(searchText, " ", "")
33
+ local matchingElements = __TS__ArrayFilter(
34
+ array,
35
+ function(____, element) return __TS__StringStartsWith(
36
+ string.lower(element),
37
+ searchText
38
+ ) end
39
+ )
40
+ __TS__ArraySort(matchingElements)
41
+ return matchingElements[1]
42
+ end
13
43
  function ____exports.removeAllCharacters(self, ____string, character)
14
44
  return __TS__StringReplaceAll(____string, character, "")
15
45
  end
@@ -80,13 +80,13 @@ export declare function repeat(n: int, func: (i: int) => void): void;
80
80
  /**
81
81
  * Helper function to signify that the enclosing code block is not yet complete. Using this function
82
82
  * is similar to writing a "TODO" comment, but it has the benefit of preventing ESLint errors due to
83
- * early returns.
83
+ * unused variables or early returns.
84
84
  *
85
85
  * When you see this function, it simply means that the programmer intends to add in more code to
86
86
  * this spot later.
87
87
  *
88
88
  * This function is variadic, meaning that you can pass as many arguments as you want. (This is
89
- * useful as a means to prevent lint warnings.)
89
+ * useful as a means to prevent unused variables.)
90
90
  *
91
91
  * This function does not actually do anything. (It is an "empty" function.)
92
92
  */
@@ -153,13 +153,13 @@ ____exports["repeat"] = function(self, n, func)
153
153
  end
154
154
  --- Helper function to signify that the enclosing code block is not yet complete. Using this function
155
155
  -- is similar to writing a "TODO" comment, but it has the benefit of preventing ESLint errors due to
156
- -- early returns.
156
+ -- unused variables or early returns.
157
157
  --
158
158
  -- When you see this function, it simply means that the programmer intends to add in more code to
159
159
  -- this spot later.
160
160
  --
161
161
  -- This function is variadic, meaning that you can pass as many arguments as you want. (This is
162
- -- useful as a means to prevent lint warnings.)
162
+ -- useful as a means to prevent unused variables.)
163
163
  --
164
164
  -- This function does not actually do anything. (It is an "empty" function.)
165
165
  function ____exports.todo(self, ...)
package/dist/index.d.ts CHANGED
@@ -3790,6 +3790,24 @@ export declare function getOppositeDoorSlot(doorSlot: DoorSlot): DoorSlot | unde
3790
3790
  */
3791
3791
  export declare function getOtherPlayers(player: EntityPlayer): EntityPlayer[];
3792
3792
 
3793
+ /**
3794
+ * Helper function to get the closest value from an array of strings based on partial search text.
3795
+ * For the purposes of this function, both search text and the array are converted to lowercase
3796
+ * before attempting to find a match.
3797
+ *
3798
+ * For example:
3799
+ *
3800
+ * ```ts
3801
+ * const array = ["foo", "bar"];
3802
+ * const searchText = "f";
3803
+ * const match = getPartialMatch(array, searchText); // match is now equal to "foo"
3804
+ *
3805
+ * @returns If a match was found, returns the array element. If a match was not
3806
+ * found, returns undefined.
3807
+ * ```
3808
+ */
3809
+ export declare function getPartialMatch(searchText: string, array: string[]): string | undefined;
3810
+
3793
3811
  /**
3794
3812
  * Helper function to get the associated pill effect after PHD is acquired. If a pill effect is not
3795
3813
  * altered by PHD, then the same pill effect will be returned.
@@ -8968,6 +8986,12 @@ export declare function registerHotkey(keyboardOrFunc: Keyboard | (() => Keyboar
8968
8986
  */
8969
8987
  export declare function reloadRoom(): void;
8970
8988
 
8989
+ /**
8990
+ * Helper function to remove all of the active items from a player. This includes the Schoolbag item
8991
+ * and any pocket actives.
8992
+ */
8993
+ export declare function removeAllActiveItems(player: EntityPlayer): void;
8994
+
8971
8995
  /**
8972
8996
  * Helper function to remove all of the batteries in the room.
8973
8997
  *
@@ -9215,6 +9239,14 @@ export declare function removeAllPits(pitVariant?: PitVariant, updateRoom?: bool
9215
9239
 
9216
9240
  export declare function removeAllPlayerHealth(player: EntityPlayer): void;
9217
9241
 
9242
+ /**
9243
+ * Helper function to remove all of the held trinkets from a player.
9244
+ *
9245
+ * This will not remove any smelted trinkets, unless the player happens to be holding a trinket that
9246
+ * they also have smelted. (In that case, both the held and the smelted trinket will be removed.)
9247
+ */
9248
+ export declare function removeAllPlayerTrinkets(player: EntityPlayer): void;
9249
+
9218
9250
  /**
9219
9251
  * Helper function to remove all of the `GridEntityPoop` in the room.
9220
9252
  *
@@ -11198,13 +11230,13 @@ export declare function texelEquals(sprite1: Sprite, sprite2: Sprite, position:
11198
11230
  /**
11199
11231
  * Helper function to signify that the enclosing code block is not yet complete. Using this function
11200
11232
  * is similar to writing a "TODO" comment, but it has the benefit of preventing ESLint errors due to
11201
- * early returns.
11233
+ * unused variables or early returns.
11202
11234
  *
11203
11235
  * When you see this function, it simply means that the programmer intends to add in more code to
11204
11236
  * this spot later.
11205
11237
  *
11206
11238
  * This function is variadic, meaning that you can pass as many arguments as you want. (This is
11207
- * useful as a means to prevent lint warnings.)
11239
+ * useful as a means to prevent unused variables.)
11208
11240
  *
11209
11241
  * This function does not actually do anything. (It is an "empty" function.)
11210
11242
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "8.0.1",
3
+ "version": "8.3.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -54,6 +54,7 @@ function initMap() {
54
54
  extraConsoleCommandsFunctionMap.set("card", commands.card);
55
55
  extraConsoleCommandsFunctionMap.set("cards", commands.cards);
56
56
  extraConsoleCommandsFunctionMap.set("cc", commands.cc);
57
+ extraConsoleCommandsFunctionMap.set("getChallenge", commands.getChallenge);
57
58
  extraConsoleCommandsFunctionMap.set(
58
59
  "chaosCardTears",
59
60
  commands.chaosCardTears,
@@ -25,6 +25,7 @@ import {
25
25
  ActiveSlot,
26
26
  CacheFlag,
27
27
  Card,
28
+ Challenge,
28
29
  CollectibleType,
29
30
  Direction,
30
31
  DisplayFlag,
@@ -373,6 +374,14 @@ export function cc(): void {
373
374
  chaosCardTears();
374
375
  }
375
376
 
377
+ /** Displays the current challenge, if any. */
378
+ export function getChallenge(): void {
379
+ const challenge = Isaac.GetChallenge();
380
+ printConsole(
381
+ `The current challenge is: Challenge.${Challenge[challenge]} (${challenge})`,
382
+ );
383
+ }
384
+
376
385
  /**
377
386
  * Toggles Chaos Card tears for the player. Useful for killing enemies very fast without using
378
387
  * "debug 10".
@@ -1,4 +1,5 @@
1
1
  import { sumArray } from "./array";
2
+ import { getPartialMatch } from "./string";
2
3
 
3
4
  /** Helper function to copy a map. (You can also use a Map constructor to accomplish this task.) */
4
5
  export function copyMap<K, V>(oldMap: Map<K, V>): Map<K, V> {
@@ -34,24 +35,17 @@ export function getMapPartialMatch<T>(
34
35
  map: ReadonlyMap<string, T>,
35
36
  ): [string, T] | undefined {
36
37
  const keys = [...map.keys()];
37
- keys.sort();
38
38
 
39
- searchText = searchText.toLowerCase();
40
- searchText = searchText.replaceAll(" ", "");
41
-
42
- const matchingKeys = keys.filter((key) =>
43
- key.toLowerCase().startsWith(searchText),
44
- );
45
- matchingKeys.sort();
46
-
47
- const matchingKey = matchingKeys[0];
39
+ const matchingKey = getPartialMatch(searchText, keys);
48
40
  if (matchingKey === undefined) {
49
41
  return undefined;
50
42
  }
51
43
 
52
44
  const value = map.get(matchingKey);
53
45
  if (value === undefined) {
54
- return undefined;
46
+ error(
47
+ `Failed to get the map value corresponding to the partial match of: ${matchingKey}`,
48
+ );
55
49
  }
56
50
 
57
51
  return [matchingKey, value];
@@ -7,6 +7,7 @@ import {
7
7
  NullItemID,
8
8
  PlayerForm,
9
9
  PlayerType,
10
+ TrinketSlot,
10
11
  TrinketType,
11
12
  } from "isaac-typescript-definitions";
12
13
  import { game, itemConfig } from "../core/cachedClasses";
@@ -882,6 +883,46 @@ export function playerHasCollectible(
882
883
  );
883
884
  }
884
885
 
886
+ /**
887
+ * Helper function to remove all of the active items from a player. This includes the Schoolbag item
888
+ * and any pocket actives.
889
+ */
890
+ export function removeAllActiveItems(player: EntityPlayer): void {
891
+ for (const activeSlot of getEnumValues(ActiveSlot)) {
892
+ const collectibleType = player.GetActiveItem(activeSlot);
893
+ if (collectibleType === CollectibleType.NULL) {
894
+ continue;
895
+ }
896
+
897
+ let hasCollectible: boolean;
898
+ do {
899
+ player.RemoveCollectible(collectibleType);
900
+ hasCollectible = player.HasCollectible(collectibleType);
901
+ } while (hasCollectible);
902
+ }
903
+ }
904
+
905
+ /**
906
+ * Helper function to remove all of the held trinkets from a player.
907
+ *
908
+ * This will not remove any smelted trinkets, unless the player happens to be holding a trinket that
909
+ * they also have smelted. (In that case, both the held and the smelted trinket will be removed.)
910
+ */
911
+ export function removeAllPlayerTrinkets(player: EntityPlayer): void {
912
+ for (const trinketSlot of getEnumValues(TrinketSlot)) {
913
+ const trinketType = player.GetTrinket(trinketSlot);
914
+ if (trinketType === TrinketType.NULL) {
915
+ continue;
916
+ }
917
+
918
+ let hasTrinket: boolean;
919
+ do {
920
+ player.TryRemoveTrinket(trinketType);
921
+ hasTrinket = player.HasTrinket(trinketType);
922
+ } while (hasTrinket);
923
+ }
924
+ }
925
+
885
926
  /**
886
927
  * Helper function to remove a collectible costume from a player. Use this helper function to avoid
887
928
  * having to request the collectible from the item config.
@@ -6,6 +6,39 @@ export function capitalizeFirstLetter(string: string): string {
6
6
  return `${capitalizedFirstLetter}${restOfString}`;
7
7
  }
8
8
 
9
+ /**
10
+ * Helper function to get the closest value from an array of strings based on partial search text.
11
+ * For the purposes of this function, both search text and the array are converted to lowercase
12
+ * before attempting to find a match.
13
+ *
14
+ * For example:
15
+ *
16
+ * ```ts
17
+ * const array = ["foo", "bar"];
18
+ * const searchText = "f";
19
+ * const match = getPartialMatch(array, searchText); // match is now equal to "foo"
20
+ *
21
+ * @returns If a match was found, returns the array element. If a match was not
22
+ * found, returns undefined.
23
+ * ```
24
+ */
25
+ export function getPartialMatch(
26
+ searchText: string,
27
+ array: string[],
28
+ ): string | undefined {
29
+ array.sort();
30
+
31
+ searchText = searchText.toLowerCase();
32
+ searchText = searchText.replaceAll(" ", "");
33
+
34
+ const matchingElements = array.filter((element) =>
35
+ element.toLowerCase().startsWith(searchText),
36
+ );
37
+ matchingElements.sort();
38
+
39
+ return matchingElements[0];
40
+ }
41
+
9
42
  export function removeAllCharacters(string: string, character: string): string {
10
43
  return string.replaceAll(character, "");
11
44
  }
@@ -182,13 +182,13 @@ export function repeat(n: int, func: (i: int) => void): void {
182
182
  /**
183
183
  * Helper function to signify that the enclosing code block is not yet complete. Using this function
184
184
  * is similar to writing a "TODO" comment, but it has the benefit of preventing ESLint errors due to
185
- * early returns.
185
+ * unused variables or early returns.
186
186
  *
187
187
  * When you see this function, it simply means that the programmer intends to add in more code to
188
188
  * this spot later.
189
189
  *
190
190
  * This function is variadic, meaning that you can pass as many arguments as you want. (This is
191
- * useful as a means to prevent lint warnings.)
191
+ * useful as a means to prevent unused variables.)
192
192
  *
193
193
  * This function does not actually do anything. (It is an "empty" function.)
194
194
  */