isaacscript-common 7.1.1 → 7.2.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.
Files changed (121) hide show
  1. package/dist/classes/DefaultMap.d.ts +5 -5
  2. package/dist/classes/DefaultMap.d.ts.map +1 -1
  3. package/dist/enums/AmbushType.d.ts +1 -0
  4. package/dist/enums/AmbushType.d.ts.map +1 -1
  5. package/dist/enums/AmbushType.lua +1 -0
  6. package/dist/enums/CornerType.d.ts +1 -0
  7. package/dist/enums/CornerType.d.ts.map +1 -1
  8. package/dist/enums/CornerType.lua +1 -0
  9. package/dist/enums/PocketItemType.d.ts +1 -0
  10. package/dist/enums/PocketItemType.d.ts.map +1 -1
  11. package/dist/enums/PocketItemType.lua +1 -0
  12. package/dist/enums/RockAltType.d.ts +1 -0
  13. package/dist/enums/RockAltType.d.ts.map +1 -1
  14. package/dist/enums/RockAltType.lua +1 -0
  15. package/dist/enums/SerializationType.d.ts +1 -0
  16. package/dist/enums/SerializationType.d.ts.map +1 -1
  17. package/dist/enums/SerializationType.lua +1 -0
  18. package/dist/enums/SlotDestructionType.d.ts +1 -0
  19. package/dist/enums/SlotDestructionType.d.ts.map +1 -1
  20. package/dist/enums/SlotDestructionType.lua +1 -0
  21. package/dist/features/customStage/backdrop.d.ts +1 -1
  22. package/dist/features/customStage/backdrop.d.ts.map +1 -1
  23. package/dist/features/customStage/backdrop.lua +1 -1
  24. package/dist/features/customStage/init.lua +2 -2
  25. package/dist/functions/cacheFlag.d.ts +23 -1
  26. package/dist/functions/cacheFlag.d.ts.map +1 -1
  27. package/dist/functions/cacheFlag.lua +78 -0
  28. package/dist/functions/flying.lua +2 -2
  29. package/dist/functions/index.d.ts +0 -1
  30. package/dist/functions/index.d.ts.map +1 -1
  31. package/dist/functions/index.lua +0 -8
  32. package/dist/functions/input.d.ts +4 -1
  33. package/dist/functions/input.d.ts.map +1 -1
  34. package/dist/functions/input.lua +10 -2
  35. package/dist/functions/rockAlt.d.ts.map +1 -1
  36. package/dist/functions/rockAlt.lua +11 -20
  37. package/dist/functions/rooms.d.ts.map +1 -1
  38. package/dist/functions/rooms.lua +1 -0
  39. package/dist/interfaces/ChargeBarSprites.d.ts +1 -1
  40. package/dist/interfaces/Corner.d.ts +5 -0
  41. package/dist/interfaces/Corner.d.ts.map +1 -1
  42. package/dist/interfaces/CustomStageLua.d.ts +57 -0
  43. package/dist/interfaces/CustomStageLua.d.ts.map +1 -1
  44. package/dist/interfaces/GridEntityCustomData.d.ts +6 -0
  45. package/dist/interfaces/GridEntityCustomData.d.ts.map +1 -1
  46. package/dist/interfaces/JSONRoomsFile.d.ts +7 -3
  47. package/dist/interfaces/JSONRoomsFile.d.ts.map +1 -1
  48. package/dist/interfaces/PlayerHealth.d.ts +1 -1
  49. package/dist/interfaces/PlayerHealth.d.ts.map +1 -1
  50. package/dist/interfaces/PocketItemDescription.d.ts +1 -1
  51. package/dist/interfaces/PocketItemDescription.d.ts.map +1 -1
  52. package/dist/interfaces/RoomDescription.d.ts +1 -1
  53. package/dist/interfaces/RoomDescription.d.ts.map +1 -1
  54. package/dist/interfaces/StatTypeType.d.ts +4 -0
  55. package/dist/interfaces/StatTypeType.d.ts.map +1 -1
  56. package/dist/interfaces/TrinketSituation.d.ts +1 -1
  57. package/dist/interfaces/TrinketSituation.d.ts.map +1 -1
  58. package/dist/maps/keyboardToString.d.ts +4 -0
  59. package/dist/maps/keyboardToString.d.ts.map +1 -0
  60. package/dist/maps/keyboardToString.lua +73 -0
  61. package/dist/types/AnyEntity.d.ts +5 -0
  62. package/dist/types/AnyEntity.d.ts.map +1 -1
  63. package/dist/types/AnyGridEntity.d.ts +5 -0
  64. package/dist/types/AnyGridEntity.d.ts.map +1 -1
  65. package/dist/types/CollectibleIndex.d.ts +4 -3
  66. package/dist/types/CollectibleIndex.d.ts.map +1 -1
  67. package/dist/types/Immutable.d.ts +3 -1
  68. package/dist/types/Immutable.d.ts.map +1 -1
  69. package/dist/types/PickupIndex.d.ts +4 -2
  70. package/dist/types/PickupIndex.d.ts.map +1 -1
  71. package/dist/types/PlayerIndex.d.ts +3 -2
  72. package/dist/types/PlayerIndex.d.ts.map +1 -1
  73. package/dist/types/SerializedIsaacAPIClass.d.ts +6 -0
  74. package/dist/types/SerializedIsaacAPIClass.d.ts.map +1 -1
  75. package/dist/types/TSTLClass.d.ts +5 -0
  76. package/dist/types/TSTLClass.d.ts.map +1 -1
  77. package/dist/types/TrapdoorDestination.d.ts +3 -0
  78. package/dist/types/TrapdoorDestination.d.ts.map +1 -1
  79. package/package.json +2 -2
  80. package/src/classes/DefaultMap.ts +7 -7
  81. package/src/enums/AmbushType.ts +1 -0
  82. package/src/enums/CornerType.ts +1 -0
  83. package/src/enums/PocketItemType.ts +1 -0
  84. package/src/enums/RockAltType.ts +1 -0
  85. package/src/enums/SerializationType.ts +1 -0
  86. package/src/enums/SlotDestructionType.ts +1 -0
  87. package/src/features/customStage/backdrop.ts +1 -1
  88. package/src/features/customStage/init.ts +2 -2
  89. package/src/features/fastReset.ts +1 -1
  90. package/src/features/indexTypeDoc.ts +2 -1
  91. package/src/functions/cacheFlag.ts +90 -1
  92. package/src/functions/flying.ts +1 -1
  93. package/src/functions/index.ts +0 -1
  94. package/src/functions/indexTypeDoc.ts +0 -1
  95. package/src/functions/input.ts +15 -2
  96. package/src/functions/rockAlt.ts +28 -13
  97. package/src/functions/rooms.ts +1 -0
  98. package/src/interfaces/ChargeBarSprites.ts +1 -1
  99. package/src/interfaces/Corner.ts +5 -0
  100. package/src/interfaces/CustomStageLua.ts +66 -0
  101. package/src/interfaces/GridEntityCustomData.ts +6 -0
  102. package/src/interfaces/JSONRoomsFile.ts +7 -3
  103. package/src/interfaces/PlayerHealth.ts +1 -1
  104. package/src/interfaces/PocketItemDescription.ts +1 -1
  105. package/src/interfaces/RoomDescription.ts +1 -1
  106. package/src/interfaces/StatTypeType.ts +4 -0
  107. package/src/interfaces/TrinketSituation.ts +1 -1
  108. package/src/maps/keyboardToString.ts +77 -0
  109. package/src/types/AnyEntity.ts +5 -0
  110. package/src/types/AnyGridEntity.ts +5 -0
  111. package/src/types/CollectibleIndex.ts +4 -3
  112. package/src/types/Immutable.ts +3 -1
  113. package/src/types/PickupIndex.ts +4 -2
  114. package/src/types/PlayerIndex.ts +3 -2
  115. package/src/types/SerializedIsaacAPIClass.ts +6 -0
  116. package/src/types/TSTLClass.ts +5 -0
  117. package/src/types/TrapdoorDestination.ts +3 -0
  118. package/dist/functions/collectibleCacheFlag.d.ts +0 -24
  119. package/dist/functions/collectibleCacheFlag.d.ts.map +0 -1
  120. package/dist/functions/collectibleCacheFlag.lua +0 -80
  121. package/src/functions/collectibleCacheFlag.ts +0 -90
@@ -1,8 +1,3 @@
1
- /**
2
- * A function that creates the default value for your `DefaultMap`. For example, if it was a
3
- * `DefaultMap` containing maps, the factory function would be: `() => new Map()`
4
- */
5
- export declare type FactoryFunction<V, Args extends unknown[]> = (...args: Args) => V;
6
1
  /**
7
2
  * `DefaultMap` is a data structure that makes working with default values easier.
8
3
  *
@@ -107,4 +102,9 @@ export declare class DefaultMap<Key, Value, Args extends unknown[] = []> extends
107
102
  */
108
103
  getConstructorArg(): Value | FactoryFunction<Value, Args>;
109
104
  }
105
+ /**
106
+ * A function that creates the default value for your `DefaultMap`. For example, if it was a
107
+ * `DefaultMap` containing maps, the factory function would be: `() => new Map()`
108
+ */
109
+ export declare type FactoryFunction<V, Args extends unknown[]> = (...args: Args) => V;
110
110
  //# sourceMappingURL=DefaultMap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultMap.d.ts","sourceRoot":"","sources":["../../src/classes/DefaultMap.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,oBAAY,eAAe,CAAC,CAAC,EAAE,IAAI,SAAS,OAAO,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,CAAC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK;IAWhD;;;OAGG;IACH,eAAe,CAAC,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK;IAYrC;;;OAGG;IACH,iBAAiB,IAAI,KAAK,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC;CAW1D;AAGD;;;GAGG;AACH,oBAAY,eAAe,CAAC,CAAC,EAAE,IAAI,SAAS,OAAO,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ /** This is used by the `POST_AMBUSH_STARTED` and `POST_AMBUSH_FINISHED` custom callbacks. */
1
2
  export declare enum AmbushType {
2
3
  CHALLENGE_ROOM = 0,
3
4
  BOSS_RUSH = 1
@@ -1 +1 @@
1
- {"version":3,"file":"AmbushType.d.ts","sourceRoot":"","sources":["../../src/enums/AmbushType.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,cAAc,IAAA;IACd,SAAS,IAAA;CACV"}
1
+ {"version":3,"file":"AmbushType.d.ts","sourceRoot":"","sources":["../../src/enums/AmbushType.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,oBAAY,UAAU;IACpB,cAAc,IAAA;IACd,SAAS,IAAA;CACV"}
@@ -1,4 +1,5 @@
1
1
  local ____exports = {}
2
+ --- This is used by the `POST_AMBUSH_STARTED` and `POST_AMBUSH_FINISHED` custom callbacks.
2
3
  ____exports.AmbushType = {}
3
4
  ____exports.AmbushType.CHALLENGE_ROOM = 0
4
5
  ____exports.AmbushType[____exports.AmbushType.CHALLENGE_ROOM] = "CHALLENGE_ROOM"
@@ -1,3 +1,4 @@
1
+ /** This is used by the `getRoomShapeCorners` helper function. */
1
2
  export declare enum CornerType {
2
3
  TOP_LEFT = 0,
3
4
  TOP_RIGHT = 1,
@@ -1 +1 @@
1
- {"version":3,"file":"CornerType.d.ts","sourceRoot":"","sources":["../../src/enums/CornerType.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,QAAQ,IAAA;IACR,SAAS,IAAA;IACT,WAAW,IAAA;IACX,YAAY,IAAA;CACb"}
1
+ {"version":3,"file":"CornerType.d.ts","sourceRoot":"","sources":["../../src/enums/CornerType.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,oBAAY,UAAU;IACpB,QAAQ,IAAA;IACR,SAAS,IAAA;IACT,WAAW,IAAA;IACX,YAAY,IAAA;CACb"}
@@ -1,4 +1,5 @@
1
1
  local ____exports = {}
2
+ --- This is used by the `getRoomShapeCorners` helper function.
2
3
  ____exports.CornerType = {}
3
4
  ____exports.CornerType.TOP_LEFT = 0
4
5
  ____exports.CornerType[____exports.CornerType.TOP_LEFT] = "TOP_LEFT"
@@ -1,3 +1,4 @@
1
+ /** This is used in the various pocket item helper functions. */
1
2
  export declare enum PocketItemType {
2
3
  EMPTY = 0,
3
4
  CARD = 1,
@@ -1 +1 @@
1
- {"version":3,"file":"PocketItemType.d.ts","sourceRoot":"","sources":["../../src/enums/PocketItemType.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,KAAK,IAAA;IACL,IAAI,IAAA;IACJ,IAAI,IAAA;IACJ,WAAW,IAAA;IACX,aAAa,IAAA;IACb,cAAc,IAAA;CACf"}
1
+ {"version":3,"file":"PocketItemType.d.ts","sourceRoot":"","sources":["../../src/enums/PocketItemType.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,oBAAY,cAAc;IACxB,KAAK,IAAA;IACL,IAAI,IAAA;IACJ,IAAI,IAAA;IACJ,WAAW,IAAA;IACX,aAAa,IAAA;IACb,cAAc,IAAA;CACf"}
@@ -1,4 +1,5 @@
1
1
  local ____exports = {}
2
+ --- This is used in the various pocket item helper functions.
2
3
  ____exports.PocketItemType = {}
3
4
  ____exports.PocketItemType.EMPTY = 0
4
5
  ____exports.PocketItemType[____exports.PocketItemType.EMPTY] = "EMPTY"
@@ -1,3 +1,4 @@
1
+ /** This is used in the various rock alt type helper functions. */
1
2
  export declare enum RockAltType {
2
3
  URN = 0,
3
4
  MUSHROOM = 1,
@@ -1 +1 @@
1
- {"version":3,"file":"RockAltType.d.ts","sourceRoot":"","sources":["../../src/enums/RockAltType.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,GAAG,IAAA;IACH,QAAQ,IAAA;IACR,KAAK,IAAA;IACL,KAAK,IAAA;IAEL;;;;OAIG;IACH,eAAe,IAAA;IAEf;;;;OAIG;IACH,YAAY,IAAA;CACb"}
1
+ {"version":3,"file":"RockAltType.d.ts","sourceRoot":"","sources":["../../src/enums/RockAltType.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,oBAAY,WAAW;IACrB,GAAG,IAAA;IACH,QAAQ,IAAA;IACR,KAAK,IAAA;IACL,KAAK,IAAA;IAEL;;;;OAIG;IACH,eAAe,IAAA;IAEf;;;;OAIG;IACH,YAAY,IAAA;CACb"}
@@ -1,4 +1,5 @@
1
1
  local ____exports = {}
2
+ --- This is used in the various rock alt type helper functions.
2
3
  ____exports.RockAltType = {}
3
4
  ____exports.RockAltType.URN = 0
4
5
  ____exports.RockAltType[____exports.RockAltType.URN] = "URN"
@@ -1,3 +1,4 @@
1
+ /** This is used with the `deepCopy` and `merge` functions. */
1
2
  export declare enum SerializationType {
2
3
  NONE = 0,
3
4
  SERIALIZE = 1,
@@ -1 +1 @@
1
- {"version":3,"file":"SerializationType.d.ts","sourceRoot":"","sources":["../../src/enums/SerializationType.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,IAAI,IAAA;IACJ,SAAS,IAAA;IACT,WAAW,IAAA;CACZ"}
1
+ {"version":3,"file":"SerializationType.d.ts","sourceRoot":"","sources":["../../src/enums/SerializationType.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,oBAAY,iBAAiB;IAC3B,IAAI,IAAA;IACJ,SAAS,IAAA;IACT,WAAW,IAAA;CACZ"}
@@ -1,4 +1,5 @@
1
1
  local ____exports = {}
2
+ --- This is used with the `deepCopy` and `merge` functions.
2
3
  ____exports.SerializationType = {}
3
4
  ____exports.SerializationType.NONE = 0
4
5
  ____exports.SerializationType[____exports.SerializationType.NONE] = "NONE"
@@ -1,3 +1,4 @@
1
+ /** This is used in the `POST_SLOT_DESTROYED` custom callback. */
1
2
  export declare enum SlotDestructionType {
2
3
  NORMAL = 0,
3
4
  COLLECTIBLE_PAYOUT = 1
@@ -1 +1 @@
1
- {"version":3,"file":"SlotDestructionType.d.ts","sourceRoot":"","sources":["../../src/enums/SlotDestructionType.ts"],"names":[],"mappings":"AAAA,oBAAY,mBAAmB;IAC7B,MAAM,IAAA;IACN,kBAAkB,IAAA;CACnB"}
1
+ {"version":3,"file":"SlotDestructionType.d.ts","sourceRoot":"","sources":["../../src/enums/SlotDestructionType.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,oBAAY,mBAAmB;IAC7B,MAAM,IAAA;IACN,kBAAkB,IAAA;CACnB"}
@@ -1,4 +1,5 @@
1
1
  local ____exports = {}
2
+ --- This is used in the `POST_SLOT_DESTROYED` custom callback.
2
3
  ____exports.SlotDestructionType = {}
3
4
  ____exports.SlotDestructionType.NORMAL = 0
4
5
  ____exports.SlotDestructionType[____exports.SlotDestructionType.NORMAL] = "NORMAL"
@@ -1,3 +1,3 @@
1
1
  import { CustomStage } from "../../interfaces/private/CustomStage";
2
- export declare function setBackdrop(customStage: CustomStage): void;
2
+ export declare function setCustomStageBackdrop(customStage: CustomStage): void;
3
3
  //# sourceMappingURL=backdrop.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"backdrop.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/backdrop.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AA2EnE,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAc1D"}
1
+ {"version":3,"file":"backdrop.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/backdrop.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AA2EnE,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAcrE"}
@@ -179,7 +179,7 @@ N_FLOOR_ANM2_LAYERS = {18, 19}
179
179
  BACKDROP_EFFECT_VARIANT = EffectVariant.LADDER
180
180
  BACKDROP_EFFECT_SUBTYPE = 101
181
181
  local BACKDROP_ROOM_TYPE_SET = __TS__New(Set, {RoomType.DEFAULT, RoomType.BOSS, RoomType.MINI_BOSS})
182
- function ____exports.setBackdrop(self, customStage)
182
+ function ____exports.setCustomStageBackdrop(self, customStage)
183
183
  local room = game:GetRoom()
184
184
  local roomType = room:GetType()
185
185
  local decorationSeed = room:GetDecorationSeed()
@@ -18,7 +18,7 @@ local removeFlag = ____flag.removeFlag
18
18
  local ____exports = require("features.saveDataManager.exports")
19
19
  local saveDataManager = ____exports.saveDataManager
20
20
  local ____backdrop = require("features.customStage.backdrop")
21
- local setBackdrop = ____backdrop.setBackdrop
21
+ local setCustomStageBackdrop = ____backdrop.setCustomStageBackdrop
22
22
  local ____customStageGridEntities = require("features.customStage.customStageGridEntities")
23
23
  local convertVanillaTrapdoors = ____customStageGridEntities.convertVanillaTrapdoors
24
24
  local removeUrnRewards = ____customStageGridEntities.removeUrnRewards
@@ -124,7 +124,7 @@ function postNewRoomReordered(self)
124
124
  if customStage == nil then
125
125
  return
126
126
  end
127
- setBackdrop(nil, customStage)
127
+ setCustomStageBackdrop(nil, customStage)
128
128
  setShadows(nil, customStage)
129
129
  playVersusScreenAnimation(nil, customStage)
130
130
  end
@@ -1,4 +1,10 @@
1
- import { CacheFlag } from "isaac-typescript-definitions";
1
+ import { CacheFlag, CollectibleType } from "isaac-typescript-definitions";
2
+ export declare function collectibleHasCacheFlag(collectibleType: CollectibleType, cacheFlag: CacheFlag): boolean;
3
+ /**
4
+ * Returns a set containing every collectible type with the given cache flag, including modded
5
+ * collectibles.
6
+ */
7
+ export declare function getCollectiblesForCacheFlag(cacheFlag: CacheFlag): Set<CollectibleType>;
2
8
  /**
3
9
  * Returns the starting stat that Isaac (the default character) starts with. For example, if you
4
10
  * pass this function `CacheFlag.DAMAGE`, it will return 3.5.
@@ -6,4 +12,20 @@ import { CacheFlag } from "isaac-typescript-definitions";
6
12
  * Note that the default fire delay is represented in the tear stat, not the `MaxFireDelay` value.
7
13
  */
8
14
  export declare function getDefaultPlayerStat(cacheFlag: CacheFlag): number | undefined;
15
+ /**
16
+ * Returns an array containing every collectible type that the player has that matches the provided
17
+ * CacheFlag.
18
+ *
19
+ * For example, if the cache flag is `CacheFlag.FLYING`, and the player has one Lord of the Pit and
20
+ * two Dead Doves, then this function would return:
21
+ *
22
+ * ```ts
23
+ * [
24
+ * CollectibleType.LORD_OF_THE_PIT,
25
+ * CollectibleType.DEAD_DOVE,
26
+ * CollectibleType.DEAD_DOVE,
27
+ * ]
28
+ * ```
29
+ */
30
+ export declare function getPlayerCollectiblesForCacheFlag(player: EntityPlayer, cacheFlag: CacheFlag): CollectibleType[];
9
31
  //# sourceMappingURL=cacheFlag.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cacheFlag.d.ts","sourceRoot":"","sources":["../../src/functions/cacheFlag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAE7E"}
1
+ {"version":3,"file":"cacheFlag.d.ts","sourceRoot":"","sources":["../../src/functions/cacheFlag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AA4B1E,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GACnB,OAAO,CAOT;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,eAAe,CAAC,CAYtB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAE7E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,GACnB,eAAe,EAAE,CAYnB"}
@@ -1,6 +1,56 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Map = ____lualib.Map
3
+ local __TS__New = ____lualib.__TS__New
4
+ local Set = ____lualib.Set
1
5
  local ____exports = {}
6
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
+ local CacheFlag = ____isaac_2Dtypescript_2Ddefinitions.CacheFlag
8
+ local ____cachedClasses = require("core.cachedClasses")
9
+ local itemConfig = ____cachedClasses.itemConfig
2
10
  local ____defaultPlayerStatMap = require("maps.defaultPlayerStatMap")
3
11
  local DEFAULT_PLAYER_STAT_MAP = ____defaultPlayerStatMap.DEFAULT_PLAYER_STAT_MAP
12
+ local ____collectibleSet = require("functions.collectibleSet")
13
+ local getCollectibleArray = ____collectibleSet.getCollectibleArray
14
+ local ____enums = require("functions.enums")
15
+ local getEnumValues = ____enums.getEnumValues
16
+ local ____flag = require("functions.flag")
17
+ local hasFlag = ____flag.hasFlag
18
+ local ____set = require("functions.set")
19
+ local copySet = ____set.copySet
20
+ local getSortedSetValues = ____set.getSortedSetValues
21
+ local ____utils = require("functions.utils")
22
+ local ____repeat = ____utils["repeat"]
23
+ function ____exports.collectibleHasCacheFlag(self, collectibleType, cacheFlag)
24
+ local itemConfigItem = itemConfig:GetCollectible(collectibleType)
25
+ if itemConfigItem == nil then
26
+ return false
27
+ end
28
+ return hasFlag(nil, itemConfigItem.CacheFlags, cacheFlag)
29
+ end
30
+ local CACHE_FLAG_TO_COLLECTIBLES_MAP = __TS__New(Map)
31
+ local function initCacheFlagMap(self)
32
+ for ____, cacheFlag in ipairs(getEnumValues(nil, CacheFlag)) do
33
+ local collectiblesSet = __TS__New(Set)
34
+ for ____, collectibleType in ipairs(getCollectibleArray(nil)) do
35
+ if ____exports.collectibleHasCacheFlag(nil, collectibleType, cacheFlag) then
36
+ collectiblesSet:add(collectibleType)
37
+ end
38
+ end
39
+ CACHE_FLAG_TO_COLLECTIBLES_MAP:set(cacheFlag, collectiblesSet)
40
+ end
41
+ end
42
+ --- Returns a set containing every collectible type with the given cache flag, including modded
43
+ -- collectibles.
44
+ function ____exports.getCollectiblesForCacheFlag(self, cacheFlag)
45
+ if CACHE_FLAG_TO_COLLECTIBLES_MAP.size == 0 then
46
+ initCacheFlagMap(nil)
47
+ end
48
+ local collectiblesSet = CACHE_FLAG_TO_COLLECTIBLES_MAP:get(cacheFlag)
49
+ if collectiblesSet == nil then
50
+ return __TS__New(Set)
51
+ end
52
+ return copySet(nil, collectiblesSet)
53
+ end
4
54
  --- Returns the starting stat that Isaac (the default character) starts with. For example, if you
5
55
  -- pass this function `CacheFlag.DAMAGE`, it will return 3.5.
6
56
  --
@@ -8,4 +58,32 @@ local DEFAULT_PLAYER_STAT_MAP = ____defaultPlayerStatMap.DEFAULT_PLAYER_STAT_MAP
8
58
  function ____exports.getDefaultPlayerStat(self, cacheFlag)
9
59
  return DEFAULT_PLAYER_STAT_MAP:get(cacheFlag)
10
60
  end
61
+ --- Returns an array containing every collectible type that the player has that matches the provided
62
+ -- CacheFlag.
63
+ --
64
+ -- For example, if the cache flag is `CacheFlag.FLYING`, and the player has one Lord of the Pit and
65
+ -- two Dead Doves, then this function would return:
66
+ --
67
+ -- ```ts
68
+ -- [
69
+ -- CollectibleType.LORD_OF_THE_PIT,
70
+ -- CollectibleType.DEAD_DOVE,
71
+ -- CollectibleType.DEAD_DOVE,
72
+ -- ]
73
+ -- ```
74
+ function ____exports.getPlayerCollectiblesForCacheFlag(self, player, cacheFlag)
75
+ local collectiblesForCacheFlag = ____exports.getCollectiblesForCacheFlag(nil, cacheFlag)
76
+ local playerCollectibles = {}
77
+ for ____, collectibleType in ipairs(getSortedSetValues(nil, collectiblesForCacheFlag)) do
78
+ local numCollectibles = player:GetCollectibleNum(collectibleType)
79
+ ____repeat(
80
+ nil,
81
+ numCollectibles,
82
+ function()
83
+ playerCollectibles[#playerCollectibles + 1] = collectibleType
84
+ end
85
+ )
86
+ end
87
+ return playerCollectibles
88
+ end
11
89
  return ____exports
@@ -9,8 +9,8 @@ local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
9
9
  local NullItemID = ____isaac_2Dtypescript_2Ddefinitions.NullItemID
10
10
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
11
11
  local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
12
- local ____collectibleCacheFlag = require("functions.collectibleCacheFlag")
13
- local getCollectiblesForCacheFlag = ____collectibleCacheFlag.getCollectiblesForCacheFlag
12
+ local ____cacheFlag = require("functions.cacheFlag")
13
+ local getCollectiblesForCacheFlag = ____cacheFlag.getCollectiblesForCacheFlag
14
14
  local ____set = require("functions.set")
15
15
  local copySet = ____set.copySet
16
16
  local deleteSetsFromSet = ____set.deleteSetsFromSet
@@ -11,7 +11,6 @@ export * from "./challenges";
11
11
  export * from "./characters";
12
12
  export * from "./charge";
13
13
  export * from "./chargeBar";
14
- export * from "./collectibleCacheFlag";
15
14
  export * from "./collectibles";
16
15
  export * from "./collectibleSet";
17
16
  export * from "./collectibleTag";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAA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.collectibleCacheFlag")
108
- for ____exportKey, ____exportValue in pairs(____export) do
109
- if ____exportKey ~= "default" then
110
- ____exports[____exportKey] = ____exportValue
111
- end
112
- end
113
- end
114
106
  do
115
107
  local ____export = require("functions.collectibles")
116
108
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -29,5 +29,8 @@ export declare function isMoveActionTriggeredOnAnyInput(): boolean;
29
29
  export declare function isShootAction(buttonAction: ButtonAction): boolean;
30
30
  export declare function isShootActionPressedOnAnyInput(): boolean;
31
31
  export declare function isShootActionTriggeredOnAnyInput(): boolean;
32
- export declare function keyboardToString(keyboard: Keyboard): string;
32
+ /**
33
+ * Helper function to get the string that would be typed if someone pressed the corresponding key.
34
+ */
35
+ export declare function keyboardToString(keyboard: Keyboard, uppercase: boolean): string | undefined;
33
36
  //# sourceMappingURL=input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/functions/input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EAEV,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAsCtC,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAOjE;AAED,wBAAgB,cAAc,IAAI,GAAG,CAAC,YAAY,CAAC,CAElD;AAED,wBAAgB,eAAe,IAAI,GAAG,CAAC,YAAY,CAAC,CAEnD;AAED,gGAAgG;AAChG,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAK7E;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,YAAY,GACzB,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,CAI9D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,OAA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AI1D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,GACjB,MAAM,GAAG,SAAS,CAQpB"}
@@ -8,6 +8,8 @@ local ButtonAction = ____isaac_2Dtypescript_2Ddefinitions.ButtonAction
8
8
  local Controller = ____isaac_2Dtypescript_2Ddefinitions.Controller
9
9
  local ControllerIndex = ____isaac_2Dtypescript_2Ddefinitions.ControllerIndex
10
10
  local Keyboard = ____isaac_2Dtypescript_2Ddefinitions.Keyboard
11
+ local ____keyboardToString = require("maps.keyboardToString")
12
+ local KEYBOARD_TO_STRING = ____keyboardToString.KEYBOARD_TO_STRING
11
13
  local ____enums = require("functions.enums")
12
14
  local getEnumValues = ____enums.getEnumValues
13
15
  local ____set = require("functions.set")
@@ -109,7 +111,13 @@ function ____exports.isShootActionTriggeredOnAnyInput(self)
109
111
  function(____, shootAction) return ____exports.isActionTriggeredOnAnyInput(nil, shootAction) end
110
112
  )
111
113
  end
112
- function ____exports.keyboardToString(self, keyboard)
113
- return Keyboard[keyboard] or "unknown"
114
+ --- Helper function to get the string that would be typed if someone pressed the corresponding key.
115
+ function ____exports.keyboardToString(self, keyboard, uppercase)
116
+ local tuple = KEYBOARD_TO_STRING:get(keyboard)
117
+ if tuple == nil then
118
+ return nil
119
+ end
120
+ local lowercaseCharacter, uppercaseCharacter = table.unpack(tuple)
121
+ return uppercase and uppercaseCharacter or lowercaseCharacter
114
122
  end
115
123
  return ____exports
@@ -1 +1 @@
1
- {"version":3,"file":"rockAlt.d.ts","sourceRoot":"","sources":["../../src/functions/rockAlt.ts"],"names":[],"mappings":";;;AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAgCnD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAK5C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,WAAW,EACxB,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,OAAO,CA4BT"}
1
+ {"version":3,"file":"rockAlt.d.ts","sourceRoot":"","sources":["../../src/functions/rockAlt.ts"],"names":[],"mappings":";;;AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAuCnD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAK5C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,WAAW,EACxB,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,OAAO,CA4BT"}
@@ -1,5 +1,5 @@
1
1
  local ____exports = {}
2
- local spawnRockAltRewardUrn, spawnRockAltRewardMushroom, spawnRockAltRewardSkull, spawnRockAltRewardPolyp, spawnRockAltRewardBucketDownpour, spawnRockAltRewardBucketDross, ROCK_ALT_CHANCES, COIN_VELOCITY_MULTIPLIER, POLYP_PROJECTILE_SPEED, POLYP_NUM_PROJECTILES
2
+ local spawnRockAltRewardUrn, spawnRockAltRewardMushroom, spawnRockAltRewardSkull, spawnRockAltRewardPolyp, spawnRockAltRewardBucketDownpour, spawnRockAltRewardBucketDross, ROCK_ALT_CHANCES, COIN_VELOCITY_MULTIPLIER, FIND_FREE_INITIAL_STEP, FART_RADIUS, POLYP_PROJECTILE_SPEED, POLYP_NUM_PROJECTILES
3
3
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
4
4
  local Card = ____isaac_2Dtypescript_2Ddefinitions.Card
5
5
  local CoinSubType = ____isaac_2Dtypescript_2Ddefinitions.CoinSubType
@@ -45,6 +45,7 @@ local ____repeat = ____utils["repeat"]
45
45
  local ____vector = require("functions.vector")
46
46
  local getRandomVector = ____vector.getRandomVector
47
47
  function spawnRockAltRewardUrn(self, position, rng)
48
+ local room = game:GetRoom()
48
49
  local chance = getRandom(nil, rng)
49
50
  local totalChance = 0
50
51
  totalChance = totalChance + ROCK_ALT_CHANCES.NOTHING
@@ -88,14 +89,11 @@ function spawnRockAltRewardUrn(self, position, rng)
88
89
  end
89
90
  local numEnemiesChance = getRandom(nil, rng)
90
91
  local numEnemies = numEnemiesChance < 0.5 and 1 or 2
91
- local length = DISTANCE_OF_GRID_TILE * 3
92
92
  ____repeat(
93
93
  nil,
94
94
  numEnemies,
95
95
  function()
96
- local randomVector = getRandomVector(nil, rng)
97
- local offset = randomVector * length
98
- local targetPos = position + offset
96
+ local targetPos = room:FindFreePickupSpawnPosition(position, FIND_FREE_INITIAL_STEP)
99
97
  EntityNPC.ThrowSpider(
100
98
  position,
101
99
  nil,
@@ -156,13 +154,8 @@ function spawnRockAltRewardMushroom(self, position, rng)
156
154
  end
157
155
  return false
158
156
  end
159
- spawnEffectWithSeed(
160
- nil,
161
- EffectVariant.FART,
162
- 0,
163
- position,
164
- rng
165
- )
157
+ game:Fart(position)
158
+ game:ButterBeanFart(position, FART_RADIUS, nil)
166
159
  return true
167
160
  end
168
161
  function spawnRockAltRewardSkull(self, position, rng)
@@ -266,6 +259,7 @@ function spawnRockAltRewardPolyp(self, position, rng)
266
259
  return true
267
260
  end
268
261
  function spawnRockAltRewardBucketDownpour(self, position, rng)
262
+ local room = game:GetRoom()
269
263
  local chance = getRandom(nil, rng)
270
264
  local totalChance = 0
271
265
  totalChance = totalChance + ROCK_ALT_CHANCES.NOTHING
@@ -311,14 +305,11 @@ function spawnRockAltRewardBucketDownpour(self, position, rng)
311
305
  local entityType = enemiesChance < 0.5 and EntityType.SPIDER or EntityType.SMALL_LEECH
312
306
  local numEnemiesChance = getRandom(nil, rng)
313
307
  local numEnemies = numEnemiesChance < 0.5 and 1 or 2
314
- local jumpDistance = DISTANCE_OF_GRID_TILE * 3
315
308
  ____repeat(
316
309
  nil,
317
310
  numEnemies,
318
311
  function()
319
- local randomVector = getRandomVector(nil, rng)
320
- local offset = randomVector * jumpDistance
321
- local targetPos = position + offset
312
+ local targetPos = room:FindFreePickupSpawnPosition(position, FIND_FREE_INITIAL_STEP)
322
313
  local spider = EntityNPC.ThrowSpider(
323
314
  position,
324
315
  nil,
@@ -334,6 +325,7 @@ function spawnRockAltRewardBucketDownpour(self, position, rng)
334
325
  return true
335
326
  end
336
327
  function spawnRockAltRewardBucketDross(self, position, rng)
328
+ local room = game:GetRoom()
337
329
  local chance = getRandom(nil, rng)
338
330
  local totalChance = 0
339
331
  totalChance = totalChance + ROCK_ALT_CHANCES.NOTHING
@@ -379,14 +371,11 @@ function spawnRockAltRewardBucketDross(self, position, rng)
379
371
  local entityType = enemiesChance < 0.5 and EntityType.DRIP or EntityType.SMALL_LEECH
380
372
  local numEnemiesChance = getRandom(nil, rng)
381
373
  local numEnemies = numEnemiesChance < 0.5 and 1 or 2
382
- local jumpDistance = DISTANCE_OF_GRID_TILE * 3
383
374
  ____repeat(
384
375
  nil,
385
376
  numEnemies,
386
377
  function()
387
- local randomVector = getRandomVector(nil, rng)
388
- local offset = randomVector * jumpDistance
389
- local targetPos = position + offset
378
+ local targetPos = room:FindFreePickupSpawnPosition(position, FIND_FREE_INITIAL_STEP)
390
379
  local spider = EntityNPC.ThrowSpider(
391
380
  position,
392
381
  nil,
@@ -401,6 +390,8 @@ function spawnRockAltRewardBucketDross(self, position, rng)
401
390
  end
402
391
  ROCK_ALT_CHANCES = {NOTHING = 0.68, BASIC_DROP = 0.0967, TRINKET = 0.025, COLLECTIBLE = 0.005}
403
392
  COIN_VELOCITY_MULTIPLIER = 2
393
+ FIND_FREE_INITIAL_STEP = 70
394
+ FART_RADIUS = DISTANCE_OF_GRID_TILE * 3
404
395
  POLYP_PROJECTILE_SPEED = 10
405
396
  POLYP_NUM_PROJECTILES = 6
406
397
  --- Helper function to get the alternate rock type (i.e. urn, mushroom, etc.) that the current room
@@ -1 +1 @@
1
- {"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../src/functions/rooms.ts"],"names":[],"mappings":"AAA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;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CASrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAWhE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAKtC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAMxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,OAAO,CAcxE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,+DAA+D;AAC/D,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
@@ -382,6 +382,7 @@ end
382
382
  --- Helper function to set the backdrop of the current room.
383
383
  function ____exports.setBackdrop(self, backdropType)
384
384
  game:ShowHallucination(0, backdropType)
385
+ sfxManager:Stop(SoundEffect.DEATH_CARD)
385
386
  end
386
387
  --- Helper function to convert an uncleared room to a cleared room in the `POST_NEW_ROOM` callback.
387
388
  -- This is useful because if enemies are removed in this callback, a room drop will be awarded and
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * A collection of the four sprites necessary in order to render a charge bar.
5
5
  *
6
- * Used in the `newChargeBarSprites` and related helper functions.
6
+ * This is used in the `newChargeBarSprites` and related helper functions.
7
7
  */
8
8
  export interface ChargeBarSprites {
9
9
  back: Sprite;
@@ -1,5 +1,10 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  import { CornerType } from "../enums/CornerType";
3
+ /**
4
+ * An interface representing a corner in the room.
5
+ *
6
+ * This is used by the `getRoomShapeCorners` helper function.
7
+ */
3
8
  export interface Corner {
4
9
  readonly type: CornerType;
5
10
  readonly position: Readonly<Vector>;
@@ -1 +1 @@
1
- {"version":3,"file":"Corner.d.ts","sourceRoot":"","sources":["../../src/interfaces/Corner.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACrC"}
1
+ {"version":3,"file":"Corner.d.ts","sourceRoot":"","sources":["../../src/interfaces/Corner.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACrC"}