isaacscript-common 2.1.0 → 2.3.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.
Files changed (87) hide show
  1. package/README.md +1 -1
  2. package/classes/DefaultMap.d.ts +1 -1
  3. package/classes/ModUpgraded.d.ts +8 -2
  4. package/constants.d.ts +5 -5
  5. package/constants.lua +1 -1
  6. package/{constantsMax.d.ts → constantsFirstLast.d.ts} +0 -0
  7. package/{constantsMax.lua → constantsFirstLast.lua} +0 -0
  8. package/enums/HealthType.d.ts +2 -2
  9. package/enums/ModCallbackCustom.d.ts +753 -2
  10. package/features/debugDisplay/exports.d.ts +36 -36
  11. package/features/deployJSONRoom.d.ts +1 -1
  12. package/features/extraConsoleCommands/commandsDisplay.d.ts +18 -18
  13. package/features/extraConsoleCommands/init.d.ts +3 -2
  14. package/features/extraConsoleCommands/init.lua +76 -76
  15. package/features/extraConsoleCommands/{commands.d.ts → listCommands.d.ts} +17 -17
  16. package/features/extraConsoleCommands/{commands.lua → listCommands.lua} +9 -9
  17. package/features/{isPonyActive.d.ts → ponyDetection.d.ts} +0 -0
  18. package/features/{isPonyActive.lua → ponyDetection.lua} +2 -2
  19. package/features/{preventCollectibleRotate.d.ts → preventCollectibleRotation.d.ts} +1 -1
  20. package/features/{preventCollectibleRotate.lua → preventCollectibleRotation.lua} +3 -3
  21. package/features/saveDataManager/exports.d.ts +13 -10
  22. package/features/saveDataManager/load.d.ts +1 -1
  23. package/features/saveDataManager/main.d.ts +1 -1
  24. package/features/saveDataManager/maps.d.ts +1 -1
  25. package/features/saveDataManager/save.d.ts +1 -1
  26. package/functions/cards.lua +5 -5
  27. package/functions/character.lua +2 -2
  28. package/functions/chargeBar.d.ts +1 -1
  29. package/functions/collectibleCacheFlag.d.ts +4 -4
  30. package/functions/collectibleSet.lua +2 -2
  31. package/functions/collectibles.lua +5 -5
  32. package/functions/enums.d.ts +3 -3
  33. package/functions/jsonRoom.d.ts +1 -1
  34. package/functions/language.d.ts +7 -1
  35. package/functions/language.lua +2 -11
  36. package/functions/pills.lua +9 -9
  37. package/functions/playerDataStructures.d.ts +51 -0
  38. package/functions/playerDataStructures.lua +4 -0
  39. package/functions/playerHealth.d.ts +1 -1
  40. package/functions/pocketItems.d.ts +1 -1
  41. package/functions/run.lua +2 -2
  42. package/functions/spawnCollectible.lua +3 -3
  43. package/functions/trinketGive.d.ts +1 -1
  44. package/functions/trinkets.lua +5 -5
  45. package/functions/utils.d.ts +2 -2
  46. package/index.d.ts +14 -13
  47. package/index.lua +12 -12
  48. package/initFeatures.lua +6 -6
  49. package/{types → interfaces}/AddCallbackParameterCustom.d.ts +0 -0
  50. package/{types → interfaces}/AddCallbackParameterCustom.lua +0 -0
  51. package/{types → interfaces}/ChargeBarSprites.d.ts +0 -0
  52. package/{types → interfaces}/ChargeBarSprites.lua +0 -0
  53. package/{types → interfaces}/JSONDoor.d.ts +1 -0
  54. package/{types → interfaces}/JSONDoor.lua +0 -0
  55. package/{types → interfaces}/JSONEntity.d.ts +1 -0
  56. package/{types → interfaces}/JSONEntity.lua +0 -0
  57. package/{types → interfaces}/JSONRoom.d.ts +1 -5
  58. package/{types → interfaces}/JSONRoom.lua +0 -0
  59. package/{types → interfaces}/JSONRooms.d.ts +0 -0
  60. package/{types → interfaces}/JSONRooms.lua +0 -0
  61. package/{types → interfaces}/JSONSpawn.d.ts +1 -0
  62. package/{types → interfaces}/JSONSpawn.lua +0 -0
  63. package/{types → interfaces}/PlayerHealth.d.ts +1 -0
  64. package/{types → interfaces}/PlayerHealth.lua +0 -0
  65. package/{types → interfaces}/PocketItemDescription.d.ts +1 -0
  66. package/{types → interfaces}/PocketItemDescription.lua +0 -0
  67. package/interfaces/SaveData.d.ts +29 -0
  68. package/{types → interfaces}/SaveData.lua +0 -0
  69. package/{types → interfaces}/TrinketSituation.d.ts +1 -0
  70. package/{types → interfaces}/TrinketSituation.lua +0 -0
  71. package/{types → interfaces}/private/TSTLClassMetatable.d.ts +0 -0
  72. package/{types → interfaces}/private/TSTLClassMetatable.lua +0 -0
  73. package/maps/cardMap.lua +85 -85
  74. package/maps/characterMap.lua +58 -58
  75. package/maps/pillEffectMap.lua +39 -39
  76. package/maps/roomTypeMap.lua +12 -12
  77. package/objects/LRoomShapeToRectangles.d.ts +1 -1
  78. package/objects/callbackRegisterFunctions.d.ts +1 -1
  79. package/objects/colors.d.ts +8 -8
  80. package/objects/languageNames.d.ts +4 -0
  81. package/objects/languageNames.lua +13 -0
  82. package/objects/roomTypeNames.lua +1 -1
  83. package/package.json +3 -3
  84. package/types/PickingUpItem.d.ts +12 -2
  85. package/types/PickingUpItem.lua +3 -0
  86. package/upgradeMod.d.ts +2 -1
  87. package/types/SaveData.d.ts +0 -28
@@ -27,7 +27,7 @@ export declare function blackMarket(): void;
27
27
  * charges. (You can use negative numbers to remove charges.)
28
28
  */
29
29
  export declare function bloodCharges(params: string): void;
30
- /** Alias for the "blackmarket" command. */
30
+ /** Alias for the "blackMarket" command. */
31
31
  export declare function bm(): void;
32
32
  /**
33
33
  * Gives a bomb. Provide a number to give a custom amount of bombs. (You can use negative numbers to
@@ -63,7 +63,7 @@ export declare function brokenHearts(params: string): void;
63
63
  export declare function card(params: string): void;
64
64
  /** Spawns every card on the ground, starting at the top-left-most tile. */
65
65
  export declare function cards(): void;
66
- /** Alias for the "chaoscardtears" command. */
66
+ /** Alias for the "chaosCardTears" command. */
67
67
  export declare function cc(): void;
68
68
  /** Toggles Chaos Card tears. Useful for killing enemies very fast without using "debug 10". */
69
69
  export declare function chaosCardTears(): void;
@@ -76,7 +76,7 @@ export declare function chaosCardTears(): void;
76
76
  * - character ta - Restarts as Tainted Azazel.
77
77
  */
78
78
  export declare function characterCommand(params: string): void;
79
- /** Alias for the "addcharges" command. */
79
+ /** Alias for the "addCharges" command. */
80
80
  export declare function charge(params: string): void;
81
81
  /** Warps to the first Clean Bedroom on the floor. */
82
82
  export declare function cleanBedroom(): void;
@@ -115,16 +115,16 @@ export declare function down(params: string): void;
115
115
  export declare function dungeon(): void;
116
116
  /** Logs the player's current temporary effects to the "log.txt" file. */
117
117
  export declare function effects(): void;
118
- /** Alias for the "eternalhearts" command. */
118
+ /** Alias for the "eternalHearts" command. */
119
119
  export declare function eh(params: string): void;
120
- /** Alias for the "iamerror" command. */
120
+ /** Alias for the "iAmError" command. */
121
121
  export declare function error(): void;
122
122
  /**
123
123
  * Gives an eternal heart. Provide a number to give a custom amount of hearts. (You can use negative
124
124
  * numbers to remove hearts.)
125
125
  */
126
126
  export declare function eternalHearts(params: string): void;
127
- /** Alias for the "startingroom" command. */
127
+ /** Alias for the "startingRoom" command. */
128
128
  export declare function fool(): void;
129
129
  /** Prints the current position of all players. */
130
130
  export declare function getPosition(): void;
@@ -133,11 +133,11 @@ export declare function getPosition(): void;
133
133
  * numbers to remove bombs.)
134
134
  */
135
135
  export declare function gigaBomb(params: string): void;
136
- /** Alias for the "goldenbomb" command. */
136
+ /** Alias for the "goldenBomb" command. */
137
137
  export declare function goldBomb(): void;
138
- /** Alias for the "goldenhearts" command. */
138
+ /** Alias for the "goldenHearts" command. */
139
139
  export declare function goldHearts(params: string): void;
140
- /** Alias for the "goldenkey" command. */
140
+ /** Alias for the "goldenKey" command. */
141
141
  export declare function goldKey(): void;
142
142
  /** Gives the player a golden bomb. */
143
143
  export declare function goldenBomb(): void;
@@ -184,7 +184,7 @@ export declare function library(): void;
184
184
  * `EntityType`.
185
185
  *
186
186
  * By default, this command will exclude background effects. If that is not desired, use the
187
- * "listall" command instead.
187
+ * "listAll" command instead.
188
188
  */
189
189
  export declare function list(params: string): void;
190
190
  /**
@@ -196,7 +196,7 @@ export declare function listAll(params: string): void;
196
196
  * Logs the grid entities in the room to the "log.txt" file. Provide a number to only log that
197
197
  * specific `GridEntityType`.
198
198
  *
199
- * By default, this command will exclude walls. If that is not desired, use the "listgridall"
199
+ * By default, this command will exclude walls. If that is not desired, use the "listGridAll"
200
200
  * command instead.
201
201
  */
202
202
  export declare function listGrid(params: string): void;
@@ -216,11 +216,11 @@ export declare function map(): void;
216
216
  * use negative numbers to remove heart containers.)
217
217
  */
218
218
  export declare function maxHearts(params: string): void;
219
- /** Alias for the "maxhearts" command. */
219
+ /** Alias for the "maxHearts" command. */
220
220
  export declare function mh(params: string): void;
221
221
  /** Warps to the first Miniboss Room on the floor. */
222
222
  export declare function miniboss(): void;
223
- /** Alias for the "disablecurses" command. */
223
+ /** Alias for the "disableCurses" command. */
224
224
  export declare function noCurses(): void;
225
225
  /** Sets every NPC in the room to 1 HP. */
226
226
  export declare function oneHP(): void;
@@ -247,11 +247,11 @@ export declare function pocket(params: string): void;
247
247
  * amount of charges. (You can use negative numbers to remove charges.)
248
248
  */
249
249
  export declare function poopMana(params: string): void;
250
- /** Alias for the "getposition" command. */
250
+ /** Alias for the "getPosition" command. */
251
251
  export declare function positionCommand(): void;
252
252
  /** Alias for the "hearts" command. */
253
253
  export declare function redHearts(params: string): void;
254
- /** Alias for the "redhearts" command. */
254
+ /** Alias for the "redHearts" command. */
255
255
  export declare function rh(params: string): void;
256
256
  /** Moves the player 0.5 units right. Provide a number to move a custom amount of units. */
257
257
  export declare function right(params: string): void;
@@ -287,10 +287,10 @@ export declare function setCharges(params: string): void;
287
287
  * Moves the first player to the specified position.
288
288
  *
289
289
  * For example:
290
- * - setposition 100 50
290
+ * - setPosition 100 50
291
291
  */
292
292
  export declare function setPosition(params: string): void;
293
- /** Alias for the "soulhearts" command. */
293
+ /** Alias for the "soulHearts" command. */
294
294
  export declare function sh(params: string): void;
295
295
  /** Warps to the first shop on the floor. */
296
296
  export declare function shop(): void;
@@ -25,13 +25,13 @@ local FIRST_STAGE = ____constants.FIRST_STAGE
25
25
  local LAST_ROOM_TYPE = ____constants.LAST_ROOM_TYPE
26
26
  local LAST_STAGE = ____constants.LAST_STAGE
27
27
  local MAX_LEVEL_GRID_INDEX = ____constants.MAX_LEVEL_GRID_INDEX
28
- local ____constantsMax = require("constantsMax")
29
- local FIRST_CARD = ____constantsMax.FIRST_CARD
30
- local FIRST_CHARACTER = ____constantsMax.FIRST_CHARACTER
31
- local FIRST_PILL_EFFECT = ____constantsMax.FIRST_PILL_EFFECT
32
- local LAST_CARD = ____constantsMax.LAST_CARD
33
- local LAST_PILL_EFFECT = ____constantsMax.LAST_PILL_EFFECT
34
- local LAST_VANILLA_CHARACTER = ____constantsMax.LAST_VANILLA_CHARACTER
28
+ local ____constantsFirstLast = require("constantsFirstLast")
29
+ local FIRST_CARD = ____constantsFirstLast.FIRST_CARD
30
+ local FIRST_CHARACTER = ____constantsFirstLast.FIRST_CHARACTER
31
+ local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
32
+ local LAST_CARD = ____constantsFirstLast.LAST_CARD
33
+ local LAST_PILL_EFFECT = ____constantsFirstLast.LAST_PILL_EFFECT
34
+ local LAST_VANILLA_CHARACTER = ____constantsFirstLast.LAST_VANILLA_CHARACTER
35
35
  local ____HealthType = require("enums.HealthType")
36
36
  local HealthType = ____HealthType.HealthType
37
37
  local ____cards = require("functions.cards")
@@ -779,12 +779,12 @@ function ____exports.setCharges(self, params)
779
779
  end
780
780
  function ____exports.setPosition(self, params)
781
781
  if params == "" then
782
- printConsole(nil, "You must specify a position. (e.g. \"setposition 100 50\")")
782
+ printConsole(nil, "You must specify a position. (e.g. \"setPosition 100 50\")")
783
783
  return
784
784
  end
785
785
  local args = __TS__StringSplit(params, " ")
786
786
  if #args ~= 2 then
787
- printConsole(nil, "You must specify a position. (e.g. \"setposition 100 50\")")
787
+ printConsole(nil, "You must specify a position. (e.g. \"setPosition 100 50\")")
788
788
  return
789
789
  end
790
790
  local xString, yString = table.unpack(args)
@@ -38,8 +38,8 @@ end
38
38
  local FEATURE_NAME = "pony activation detector"
39
39
  FLAGS_WHEN_PONY_IS_ACTIVE = {EntityFlag.NO_KNOCKBACK, EntityFlag.NO_PHYSICS_KNOCKBACK, EntityFlag.NO_DAMAGE_BLINK}
40
40
  v = {run = {playersIsPonyActive = __TS__New(Set)}}
41
- function ____exports.isPonyActiveInit(self, mod)
42
- saveDataManager(nil, "isPonyActive", v)
41
+ function ____exports.ponyDetectionInit(self, mod)
42
+ saveDataManager(nil, "ponyDetection", v)
43
43
  mod:AddCallbackCustom(ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, postPEffectUpdateReordered)
44
44
  end
45
45
  function ____exports.isPonyActive(self, player)
@@ -8,4 +8,4 @@ import { CollectibleType } from "isaac-typescript-definitions";
8
8
  * It is required to pass the intended collectible type to this function since it is possible for
9
9
  * collectibles to rotate on the first frame that they are spawned.
10
10
  */
11
- export declare function preventCollectibleRotate(collectible: EntityPickup, collectibleType: CollectibleType): void;
11
+ export declare function preventCollectibleRotation(collectible: EntityPickup, collectibleType: CollectibleType): void;
@@ -40,12 +40,12 @@ function getMapIndex(self, collectible)
40
40
  end
41
41
  local FEATURE_NAME = "prevent collectible rotation"
42
42
  v = {room = {trackedCollectibles = __TS__New(Map)}}
43
- function ____exports.preventCollectibleRotateInit(self, mod)
44
- saveDataManager(nil, "preventCollectibleRotate", v)
43
+ function ____exports.preventCollectibleRotationInit(self, mod)
44
+ saveDataManager(nil, "preventCollectibleRotation", v)
45
45
  mod:AddCallback(ModCallback.POST_USE_CARD, useCardSoulOfIsaac, Card.SOUL_ISAAC)
46
46
  mod:AddCallback(ModCallback.POST_PICKUP_UPDATE, postPickupUpdateCollectible, PickupVariant.COLLECTIBLE)
47
47
  end
48
- function ____exports.preventCollectibleRotate(self, collectible, collectibleType)
48
+ function ____exports.preventCollectibleRotation(self, collectible, collectibleType)
49
49
  errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
50
50
  if not isCollectible(nil, collectible) then
51
51
  local entityID = getEntityID(nil, collectible)
@@ -1,4 +1,4 @@
1
- import { SaveData } from "../../types/SaveData";
1
+ import { SaveData } from "../../interfaces/SaveData";
2
2
  /**
3
3
  * This is the entry point to the save data manager, a system which provides two major features:
4
4
  *
@@ -36,7 +36,7 @@ import { SaveData } from "../../types/SaveData";
36
36
  *
37
37
  * // These variables are reset at the beginning of every room.
38
38
  * room: {
39
- * foo2: 0,
39
+ * foo4: 0,
40
40
  * },
41
41
  * };
42
42
  * // Every child object is optional; only create the ones that you need.
@@ -50,7 +50,7 @@ import { SaveData } from "../../types/SaveData";
50
50
  * // Elsewhere in the file, use your variables.
51
51
  * function feature1Function() {
52
52
  * if (v.run.foo1 > 0) {
53
- * // TODO
53
+ * // Insert code here.
54
54
  * }
55
55
  * }
56
56
  * ```
@@ -59,7 +59,9 @@ import { SaveData } from "../../types/SaveData";
59
59
  * can possibly run).
60
60
  * - Save data is recorded to disk in the `PRE_GAME_EXIT` callback.
61
61
  *
62
- * Note that before using the save data manager, you must call the `upgradeMod` function.
62
+ * Note that before using the save data manager, you must call the `upgradeMod` function. (Upgrade
63
+ * your mod before registering any of your own callbacks so that the save data manager will run
64
+ * before any of your code does.)
63
65
  *
64
66
  * If you want the save data manager to load data before the `POST_PLAYER_INIT` callback (i.e. in
65
67
  * the main menu), then you should explicitly call the `saveDataManagerLoad` function. (The save
@@ -77,10 +79,10 @@ import { SaveData } from "../../types/SaveData";
77
79
  * @param conditionalFunc An optional function to run upon saving this key to disk. For example,
78
80
  * this allows features to only save data to disk if the feature is enabled.
79
81
  * Specify a value of `() => false` to completely disable saving this feature
80
- * to disk. This is useful if you are using data that is not serializable, or
81
- * you want to use the save data manager to automatically reset variables on
82
- * run/level/room, but not clutter the the "save#.dat" file with unnecessary
83
- * keys.
82
+ * to disk. Disabling saving to disk is useful if you are using data that is
83
+ * not serializable. Alternatively, it could be useful if you want to use the
84
+ * save data manager to automatically reset variables on run/level/room, but
85
+ * not clutter the the "save#.dat" file with unnecessary keys.
84
86
  */
85
87
  export declare function saveDataManager(key: string, v: SaveData, conditionalFunc?: () => boolean): void;
86
88
  /**
@@ -88,7 +90,8 @@ export declare function saveDataManager(key: string, v: SaveData, conditionalFun
88
90
  * when a new run is started). Use this function to explicitly force the save data manager to load
89
91
  * all of its variables from disk immediately.
90
92
  *
91
- * Note that doing this will overwrite current data, which can potentially result in lost state.
93
+ * Obviously, doing this will overwrite the current data, so using this function can potentially
94
+ * result in lost state.
92
95
  */
93
96
  export declare function saveDataManagerLoad(): void;
94
97
  /**
@@ -112,7 +115,7 @@ export declare function saveDataManagerSetGlobal(): void;
112
115
  *
113
116
  * For example:
114
117
  *
115
- * ```
118
+ * ```ts
116
119
  * const v = {
117
120
  * room: {
118
121
  * foo: 123,
@@ -1,4 +1,4 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  /// <reference types="typescript-to-lua/language-extensions" />
3
- import { SaveData } from "../../types/SaveData";
3
+ import { SaveData } from "../../interfaces/SaveData";
4
4
  export declare function loadFromDisk(mod: Mod, oldSaveData: LuaTable<string, SaveData>): void;
@@ -1,3 +1,3 @@
1
1
  import { SaveDataKey } from "../../enums/private/SaveDataKey";
2
- import { SaveData } from "../../types/SaveData";
2
+ import { SaveData } from "../../interfaces/SaveData";
3
3
  export declare function restoreDefaultSaveData(subscriberName: string, saveData: SaveData, saveDataKey: SaveDataKey): void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="typescript-to-lua/language-extensions" />
2
- import { SaveData } from "../../types/SaveData";
2
+ import { SaveData } from "../../interfaces/SaveData";
3
3
  /**
4
4
  * The save data map is indexed by subscriber name. We use Lua tables instead of TypeScriptToLua
5
5
  * Maps for the master map so that we can access the variables via the in-game console when
@@ -1,4 +1,4 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  /// <reference types="typescript-to-lua/language-extensions" />
3
- import { SaveData } from "../../types/SaveData";
3
+ import { SaveData } from "../../interfaces/SaveData";
4
4
  export declare function saveToDisk(mod: Mod, saveDataMap: LuaTable<string, SaveData>, saveDataConditionalFuncMap: Map<string, () => boolean>): void;
@@ -10,11 +10,11 @@ local Card = ____isaac_2Dtypescript_2Ddefinitions.Card
10
10
  local ItemConfigCardType = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigCardType
11
11
  local ____cachedClasses = require("cachedClasses")
12
12
  local itemConfig = ____cachedClasses.itemConfig
13
- local ____constantsMax = require("constantsMax")
14
- local FIRST_CARD = ____constantsMax.FIRST_CARD
15
- local FIRST_MODDED_CARD = ____constantsMax.FIRST_MODDED_CARD
16
- local LAST_CARD = ____constantsMax.LAST_CARD
17
- local MAX_VANILLA_CARD = ____constantsMax.MAX_VANILLA_CARD
13
+ local ____constantsFirstLast = require("constantsFirstLast")
14
+ local FIRST_CARD = ____constantsFirstLast.FIRST_CARD
15
+ local FIRST_MODDED_CARD = ____constantsFirstLast.FIRST_MODDED_CARD
16
+ local LAST_CARD = ____constantsFirstLast.LAST_CARD
17
+ local MAX_VANILLA_CARD = ____constantsFirstLast.MAX_VANILLA_CARD
18
18
  local ____cardDescriptions = require("objects.cardDescriptions")
19
19
  local CARD_DESCRIPTIONS = ____cardDescriptions.CARD_DESCRIPTIONS
20
20
  local DEFAULT_CARD_DESCRIPTION = ____cardDescriptions.DEFAULT_CARD_DESCRIPTION
@@ -1,8 +1,8 @@
1
1
  local ____exports = {}
2
2
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
3
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
4
- local ____constantsMax = require("constantsMax")
5
- local LAST_VANILLA_CHARACTER = ____constantsMax.LAST_VANILLA_CHARACTER
4
+ local ____constantsFirstLast = require("constantsFirstLast")
5
+ local LAST_VANILLA_CHARACTER = ____constantsFirstLast.LAST_VANILLA_CHARACTER
6
6
  local ____characterNames = require("objects.characterNames")
7
7
  local CHARACTER_NAMES = ____characterNames.CHARACTER_NAMES
8
8
  local DEFAULT_CHARACTER_NAME = ____characterNames.DEFAULT_CHARACTER_NAME
@@ -1,5 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
- import { ChargeBarSprites } from "../types/ChargeBarSprites";
2
+ import { ChargeBarSprites } from "../interfaces/ChargeBarSprites";
3
3
  /**
4
4
  * Constructor for a `ChargeBarSprites` object. For more information, see the `renderChargeBar`
5
5
  * helper function.
@@ -9,14 +9,14 @@ export declare function getCollectiblesForCacheFlag(cacheFlag: CacheFlag): Set<C
9
9
  * Returns an array containing every collectible type that the player has that matches the provided
10
10
  * CacheFlag.
11
11
  *
12
- * For example, if a player has one Lord of the Pit and two Transcendences, then this function would
13
- * return:
12
+ * For example, if the cache flag is `CacheFlag.FLYING`, and the player has one Lord of the Pit and
13
+ * two Dead Doves, then this function would return:
14
14
  *
15
15
  * ```ts
16
16
  * [
17
17
  * CollectibleType.LORD_OF_THE_PIT,
18
- * CollectibleType.TRANSCENDENCE,
19
- * CollectibleType.TRANSCENDENCE,
18
+ * CollectibleType.DEAD_DOVE,
19
+ * CollectibleType.DEAD_DOVE,
20
20
  * ]
21
21
  * ```
22
22
  */
@@ -4,8 +4,8 @@ local __TS__New = ____lualib.__TS__New
4
4
  local ____exports = {}
5
5
  local ____cachedClasses = require("cachedClasses")
6
6
  local itemConfig = ____cachedClasses.itemConfig
7
- local ____constantsMax = require("constantsMax")
8
- local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsMax.LAST_VANILLA_COLLECTIBLE_TYPE
7
+ local ____constantsFirstLast = require("constantsFirstLast")
8
+ local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
9
9
  local ____collectibles = require("functions.collectibles")
10
10
  local getCollectibleTypeRange = ____collectibles.getCollectibleTypeRange
11
11
  local ____set = require("functions.set")
@@ -13,11 +13,11 @@ local game = ____cachedClasses.game
13
13
  local itemConfig = ____cachedClasses.itemConfig
14
14
  local ____constants = require("constants")
15
15
  local BLIND_ITEM_PNG_PATH = ____constants.BLIND_ITEM_PNG_PATH
16
- local ____constantsMax = require("constantsMax")
17
- local FIRST_COLLECTIBLE_TYPE = ____constantsMax.FIRST_COLLECTIBLE_TYPE
18
- local FIRST_MODDED_COLLECTIBLE_TYPE = ____constantsMax.FIRST_MODDED_COLLECTIBLE_TYPE
19
- local LAST_COLLECTIBLE_TYPE = ____constantsMax.LAST_COLLECTIBLE_TYPE
20
- local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsMax.LAST_VANILLA_COLLECTIBLE_TYPE
16
+ local ____constantsFirstLast = require("constantsFirstLast")
17
+ local FIRST_COLLECTIBLE_TYPE = ____constantsFirstLast.FIRST_COLLECTIBLE_TYPE
18
+ local FIRST_MODDED_COLLECTIBLE_TYPE = ____constantsFirstLast.FIRST_MODDED_COLLECTIBLE_TYPE
19
+ local LAST_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_COLLECTIBLE_TYPE
20
+ local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
21
21
  local ____collectibleDescriptionMap = require("maps.collectibleDescriptionMap")
22
22
  local COLLECTIBLE_DESCRIPTION_MAP = ____collectibleDescriptionMap.COLLECTIBLE_DESCRIPTION_MAP
23
23
  local DEFAULT_COLLECTIBLE_DESCRIPTION = ____collectibleDescriptionMap.DEFAULT_COLLECTIBLE_DESCRIPTION
@@ -14,7 +14,7 @@
14
14
  * Also see the `getEnumKeys` and `getEnumValues` helper functions.
15
15
  *
16
16
  * For a more in depth explanation, see:
17
- * https://isaacscript.github.io/docs/gotchas#iterating-over-enums
17
+ * https://isaacscript.github.io/gotchas#iterating-over-enums
18
18
  */
19
19
  export declare function getEnumEntries<T>(transpiledEnum: T): Array<[key: string, value: T[keyof T]]>;
20
20
  /**
@@ -31,7 +31,7 @@ export declare function getEnumEntries<T>(transpiledEnum: T): Array<[key: string
31
31
  * Also see the `getEnumEntries` and `getEnumValues` helper functions.
32
32
  *
33
33
  * For a more in depth explanation, see:
34
- * https://isaacscript.github.io/docs/gotchas#iterating-over-enums
34
+ * https://isaacscript.github.io/gotchas#iterating-over-enums
35
35
  */
36
36
  export declare function getEnumKeys<T>(transpiledEnum: T): string[];
37
37
  /** Helper function to get the amount of entries inside of an enum. */
@@ -50,7 +50,7 @@ export declare function getEnumLength<T>(transpiledEnum: T): int;
50
50
  * Also see the `getEnumEntries` and `getEnumKeys` helper functions.
51
51
  *
52
52
  * For a more in depth explanation, see:
53
- * https://isaacscript.github.io/docs/gotchas#iterating-over-enums
53
+ * https://isaacscript.github.io/gotchas#iterating-over-enums
54
54
  */
55
55
  export declare function getEnumValues<T>(transpiledEnum: T): Array<T[keyof T]>;
56
56
  export declare function getLastEnumValue<T>(transpiledEnum: T): T[keyof T];
@@ -1,5 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
- import { JSONRoom } from "../types/JSONRoom";
2
+ import { JSONRoom } from "../interfaces/JSONRoom";
3
3
  export declare function getJSONRoomOfVariant(jsonRooms: JSONRoom[], variant: int): JSONRoom | undefined;
4
4
  export declare function getJSONRoomsOfSubType(jsonRooms: JSONRoom[], subType: int): JSONRoom[];
5
5
  /**
@@ -1,2 +1,8 @@
1
- /** Returns a 3-tuple of Language enum value, language name and resource folder suffix. */
1
+ /**
2
+ * Helper function to convert the language abbreviation from `Options.Language` to the "full"
3
+ * language name.
4
+ *
5
+ * For example, if the current language is set to Korean, `Options.Language` will be set to "kr",
6
+ * and this function will return "Korean".
7
+ */
2
8
  export declare function getLanguageName(): string;
@@ -1,15 +1,6 @@
1
1
  local ____exports = {}
2
- local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
- local LanguageAbbreviation = ____isaac_2Dtypescript_2Ddefinitions.LanguageAbbreviation
4
- local LANGUAGE_NAMES = {
5
- [LanguageAbbreviation.ENGLISH] = "English",
6
- [LanguageAbbreviation.JAPANESE] = "Japanese",
7
- [LanguageAbbreviation.KOREAN] = "Korean",
8
- [LanguageAbbreviation.CHINESE_SIMPLE] = "Chinese (Simple)",
9
- [LanguageAbbreviation.RUSSIAN] = "Russian",
10
- [LanguageAbbreviation.GERMAN] = "German",
11
- [LanguageAbbreviation.SPANISH] = "Spanish"
12
- }
2
+ local ____languageNames = require("objects.languageNames")
3
+ local LANGUAGE_NAMES = ____languageNames.LANGUAGE_NAMES
13
4
  function ____exports.getLanguageName(self)
14
5
  local languageAbbreviation = Options.Language
15
6
  return LANGUAGE_NAMES[languageAbbreviation]
@@ -5,15 +5,15 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
5
5
  local PillColor = ____isaac_2Dtypescript_2Ddefinitions.PillColor
6
6
  local ____cachedClasses = require("cachedClasses")
7
7
  local itemConfig = ____cachedClasses.itemConfig
8
- local ____constantsMax = require("constantsMax")
9
- local FIRST_HORSE_PILL_COLOR = ____constantsMax.FIRST_HORSE_PILL_COLOR
10
- local FIRST_MODDED_PILL_EFFECT = ____constantsMax.FIRST_MODDED_PILL_EFFECT
11
- local FIRST_PILL_COLOR = ____constantsMax.FIRST_PILL_COLOR
12
- local FIRST_PILL_EFFECT = ____constantsMax.FIRST_PILL_EFFECT
13
- local LAST_HORSE_PILL_COLOR = ____constantsMax.LAST_HORSE_PILL_COLOR
14
- local LAST_NORMAL_PILL_COLOR = ____constantsMax.LAST_NORMAL_PILL_COLOR
15
- local LAST_PILL_EFFECT = ____constantsMax.LAST_PILL_EFFECT
16
- local LAST_VANILLA_PILL_EFFECT = ____constantsMax.LAST_VANILLA_PILL_EFFECT
8
+ local ____constantsFirstLast = require("constantsFirstLast")
9
+ local FIRST_HORSE_PILL_COLOR = ____constantsFirstLast.FIRST_HORSE_PILL_COLOR
10
+ local FIRST_MODDED_PILL_EFFECT = ____constantsFirstLast.FIRST_MODDED_PILL_EFFECT
11
+ local FIRST_PILL_COLOR = ____constantsFirstLast.FIRST_PILL_COLOR
12
+ local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
13
+ local LAST_HORSE_PILL_COLOR = ____constantsFirstLast.LAST_HORSE_PILL_COLOR
14
+ local LAST_NORMAL_PILL_COLOR = ____constantsFirstLast.LAST_NORMAL_PILL_COLOR
15
+ local LAST_PILL_EFFECT = ____constantsFirstLast.LAST_PILL_EFFECT
16
+ local LAST_VANILLA_PILL_EFFECT = ____constantsFirstLast.LAST_VANILLA_PILL_EFFECT
17
17
  local ____pillEffectClasses = require("objects.pillEffectClasses")
18
18
  local DEFAULT_PILL_EFFECT_CLASS = ____pillEffectClasses.DEFAULT_PILL_EFFECT_CLASS
19
19
  local PILL_EFFECT_CLASSES = ____pillEffectClasses.PILL_EFFECT_CLASSES
@@ -4,6 +4,20 @@ import { PlayerIndex } from "../types/PlayerIndex";
4
4
  /**
5
5
  * Helper function to make using default maps with an index of `PlayerIndex` easier. Use this
6
6
  * instead of the `DefaultMap.getAndSetDefault` method if you have a default map of this type.
7
+ *
8
+ * For example:
9
+ *
10
+ * ```ts
11
+ * const v = {
12
+ * run: {
13
+ * playersSpeedBoost: new DefaultMap<PlayerIndex, int>(0),
14
+ * },
15
+ * };
16
+ *
17
+ * function evaluateCacheSpeed(player: EntityPlayer) {
18
+ * player.MoveSpeed = defaultMapGetPlayer(v.run.playersSpeedBoost, player);
19
+ * }
20
+ * ```
7
21
  */
8
22
  export declare function defaultMapGetPlayer<V, A extends unknown[]>(map: DefaultMap<PlayerIndex, V, A>, player: EntityPlayer, ...extraArgs: A): V;
9
23
  /**
@@ -17,11 +31,48 @@ export declare function defaultMapSetPlayer<V>(map: Map<PlayerIndex, V>, player:
17
31
  /**
18
32
  * Helper function to make using maps with an index of `PlayerIndex` easier. Use this instead of the
19
33
  * `Map.get` method if you have a map of this type.
34
+ *
35
+ * For example:
36
+ *
37
+ * ```ts
38
+ * const v = {
39
+ * run: {
40
+ * playersSpeedBoost: new Map<PlayerIndex, int>(),
41
+ * },
42
+ * };
43
+ *
44
+ * function incrementSpeedBoost(player: EntityPlayer) {
45
+ * const oldSpeedBoost = mapGetPlayer(v.run.playersSpeedBoost, player);
46
+ * const newSpeedBoost = oldSpeedBoost + 0.1;
47
+ * mapSetPlayer(v.run.playersSpeedBoost, player);
48
+ * }
49
+ * ```
20
50
  */
21
51
  export declare function mapGetPlayer<V>(map: Map<PlayerIndex, V>, player: EntityPlayer): V | undefined;
52
+ /**
53
+ * Helper function to make using maps with an index of `PlayerIndex` easier. Use this instead of the
54
+ * `Map.has` method if you have a map of this type.
55
+ */
56
+ export declare function mapHasPlayer<V>(map: Map<PlayerIndex, V>, player: EntityPlayer): boolean;
22
57
  /**
23
58
  * Helper function to make using maps with an index of `PlayerIndex` easier. Use this instead of the
24
59
  * `Map.set` method if you have a map of this type.
60
+ *
61
+ * For example:
62
+ *
63
+ * ```ts
64
+ * const v = {
65
+ * run: {
66
+ * playersSpeedBoost: new Map<PlayerIndex, int>(),
67
+ * },
68
+ * };
69
+ *
70
+ * function incrementSpeedBoost(player: EntityPlayer) {
71
+ * const oldSpeedBoost = mapGetPlayer(v.run.playersSpeedBoost, player);
72
+ * const newSpeedBoost = oldSpeedBoost + 0.1;
73
+ * mapSetPlayer(v.run.playersSpeedBoost, player);
74
+ * }
75
+ * ```
25
76
  */
26
77
  export declare function mapSetPlayer<V>(map: Map<PlayerIndex, V>, player: EntityPlayer, value: V): void;
27
78
  /**
@@ -19,6 +19,10 @@ function ____exports.mapGetPlayer(self, map, player)
19
19
  local playerIndex = getPlayerIndex(nil, player)
20
20
  return map:get(playerIndex)
21
21
  end
22
+ function ____exports.mapHasPlayer(self, map, player)
23
+ local playerIndex = getPlayerIndex(nil, player)
24
+ return map:has(playerIndex)
25
+ end
22
26
  function ____exports.setAddPlayer(self, set, player)
23
27
  local playerIndex = getPlayerIndex(nil, player)
24
28
  return set:add(playerIndex)
@@ -1,6 +1,6 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  import { HealthType } from "../enums/HealthType";
3
- import { PlayerHealth } from "../types/PlayerHealth";
3
+ import { PlayerHealth } from "../interfaces/PlayerHealth";
4
4
  export declare function addPlayerHealthType(player: EntityPlayer, healthType: HealthType, numHearts: int): void;
5
5
  /**
6
6
  * Helper function to get an object representing the player's health. You can use this in
@@ -1,5 +1,5 @@
1
1
  import { PocketItemSlot } from "isaac-typescript-definitions";
2
- import { PocketItemDescription } from "../types/PocketItemDescription";
2
+ import { PocketItemDescription } from "../interfaces/PocketItemDescription";
3
3
  /**
4
4
  * Helper function to get the `PocketItemSlot` that the player's pocket active collectible item is
5
5
  * in, if any. Returns undefined if the player does not have a pocket active item.
package/functions/run.lua CHANGED
@@ -3,8 +3,8 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
3
3
  local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
4
4
  local ____cachedClasses = require("cachedClasses")
5
5
  local game = ____cachedClasses.game
6
- local ____constantsMax = require("constantsMax")
7
- local FIRST_CHARACTER = ____constantsMax.FIRST_CHARACTER
6
+ local ____constantsFirstLast = require("constantsFirstLast")
7
+ local FIRST_CHARACTER = ____constantsFirstLast.FIRST_CHARACTER
8
8
  local ____log = require("functions.log")
9
9
  local log = ____log.log
10
10
  function ____exports.onSetSeed(self)
@@ -5,8 +5,8 @@ local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
5
5
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
6
6
  local ____constants = require("constants")
7
7
  local VectorZero = ____constants.VectorZero
8
- local ____preventCollectibleRotate = require("features.preventCollectibleRotate")
9
- local preventCollectibleRotate = ____preventCollectibleRotate.preventCollectibleRotate
8
+ local ____preventCollectibleRotation = require("features.preventCollectibleRotation")
9
+ local preventCollectibleRotation = ____preventCollectibleRotation.preventCollectibleRotation
10
10
  local ____featuresInitialized = require("featuresInitialized")
11
11
  local areFeaturesInitialized = ____featuresInitialized.areFeaturesInitialized
12
12
  local ____collectibles = require("functions.collectibles")
@@ -48,7 +48,7 @@ function ____exports.spawnCollectible(self, collectibleType, position, seedOrRNG
48
48
  collectible.Price = 15
49
49
  end
50
50
  if isQuestCollectible(nil, collectibleType) and areFeaturesInitialized(nil) then
51
- preventCollectibleRotate(nil, collectible, collectibleType)
51
+ preventCollectibleRotation(nil, collectible, collectibleType)
52
52
  end
53
53
  return collectible
54
54
  end
@@ -1,5 +1,5 @@
1
1
  import { TrinketType } from "isaac-typescript-definitions";
2
- import { TrinketSituation } from "../types/TrinketSituation";
2
+ import { TrinketSituation } from "../interfaces/TrinketSituation";
3
3
  /**
4
4
  * Helper function to restore the player's trinkets back to the way they were before the
5
5
  * `temporarilyRemoveTrinket` function was used. It will re-smelt any smelted trinkets that were
@@ -5,11 +5,11 @@ local TrinketSlot = ____isaac_2Dtypescript_2Ddefinitions.TrinketSlot
5
5
  local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
6
6
  local ____cachedClasses = require("cachedClasses")
7
7
  local itemConfig = ____cachedClasses.itemConfig
8
- local ____constantsMax = require("constantsMax")
9
- local FIRST_MODDED_TRINKET_TYPE = ____constantsMax.FIRST_MODDED_TRINKET_TYPE
10
- local FIRST_TRINKET_TYPE = ____constantsMax.FIRST_TRINKET_TYPE
11
- local LAST_TRINKET_TYPE = ____constantsMax.LAST_TRINKET_TYPE
12
- local LAST_VANILLA_TRINKET_TYPE = ____constantsMax.LAST_VANILLA_TRINKET_TYPE
8
+ local ____constantsFirstLast = require("constantsFirstLast")
9
+ local FIRST_MODDED_TRINKET_TYPE = ____constantsFirstLast.FIRST_MODDED_TRINKET_TYPE
10
+ local FIRST_TRINKET_TYPE = ____constantsFirstLast.FIRST_TRINKET_TYPE
11
+ local LAST_TRINKET_TYPE = ____constantsFirstLast.LAST_TRINKET_TYPE
12
+ local LAST_VANILLA_TRINKET_TYPE = ____constantsFirstLast.LAST_VANILLA_TRINKET_TYPE
13
13
  local ____trinketDescriptionMap = require("maps.trinketDescriptionMap")
14
14
  local DEFAULT_TRINKET_DESCRIPTION = ____trinketDescriptionMap.DEFAULT_TRINKET_DESCRIPTION
15
15
  local TRINKET_DESCRIPTION_MAP = ____trinketDescriptionMap.TRINKET_DESCRIPTION_MAP