isaacscript-common 1.0.488 → 1.0.492

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 (130) hide show
  1. package/README.md +2 -0
  2. package/dist/callbacks/itemPickup.lua +2 -6
  3. package/dist/callbacks/postBombInitLate.lua +6 -8
  4. package/dist/callbacks/postCursedTeleport.lua +8 -10
  5. package/dist/callbacks/postEffectInitLate.lua +6 -8
  6. package/dist/callbacks/postEsauJr.lua +2 -4
  7. package/dist/callbacks/postFamiliarInitLate.lua +6 -8
  8. package/dist/callbacks/postFlip.lua +2 -4
  9. package/dist/callbacks/postGridEntity.lua +8 -18
  10. package/dist/callbacks/postKnifeInitLate.lua +6 -8
  11. package/dist/callbacks/postLaserInitLate.lua +6 -8
  12. package/dist/callbacks/postNPCInitLate.lua +6 -8
  13. package/dist/callbacks/postPickupCollect.lua +1 -5
  14. package/dist/callbacks/postPickupInitLate.lua +6 -8
  15. package/dist/callbacks/postPlayerChangeHealth.lua +9 -13
  16. package/dist/callbacks/postPlayerChangeType.lua +1 -5
  17. package/dist/callbacks/postPlayerFatalDamage.lua +2 -2
  18. package/dist/callbacks/postPlayerInitLate.lua +1 -5
  19. package/dist/callbacks/postPlayerReordered.lua +1 -1
  20. package/dist/callbacks/postProjectileInitLate.lua +6 -8
  21. package/dist/callbacks/postPurchase.lua +10 -14
  22. package/dist/callbacks/postSacrifice.lua +3 -3
  23. package/dist/callbacks/postSlotInitUpdate.lua +3 -11
  24. package/dist/callbacks/postSlotRenderBroken.lua +2 -8
  25. package/dist/callbacks/postTearInitLate.lua +6 -8
  26. package/dist/callbacks/postTransformation.lua +1 -5
  27. package/dist/callbacks/reorderedCallbacks.lua +4 -4
  28. package/dist/callbacks/subscriptions/postBombInitLate.lua +3 -3
  29. package/dist/callbacks/subscriptions/postCursedTeleport.lua +1 -1
  30. package/dist/callbacks/subscriptions/postCustomRevive.lua +3 -3
  31. package/dist/callbacks/subscriptions/postEffectInitLate.lua +3 -3
  32. package/dist/callbacks/subscriptions/postEsauJr.lua +1 -1
  33. package/dist/callbacks/subscriptions/postFamiliarInitLate.lua +3 -3
  34. package/dist/callbacks/subscriptions/postFirstEsauJr.lua +1 -1
  35. package/dist/callbacks/subscriptions/postFirstFlip.lua +1 -1
  36. package/dist/callbacks/subscriptions/postFlip.lua +1 -1
  37. package/dist/callbacks/subscriptions/postGameStartedReordered.lua +1 -1
  38. package/dist/callbacks/subscriptions/postGridEntityInit.lua +3 -3
  39. package/dist/callbacks/subscriptions/postGridEntityRemove.lua +3 -3
  40. package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +3 -3
  41. package/dist/callbacks/subscriptions/postItemPickup.lua +5 -5
  42. package/dist/callbacks/subscriptions/postKnifeInitLate.lua +3 -3
  43. package/dist/callbacks/subscriptions/postLaserInitLate.lua +3 -3
  44. package/dist/callbacks/subscriptions/postNPCInitLate.lua +3 -3
  45. package/dist/callbacks/subscriptions/postNewLevelReordered.lua +1 -1
  46. package/dist/callbacks/subscriptions/postNewRoomReordered.lua +1 -1
  47. package/dist/callbacks/subscriptions/postPickupCollect.lua +3 -3
  48. package/dist/callbacks/subscriptions/postPickupInitLate.lua +3 -3
  49. package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +3 -3
  50. package/dist/callbacks/subscriptions/postPlayerChangeType.lua +1 -1
  51. package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +3 -3
  52. package/dist/callbacks/subscriptions/postPlayerInitLate.lua +3 -3
  53. package/dist/callbacks/subscriptions/postPlayerInitReordered.lua +3 -3
  54. package/dist/callbacks/subscriptions/postPlayerRenderReordered.lua +3 -3
  55. package/dist/callbacks/subscriptions/postPlayerUpdateReordered.lua +3 -3
  56. package/dist/callbacks/subscriptions/postProjectileInitLate.lua +3 -3
  57. package/dist/callbacks/subscriptions/postPurchase.lua +8 -2
  58. package/dist/callbacks/subscriptions/postSacrifice.lua +1 -1
  59. package/dist/callbacks/subscriptions/postSlotDestroyed.lua +3 -3
  60. package/dist/callbacks/subscriptions/postSlotInit.lua +3 -3
  61. package/dist/callbacks/subscriptions/postSlotRender.lua +3 -3
  62. package/dist/callbacks/subscriptions/postSlotUpdate.lua +3 -3
  63. package/dist/callbacks/subscriptions/postTearInitLate.lua +3 -3
  64. package/dist/callbacks/subscriptions/postTransformation.lua +3 -3
  65. package/dist/callbacks/subscriptions/preCustomRevive.lua +1 -1
  66. package/dist/callbacks/subscriptions/preItemPickup.lua +5 -5
  67. package/dist/constants.d.ts +9 -0
  68. package/dist/constants.lua +41 -4
  69. package/dist/features/deployJSONRoom.lua +90 -61
  70. package/dist/features/disableInputs.lua +9 -3
  71. package/dist/features/forgottenSwitch.lua +1 -1
  72. package/dist/features/getCollectibleItemPoolType.lua +10 -14
  73. package/dist/features/preventCollectibleRotate.lua +3 -9
  74. package/dist/features/saveDataManager/load.lua +2 -6
  75. package/dist/features/saveDataManager/main.lua +1 -1
  76. package/dist/features/saveDataManager/merge.lua +2 -4
  77. package/dist/features/sirenHelpers.lua +5 -5
  78. package/dist/functions/array.lua +5 -7
  79. package/dist/functions/bitwise.lua +1 -1
  80. package/dist/functions/cards.d.ts +2 -2
  81. package/dist/functions/charge.lua +10 -12
  82. package/dist/functions/collectibles.d.ts +23 -2
  83. package/dist/functions/collectibles.lua +26 -21
  84. package/dist/functions/color.lua +9 -1
  85. package/dist/functions/deepCopy.lua +45 -25
  86. package/dist/functions/deepCopyTests.lua +12 -20
  87. package/dist/functions/doors.lua +7 -19
  88. package/dist/functions/entity.lua +7 -1
  89. package/dist/functions/flag.lua +1 -1
  90. package/dist/functions/gridEntity.lua +13 -8
  91. package/dist/functions/input.lua +14 -18
  92. package/dist/functions/jsonRoom.lua +3 -9
  93. package/dist/functions/language.lua +9 -1
  94. package/dist/functions/log.lua +18 -46
  95. package/dist/functions/math.lua +15 -17
  96. package/dist/functions/npc.lua +15 -17
  97. package/dist/functions/pickups.lua +14 -1
  98. package/dist/functions/pills.d.ts +1 -1
  99. package/dist/functions/player.d.ts +12 -0
  100. package/dist/functions/player.lua +45 -59
  101. package/dist/functions/playerHealth.lua +19 -9
  102. package/dist/functions/pocketItems.lua +4 -4
  103. package/dist/functions/random.lua +2 -2
  104. package/dist/functions/revive.lua +4 -4
  105. package/dist/functions/rooms.lua +13 -17
  106. package/dist/functions/spawnCollectible.lua +10 -2
  107. package/dist/functions/sprite.lua +2 -2
  108. package/dist/functions/stage.lua +6 -6
  109. package/dist/functions/tears.lua +1 -1
  110. package/dist/functions/transformations.lua +4 -10
  111. package/dist/functions/trinketGive.lua +2 -2
  112. package/dist/functions/trinkets.d.ts +6 -2
  113. package/dist/functions/trinkets.lua +3 -5
  114. package/dist/functions/ui.lua +3 -3
  115. package/dist/functions/util.lua +4 -8
  116. package/dist/functions/vector.lua +8 -8
  117. package/dist/lualib_bundle.lua +603 -555
  118. package/dist/maps/cardDescriptionMap.lua +99 -1
  119. package/dist/maps/cardNameMap.lua +99 -1
  120. package/dist/maps/collectibleDescriptionMap.lua +722 -1
  121. package/dist/maps/collectibleNameMap.lua +722 -1
  122. package/dist/maps/gridEntityXMLMap.lua +36 -1
  123. package/dist/maps/pillEffectNameMap.lua +52 -1
  124. package/dist/maps/roomTypeToItemPoolMap.lua +15 -1
  125. package/dist/maps/transformationMap.lua +19 -12
  126. package/dist/maps/trinketDescriptionMap.lua +190 -1
  127. package/dist/maps/trinketNameMap.lua +190 -1
  128. package/dist/sets/cards.lua +98 -2
  129. package/dist/types/ModUpgraded.lua +82 -166
  130. package/package.json +5 -5
@@ -36,13 +36,11 @@ function ____exports.convertXMLGridEntityType(self, gridEntityXMLType, gridEntit
36
36
  end
37
37
  local gridEntityArray = GRID_ENTITY_XML_MAP:get(gridEntityXMLType)
38
38
  if gridEntityArray == nil then
39
- error(
40
- "Failed to find an entry in the grid entity map for XML entity type: " .. tostring(gridEntityXMLType)
41
- )
39
+ error("Failed to find an entry in the grid entity map for XML entity type: " .. tostring(gridEntityXMLType))
42
40
  end
43
41
  local gridEntityType = gridEntityArray[1]
44
42
  local gridEntityVariant = gridEntityArray[2]
45
- if ((gridEntityType == GridEntityType.GRID_SPIKES_ONOFF) or (gridEntityType == GridEntityType.GRID_PRESSURE_PLATE)) or (gridEntityType == GridEntityType.GRID_TELEPORTER) then
43
+ if gridEntityType == GridEntityType.GRID_SPIKES_ONOFF or gridEntityType == GridEntityType.GRID_PRESSURE_PLATE or gridEntityType == GridEntityType.GRID_TELEPORTER then
46
44
  gridEntityVariant = gridEntityXMLVariant
47
45
  end
48
46
  return {gridEntityType, gridEntityVariant}
@@ -82,7 +80,16 @@ function ____exports.getSurroundingGridEntities(self, gridEntity)
82
80
  local room = game:GetRoom()
83
81
  local gridWidth = room:GetGridWidth()
84
82
  local gridIndex = gridEntity:GetGridIndex()
85
- local surroundingGridIndexes = {gridIndex - 1, gridIndex + 1, (gridIndex - gridWidth) - 1, gridIndex - gridWidth, (gridIndex - gridWidth) + 1, (gridIndex + gridWidth) - 1, gridIndex + gridWidth, (gridIndex + gridWidth) + 1}
83
+ local surroundingGridIndexes = {
84
+ gridIndex - 1,
85
+ gridIndex + 1,
86
+ gridIndex - gridWidth - 1,
87
+ gridIndex - gridWidth,
88
+ gridIndex - gridWidth + 1,
89
+ gridIndex + gridWidth - 1,
90
+ gridIndex + gridWidth,
91
+ gridIndex + gridWidth + 1
92
+ }
86
93
  local surroundingGridEntities = {}
87
94
  for ____, surroundingGridIndex in ipairs(surroundingGridIndexes) do
88
95
  local surroundingGridEntity = room:GetGridEntity(surroundingGridIndex)
@@ -99,9 +106,7 @@ function ____exports.isAllPressurePlatesPushed(self)
99
106
  if not hasPressurePlates then
100
107
  return true
101
108
  end
102
- for ____, gridEntity in ipairs(
103
- ____exports.getGridEntities(nil, GridEntityType.GRID_PRESSURE_PLATE)
104
- ) do
109
+ for ____, gridEntity in ipairs(____exports.getGridEntities(nil, GridEntityType.GRID_PRESSURE_PLATE)) do
105
110
  local gridEntityDesc = gridEntity:GetSaveState()
106
111
  if gridEntityDesc.State ~= 3 then
107
112
  return false
@@ -39,12 +39,10 @@ ControllerLiteral[ControllerLiteral.BUTTON_BACK] = "BUTTON_BACK"
39
39
  ControllerLiteral.BUTTON_START = 15
40
40
  ControllerLiteral[ControllerLiteral.BUTTON_START] = "BUTTON_START"
41
41
  function ____exports.controllerToString(self, controller)
42
- for ____, ____value in ipairs(
43
- __TS__ObjectEntries(ControllerLiteral)
44
- ) do
45
- local key
42
+ local controllerLiteralCode
43
+ local key
44
+ for ____, ____value in ipairs(__TS__ObjectEntries(ControllerLiteral)) do
46
45
  key = ____value[1]
47
- local controllerLiteralCode
48
46
  controllerLiteralCode = ____value[2]
49
47
  do
50
48
  if type(key) ~= "string" then
@@ -55,7 +53,13 @@ function ____exports.controllerToString(self, controller)
55
53
  goto __continue3
56
54
  end
57
55
  local controllerName = key
58
- for ____, prefix in ipairs({"DPAD_", "BUTTON_", "BUMPER_", "TRIGGER_", "STICK_"}) do
56
+ for ____, prefix in ipairs({
57
+ "DPAD_",
58
+ "BUTTON_",
59
+ "BUMPER_",
60
+ "TRIGGER_",
61
+ "STICK_"
62
+ }) do
59
63
  controllerName = __TS__StringReplace(controllerName, prefix, "")
60
64
  end
61
65
  return controllerName
@@ -92,9 +96,7 @@ function ____exports.isKeyboardPressed(self, key)
92
96
  return Input.IsButtonPressed(key, 0)
93
97
  end
94
98
  function ____exports.isMoveActionPressedOnAnyInput(self)
95
- for ____, buttonAction in __TS__Iterator(
96
- MOVEMENT_ACTIONS:values()
97
- ) do
99
+ for ____, buttonAction in __TS__Iterator(MOVEMENT_ACTIONS:values()) do
98
100
  if ____exports.isActionPressedOnAnyInput(nil, buttonAction) then
99
101
  return true
100
102
  end
@@ -102,9 +104,7 @@ function ____exports.isMoveActionPressedOnAnyInput(self)
102
104
  return false
103
105
  end
104
106
  function ____exports.isMoveActionTriggeredOnAnyInput(self)
105
- for ____, buttonAction in __TS__Iterator(
106
- MOVEMENT_ACTIONS:values()
107
- ) do
107
+ for ____, buttonAction in __TS__Iterator(MOVEMENT_ACTIONS:values()) do
108
108
  if ____exports.isActionTriggeredOnAnyInput(nil, buttonAction) then
109
109
  return true
110
110
  end
@@ -112,9 +112,7 @@ function ____exports.isMoveActionTriggeredOnAnyInput(self)
112
112
  return false
113
113
  end
114
114
  function ____exports.isShootActionPressedOnAnyInput(self)
115
- for ____, buttonAction in __TS__Iterator(
116
- SHOOTING_ACTIONS:values()
117
- ) do
115
+ for ____, buttonAction in __TS__Iterator(SHOOTING_ACTIONS:values()) do
118
116
  if ____exports.isActionPressedOnAnyInput(nil, buttonAction) then
119
117
  return true
120
118
  end
@@ -122,9 +120,7 @@ function ____exports.isShootActionPressedOnAnyInput(self)
122
120
  return false
123
121
  end
124
122
  function ____exports.isShootActionTriggeredOnAnyInput(self)
125
- for ____, buttonAction in __TS__Iterator(
126
- SHOOTING_ACTIONS:values()
127
- ) do
123
+ for ____, buttonAction in __TS__Iterator(SHOOTING_ACTIONS:values()) do
128
124
  if ____exports.isActionTriggeredOnAnyInput(nil, buttonAction) then
129
125
  return true
130
126
  end
@@ -30,9 +30,7 @@ function getJSONRoomWithChosenWeight(self, jsonRooms, chosenWeight)
30
30
  end
31
31
  chosenWeight = chosenWeight - roomWeight
32
32
  end
33
- error(
34
- "Failed to get a room with chosen weight: " .. tostring(chosenWeight)
35
- )
33
+ error("Failed to get a room with chosen weight: " .. tostring(chosenWeight))
36
34
  return jsonRooms[1]
37
35
  end
38
36
  function ____exports.getJSONRoomOfVariant(self, jsonRooms, variant)
@@ -65,15 +63,11 @@ function ____exports.getRandomJSONRoom(self, jsonRooms, seed, verbose)
65
63
  end
66
64
  local totalWeight = getTotalWeightOfJSONRooms(nil, jsonRooms)
67
65
  if verbose then
68
- log(
69
- "Total weight of the JSON rooms provided: " .. tostring(totalWeight)
70
- )
66
+ log("Total weight of the JSON rooms provided: " .. tostring(totalWeight))
71
67
  end
72
68
  local chosenWeight = getRandomFloat(nil, 0, totalWeight, seed)
73
69
  if verbose then
74
- log(
75
- "Randomly chose weight: " .. tostring(chosenWeight)
76
- )
70
+ log("Randomly chose weight: " .. tostring(chosenWeight))
77
71
  end
78
72
  return getJSONRoomWithChosenWeight(nil, jsonRooms, chosenWeight)
79
73
  end
@@ -1,6 +1,14 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____exports = {}
3
- local LANGUAGE_NAMES = {en = "English", jp = "Japanese", kr = "Korean", zh = "Chinese (Simple)", ru = "Russian", de = "German", es = "Spanish"}
3
+ local LANGUAGE_NAMES = {
4
+ en = "English",
5
+ jp = "Japanese",
6
+ kr = "Korean",
7
+ zh = "Chinese (Simple)",
8
+ ru = "Russian",
9
+ de = "German",
10
+ es = "Spanish"
11
+ }
4
12
  function ____exports.getLanguageName(self)
5
13
  local languageAbbreviation = Options.Language
6
14
  return LANGUAGE_NAMES[languageAbbreviation]
@@ -16,9 +16,7 @@ function ____exports.getDebugPrependString(self, msg, numParentFunctions)
16
16
  end
17
17
  end
18
18
  if getParentFunctionDescription ~= nil then
19
- return (tostring(
20
- getParentFunctionDescription(numParentFunctions + 1)
21
- ) .. " - ") .. msg
19
+ return (tostring(getParentFunctionDescription(numParentFunctions + 1)) .. " - ") .. msg
22
20
  end
23
21
  return msg
24
22
  end
@@ -36,9 +34,7 @@ function ____exports.logAllFlags(flags, flagEnum, description)
36
34
  ____exports.log(("Logging all " .. description) .. "flags:")
37
35
  for key, value in pairs(flagEnum) do
38
36
  if hasFlag(nil, flags, value) then
39
- ____exports.log(
40
- "- Has flag: " .. tostring(key)
41
- )
37
+ ____exports.log("- Has flag: " .. tostring(key))
42
38
  end
43
39
  end
44
40
  end
@@ -51,12 +47,10 @@ end
51
47
  function ____exports.logAllGameStateFlags()
52
48
  local game = Game()
53
49
  ____exports.log("Logging all game state flags:")
54
- for ____, ____value in ipairs(
55
- __TS__ObjectEntries(GameStateFlag)
56
- ) do
57
- local key
50
+ local value
51
+ local key
52
+ for ____, ____value in ipairs(__TS__ObjectEntries(GameStateFlag)) do
58
53
  key = ____value[1]
59
- local value
60
54
  value = ____value[2]
61
55
  local gameStateFlag = value
62
56
  local flagValue = game:GetStateFlag(gameStateFlag)
@@ -79,62 +73,40 @@ function ____exports.logArray(array)
79
73
  ____exports.log("Array: " .. arrayString)
80
74
  end
81
75
  function ____exports.logColor(color)
82
- ____exports.log(
83
- (((((((((((("Color: R" .. tostring(color.R)) .. ", G") .. tostring(color.G)) .. ", B") .. tostring(color.B)) .. ", A") .. tostring(color.A)) .. ", RO") .. tostring(color.RO)) .. ", BO") .. tostring(color.BO)) .. ", GO") .. tostring(color.GO)
84
- )
76
+ ____exports.log((((((((((((("Color: R" .. tostring(color.R)) .. ", G") .. tostring(color.G)) .. ", B") .. tostring(color.B)) .. ", A") .. tostring(color.A)) .. ", RO") .. tostring(color.RO)) .. ", BO") .. tostring(color.BO)) .. ", GO") .. tostring(color.GO))
85
77
  end
86
78
  function ____exports.logEntity(entity)
87
- ____exports.log(
88
- (((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType)
89
- )
79
+ ____exports.log((((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType))
90
80
  end
91
81
  function ____exports.logKColor(kColor)
92
- ____exports.log(
93
- (((((("Color: R" .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha)
94
- )
82
+ ____exports.log((((((("Color: R" .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha))
95
83
  end
96
84
  function ____exports.logMap(map)
97
85
  ____exports.log("Printing out a TSTL Map:")
98
- for ____, ____value in __TS__Iterator(
99
- map:entries()
100
- ) do
101
- local key
86
+ local value
87
+ local key
88
+ for ____, ____value in __TS__Iterator(map:entries()) do
102
89
  key = ____value[1]
103
- local value
104
90
  value = ____value[2]
105
- ____exports.log(
106
- ((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value)
107
- )
91
+ ____exports.log(((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value))
108
92
  end
109
- ____exports.log(
110
- "The size of the map was: " .. tostring(map.size)
111
- )
93
+ ____exports.log("The size of the map was: " .. tostring(map.size))
112
94
  end
113
95
  function ____exports.logTable(____table)
114
96
  ____exports.log("Printing out a Lua table:")
115
97
  for key, value in pairs(____table) do
116
- ____exports.log(
117
- ((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value)
118
- )
98
+ ____exports.log(((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value))
119
99
  end
120
100
  end
121
101
  function ____exports.logSet(set)
122
102
  ____exports.log("Printing out a TSTL Set:")
123
- for ____, value in __TS__Iterator(
124
- set:values()
125
- ) do
126
- ____exports.log(
127
- " Value: " .. tostring(value)
128
- )
103
+ for ____, value in __TS__Iterator(set:values()) do
104
+ ____exports.log(" Value: " .. tostring(value))
129
105
  end
130
- ____exports.log(
131
- "The size of the set was: " .. tostring(set.size)
132
- )
106
+ ____exports.log("The size of the set was: " .. tostring(set.size))
133
107
  end
134
108
  function ____exports.logVector(vector)
135
- ____exports.log(
136
- ((("Vector: (" .. tostring(vector.X)) .. ", ") .. tostring(vector.Y)) .. ")"
137
- )
109
+ ____exports.log(((("Vector: (" .. tostring(vector.X)) .. ", ") .. tostring(vector.Y)) .. ")")
138
110
  end
139
111
  function ____exports.setLogFunctionsGlobal(self)
140
112
  local globals = _G
@@ -13,25 +13,25 @@ function getCircleInitialPosition(self, direction, radius)
13
13
  return Vector.Zero
14
14
  end
15
15
  end
16
- ____cond6 = ____cond6 or (____switch6 == Direction.LEFT)
16
+ ____cond6 = ____cond6 or ____switch6 == Direction.LEFT
17
17
  if ____cond6 then
18
18
  do
19
19
  return Vector(-radius, 0)
20
20
  end
21
21
  end
22
- ____cond6 = ____cond6 or (____switch6 == Direction.UP)
22
+ ____cond6 = ____cond6 or ____switch6 == Direction.UP
23
23
  if ____cond6 then
24
24
  do
25
25
  return Vector(0, -radius)
26
26
  end
27
27
  end
28
- ____cond6 = ____cond6 or (____switch6 == Direction.RIGHT)
28
+ ____cond6 = ____cond6 or ____switch6 == Direction.RIGHT
29
29
  if ____cond6 then
30
30
  do
31
31
  return Vector(radius, 0)
32
32
  end
33
33
  end
34
- ____cond6 = ____cond6 or (____switch6 == Direction.DOWN)
34
+ ____cond6 = ____cond6 or ____switch6 == Direction.DOWN
35
35
  if ____cond6 then
36
36
  do
37
37
  return Vector(0, radius)
@@ -47,7 +47,7 @@ function getCircleInitialPosition(self, direction, radius)
47
47
  end
48
48
  function ____exports.getAngleDifference(self, angle1, angle2)
49
49
  local subtractedAngle = angle1 - angle2
50
- return ((subtractedAngle + 180) % 360) - 180
50
+ return (subtractedAngle + 180) % 360 - 180
51
51
  end
52
52
  function ____exports.getCircleDiscretizedPoints(self, centerPos, radius, numPoints, xMultiplier, yMultiplier, initialDirection)
53
53
  if xMultiplier == nil then
@@ -64,7 +64,7 @@ function ____exports.getCircleDiscretizedPoints(self, centerPos, radius, numPoin
64
64
  do
65
65
  local i = 0
66
66
  while i < numPoints do
67
- local rotatedPosition = initialPosition:Rotated((i * 360) / numPoints)
67
+ local rotatedPosition = initialPosition:Rotated(i * 360 / numPoints)
68
68
  rotatedPosition.X = rotatedPosition.X * xMultiplier
69
69
  rotatedPosition.Y = rotatedPosition.Y * yMultiplier
70
70
  local positionFromCenter = centerPos + rotatedPosition
@@ -75,28 +75,26 @@ function ____exports.getCircleDiscretizedPoints(self, centerPos, radius, numPoin
75
75
  return positions
76
76
  end
77
77
  function ____exports.isEven(self, num)
78
- return (num & 1) == 0
78
+ return num & 1 == 0
79
79
  end
80
80
  function ____exports.isOdd(self, num)
81
- return (num & 1) == 1
81
+ return num & 1 == 1
82
82
  end
83
83
  function ____exports.lerp(self, a, b, pos)
84
- return a + ((b - a) * pos)
84
+ return a + (b - a) * pos
85
85
  end
86
86
  function ____exports.lerpAngleDegrees(self, aStart, aEnd, percent)
87
- return aStart + (____exports.getAngleDifference(nil, aStart, aEnd) * percent)
87
+ return aStart + ____exports.getAngleDifference(nil, aStart, aEnd) * percent
88
88
  end
89
89
  function ____exports.round(self, num, numDecimalPlaces)
90
90
  if numDecimalPlaces == nil then
91
91
  numDecimalPlaces = 0
92
92
  end
93
- local roundedNum = tonumber(
94
- string.format(
95
- ("%." .. tostring(numDecimalPlaces)) .. "f",
96
- num
97
- )
98
- )
99
- return ((roundedNum == nil) and 0) or roundedNum
93
+ local roundedNum = tonumber(string.format(
94
+ ("%." .. tostring(numDecimalPlaces)) .. "f",
95
+ num
96
+ ))
97
+ return roundedNum == nil and 0 or roundedNum
100
98
  end
101
99
  function ____exports.tanh(self, x)
102
100
  return (math.exp(x) - math.exp(-x)) / (math.exp(x) + math.exp(-x))
@@ -8,9 +8,7 @@ local ____entity = require("functions.entity")
8
8
  local getEntities = ____entity.getEntities
9
9
  function ____exports.getBosses(self)
10
10
  local bosses = {}
11
- for ____, npc in ipairs(
12
- ____exports.getNPCs(nil)
13
- ) do
11
+ for ____, npc in ipairs(____exports.getNPCs(nil)) do
14
12
  if npc:IsBoss() then
15
13
  __TS__ArrayPush(bosses, npc)
16
14
  end
@@ -21,7 +19,13 @@ function ____exports.getNPCs(self, matchingEntityType, matchingVariant, matching
21
19
  if ignoreFriendly == nil then
22
20
  ignoreFriendly = false
23
21
  end
24
- local entities = getEntities(nil, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
22
+ local entities = getEntities(
23
+ nil,
24
+ matchingEntityType,
25
+ matchingVariant,
26
+ matchingSubType,
27
+ ignoreFriendly
28
+ )
25
29
  local npcs = {}
26
30
  for ____, entity in ipairs(entities) do
27
31
  local npc = entity:ToNPC()
@@ -49,10 +53,10 @@ function ____exports.isAliveExceptionNPC(self, npc)
49
53
  return false
50
54
  end
51
55
  function ____exports.isDyingEggyWithNoSpidersLeft(self, npc)
52
- return (npc.State == NpcState.STATE_SUICIDE) and (npc.StateFrame >= EGGY_STATE_FRAME_OF_FINAL_SPIDER)
56
+ return npc.State == NpcState.STATE_SUICIDE and npc.StateFrame >= EGGY_STATE_FRAME_OF_FINAL_SPIDER
53
57
  end
54
58
  function ____exports.isRaglingDeathPatch(self, npc)
55
- return ((npc.Type == EntityType.ENTITY_RAGLING) and (npc.Variant == 1)) and (npc.State == NpcState.STATE_SPECIAL)
59
+ return npc.Type == EntityType.ENTITY_RAGLING and npc.Variant == 1 and npc.State == NpcState.STATE_SPECIAL
56
60
  end
57
61
  NON_ALIVE_NPCS_TYPE_VARIANT = __TS__New(
58
62
  Set,
@@ -70,16 +74,12 @@ NON_ALIVE_NPCS_TYPE_VARIANT = __TS__New(
70
74
  )
71
75
  NON_ALIVE_NPCS_TYPE_VARIANT_SUBTYPE = __TS__New(
72
76
  Set,
73
- {
74
- (((tostring(EntityType.ENTITY_CHARGER) .. ".") .. 0) .. ".") .. 1
75
- }
77
+ {(((tostring(EntityType.ENTITY_CHARGER) .. ".") .. 0) .. ".") .. 1}
76
78
  )
77
79
  function ____exports.getAliveBosses(self)
78
80
  local aliveBosses = {}
79
- for ____, boss in ipairs(
80
- ____exports.getBosses(nil)
81
- ) do
82
- if (not boss:IsDead()) and (not ____exports.isAliveExceptionNPC(nil, boss)) then
81
+ for ____, boss in ipairs(____exports.getBosses(nil)) do
82
+ if not boss:IsDead() and not ____exports.isAliveExceptionNPC(nil, boss) then
83
83
  __TS__ArrayPush(aliveBosses, boss)
84
84
  end
85
85
  end
@@ -87,10 +87,8 @@ function ____exports.getAliveBosses(self)
87
87
  end
88
88
  function ____exports.getAliveNPCs(self)
89
89
  local aliveNPCs = {}
90
- for ____, npc in ipairs(
91
- ____exports.getNPCs(nil)
92
- ) do
93
- if (not npc:IsDead()) and (not ____exports.isAliveExceptionNPC(nil, npc)) then
90
+ for ____, npc in ipairs(____exports.getNPCs(nil)) do
91
+ if not npc:IsDead() and not ____exports.isAliveExceptionNPC(nil, npc) then
94
92
  __TS__ArrayPush(aliveNPCs, npc)
95
93
  end
96
94
  end
@@ -15,7 +15,20 @@ function ____exports.getRandomHeartSubType(self, seed, exceptions)
15
15
  local heartSubTypes = getEnumValues(nil, HeartSubType)
16
16
  return getRandomArrayElement(nil, heartSubTypes, seed, exceptions)
17
17
  end
18
- local CHEST_PICKUP_VARIANTS = __TS__New(Set, {PickupVariant.PICKUP_CHEST, PickupVariant.PICKUP_BOMBCHEST, PickupVariant.PICKUP_SPIKEDCHEST, PickupVariant.PICKUP_ETERNALCHEST, PickupVariant.PICKUP_MIMICCHEST, PickupVariant.PICKUP_OLDCHEST, PickupVariant.PICKUP_WOODENCHEST, PickupVariant.PICKUP_MEGACHEST, PickupVariant.PICKUP_HAUNTEDCHEST, PickupVariant.PICKUP_LOCKEDCHEST, PickupVariant.PICKUP_REDCHEST, PickupVariant.PICKUP_MOMSCHEST})
18
+ local CHEST_PICKUP_VARIANTS = __TS__New(Set, {
19
+ PickupVariant.PICKUP_CHEST,
20
+ PickupVariant.PICKUP_BOMBCHEST,
21
+ PickupVariant.PICKUP_SPIKEDCHEST,
22
+ PickupVariant.PICKUP_ETERNALCHEST,
23
+ PickupVariant.PICKUP_MIMICCHEST,
24
+ PickupVariant.PICKUP_OLDCHEST,
25
+ PickupVariant.PICKUP_WOODENCHEST,
26
+ PickupVariant.PICKUP_MEGACHEST,
27
+ PickupVariant.PICKUP_HAUNTEDCHEST,
28
+ PickupVariant.PICKUP_LOCKEDCHEST,
29
+ PickupVariant.PICKUP_REDCHEST,
30
+ PickupVariant.PICKUP_MOMSCHEST
31
+ })
19
32
  function ____exports.isChest(self, pickup)
20
33
  return CHEST_PICKUP_VARIANTS:has(pickup.Variant)
21
34
  end
@@ -1,6 +1,6 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  /**
3
- * This is a helper function to get a pill effect name from a PillEffect.
3
+ * Helper function to get a pill effect name from a PillEffect.
4
4
  *
5
5
  * Example:
6
6
  * ```
@@ -20,6 +20,18 @@ export declare function anyPlayerCloserThan(position: Vector, distance: float):
20
20
  export declare function anyPlayerHasCollectible(collectibleType: CollectibleType | int): boolean;
21
21
  export declare function anyPlayerHasTrinket(trinketType: TrinketType | int): boolean;
22
22
  export declare function anyPlayerIs(matchingCharacter: PlayerType): boolean;
23
+ /**
24
+ * Helper function to see if the provided character can have red heart containers. Returns true for
25
+ * characters like Isaac, Magdalene, or Cain. Returns false for characters like Blue Baby. Returns
26
+ * false for The Lost and Tainted Lost.
27
+ */
28
+ export declare function characterCanHaveRedHearts(character: PlayerType): boolean;
29
+ /**
30
+ * Helper function to see if the provided character can have soul hearts. Returns true for
31
+ * characters like Isaac, Magdalene, or Cain. Returns false for characters like Bethany. Returns
32
+ * false for The Lost and Tainted Lost.
33
+ */
34
+ export declare function characterCanHaveSoulHearts(character: PlayerType): boolean;
23
35
  /**
24
36
  * Helper function to get how long Azazel's Brimstone laser should be. You can pass either an
25
37
  * `EntityPlayer` object or a tear height stat.