isaacscript-common 2.0.16 → 2.0.19
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.
- package/dist/callbacks/itemPickup.lua +3 -3
- package/dist/callbacks/postCustomDoorEnter.d.ts +5 -3
- package/dist/callbacks/postDoorRender.d.ts +1 -0
- package/dist/callbacks/postDoorRender.lua +24 -0
- package/dist/callbacks/postDoorUpdate.d.ts +1 -0
- package/dist/callbacks/postDoorUpdate.lua +24 -0
- package/dist/callbacks/postEffectStateChanged.lua +1 -1
- package/dist/callbacks/postFamiliarStateChanged.lua +1 -1
- package/dist/callbacks/postGridEntity.lua +5 -4
- package/dist/callbacks/postGridEntityRender.d.ts +1 -0
- package/dist/callbacks/postGridEntityRender.lua +24 -0
- package/dist/callbacks/postItemDischarged.lua +5 -5
- package/dist/callbacks/postNPCStateChanged.lua +1 -1
- package/dist/callbacks/postPickupStateChanged.lua +1 -1
- package/dist/callbacks/postPitRender.d.ts +1 -0
- package/dist/callbacks/postPitRender.lua +24 -0
- package/dist/callbacks/postPitUpdate.d.ts +1 -0
- package/dist/callbacks/postPitUpdate.lua +24 -0
- package/dist/callbacks/postPlayerChangeType.lua +1 -1
- package/dist/callbacks/postPoopRender.d.ts +1 -0
- package/dist/callbacks/postPoopRender.lua +24 -0
- package/dist/callbacks/postPoopUpdate.d.ts +1 -0
- package/dist/callbacks/postPoopUpdate.lua +24 -0
- package/dist/callbacks/postPressurePlateRender.d.ts +1 -0
- package/dist/callbacks/postPressurePlateRender.lua +24 -0
- package/dist/callbacks/postPressurePlateUpdate.d.ts +1 -0
- package/dist/callbacks/postPressurePlateUpdate.lua +24 -0
- package/dist/callbacks/postRockRender.d.ts +1 -0
- package/dist/callbacks/postRockRender.lua +24 -0
- package/dist/callbacks/postRockUpdate.d.ts +1 -0
- package/dist/callbacks/postRockUpdate.lua +24 -0
- package/dist/callbacks/postSlotRender.lua +1 -1
- package/dist/callbacks/postSpikesRender.d.ts +1 -0
- package/dist/callbacks/postSpikesRender.lua +24 -0
- package/dist/callbacks/postSpikesUpdate.d.ts +1 -0
- package/dist/callbacks/postSpikesUpdate.lua +24 -0
- package/dist/callbacks/postTNTRender.d.ts +1 -0
- package/dist/callbacks/postTNTRender.lua +24 -0
- package/dist/callbacks/postTNTUpdate.d.ts +1 -0
- package/dist/callbacks/postTNTUpdate.lua +24 -0
- package/dist/callbacks/subscriptions/postDoorRender.d.ts +5 -0
- package/dist/callbacks/subscriptions/postDoorRender.lua +24 -0
- package/dist/callbacks/subscriptions/postDoorUpdate.d.ts +5 -0
- package/dist/callbacks/subscriptions/postDoorUpdate.lua +24 -0
- package/dist/callbacks/subscriptions/postGridEntityBroken.d.ts +2 -1
- package/dist/callbacks/subscriptions/postGridEntityBroken.lua +8 -2
- package/dist/callbacks/subscriptions/postGridEntityCollision.d.ts +2 -1
- package/dist/callbacks/subscriptions/postGridEntityCollision.lua +5 -0
- package/dist/callbacks/subscriptions/postGridEntityInit.d.ts +2 -1
- package/dist/callbacks/subscriptions/postGridEntityInit.lua +8 -2
- package/dist/callbacks/subscriptions/postGridEntityRemove.d.ts +2 -1
- package/dist/callbacks/subscriptions/postGridEntityRemove.lua +5 -1
- package/dist/callbacks/subscriptions/postGridEntityRender.d.ts +6 -0
- package/dist/callbacks/subscriptions/postGridEntityRender.lua +29 -0
- package/dist/callbacks/subscriptions/postGridEntityStateChanged.d.ts +2 -1
- package/dist/callbacks/subscriptions/postGridEntityStateChanged.lua +8 -2
- package/dist/callbacks/subscriptions/postGridEntityUpdate.d.ts +2 -1
- package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +8 -2
- package/dist/callbacks/subscriptions/postItemPickup.d.ts +9 -5
- package/dist/callbacks/subscriptions/postItemPickup.lua +2 -2
- package/dist/callbacks/subscriptions/postPitRender.d.ts +5 -0
- package/dist/callbacks/subscriptions/postPitRender.lua +24 -0
- package/dist/callbacks/subscriptions/postPitUpdate.d.ts +5 -0
- package/dist/callbacks/subscriptions/postPitUpdate.lua +24 -0
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.d.ts +3 -2
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +5 -0
- package/dist/callbacks/subscriptions/postPlayerChangeType.d.ts +3 -2
- package/dist/callbacks/subscriptions/postPlayerChangeType.lua +8 -1
- package/dist/callbacks/subscriptions/postPlayerFatalDamage.d.ts +3 -2
- package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +5 -0
- package/dist/callbacks/subscriptions/postPlayerInitLate.d.ts +3 -2
- package/dist/callbacks/subscriptions/postPlayerInitLate.lua +5 -0
- package/dist/callbacks/subscriptions/postPlayerInitReordered.d.ts +3 -2
- package/dist/callbacks/subscriptions/postPlayerInitReordered.lua +5 -0
- package/dist/callbacks/subscriptions/postPlayerRenderReordered.d.ts +3 -2
- package/dist/callbacks/subscriptions/postPlayerRenderReordered.lua +5 -0
- package/dist/callbacks/subscriptions/postPlayerUpdateReordered.d.ts +3 -2
- package/dist/callbacks/subscriptions/postPlayerUpdateReordered.lua +5 -0
- package/dist/callbacks/subscriptions/postPoopRender.d.ts +5 -0
- package/dist/callbacks/subscriptions/postPoopRender.lua +24 -0
- package/dist/callbacks/subscriptions/postPoopUpdate.d.ts +5 -0
- package/dist/callbacks/subscriptions/postPoopUpdate.lua +24 -0
- package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts +5 -0
- package/dist/callbacks/subscriptions/postPressurePlateRender.lua +24 -0
- package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts +5 -0
- package/dist/callbacks/subscriptions/postPressurePlateUpdate.lua +24 -0
- package/dist/callbacks/subscriptions/postRockRender.d.ts +5 -0
- package/dist/callbacks/subscriptions/postRockRender.lua +24 -0
- package/dist/callbacks/subscriptions/postRockUpdate.d.ts +5 -0
- package/dist/callbacks/subscriptions/postRockUpdate.lua +24 -0
- package/dist/callbacks/subscriptions/postSacrifice.d.ts +4 -2
- package/dist/callbacks/subscriptions/postSacrifice.lua +13 -1
- package/dist/callbacks/subscriptions/postSlotAnimationChanged.d.ts +1 -1
- package/dist/callbacks/subscriptions/postSlotDestroyed.d.ts +1 -1
- package/dist/callbacks/subscriptions/postSlotInit.d.ts +1 -1
- package/dist/callbacks/subscriptions/postSlotRender.d.ts +1 -1
- package/dist/callbacks/subscriptions/postSlotUpdate.d.ts +1 -1
- package/dist/callbacks/subscriptions/postSpikesRender.d.ts +5 -0
- package/dist/callbacks/subscriptions/postSpikesRender.lua +24 -0
- package/dist/callbacks/subscriptions/postSpikesUpdate.d.ts +5 -0
- package/dist/callbacks/subscriptions/postSpikesUpdate.lua +24 -0
- package/dist/callbacks/subscriptions/postTNTRender.d.ts +5 -0
- package/dist/callbacks/subscriptions/postTNTRender.lua +24 -0
- package/dist/callbacks/subscriptions/postTNTUpdate.d.ts +5 -0
- package/dist/callbacks/subscriptions/postTNTUpdate.lua +24 -0
- package/dist/callbacks/subscriptions/preBerserkDeath.d.ts +3 -2
- package/dist/callbacks/subscriptions/preBerserkDeath.lua +5 -0
- package/dist/callbacks/subscriptions/preCustomRevive.d.ts +4 -2
- package/dist/callbacks/subscriptions/preCustomRevive.lua +15 -3
- package/dist/callbacks/subscriptions/preItemPickup.d.ts +9 -5
- package/dist/callbacks/subscriptions/preItemPickup.lua +2 -2
- package/dist/classes/DefaultMap.d.ts +8 -8
- package/dist/classes/DefaultMap.lua +3 -3
- package/dist/constants.d.ts +3 -2
- package/dist/constants.lua +2 -2
- package/dist/constantsMax.d.ts +15 -9
- package/dist/constantsMax.lua +7 -1
- package/dist/enums/ModCallbackCustom.d.ts +69 -54
- package/dist/enums/ModCallbackCustom.lua +84 -54
- package/dist/features/debugDisplay.d.ts +7 -0
- package/dist/features/debugDisplay.lua +117 -14
- package/dist/features/deployJSONRoom.lua +2 -2
- package/dist/features/extraConsoleCommands/commands.lua +32 -27
- package/dist/features/extraConsoleCommands/commandsDisplay.d.ts +63 -0
- package/dist/features/extraConsoleCommands/commandsDisplay.lua +49 -0
- package/dist/features/extraConsoleCommands/init.d.ts +2 -2
- package/dist/features/extraConsoleCommands/init.lua +18 -1
- package/dist/features/getCollectibleItemPoolType.lua +3 -2
- package/dist/features/playerInventory.lua +6 -6
- package/dist/features/preventCollectibleRotate.lua +7 -2
- package/dist/functions/array.lua +1 -1
- package/dist/functions/boss.d.ts +2 -3
- package/dist/functions/cards.lua +3 -1
- package/dist/functions/character.lua +2 -2
- package/dist/functions/charge.d.ts +6 -6
- package/dist/functions/collectibleCacheFlag.lua +3 -1
- package/dist/functions/collectibleSet.lua +3 -1
- package/dist/functions/collectibleTag.lua +3 -1
- package/dist/functions/collectibles.d.ts +1 -0
- package/dist/functions/collectibles.lua +32 -16
- package/dist/functions/entity.d.ts +1 -1
- package/dist/functions/entitySpecific.d.ts +4 -5
- package/dist/functions/entityTypes.d.ts +5 -0
- package/dist/functions/entityTypes.lua +10 -0
- package/dist/functions/familiars.d.ts +3 -3
- package/dist/functions/gridEntity.d.ts +0 -5
- package/dist/functions/gridEntity.lua +0 -14
- package/dist/functions/gridEntitySpecific.d.ts +18 -0
- package/dist/functions/gridEntitySpecific.lua +88 -0
- package/dist/functions/log.lua +2 -3
- package/dist/functions/npc.lua +3 -1
- package/dist/functions/npcTypes.d.ts +3 -0
- package/dist/functions/npcTypes.lua +7 -0
- package/dist/functions/pickupVariants.d.ts +13 -0
- package/dist/functions/pickupVariants.lua +22 -0
- package/dist/functions/pickups.lua +3 -1
- package/dist/functions/playerIndex.d.ts +2 -2
- package/dist/functions/rooms.d.ts +2 -3
- package/dist/functions/rooms.lua +5 -3
- package/dist/functions/run.lua +3 -1
- package/dist/functions/stage.d.ts +1 -1
- package/dist/functions/stage.lua +6 -5
- package/dist/functions/trinketCacheFlag.lua +3 -1
- package/dist/functions/trinketSet.lua +3 -1
- package/dist/functions/trinkets.lua +7 -3
- package/dist/index.d.ts +3 -0
- package/dist/index.lua +24 -0
- package/dist/initCustomCallbacks.lua +45 -0
- package/dist/initFeatures.lua +0 -3
- package/dist/maps/cardMap.lua +204 -202
- package/dist/maps/pillEffectMap.lua +82 -80
- package/dist/objects/callbackRegisterFunctions.lua +45 -0
- package/dist/objects/cardDescriptions.lua +1 -1
- package/dist/objects/cardNames.lua +1 -1
- package/dist/objects/cardTypes.lua +1 -1
- package/dist/types/AddCallbackParameterCustom.d.ts +30 -0
- package/dist/types/PickingUpItem.d.ts +2 -0
- package/dist/types/PickingUpItem.lua +10 -0
- package/dist/types/private/TSTLClassMetatable.d.ts +1 -1
- package/package.json +3 -3
|
@@ -5,6 +5,7 @@ local ____exports = {}
|
|
|
5
5
|
local ____cachedClasses = require("cachedClasses")
|
|
6
6
|
local itemConfig = ____cachedClasses.itemConfig
|
|
7
7
|
local ____constantsMax = require("constantsMax")
|
|
8
|
+
local FIRST_COLLECTIBLE_TYPE = ____constantsMax.FIRST_COLLECTIBLE_TYPE
|
|
8
9
|
local MAX_COLLECTIBLE_TYPE = ____constantsMax.MAX_COLLECTIBLE_TYPE
|
|
9
10
|
local ____set = require("functions.set")
|
|
10
11
|
local copySet = ____set.copySet
|
|
@@ -12,7 +13,8 @@ local ____utils = require("functions.utils")
|
|
|
12
13
|
local irange = ____utils.irange
|
|
13
14
|
local COLLECTIBLE_SET = __TS__New(Set)
|
|
14
15
|
local function initCollectibleSet(self)
|
|
15
|
-
for ____,
|
|
16
|
+
for ____, collectibleTypeInt in ipairs(irange(nil, FIRST_COLLECTIBLE_TYPE, MAX_COLLECTIBLE_TYPE)) do
|
|
17
|
+
local collectibleType = collectibleTypeInt
|
|
16
18
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
17
19
|
if itemConfigItem ~= nil then
|
|
18
20
|
COLLECTIBLE_SET:add(collectibleType)
|
|
@@ -9,6 +9,7 @@ local ItemConfigTag = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigTag
|
|
|
9
9
|
local ____cachedClasses = require("cachedClasses")
|
|
10
10
|
local itemConfig = ____cachedClasses.itemConfig
|
|
11
11
|
local ____constantsMax = require("constantsMax")
|
|
12
|
+
local FIRST_COLLECTIBLE_TYPE = ____constantsMax.FIRST_COLLECTIBLE_TYPE
|
|
12
13
|
local MAX_COLLECTIBLE_TYPE = ____constantsMax.MAX_COLLECTIBLE_TYPE
|
|
13
14
|
local ____enums = require("functions.enums")
|
|
14
15
|
local getEnumValues = ____enums.getEnumValues
|
|
@@ -35,7 +36,8 @@ local function initTagMap(self)
|
|
|
35
36
|
__TS__New(Set)
|
|
36
37
|
)
|
|
37
38
|
end
|
|
38
|
-
for ____,
|
|
39
|
+
for ____, collectibleTypeInt in ipairs(irange(nil, FIRST_COLLECTIBLE_TYPE, MAX_COLLECTIBLE_TYPE)) do
|
|
40
|
+
local collectibleType = collectibleTypeInt
|
|
39
41
|
for ____, itemConfigTag in ipairs(getEnumValues(nil, ItemConfigTag)) do
|
|
40
42
|
do
|
|
41
43
|
if not ____exports.collectibleHasTag(nil, collectibleType, itemConfigTag) then
|
|
@@ -123,6 +123,7 @@ export declare function isPassiveCollectible(collectibleType: CollectibleType):
|
|
|
123
123
|
* dynamically know if a modded item will disappear.
|
|
124
124
|
*/
|
|
125
125
|
export declare function isSingleUseCollectible(collectibleType: CollectibleType): boolean;
|
|
126
|
+
export declare function isValidCollectibleType(collectibleType: CollectibleType): boolean;
|
|
126
127
|
/**
|
|
127
128
|
* Helper function to put a message in the log.txt file to let the Rebirth Item Tracker know that it
|
|
128
129
|
* should remove an item.
|
|
@@ -21,8 +21,12 @@ local COLLECTIBLE_NAME_MAP = ____collectibleNameMap.COLLECTIBLE_NAME_MAP
|
|
|
21
21
|
local DEFAULT_COLLECTIBLE_NAME = ____collectibleNameMap.DEFAULT_COLLECTIBLE_NAME
|
|
22
22
|
local ____singleUseActiveCollectibleTypesSet = require("sets.singleUseActiveCollectibleTypesSet")
|
|
23
23
|
local SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET = ____singleUseActiveCollectibleTypesSet.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET
|
|
24
|
+
local ____entity = require("functions.entity")
|
|
25
|
+
local getEntityID = ____entity.getEntityID
|
|
24
26
|
local ____flag = require("functions.flag")
|
|
25
27
|
local hasFlag = ____flag.hasFlag
|
|
28
|
+
local ____pickupVariants = require("functions.pickupVariants")
|
|
29
|
+
local isCollectible = ____pickupVariants.isCollectible
|
|
26
30
|
local ____roomData = require("functions.roomData")
|
|
27
31
|
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
28
32
|
local ____sprite = require("functions.sprite")
|
|
@@ -36,8 +40,9 @@ function initQuestionMarkSprite(self)
|
|
|
36
40
|
return sprite
|
|
37
41
|
end
|
|
38
42
|
function ____exports.setCollectibleSprite(self, collectible, pngPath)
|
|
39
|
-
if
|
|
40
|
-
|
|
43
|
+
if not isCollectible(nil, collectible) then
|
|
44
|
+
local entityID = getEntityID(nil, collectible)
|
|
45
|
+
error("The \"setCollectibleSprite\" function was given a non-collectible: " .. entityID)
|
|
41
46
|
end
|
|
42
47
|
local sprite = collectible:GetSprite()
|
|
43
48
|
if pngPath == nil then
|
|
@@ -116,8 +121,9 @@ function ____exports.getCollectibleGfxFilename(self, collectibleType)
|
|
|
116
121
|
return itemConfigItem.GfxFileName
|
|
117
122
|
end
|
|
118
123
|
function ____exports.getCollectibleIndex(self, collectible)
|
|
119
|
-
if
|
|
120
|
-
|
|
124
|
+
if not isCollectible(nil, collectible) then
|
|
125
|
+
local entityID = getEntityID(nil, collectible)
|
|
126
|
+
error("The \"getCollectibleIndex\" function was given a non-collectible: " .. entityID)
|
|
121
127
|
end
|
|
122
128
|
local level = game:GetLevel()
|
|
123
129
|
local stage = level:GetStage()
|
|
@@ -164,8 +170,9 @@ function ____exports.getCollectibleName(self, collectibleType)
|
|
|
164
170
|
return DEFAULT_COLLECTIBLE_NAME
|
|
165
171
|
end
|
|
166
172
|
function ____exports.getCollectiblePedestalType(self, collectible)
|
|
167
|
-
if
|
|
168
|
-
|
|
173
|
+
if not isCollectible(nil, collectible) then
|
|
174
|
+
local entityID = getEntityID(nil, collectible)
|
|
175
|
+
error("The \"getCollectiblePedestalType\" function was given a non-collectible: " .. entityID)
|
|
169
176
|
end
|
|
170
177
|
local sprite = collectible:GetSprite()
|
|
171
178
|
return sprite:GetOverlayFrame()
|
|
@@ -186,8 +193,9 @@ function ____exports.isActiveCollectible(self, collectibleType)
|
|
|
186
193
|
return itemType == ItemType.ACTIVE
|
|
187
194
|
end
|
|
188
195
|
function ____exports.isBlindCollectible(self, collectible)
|
|
189
|
-
if
|
|
190
|
-
|
|
196
|
+
if not isCollectible(nil, collectible) then
|
|
197
|
+
local entityID = getEntityID(nil, collectible)
|
|
198
|
+
error("The \"isBlindCollectible\" function was given a non-collectible: " .. entityID)
|
|
191
199
|
end
|
|
192
200
|
local sprite = collectible:GetSprite()
|
|
193
201
|
local animation = sprite:GetAnimation()
|
|
@@ -205,32 +213,40 @@ end
|
|
|
205
213
|
function ____exports.isSingleUseCollectible(self, collectibleType)
|
|
206
214
|
return SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET:has(collectibleType)
|
|
207
215
|
end
|
|
216
|
+
function ____exports.isValidCollectibleType(self, collectibleType)
|
|
217
|
+
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
218
|
+
return itemConfigItem ~= nil
|
|
219
|
+
end
|
|
208
220
|
function ____exports.removeCollectibleFromItemTracker(self, collectibleType)
|
|
209
221
|
local collectibleName = ____exports.getCollectibleName(nil, collectibleType)
|
|
210
222
|
Isaac.DebugString(((("Removing collectible " .. tostring(collectibleType)) .. " (") .. collectibleName) .. ") on player 0 (Player)")
|
|
211
223
|
end
|
|
212
224
|
function ____exports.removeCollectiblePickupDelay(self, collectible)
|
|
213
|
-
if
|
|
214
|
-
|
|
225
|
+
if not isCollectible(nil, collectible) then
|
|
226
|
+
local entityID = getEntityID(nil, collectible)
|
|
227
|
+
error("The \"removeCollectiblePickupDelay\" function was given a non-collectible: " .. entityID)
|
|
215
228
|
end
|
|
216
229
|
collectible.Wait = 0
|
|
217
230
|
end
|
|
218
231
|
function ____exports.setCollectibleBlind(self, collectible)
|
|
219
|
-
if
|
|
220
|
-
|
|
232
|
+
if not isCollectible(nil, collectible) then
|
|
233
|
+
local entityID = getEntityID(nil, collectible)
|
|
234
|
+
error("The \"setCollectibleBlind\" function was given a non-collectible: " .. entityID)
|
|
221
235
|
end
|
|
222
236
|
____exports.setCollectibleSprite(nil, collectible, BLIND_ITEM_PNG_PATH)
|
|
223
237
|
end
|
|
224
238
|
function ____exports.setCollectibleEmpty(self, collectible)
|
|
225
|
-
if
|
|
226
|
-
|
|
239
|
+
if not isCollectible(nil, collectible) then
|
|
240
|
+
local entityID = getEntityID(nil, collectible)
|
|
241
|
+
error("The \"setCollectibleEmpty\" function was given a non-collectible: " .. entityID)
|
|
227
242
|
end
|
|
228
243
|
collectible.SubType = CollectibleType.NULL
|
|
229
244
|
____exports.clearCollectibleSprite(nil, collectible)
|
|
230
245
|
end
|
|
231
246
|
function ____exports.setCollectibleSubType(self, collectible, newCollectibleType)
|
|
232
|
-
if
|
|
233
|
-
|
|
247
|
+
if not isCollectible(nil, collectible) then
|
|
248
|
+
local entityID = getEntityID(nil, collectible)
|
|
249
|
+
error("The \"setCollectibleSubType\" function was given a non-collectible: " .. entityID)
|
|
234
250
|
end
|
|
235
251
|
if newCollectibleType == CollectibleType.NULL then
|
|
236
252
|
____exports.setCollectibleEmpty(nil, collectible)
|
|
@@ -98,7 +98,7 @@ export declare function parseEntityTypeVariantString(entityTypeVariantString: st
|
|
|
98
98
|
* @param cap Optional. If specified, will only remove the given amount of collectibles.
|
|
99
99
|
* @returns True if one or more entities were removed, false otherwise.
|
|
100
100
|
*/
|
|
101
|
-
export declare function removeAllMatchingEntities(entityType:
|
|
101
|
+
export declare function removeAllMatchingEntities(entityType: EntityType, entityVariant?: number, entitySubType?: number, cap?: int | undefined): boolean;
|
|
102
102
|
/**
|
|
103
103
|
* Helper function to remove all of the entities in the supplied array.
|
|
104
104
|
*
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BombVariant, EffectVariant, EntityType, FamiliarVariant, KnifeVariant, LaserVariant, PickupVariant, ProjectileVariant, SlotVariant, TearVariant } from "isaac-typescript-definitions";
|
|
2
|
-
import { EntityTypeNonNPC } from "../types/EntityTypeNonNPC";
|
|
3
2
|
/**
|
|
4
3
|
* Helper function to get all of the `EntityType.BOMB` in the room.
|
|
5
4
|
*
|
|
@@ -105,7 +104,7 @@ export declare function getProjectiles(projectileVariant?: ProjectileVariant, su
|
|
|
105
104
|
* }
|
|
106
105
|
* ```
|
|
107
106
|
*/
|
|
108
|
-
export declare function getSlots(slotVariant?: SlotVariant, subType?: number):
|
|
107
|
+
export declare function getSlots(slotVariant?: SlotVariant, subType?: number): EntitySlot[];
|
|
109
108
|
/**
|
|
110
109
|
* Helper function to get all of the `EntityType.TEAR` in the room.
|
|
111
110
|
*
|
|
@@ -230,9 +229,9 @@ export declare function spawnLaser(laserVariant: LaserVariant, subType: int, pos
|
|
|
230
229
|
/** Helper function to spawn a `EntityType.LASER` (7) with a specific seed. */
|
|
231
230
|
export declare function spawnLaserWithSeed(laserVariant: LaserVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityLaser;
|
|
232
231
|
/** Helper function to spawn an NPC. */
|
|
233
|
-
export declare function spawnNPC
|
|
232
|
+
export declare function spawnNPC(entityType: EntityType, variant: int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityNPC;
|
|
234
233
|
/** Helper function to spawn an NPC with a specific seed. */
|
|
235
|
-
export declare function spawnNPCWithSeed
|
|
234
|
+
export declare function spawnNPCWithSeed(entityType: EntityType, variant: int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityNPC;
|
|
236
235
|
/** Helper function to spawn a `EntityType.PICKUP` (5). */
|
|
237
236
|
export declare function spawnPickup(pickupVariant: PickupVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
238
237
|
/** Helper function to spawn a `EntityType.PICKUP` (5) with a specific seed. */
|
|
@@ -244,7 +243,7 @@ export declare function spawnProjectileWithSeed(projectileVariant: ProjectileVar
|
|
|
244
243
|
/** Helper function to spawn a `EntityType.SLOT` (6). */
|
|
245
244
|
export declare function spawnSlot(slotVariant: SlotVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): Entity;
|
|
246
245
|
/** Helper function to spawn a `EntityType.SLOT` (6) with a specific seed. */
|
|
247
|
-
export declare function spawnSlotWithSeed(slotVariant:
|
|
246
|
+
export declare function spawnSlotWithSeed(slotVariant: SlotVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): Entity;
|
|
248
247
|
/** Helper function to spawn a `EntityType.TEAR` (2). */
|
|
249
248
|
export declare function spawnTear(tearVariant: TearVariant, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityTear;
|
|
250
249
|
/** Helper function to spawn a `EntityType.EntityType` (2) with a specific seed. */
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/** For EntityType.RAGLING (246) */
|
|
3
|
+
export declare function isSlot(entity: Entity): entity is EntitySlot;
|
|
4
|
+
/** For EntityType.RAGLING (246) */
|
|
5
|
+
export declare function isRagling(npc: EntityNPC): npc is EntityNPCRagling;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
|
+
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
4
|
+
function ____exports.isSlot(self, entity)
|
|
5
|
+
return entity.Type == EntityType.SLOT
|
|
6
|
+
end
|
|
7
|
+
function ____exports.isRagling(self, npc)
|
|
8
|
+
return npc.Type == EntityType.RAGLING
|
|
9
|
+
end
|
|
10
|
+
return ____exports
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { CollectibleType, FamiliarVariant } from "isaac-typescript-definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to add and remove familiars based on a target amount that you specify.
|
|
4
4
|
*
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* specified, it will search for existing familiars of all sub-types, and
|
|
29
29
|
* spawn new familiars with a sub-type of 0.
|
|
30
30
|
*/
|
|
31
|
-
export declare function checkFamiliar(player: EntityPlayer, collectibleType:
|
|
31
|
+
export declare function checkFamiliar(player: EntityPlayer, collectibleType: CollectibleType, targetCount: int, familiarVariant: FamiliarVariant, familiarSubType?: int): void;
|
|
32
32
|
/**
|
|
33
33
|
* Helper function to add and remove familiars based on the amount of associated collectibles that a
|
|
34
34
|
* player has.
|
|
@@ -56,5 +56,5 @@ export declare function checkFamiliar(player: EntityPlayer, collectibleType: int
|
|
|
56
56
|
* specified, it will search for existing familiars of all sub-types, and
|
|
57
57
|
* spawn new familiars with a sub-type of 0.
|
|
58
58
|
*/
|
|
59
|
-
export declare function checkFamiliarFromCollectibles(player: EntityPlayer, collectibleType:
|
|
59
|
+
export declare function checkFamiliarFromCollectibles(player: EntityPlayer, collectibleType: CollectibleType, familiarVariant: FamiliarVariant, familiarSubType?: int): void;
|
|
60
60
|
export declare function isFamiliarThatShootsPlayerTears(familiar: EntityFamiliar): boolean;
|
|
@@ -55,11 +55,6 @@ export declare function getTopLeftWall(): GridEntity | undefined;
|
|
|
55
55
|
* room shape is.)
|
|
56
56
|
*/
|
|
57
57
|
export declare function getTopLeftWallGridIndex(): int;
|
|
58
|
-
/**
|
|
59
|
-
* Helper function to determine if all of the pressure plates in the current room are pushed.
|
|
60
|
-
* Returns true if there are no pressure plates in the room.
|
|
61
|
-
*/
|
|
62
|
-
export declare function isAllPressurePlatesPushed(): boolean;
|
|
63
58
|
export declare function isGridEntityBreakableByExplosion(gridEntity: GridEntity): boolean;
|
|
64
59
|
/**
|
|
65
60
|
* Helper function to see if the provided gridEntity is in its respective broken state. See the
|
|
@@ -3,14 +3,12 @@ local Set = ____lualib.Set
|
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
4
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
5
5
|
local Map = ____lualib.Map
|
|
6
|
-
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
7
6
|
local ____exports = {}
|
|
8
7
|
local getAllGridEntities
|
|
9
8
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
10
9
|
local GridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.GridCollisionClass
|
|
11
10
|
local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
|
|
12
11
|
local PoopGridEntityVariant = ____isaac_2Dtypescript_2Ddefinitions.PoopGridEntityVariant
|
|
13
|
-
local PressurePlateState = ____isaac_2Dtypescript_2Ddefinitions.PressurePlateState
|
|
14
12
|
local StatueVariant = ____isaac_2Dtypescript_2Ddefinitions.StatueVariant
|
|
15
13
|
local TrapdoorVariant = ____isaac_2Dtypescript_2Ddefinitions.TrapdoorVariant
|
|
16
14
|
local ____cachedClasses = require("cachedClasses")
|
|
@@ -191,18 +189,6 @@ function ____exports.getTopLeftWall(self)
|
|
|
191
189
|
local topLeftWallGridIndex = ____exports.getTopLeftWallGridIndex(nil)
|
|
192
190
|
return room:GetGridEntity(topLeftWallGridIndex)
|
|
193
191
|
end
|
|
194
|
-
function ____exports.isAllPressurePlatesPushed(self)
|
|
195
|
-
local room = game:GetRoom()
|
|
196
|
-
local hasPressurePlates = room:HasTriggerPressurePlates()
|
|
197
|
-
if not hasPressurePlates then
|
|
198
|
-
return true
|
|
199
|
-
end
|
|
200
|
-
local pressurePlates = ____exports.getGridEntities(nil, GridEntityType.PRESSURE_PLATE)
|
|
201
|
-
return __TS__ArrayEvery(
|
|
202
|
-
pressurePlates,
|
|
203
|
-
function(____, pressurePlate) return pressurePlate.State == PressurePlateState.PRESSURE_PLATE_PRESSED end
|
|
204
|
-
)
|
|
205
|
-
end
|
|
206
192
|
function ____exports.isGridEntityBreakableByExplosion(self, gridEntity)
|
|
207
193
|
local gridEntityType = gridEntity:GetType()
|
|
208
194
|
local gridEntityVariant = gridEntity:GetVariant()
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/** Helper function to get all of the `GridEntityPit` in the room. */
|
|
3
|
+
export declare function getPits(): GridEntityPit[];
|
|
4
|
+
/** Helper function to get all of the `GridEntityPoop` in the room. */
|
|
5
|
+
export declare function getPoops(): GridEntityPoop[];
|
|
6
|
+
/** Helper function to get all of the `GridEntityPressurePlate` in the room. */
|
|
7
|
+
export declare function getPressurePlates(): GridEntityPressurePlate[];
|
|
8
|
+
/** Helper function to get all of the `GridEntityRock` in the room. */
|
|
9
|
+
export declare function getRocks(): GridEntityRock[];
|
|
10
|
+
/** Helper function to get all of the `GridEntitySpikes` in the room. */
|
|
11
|
+
export declare function getSpikes(): GridEntitySpikes[];
|
|
12
|
+
/** Helper function to get all of the `GridEntityTNT` in the room. */
|
|
13
|
+
export declare function getTNT(): GridEntityTNT[];
|
|
14
|
+
/**
|
|
15
|
+
* Helper function to determine if all of the pressure plates in the current room are pushed.
|
|
16
|
+
* Returns true if there are no pressure plates in the room.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isAllPressurePlatesPushed(): boolean;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
5
|
+
local PressurePlateState = ____isaac_2Dtypescript_2Ddefinitions.PressurePlateState
|
|
6
|
+
local ____cachedClasses = require("cachedClasses")
|
|
7
|
+
local game = ____cachedClasses.game
|
|
8
|
+
local ____gridEntity = require("functions.gridEntity")
|
|
9
|
+
local getGridEntities = ____gridEntity.getGridEntities
|
|
10
|
+
function ____exports.getPits(self)
|
|
11
|
+
local gridEntities = getGridEntities(nil)
|
|
12
|
+
local pits = {}
|
|
13
|
+
for ____, gridEntity in ipairs(gridEntities) do
|
|
14
|
+
local pit = gridEntity:ToPit()
|
|
15
|
+
if pit ~= nil then
|
|
16
|
+
pits[#pits + 1] = pit
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
return pits
|
|
20
|
+
end
|
|
21
|
+
function ____exports.getPoops(self)
|
|
22
|
+
local gridEntities = getGridEntities(nil)
|
|
23
|
+
local poops = {}
|
|
24
|
+
for ____, gridEntity in ipairs(gridEntities) do
|
|
25
|
+
local poop = gridEntity:ToPoop()
|
|
26
|
+
if poop ~= nil then
|
|
27
|
+
poops[#poops + 1] = poop
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
return poops
|
|
31
|
+
end
|
|
32
|
+
function ____exports.getPressurePlates(self)
|
|
33
|
+
local gridEntities = getGridEntities(nil)
|
|
34
|
+
local pressurePlates = {}
|
|
35
|
+
for ____, gridEntity in ipairs(gridEntities) do
|
|
36
|
+
local pressurePlate = gridEntity:ToPressurePlate()
|
|
37
|
+
if pressurePlate ~= nil then
|
|
38
|
+
pressurePlates[#pressurePlates + 1] = pressurePlate
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
return pressurePlates
|
|
42
|
+
end
|
|
43
|
+
function ____exports.getRocks(self)
|
|
44
|
+
local gridEntities = getGridEntities(nil)
|
|
45
|
+
local rocks = {}
|
|
46
|
+
for ____, gridEntity in ipairs(gridEntities) do
|
|
47
|
+
local rock = gridEntity:ToRock()
|
|
48
|
+
if rock ~= nil then
|
|
49
|
+
rocks[#rocks + 1] = rock
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
return rocks
|
|
53
|
+
end
|
|
54
|
+
function ____exports.getSpikes(self)
|
|
55
|
+
local gridEntities = getGridEntities(nil)
|
|
56
|
+
local spikes = {}
|
|
57
|
+
for ____, gridEntity in ipairs(gridEntities) do
|
|
58
|
+
local spike = gridEntity:ToSpikes()
|
|
59
|
+
if spike ~= nil then
|
|
60
|
+
spikes[#spikes + 1] = spike
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
return spikes
|
|
64
|
+
end
|
|
65
|
+
function ____exports.getTNT(self)
|
|
66
|
+
local gridEntities = getGridEntities(nil)
|
|
67
|
+
local tntArray = {}
|
|
68
|
+
for ____, gridEntity in ipairs(gridEntities) do
|
|
69
|
+
local tnt = gridEntity:ToTNT()
|
|
70
|
+
if tnt ~= nil then
|
|
71
|
+
tntArray[#tntArray + 1] = tnt
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
return tntArray
|
|
75
|
+
end
|
|
76
|
+
function ____exports.isAllPressurePlatesPushed(self)
|
|
77
|
+
local room = game:GetRoom()
|
|
78
|
+
local hasPressurePlates = room:HasTriggerPressurePlates()
|
|
79
|
+
if not hasPressurePlates then
|
|
80
|
+
return true
|
|
81
|
+
end
|
|
82
|
+
local pressurePlates = ____exports.getPressurePlates(nil)
|
|
83
|
+
return __TS__ArrayEvery(
|
|
84
|
+
pressurePlates,
|
|
85
|
+
function(____, pressurePlate) return pressurePlate.State == PressurePlateState.PRESSURE_PLATE_PRESSED end
|
|
86
|
+
)
|
|
87
|
+
end
|
|
88
|
+
return ____exports
|
package/dist/functions/log.lua
CHANGED
|
@@ -10,7 +10,6 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
|
|
|
10
10
|
local DamageFlag = ____isaac_2Dtypescript_2Ddefinitions.DamageFlag
|
|
11
11
|
local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
|
|
12
12
|
local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
|
|
13
|
-
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
14
13
|
local GameStateFlag = ____isaac_2Dtypescript_2Ddefinitions.GameStateFlag
|
|
15
14
|
local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
|
|
16
15
|
local LevelStateFlag = ____isaac_2Dtypescript_2Ddefinitions.LevelStateFlag
|
|
@@ -157,7 +156,8 @@ function ____exports.logEntities(includeBackgroundEffects, entityTypeFilter)
|
|
|
157
156
|
if entityTypeFilter ~= nil and entity.Type ~= entityTypeFilter then
|
|
158
157
|
return
|
|
159
158
|
end
|
|
160
|
-
|
|
159
|
+
local effect = entity:ToEffect()
|
|
160
|
+
if not includeBackgroundEffects and effect ~= nil and IGNORE_EFFECT_VARIANTS:has(effect.Variant) then
|
|
161
161
|
return
|
|
162
162
|
end
|
|
163
163
|
local entityID = getEntityID(nil, entity)
|
|
@@ -166,7 +166,6 @@ function ____exports.logEntities(includeBackgroundEffects, entityTypeFilter)
|
|
|
166
166
|
if bomb ~= nil then
|
|
167
167
|
msg = msg .. " (bomb)"
|
|
168
168
|
end
|
|
169
|
-
local effect = entity:ToEffect()
|
|
170
169
|
if effect ~= nil then
|
|
171
170
|
msg = msg .. (" (effect) (State: " .. tostring(effect.State)) .. ")"
|
|
172
171
|
end
|
package/dist/functions/npc.lua
CHANGED
|
@@ -27,6 +27,8 @@ local getFilteredNewEntities = ____entity.getFilteredNewEntities
|
|
|
27
27
|
local ____entitySpecific = require("functions.entitySpecific")
|
|
28
28
|
local getNPCs = ____entitySpecific.getNPCs
|
|
29
29
|
local getProjectiles = ____entitySpecific.getProjectiles
|
|
30
|
+
local ____entityTypes = require("functions.entityTypes")
|
|
31
|
+
local isRagling = ____entityTypes.isRagling
|
|
30
32
|
function ____exports.isAliveExceptionNPC(self, npc)
|
|
31
33
|
local entityTypeVariant = (tostring(npc.Type) .. ".") .. tostring(npc.Variant)
|
|
32
34
|
if NON_ALIVE_NPCS_TYPE_VARIANT:has(entityTypeVariant) then
|
|
@@ -48,7 +50,7 @@ function ____exports.isDyingEggyWithNoSpidersLeft(self, npc)
|
|
|
48
50
|
return npc.State == NpcState.SUICIDE and npc.StateFrame >= EGGY_STATE_FRAME_OF_FINAL_SPIDER
|
|
49
51
|
end
|
|
50
52
|
function ____exports.isRaglingDeathPatch(self, npc)
|
|
51
|
-
return npc
|
|
53
|
+
return isRagling(nil, npc) and npc.Variant == RaglingVariant.RAG_MANS_RAGLING and npc.State == NpcState.SPECIAL
|
|
52
54
|
end
|
|
53
55
|
NON_ALIVE_NPCS_TYPE_VARIANT = __TS__New(
|
|
54
56
|
Set,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
|
+
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
4
|
+
function ____exports.isRagling(self, npc)
|
|
5
|
+
return npc.Type == EntityType.RAGLING
|
|
6
|
+
end
|
|
7
|
+
return ____exports
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/** For PickupVariant.HEART (10) */
|
|
3
|
+
export declare function isHeart(pickup: EntityPickup): pickup is EntityPickupHeart;
|
|
4
|
+
/** For PickupVariant.COIN (20) */
|
|
5
|
+
export declare function isCoin(pickup: EntityPickup): pickup is EntityPickupCoin;
|
|
6
|
+
/** For PickupVariant.KEY (30) */
|
|
7
|
+
export declare function isKey(pickup: EntityPickup): pickup is EntityPickupKey;
|
|
8
|
+
/** For PickupVariant.BOMB (40) */
|
|
9
|
+
export declare function isBomb(pickup: EntityPickup): pickup is EntityPickupBomb;
|
|
10
|
+
/** For PickupVariant.COLLECTIBLE (100) */
|
|
11
|
+
export declare function isCollectible(pickup: EntityPickup): pickup is EntityPickupCollectible;
|
|
12
|
+
/** For PickupVariant.TRINKET (350) */
|
|
13
|
+
export declare function isTrinket(pickup: EntityPickup): pickup is EntityPickupTrinket;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
|
+
local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
|
|
4
|
+
function ____exports.isHeart(self, pickup)
|
|
5
|
+
return pickup.Variant == PickupVariant.HEART
|
|
6
|
+
end
|
|
7
|
+
function ____exports.isCoin(self, pickup)
|
|
8
|
+
return pickup.Variant == PickupVariant.COIN
|
|
9
|
+
end
|
|
10
|
+
function ____exports.isKey(self, pickup)
|
|
11
|
+
return pickup.Variant == PickupVariant.KEY
|
|
12
|
+
end
|
|
13
|
+
function ____exports.isBomb(self, pickup)
|
|
14
|
+
return pickup.Variant == PickupVariant.BOMB
|
|
15
|
+
end
|
|
16
|
+
function ____exports.isCollectible(self, pickup)
|
|
17
|
+
return pickup.Variant == PickupVariant.COLLECTIBLE
|
|
18
|
+
end
|
|
19
|
+
function ____exports.isTrinket(self, pickup)
|
|
20
|
+
return pickup.Variant == PickupVariant.TRINKET
|
|
21
|
+
end
|
|
22
|
+
return ____exports
|
|
@@ -16,6 +16,8 @@ local ____entitySpecific = require("functions.entitySpecific")
|
|
|
16
16
|
local getPickups = ____entitySpecific.getPickups
|
|
17
17
|
local removeAllPickups = ____entitySpecific.removeAllPickups
|
|
18
18
|
local spawnPickup = ____entitySpecific.spawnPickup
|
|
19
|
+
local ____pickupVariants = require("functions.pickupVariants")
|
|
20
|
+
local isHeart = ____pickupVariants.isHeart
|
|
19
21
|
function ____exports.getBatteries(self, matchingSubType)
|
|
20
22
|
if matchingSubType == nil then
|
|
21
23
|
matchingSubType = -1
|
|
@@ -85,7 +87,7 @@ function ____exports.isChest(self, pickup)
|
|
|
85
87
|
return CHEST_PICKUP_VARIANTS:has(pickup.Variant)
|
|
86
88
|
end
|
|
87
89
|
function ____exports.isRedHeart(self, pickup)
|
|
88
|
-
return pickup
|
|
90
|
+
return isHeart(nil, pickup) and RED_HEART_SUB_TYPES_SET:has(pickup.SubType)
|
|
89
91
|
end
|
|
90
92
|
function ____exports.removeAllBatteries(self, batterySubType, cap)
|
|
91
93
|
return removeAllPickups(nil, PickupVariant.LIL_BATTERY, batterySubType, cap)
|
|
@@ -51,8 +51,8 @@ export declare function getPlayerIndexVanilla(playerToFind: EntityPlayer): int |
|
|
|
51
51
|
* If this is not desired, use the `getAllPlayers` helper function instead.
|
|
52
52
|
*
|
|
53
53
|
* @param performCharacterExclusions Whether or not to exclude characters that are not directly
|
|
54
|
-
*
|
|
55
|
-
*
|
|
54
|
+
* controlled by the player (i.e. Esau & Tainted Soul). Default is
|
|
55
|
+
* false.
|
|
56
56
|
*/
|
|
57
57
|
export declare function getPlayers(performCharacterExclusions?: boolean): EntityPlayer[];
|
|
58
58
|
/**
|
|
@@ -53,9 +53,8 @@ export declare function getRoomTypeName(roomType: RoomType): string;
|
|
|
53
53
|
* the list.
|
|
54
54
|
*
|
|
55
55
|
* @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* false.
|
|
56
|
+
* extra-dimensional rooms are automatically be generated and can be
|
|
57
|
+
* seen when you iterate over the `RoomList`. Default is false.
|
|
59
58
|
*/
|
|
60
59
|
export declare function getRooms(includeExtraDimensionalRooms?: boolean): RoomDescriptor[];
|
|
61
60
|
/**
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -12,6 +12,7 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
|
|
|
12
12
|
local AngelRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.AngelRoomSubType
|
|
13
13
|
local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
|
|
14
14
|
local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
|
|
15
|
+
local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
|
|
15
16
|
local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
|
|
16
17
|
local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
|
|
17
18
|
local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
|
|
@@ -110,7 +111,7 @@ function ____exports.changeRoom(self, roomGridIndex)
|
|
|
110
111
|
if roomData == nil then
|
|
111
112
|
error(("Failed to change the room to grid index " .. tostring(roomGridIndex)) .. " because that room does not exist.")
|
|
112
113
|
end
|
|
113
|
-
level.LeaveDoor =
|
|
114
|
+
level.LeaveDoor = DoorSlot.NO_DOOR_SLOT
|
|
114
115
|
game:ChangeRoom(roomGridIndex)
|
|
115
116
|
end
|
|
116
117
|
function ____exports.getAllRoomGridIndexes(self)
|
|
@@ -128,7 +129,8 @@ function ____exports.getCurrentDimension(self)
|
|
|
128
129
|
local startingRoomGridIndex = level:GetStartingRoomIndex()
|
|
129
130
|
local startingRoomDescription = level:GetRoomByIdx(startingRoomGridIndex, Dimension.CURRENT)
|
|
130
131
|
local startingRoomHash = GetPtrHash(startingRoomDescription)
|
|
131
|
-
for ____,
|
|
132
|
+
for ____, dimensionInt in ipairs(erange(nil, NUM_DIMENSIONS)) do
|
|
133
|
+
local dimension = dimensionInt
|
|
132
134
|
local dimensionRoomDescription = level:GetRoomByIdx(startingRoomGridIndex, dimension)
|
|
133
135
|
local dimensionRoomHash = GetPtrHash(dimensionRoomDescription)
|
|
134
136
|
if dimensionRoomHash == startingRoomHash then
|
|
@@ -372,7 +374,7 @@ function ____exports.teleport(self, roomGridIndex, direction, roomTransitionAnim
|
|
|
372
374
|
if roomData == nil then
|
|
373
375
|
error(("Failed to change the room to grid index " .. tostring(roomGridIndex)) .. " because that room does not exist.")
|
|
374
376
|
end
|
|
375
|
-
level.LeaveDoor =
|
|
377
|
+
level.LeaveDoor = DoorSlot.NO_DOOR_SLOT
|
|
376
378
|
game:StartRoomTransition(roomGridIndex, direction, roomTransitionAnim)
|
|
377
379
|
end
|
|
378
380
|
return ____exports
|
package/dist/functions/run.lua
CHANGED
|
@@ -3,6 +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
8
|
local ____log = require("functions.log")
|
|
7
9
|
local log = ____log.log
|
|
8
10
|
function ____exports.onSetSeed(self)
|
|
@@ -17,7 +19,7 @@ function ____exports.restart(self, character)
|
|
|
17
19
|
Isaac.ExecuteCommand("restart")
|
|
18
20
|
return
|
|
19
21
|
end
|
|
20
|
-
if character <
|
|
22
|
+
if character < FIRST_CHARACTER then
|
|
21
23
|
error(("Restarting as a character of " .. tostring(character)) .. " would crash the game.")
|
|
22
24
|
end
|
|
23
25
|
log("Restarting as character: " .. tostring(character))
|
|
@@ -11,7 +11,7 @@ export declare function getStage(): LevelStage;
|
|
|
11
11
|
export declare function getStageType(): StageType;
|
|
12
12
|
/** Helper function to directly warp to a specific stage using the "stage" console command. */
|
|
13
13
|
export declare function goToStage(stage: LevelStage, stageType: StageType): void;
|
|
14
|
-
export declare function isRepentanceStage(stageType:
|
|
14
|
+
export declare function isRepentanceStage(stageType: StageType): boolean;
|
|
15
15
|
export declare function onCathedral(): boolean;
|
|
16
16
|
export declare function onChest(): boolean;
|
|
17
17
|
export declare function onDarkRoom(): boolean;
|