isaacscript-common 1.2.235 → 1.2.238
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/customRevive.lua +2 -2
- package/dist/callbacks/postCustomDoorEnter.lua +2 -13
- package/dist/callbacks/postPurchase.lua +2 -2
- package/dist/features/deployJSONRoom.lua +18 -22
- package/dist/features/extraConsoleCommands/commands.lua +9 -27
- package/dist/functions/collectibles.d.ts +0 -11
- package/dist/functions/collectibles.lua +0 -12
- package/dist/functions/entity.d.ts +9 -3
- package/dist/functions/entity.lua +21 -6
- package/dist/functions/entitySpecific.d.ts +107 -20
- package/dist/functions/entitySpecific.lua +451 -0
- package/dist/functions/familiars.d.ts +0 -21
- package/dist/functions/familiars.lua +9 -37
- package/dist/functions/gridEntity.d.ts +2 -2
- package/dist/functions/npc.d.ts +0 -9
- package/dist/functions/npc.lua +3 -29
- package/dist/functions/pickups.d.ts +103 -18
- package/dist/functions/pickups.lua +265 -23
- package/dist/functions/spawnCollectible.lua +6 -13
- package/dist/functions/trinkets.d.ts +0 -2
- package/dist/functions/trinkets.lua +0 -8
- package/package.json +1 -1
|
@@ -11,8 +11,8 @@ local ____exports = require("features.saveDataManager.exports")
|
|
|
11
11
|
local saveDataManager = ____exports.saveDataManager
|
|
12
12
|
local ____collectibles = require("functions.collectibles")
|
|
13
13
|
local removeCollectibleFromItemTracker = ____collectibles.removeCollectibleFromItemTracker
|
|
14
|
-
local
|
|
15
|
-
local removeAllFamiliars =
|
|
14
|
+
local ____entitySpecific = require("functions.entitySpecific")
|
|
15
|
+
local removeAllFamiliars = ____entitySpecific.removeAllFamiliars
|
|
16
16
|
local ____log = require("functions.log")
|
|
17
17
|
local log = ____log.log
|
|
18
18
|
local logError = ____log.logError
|
|
@@ -6,8 +6,6 @@ local ____exports = {}
|
|
|
6
6
|
local hasSubscriptions, postEffectUpdaterCustomEntity, doorChangedState, getAnimationForCustomDoor, postEffectRenderCustomEntity, isPlayerPastDoorThreshold, roomClearChange, getPositionOffset, POSITION_OFFSET_MULTIPLIER, v
|
|
7
7
|
local ____cachedClasses = require("cachedClasses")
|
|
8
8
|
local game = ____cachedClasses.game
|
|
9
|
-
local ____constants = require("constants")
|
|
10
|
-
local VectorZero = ____constants.VectorZero
|
|
11
9
|
local ____ModCallbacksCustom = require("enums.ModCallbacksCustom")
|
|
12
10
|
local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
|
|
13
11
|
local ____exports = require("features.saveDataManager.exports")
|
|
@@ -16,6 +14,7 @@ local ____doors = require("functions.doors")
|
|
|
16
14
|
local doorSlotToDirection = ____doors.doorSlotToDirection
|
|
17
15
|
local ____entitySpecific = require("functions.entitySpecific")
|
|
18
16
|
local getEffects = ____entitySpecific.getEffects
|
|
17
|
+
local spawnEffect = ____entitySpecific.spawnEffect
|
|
19
18
|
local ____player = require("functions.player")
|
|
20
19
|
local getClosestPlayer = ____player.getClosestPlayer
|
|
21
20
|
local ____utils = require("functions.utils")
|
|
@@ -182,17 +181,7 @@ function ____exports.spawnCustomDoor(self, effectVariant, doorSlot)
|
|
|
182
181
|
if gridEntityType ~= GridEntityType.GRID_WALL then
|
|
183
182
|
error((("Failed to initialize a custom door at slot " .. tostring(doorSlot)) .. " because there is another grid entity on that tile with a type of: ") .. tostring(gridEntityType))
|
|
184
183
|
end
|
|
185
|
-
local effect =
|
|
186
|
-
EntityType.ENTITY_EFFECT,
|
|
187
|
-
effectVariant,
|
|
188
|
-
0,
|
|
189
|
-
position,
|
|
190
|
-
VectorZero,
|
|
191
|
-
nil
|
|
192
|
-
):ToEffect()
|
|
193
|
-
if effect == nil then
|
|
194
|
-
error("Failed to spawn a custom door with variant: " .. tostring(effectVariant))
|
|
195
|
-
end
|
|
184
|
+
local effect = spawnEffect(nil, effectVariant, 0, position)
|
|
196
185
|
effect.State = roomClear and DoorState.STATE_OPEN or DoorState.STATE_CLOSED
|
|
197
186
|
effect.RenderZOffset = -10000
|
|
198
187
|
effect.PositionOffset = getPositionOffset(nil, doorSlot)
|
|
@@ -9,8 +9,8 @@ local ____ModCallbacksCustom = require("enums.ModCallbacksCustom")
|
|
|
9
9
|
local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
|
|
10
10
|
local ____exports = require("features.saveDataManager.exports")
|
|
11
11
|
local saveDataManager = ____exports.saveDataManager
|
|
12
|
-
local
|
|
13
|
-
local getPickups =
|
|
12
|
+
local ____entitySpecific = require("functions.entitySpecific")
|
|
13
|
+
local getPickups = ____entitySpecific.getPickups
|
|
14
14
|
local ____playerDataStructures = require("functions.playerDataStructures")
|
|
15
15
|
local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
|
|
16
16
|
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
@@ -10,14 +10,16 @@ local ____cachedClasses = require("cachedClasses")
|
|
|
10
10
|
local game = ____cachedClasses.game
|
|
11
11
|
local ____DefaultMap = require("classes.DefaultMap")
|
|
12
12
|
local DefaultMap = ____DefaultMap.DefaultMap
|
|
13
|
-
local ____constants = require("constants")
|
|
14
|
-
local VectorZero = ____constants.VectorZero
|
|
15
13
|
local ____featuresInitialized = require("featuresInitialized")
|
|
16
14
|
local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
|
|
17
15
|
local ____entity = require("functions.entity")
|
|
18
16
|
local removeAllMatchingEntities = ____entity.removeAllMatchingEntities
|
|
17
|
+
local spawn = ____entity.spawn
|
|
18
|
+
local spawnWithSeed = ____entity.spawnWithSeed
|
|
19
19
|
local ____entitySpecific = require("functions.entitySpecific")
|
|
20
|
+
local getNPCs = ____entitySpecific.getNPCs
|
|
20
21
|
local removeAllBombs = ____entitySpecific.removeAllBombs
|
|
22
|
+
local removeAllPickups = ____entitySpecific.removeAllPickups
|
|
21
23
|
local ____gridEntity = require("functions.gridEntity")
|
|
22
24
|
local convertXMLGridEntityType = ____gridEntity.convertXMLGridEntityType
|
|
23
25
|
local getGridEntities = ____gridEntity.getGridEntities
|
|
@@ -30,10 +32,6 @@ local ____log = require("functions.log")
|
|
|
30
32
|
local log = ____log.log
|
|
31
33
|
local ____math = require("functions.math")
|
|
32
34
|
local range = ____math.range
|
|
33
|
-
local ____npc = require("functions.npc")
|
|
34
|
-
local getNPCs = ____npc.getNPCs
|
|
35
|
-
local ____pickups = require("functions.pickups")
|
|
36
|
-
local removeAllPickups = ____pickups.removeAllPickups
|
|
37
35
|
local ____rng = require("functions.rng")
|
|
38
36
|
local getRandomSeed = ____rng.getRandomSeed
|
|
39
37
|
local isRNG = ____rng.isRNG
|
|
@@ -74,13 +72,12 @@ function respawnPersistentEntities(self)
|
|
|
74
72
|
local persistentEntities = v.level.roomToPersistentEntitiesMap:getAndSetDefault(roomListIndex)
|
|
75
73
|
for ____, persistentEntity in ipairs(persistentEntities) do
|
|
76
74
|
local position = room:GetGridPosition(persistentEntity.gridIndex)
|
|
77
|
-
|
|
75
|
+
spawn(
|
|
76
|
+
nil,
|
|
78
77
|
persistentEntity.type,
|
|
79
78
|
persistentEntity.variant,
|
|
80
79
|
persistentEntity.subType,
|
|
81
|
-
position
|
|
82
|
-
VectorZero,
|
|
83
|
-
nil
|
|
80
|
+
position
|
|
84
81
|
)
|
|
85
82
|
end
|
|
86
83
|
end
|
|
@@ -146,32 +143,32 @@ function spawnAllEntities(self, jsonRoom, rng, verbose)
|
|
|
146
143
|
verbose = false
|
|
147
144
|
end
|
|
148
145
|
local shouldUnclearRoom = false
|
|
149
|
-
for ____,
|
|
150
|
-
local xString =
|
|
146
|
+
for ____, jsonSpawn in ipairs(jsonRoom.spawn) do
|
|
147
|
+
local xString = jsonSpawn["$"].x
|
|
151
148
|
local x = tonumber(xString)
|
|
152
149
|
if x == nil then
|
|
153
150
|
error("Failed to convert the following x coordinate to a number (for a spawn): " .. xString)
|
|
154
151
|
end
|
|
155
|
-
local yString =
|
|
152
|
+
local yString = jsonSpawn["$"].y
|
|
156
153
|
local y = tonumber(yString)
|
|
157
154
|
if y == nil then
|
|
158
155
|
error("Failed to convert the following y coordinate to a number (for a spawn): " .. yString)
|
|
159
156
|
end
|
|
160
|
-
if #
|
|
157
|
+
if #jsonSpawn.entity > 1 then
|
|
161
158
|
error("Stacked entities are not implemented for JSON rooms.")
|
|
162
159
|
end
|
|
163
|
-
local
|
|
164
|
-
local entityTypeString =
|
|
160
|
+
local firstXMLEntity = jsonSpawn.entity[1]
|
|
161
|
+
local entityTypeString = firstXMLEntity["$"].type
|
|
165
162
|
local entityType = tonumber(entityTypeString)
|
|
166
163
|
if entityType == nil then
|
|
167
164
|
error("Failed to convert the entity type to a number: " .. entityTypeString)
|
|
168
165
|
end
|
|
169
|
-
local variantString =
|
|
166
|
+
local variantString = firstXMLEntity["$"].variant
|
|
170
167
|
local variant = tonumber(variantString)
|
|
171
168
|
if variant == nil then
|
|
172
169
|
error("Failed to convert the entity variant to a number: " .. tostring(variant))
|
|
173
170
|
end
|
|
174
|
-
local subTypeString =
|
|
171
|
+
local subTypeString = firstXMLEntity["$"].subtype
|
|
175
172
|
local subType = tonumber(subTypeString)
|
|
176
173
|
if subType == nil then
|
|
177
174
|
error("Failed to convert the entity sub-type to a number: " .. tostring(subType))
|
|
@@ -251,13 +248,12 @@ function spawnNormalEntityForJSONRoom(self, entityType, variant, subType, x, y,
|
|
|
251
248
|
options
|
|
252
249
|
)
|
|
253
250
|
else
|
|
254
|
-
entity =
|
|
251
|
+
entity = spawnWithSeed(
|
|
252
|
+
nil,
|
|
255
253
|
entityType,
|
|
256
254
|
variant,
|
|
257
|
-
position,
|
|
258
|
-
VectorZero,
|
|
259
|
-
nil,
|
|
260
255
|
subType,
|
|
256
|
+
position,
|
|
261
257
|
seed
|
|
262
258
|
)
|
|
263
259
|
end
|
|
@@ -10,13 +10,14 @@ local sfxManager = ____cachedClasses.sfxManager
|
|
|
10
10
|
local ____constants = require("constants")
|
|
11
11
|
local PILL_GIANT_FLAG = ____constants.PILL_GIANT_FLAG
|
|
12
12
|
local TRINKET_GOLDEN_FLAG = ____constants.TRINKET_GOLDEN_FLAG
|
|
13
|
-
local VectorZero = ____constants.VectorZero
|
|
14
13
|
local ____HealthType = require("enums.HealthType")
|
|
15
14
|
local HealthType = ____HealthType.HealthType
|
|
16
15
|
local ____cards = require("functions.cards")
|
|
17
16
|
local getCardName = ____cards.getCardName
|
|
18
17
|
local ____character = require("functions.character")
|
|
19
18
|
local getCharacterName = ____character.getCharacterName
|
|
19
|
+
local ____entitySpecific = require("functions.entitySpecific")
|
|
20
|
+
local getNPCs = ____entitySpecific.getNPCs
|
|
20
21
|
local ____gridEntity = require("functions.gridEntity")
|
|
21
22
|
local spawnGridEntityWithVariant = ____gridEntity.spawnGridEntityWithVariant
|
|
22
23
|
local ____log = require("functions.log")
|
|
@@ -28,8 +29,10 @@ local logSeedEffects = ____log.logSeedEffects
|
|
|
28
29
|
local logSounds = ____log.logSounds
|
|
29
30
|
local ____map = require("functions.map")
|
|
30
31
|
local getMapPartialMatch = ____map.getMapPartialMatch
|
|
31
|
-
local
|
|
32
|
-
local
|
|
32
|
+
local ____pickups = require("functions.pickups")
|
|
33
|
+
local spawnCard = ____pickups.spawnCard
|
|
34
|
+
local spawnPill = ____pickups.spawnPill
|
|
35
|
+
local spawnTrinket = ____pickups.spawnTrinket
|
|
33
36
|
local ____pills = require("functions.pills")
|
|
34
37
|
local getPillEffectName = ____pills.getPillEffectName
|
|
35
38
|
local ____player = require("functions.player")
|
|
@@ -376,14 +379,7 @@ function ____exports.cards(self)
|
|
|
376
379
|
return
|
|
377
380
|
end
|
|
378
381
|
local position = gridCoordinatesToWorldPosition(nil, x, y)
|
|
379
|
-
|
|
380
|
-
EntityType.ENTITY_PICKUP,
|
|
381
|
-
300,
|
|
382
|
-
cardType,
|
|
383
|
-
position,
|
|
384
|
-
VectorZero,
|
|
385
|
-
nil
|
|
386
|
-
)
|
|
382
|
+
spawnCard(nil, cardType, position)
|
|
387
383
|
cardType = cardType + 1
|
|
388
384
|
x = x + 1
|
|
389
385
|
end
|
|
@@ -658,14 +654,7 @@ function ____exports.pills(self)
|
|
|
658
654
|
local horsePillColor = pillColor + PILL_GIANT_FLAG
|
|
659
655
|
local subType = horse and horsePillColor or pillColor
|
|
660
656
|
local position = gridCoordinatesToWorldPosition(nil, x, y)
|
|
661
|
-
|
|
662
|
-
EntityType.ENTITY_PICKUP,
|
|
663
|
-
70,
|
|
664
|
-
subType,
|
|
665
|
-
position,
|
|
666
|
-
VectorZero,
|
|
667
|
-
nil
|
|
668
|
-
)
|
|
657
|
+
spawnPill(nil, subType, position)
|
|
669
658
|
pillColor = pillColor + 1
|
|
670
659
|
x = x + 1
|
|
671
660
|
end
|
|
@@ -881,14 +870,7 @@ function ____exports.spawnGoldenTrinket(self, params)
|
|
|
881
870
|
local goldenTrinketType = trinketType + TRINKET_GOLDEN_FLAG
|
|
882
871
|
local room = game:GetRoom()
|
|
883
872
|
local centerPos = room:GetCenterPos()
|
|
884
|
-
|
|
885
|
-
EntityType.ENTITY_PICKUP,
|
|
886
|
-
350,
|
|
887
|
-
goldenTrinketType,
|
|
888
|
-
centerPos,
|
|
889
|
-
VectorZero,
|
|
890
|
-
nil
|
|
891
|
-
)
|
|
873
|
+
spawnTrinket(nil, goldenTrinketType, centerPos)
|
|
892
874
|
end
|
|
893
875
|
function ____exports.speed(self)
|
|
894
876
|
local player = Isaac.GetPlayer()
|
|
@@ -90,8 +90,6 @@ export declare function getCollectiblePedestalType(collectible: EntityPickup): C
|
|
|
90
90
|
* type was not valid.
|
|
91
91
|
*/
|
|
92
92
|
export declare function getCollectibleQuality(collectibleType: CollectibleType | int): int;
|
|
93
|
-
/** Helper function to get all of the collectible entities in the room. */
|
|
94
|
-
export declare function getCollectibles(matchingSubType?: number): EntityPickup[];
|
|
95
93
|
/**
|
|
96
94
|
* Helper function to get the final collectible type in the game.
|
|
97
95
|
*
|
|
@@ -121,15 +119,6 @@ export declare function isQuestCollectible(collectibleType: CollectibleType | in
|
|
|
121
119
|
* dynamically know if a modded item will disappear.
|
|
122
120
|
*/
|
|
123
121
|
export declare function isSingleUseCollectible(collectibleType: CollectibleType | int): boolean;
|
|
124
|
-
/**
|
|
125
|
-
* Helper function to remove all of the collectibles in the room.
|
|
126
|
-
*
|
|
127
|
-
* @param collectibleType Optional. If specified, will only remove collectibles that match this
|
|
128
|
-
* collectible type.
|
|
129
|
-
* @param cap Optional. If specified, will only remove the given amount of collectibles.
|
|
130
|
-
* @returns True if one or more collectibles was removed, false otherwise.
|
|
131
|
-
*/
|
|
132
|
-
export declare function removeAllCollectibles(collectibleType?: CollectibleType | int, cap?: int): boolean;
|
|
133
122
|
/**
|
|
134
123
|
* Helper function to put a message in the log.txt file to let the Rebirth Item Tracker know that it
|
|
135
124
|
* should remove an item.
|
|
@@ -16,9 +16,6 @@ local ____singleUseActiveCollectibleTypesSet = require("sets.singleUseActiveColl
|
|
|
16
16
|
local SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET = ____singleUseActiveCollectibleTypesSet.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET
|
|
17
17
|
local ____flag = require("functions.flag")
|
|
18
18
|
local hasFlag = ____flag.hasFlag
|
|
19
|
-
local ____pickups = require("functions.pickups")
|
|
20
|
-
local getPickups = ____pickups.getPickups
|
|
21
|
-
local removeAllPickups = ____pickups.removeAllPickups
|
|
22
19
|
local ____roomData = require("functions.roomData")
|
|
23
20
|
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
24
21
|
local ____sprite = require("functions.sprite")
|
|
@@ -180,12 +177,6 @@ function ____exports.getCollectibleQuality(self, collectibleType)
|
|
|
180
177
|
end
|
|
181
178
|
return itemConfigItem.Quality
|
|
182
179
|
end
|
|
183
|
-
function ____exports.getCollectibles(self, matchingSubType)
|
|
184
|
-
if matchingSubType == nil then
|
|
185
|
-
matchingSubType = -1
|
|
186
|
-
end
|
|
187
|
-
return getPickups(nil, 100, matchingSubType)
|
|
188
|
-
end
|
|
189
180
|
function ____exports.getMaxCollectibleType(self)
|
|
190
181
|
return itemConfig:GetCollectibles().Size - 1
|
|
191
182
|
end
|
|
@@ -216,9 +207,6 @@ end
|
|
|
216
207
|
function ____exports.isSingleUseCollectible(self, collectibleType)
|
|
217
208
|
return SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET:has(collectibleType)
|
|
218
209
|
end
|
|
219
|
-
function ____exports.removeAllCollectibles(self, collectibleType, cap)
|
|
220
|
-
return removeAllPickups(nil, 100, collectibleType, cap)
|
|
221
|
-
end
|
|
222
210
|
function ____exports.removeCollectibleFromItemTracker(self, collectibleType)
|
|
223
211
|
local collectibleName = ____exports.getCollectibleName(nil, collectibleType)
|
|
224
212
|
Isaac.DebugString(((("Removing collectible " .. tostring(collectibleType)) .. " (") .. collectibleName) .. ") on player 0 (Player)")
|
|
@@ -76,7 +76,7 @@ export declare function isStoryBoss(entity: Entity): boolean;
|
|
|
76
76
|
* @param entitySubType Optional. The sub-type to match. Default is -1 (which will match every
|
|
77
77
|
* sub-type).
|
|
78
78
|
* @param cap Optional. If specified, will only remove the given amount of collectibles.
|
|
79
|
-
* @returns True if one or more entities
|
|
79
|
+
* @returns True if one or more entities were removed, false otherwise.
|
|
80
80
|
*/
|
|
81
81
|
export declare function removeAllMatchingEntities(entityType: int, entityVariant?: number, entitySubType?: number, cap?: int | undefined): boolean;
|
|
82
82
|
/**
|
|
@@ -84,7 +84,7 @@ export declare function removeAllMatchingEntities(entityType: int, entityVariant
|
|
|
84
84
|
*
|
|
85
85
|
* @param entities The array of entities to remove.
|
|
86
86
|
* @param cap Optional. If specified, will only remove the given amount of entities.
|
|
87
|
-
* @returns True if one or more entities
|
|
87
|
+
* @returns True if one or more entities were removed, false otherwise.
|
|
88
88
|
*/
|
|
89
89
|
export declare function removeEntities(entities: Entity[], cap?: int): boolean;
|
|
90
90
|
/**
|
|
@@ -100,6 +100,12 @@ export declare function setEntityRandomColor(entity: Entity): void;
|
|
|
100
100
|
/**
|
|
101
101
|
* Helper function to spawn an entity. Use this instead of the `Isaac.Spawn` method if you do not
|
|
102
102
|
* need to specify the velocity or spawner.
|
|
103
|
+
*
|
|
104
|
+
* Also see the `spawnWithSeed` helper function.
|
|
105
|
+
*/
|
|
106
|
+
export declare function spawn(entityType: EntityType | int, variant: int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): Entity;
|
|
107
|
+
/**
|
|
108
|
+
* Helper function to spawn an entity. Use this instead of the `Game.Spawn` method if you do not
|
|
109
|
+
* need to specify the velocity or spawner.
|
|
103
110
|
*/
|
|
104
|
-
export declare function spawn(entityType: EntityType | int, variant: int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined): Entity;
|
|
105
111
|
export declare function spawnWithSeed(entityType: EntityType | int, variant: int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): Entity;
|
|
@@ -157,20 +157,34 @@ function ____exports.setEntityRandomColor(self, entity)
|
|
|
157
157
|
false
|
|
158
158
|
)
|
|
159
159
|
end
|
|
160
|
-
function ____exports.spawn(self, entityType, variant, subType, position, velocity, spawner)
|
|
160
|
+
function ____exports.spawn(self, entityType, variant, subType, position, velocity, spawner, seed)
|
|
161
161
|
if velocity == nil then
|
|
162
162
|
velocity = VectorZero
|
|
163
163
|
end
|
|
164
164
|
if spawner == nil then
|
|
165
165
|
spawner = nil
|
|
166
166
|
end
|
|
167
|
-
|
|
167
|
+
if seed == nil then
|
|
168
|
+
seed = nil
|
|
169
|
+
end
|
|
170
|
+
if seed == nil then
|
|
171
|
+
return Isaac.Spawn(
|
|
172
|
+
entityType,
|
|
173
|
+
variant,
|
|
174
|
+
subType,
|
|
175
|
+
position,
|
|
176
|
+
velocity,
|
|
177
|
+
spawner
|
|
178
|
+
)
|
|
179
|
+
end
|
|
180
|
+
return game:Spawn(
|
|
168
181
|
entityType,
|
|
169
182
|
variant,
|
|
170
|
-
subType,
|
|
171
183
|
position,
|
|
172
184
|
velocity,
|
|
173
|
-
spawner
|
|
185
|
+
spawner,
|
|
186
|
+
subType,
|
|
187
|
+
seed
|
|
174
188
|
)
|
|
175
189
|
end
|
|
176
190
|
function ____exports.spawnWithSeed(self, entityType, variant, subType, position, seed, velocity, spawner)
|
|
@@ -180,13 +194,14 @@ function ____exports.spawnWithSeed(self, entityType, variant, subType, position,
|
|
|
180
194
|
if spawner == nil then
|
|
181
195
|
spawner = nil
|
|
182
196
|
end
|
|
183
|
-
return
|
|
197
|
+
return ____exports.spawn(
|
|
198
|
+
nil,
|
|
184
199
|
entityType,
|
|
185
200
|
variant,
|
|
201
|
+
subType,
|
|
186
202
|
position,
|
|
187
203
|
velocity,
|
|
188
204
|
spawner,
|
|
189
|
-
subType,
|
|
190
205
|
seed
|
|
191
206
|
)
|
|
192
207
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/**
|
|
3
|
-
* Helper function to get all of the
|
|
3
|
+
* Helper function to get all of the `EntityType.ENTITY_BOMB` in the room.
|
|
4
4
|
*
|
|
5
5
|
* Example:
|
|
6
6
|
* ```ts
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function getBombs(matchingVariant?: BombVariant | int, matchingSubType?: number): EntityBomb[];
|
|
14
14
|
/**
|
|
15
|
-
* Helper function to get all of the
|
|
15
|
+
* Helper function to get all of the `EntityType.ENTITY_EFFECT` in the room.
|
|
16
16
|
*
|
|
17
17
|
* Example:
|
|
18
18
|
* ```ts
|
|
@@ -24,7 +24,19 @@ export declare function getBombs(matchingVariant?: BombVariant | int, matchingSu
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function getEffects(matchingVariant?: EffectVariant | int, matchingSubType?: number): EntityEffect[];
|
|
26
26
|
/**
|
|
27
|
-
* Helper function to get all of the
|
|
27
|
+
* Helper function to get all of the familiars in the room.
|
|
28
|
+
*
|
|
29
|
+
* Example:
|
|
30
|
+
* ```ts
|
|
31
|
+
* // Make all of the familiars in the room invisible
|
|
32
|
+
* for (const familiar of getFamiliars()) {
|
|
33
|
+
* familiar.Visible = false;
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function getFamiliars(matchingVariant?: FamiliarVariant | int, matchingSubType?: number): EntityFamiliar[];
|
|
38
|
+
/**
|
|
39
|
+
* Helper function to get all of the `EntityType.ENTITY_KNIFE` in the room.
|
|
28
40
|
*
|
|
29
41
|
* Example:
|
|
30
42
|
* ```ts
|
|
@@ -36,7 +48,7 @@ export declare function getEffects(matchingVariant?: EffectVariant | int, matchi
|
|
|
36
48
|
*/
|
|
37
49
|
export declare function getKnives(matchingVariant?: KnifeVariant | int, matchingSubType?: number): EntityKnife[];
|
|
38
50
|
/**
|
|
39
|
-
* Helper function to get all of the
|
|
51
|
+
* Helper function to get all of the `EntityType.ENTITY_LASER` in the room.
|
|
40
52
|
*
|
|
41
53
|
* Example:
|
|
42
54
|
* ```ts
|
|
@@ -47,8 +59,22 @@ export declare function getKnives(matchingVariant?: KnifeVariant | int, matching
|
|
|
47
59
|
* ```
|
|
48
60
|
*/
|
|
49
61
|
export declare function getLasers(matchingVariant?: LaserVariant | int, matchingSubType?: number): EntityLaser[];
|
|
62
|
+
/** The same thing as the `getEntities` function, but returns only NPCs. */
|
|
63
|
+
export declare function getNPCs(matchingEntityType?: EntityType | int, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
|
|
50
64
|
/**
|
|
51
|
-
* Helper function to get all of the
|
|
65
|
+
* Helper function to get all of the pickups in the room.
|
|
66
|
+
*
|
|
67
|
+
* Example:
|
|
68
|
+
* ```ts
|
|
69
|
+
* // Make all of the pickups in the room invisible
|
|
70
|
+
* for (const pickup of getPickups()) {
|
|
71
|
+
* pickup.Visible = false;
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare function getPickups(matchingVariant?: PickupVariant | int, matchingSubType?: number): EntityPickup[];
|
|
76
|
+
/**
|
|
77
|
+
* Helper function to get all of the `EntityType.ENTITY_PROJECTILE` in the room.
|
|
52
78
|
*
|
|
53
79
|
* Example:
|
|
54
80
|
* ```ts
|
|
@@ -60,7 +86,7 @@ export declare function getLasers(matchingVariant?: LaserVariant | int, matching
|
|
|
60
86
|
*/
|
|
61
87
|
export declare function getProjectiles(matchingVariant?: ProjectileVariant | int, matchingSubType?: number): EntityProjectile[];
|
|
62
88
|
/**
|
|
63
|
-
* Helper function to get all of the
|
|
89
|
+
* Helper function to get all of the `EntityType.ENTITY_SLOT` in the room.
|
|
64
90
|
*
|
|
65
91
|
* Example:
|
|
66
92
|
* ```ts
|
|
@@ -72,7 +98,7 @@ export declare function getProjectiles(matchingVariant?: ProjectileVariant | int
|
|
|
72
98
|
*/
|
|
73
99
|
export declare function getSlots(matchingVariant?: SlotVariant | int, matchingSubType?: number): Entity[];
|
|
74
100
|
/**
|
|
75
|
-
* Helper function to get all of the
|
|
101
|
+
* Helper function to get all of the `EntityType.ENTITY_TEAR` in the room.
|
|
76
102
|
*
|
|
77
103
|
* Example:
|
|
78
104
|
* ```ts
|
|
@@ -84,12 +110,12 @@ export declare function getSlots(matchingVariant?: SlotVariant | int, matchingSu
|
|
|
84
110
|
*/
|
|
85
111
|
export declare function getTears(matchingVariant?: TearVariant | int, matchingSubType?: number): EntityTear[];
|
|
86
112
|
/**
|
|
87
|
-
* Helper function to remove all of the
|
|
113
|
+
* Helper function to remove all of the `EntityType.ENTITY_BOMB` in the room.
|
|
88
114
|
*
|
|
89
115
|
* @param variant Optional. If specified, will only remove bombs that match this variant.
|
|
90
116
|
* @param subType Optional. If specified, will only remove bombs that match this sub-type.
|
|
91
117
|
* @param cap Optional. If specified, will only remove the given amount of bombs.
|
|
92
|
-
* @returns True if one or more bombs
|
|
118
|
+
* @returns True if one or more bombs were removed, false otherwise.
|
|
93
119
|
*/
|
|
94
120
|
export declare function removeAllBombs(variant?: BombVariant | int, subType?: int, cap?: int): boolean;
|
|
95
121
|
/**
|
|
@@ -98,51 +124,112 @@ export declare function removeAllBombs(variant?: BombVariant | int, subType?: in
|
|
|
98
124
|
* @param variant Optional. If specified, will only remove effects that match this variant.
|
|
99
125
|
* @param subType Optional. If specified, will only remove effects that match this sub-type.
|
|
100
126
|
* @param cap Optional. If specified, will only remove the given amount of effects.
|
|
101
|
-
* @returns True if one or more effects
|
|
127
|
+
* @returns True if one or more effects were removed, false otherwise.
|
|
102
128
|
*/
|
|
103
129
|
export declare function removeAllEffects(variant?: EffectVariant | int, subType?: int, cap?: int): boolean;
|
|
104
130
|
/**
|
|
105
|
-
* Helper function to remove all of the
|
|
131
|
+
* Helper function to remove all of the familiars in the room.
|
|
132
|
+
*
|
|
133
|
+
* @param variant Optional. If specified, will only remove familiars that match this variant.
|
|
134
|
+
* @param subType Optional. If specified, will only remove familiars that match this sub-type.
|
|
135
|
+
* @param cap Optional. If specified, will only remove the given amount of familiars.
|
|
136
|
+
* @returns True if one or more familiars were removed, false otherwise.
|
|
137
|
+
*/
|
|
138
|
+
export declare function removeAllFamiliars(variant?: FamiliarVariant | int, subType?: int, cap?: int): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Helper function to remove all of the `EntityType.ENTITY_KNIFE` in the room.
|
|
106
141
|
*
|
|
107
142
|
* @param variant Optional. If specified, will only remove knives that match this variant.
|
|
108
143
|
* @param subType Optional. If specified, will only remove knives that match this sub-type.
|
|
109
144
|
* @param cap Optional. If specified, will only remove the given amount of knives.
|
|
110
|
-
* @returns True if one or more knives
|
|
145
|
+
* @returns True if one or more knives were removed, false otherwise.
|
|
111
146
|
*/
|
|
112
147
|
export declare function removeAllKnives(variant?: KnifeVariant | int, subType?: int, cap?: int): boolean;
|
|
113
148
|
/**
|
|
114
|
-
* Helper function to remove all of the
|
|
149
|
+
* Helper function to remove all of the `EntityType.ENTITY_LASER` in the room.
|
|
115
150
|
*
|
|
116
151
|
* @param variant Optional. If specified, will only remove lasers that match this variant.
|
|
117
152
|
* @param subType Optional. If specified, will only remove lasers that match this sub-type.
|
|
118
153
|
* @param cap Optional. If specified, will only remove the given amount of lasers.
|
|
119
|
-
* @returns True if one or more lasers
|
|
154
|
+
* @returns True if one or more lasers were removed, false otherwise.
|
|
120
155
|
*/
|
|
121
156
|
export declare function removeAllLasers(variant?: LaserVariant | int, subType?: int, cap?: int): boolean;
|
|
122
157
|
/**
|
|
123
|
-
* Helper function to remove all
|
|
158
|
+
* Helper function to remove all NPCs in the room.
|
|
159
|
+
*
|
|
160
|
+
* @param cap Optional. If specified, will only remove the given amount of NPCs.
|
|
161
|
+
* @returns True if one or more NPCs were removed, false otherwise.
|
|
162
|
+
*/
|
|
163
|
+
export declare function removeAllNPCs(cap?: int): boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Helper function to remove all of the pickups in the room.
|
|
166
|
+
*
|
|
167
|
+
* @param variant Optional. If specified, will only remove pickups that match this variant.
|
|
168
|
+
* @param subType Optional. If specified, will only remove pickups that match this sub-type.
|
|
169
|
+
* @param cap Optional. If specified, will only remove the given amount of pickups.
|
|
170
|
+
* @returns True if one or more pickups were removed, false otherwise.
|
|
171
|
+
*/
|
|
172
|
+
export declare function removeAllPickups(variant?: PickupVariant | int, subType?: int, cap?: int): boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Helper function to remove all of the `EntityType.ENTITY_PROJECTILE` in the room.
|
|
124
175
|
*
|
|
125
176
|
* @param variant Optional. If specified, will only remove projectiles that match this variant.
|
|
126
177
|
* @param subType Optional. If specified, will only remove projectiles that match this sub-type.
|
|
127
178
|
* @param cap Optional. If specified, will only remove the given amount of projectiles.
|
|
128
|
-
* @returns True if one or more projectiles
|
|
179
|
+
* @returns True if one or more projectiles were removed, false otherwise.
|
|
129
180
|
*/
|
|
130
181
|
export declare function removeAllProjectiles(variant?: ProjectileVariant | int, subType?: int, cap?: int): boolean;
|
|
131
182
|
/**
|
|
132
|
-
* Helper function to remove all of the
|
|
183
|
+
* Helper function to remove all of the `EntityType.ENTITY_SLOT` in the room.
|
|
133
184
|
*
|
|
134
185
|
* @param variant Optional. If specified, will only remove slots that match this variant.
|
|
135
186
|
* @param subType Optional. If specified, will only remove slots that match this sub-type.
|
|
136
187
|
* @param cap Optional. If specified, will only remove the given amount of slots.
|
|
137
|
-
* @returns True if one or more slots
|
|
188
|
+
* @returns True if one or more slots were removed, false otherwise.
|
|
138
189
|
*/
|
|
139
190
|
export declare function removeAllSlots(variant?: SlotVariant | int, subType?: int, cap?: int): boolean;
|
|
140
191
|
/**
|
|
141
|
-
* Helper function to remove all of the
|
|
192
|
+
* Helper function to remove all of the `EntityType.ENTITY_TEAR` in the room.
|
|
142
193
|
*
|
|
143
194
|
* @param variant Optional. If specified, will only remove tears that match this variant.
|
|
144
195
|
* @param subType Optional. If specified, will only remove tears that match this sub-type.
|
|
145
196
|
* @param cap Optional. If specified, will only remove the given amount of tears.
|
|
146
|
-
* @returns True if one or more tears
|
|
197
|
+
* @returns True if one or more tears were removed, false otherwise.
|
|
147
198
|
*/
|
|
148
199
|
export declare function removeAllTears(variant?: TearVariant | int, subType?: int, cap?: int): boolean;
|
|
200
|
+
/** Helper function to spawn a `EntityType.ENTITY_BOMB` (4). */
|
|
201
|
+
export declare function spawnBomb(variant: BombVariant | int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityBomb;
|
|
202
|
+
/** Helper function to spawn a `EntityType.ENTITY_BOMB` (4) with a specific seed. */
|
|
203
|
+
export declare function spawnBombWithSeed(variant: BombVariant | int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityBomb;
|
|
204
|
+
/** Helper function to spawn a `EntityType.ENTITY_EFFECT` (1000). */
|
|
205
|
+
export declare function spawnEffect(variant: EffectVariant | int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityEffect;
|
|
206
|
+
/** Helper function to spawn a `EntityType.ENTITY_EFFECT` (1000) with a specific seed. */
|
|
207
|
+
export declare function spawnEffectWithSeed(variant: EffectVariant | int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityEffect;
|
|
208
|
+
/** Helper function to spawn a `EntityType.ENTITY_FAMILIAR` (3). */
|
|
209
|
+
export declare function spawnFamiliar(variant: FamiliarVariant | int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityFamiliar;
|
|
210
|
+
/** Helper function to spawn a `EntityType.ENTITY_FAMILIAR` (3) with a specific seed. */
|
|
211
|
+
export declare function spawnFamiliarWithSeed(variant: FamiliarVariant | int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityFamiliar;
|
|
212
|
+
/** Helper function to spawn a `EntityType.ENTITY_KNIFE` (8). */
|
|
213
|
+
export declare function spawnKnife(variant: KnifeVariant | int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityKnife;
|
|
214
|
+
/** Helper function to spawn a `EntityType.ENTITY_KNIFE` (8) with a specific seed. */
|
|
215
|
+
export declare function spawnKnifeWithSeed(variant: KnifeVariant | int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityKnife;
|
|
216
|
+
/** Helper function to spawn a `EntityType.ENTITY_LASER` (7). */
|
|
217
|
+
export declare function spawnLaser(variant: LaserVariant | int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityLaser;
|
|
218
|
+
/** Helper function to spawn a `EntityType.ENTITY_LASER` (7) with a specific seed. */
|
|
219
|
+
export declare function spawnLaserWithSeed(variant: LaserVariant | int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityLaser;
|
|
220
|
+
/** Helper function to spawn a `EntityType.ENTITY_PICKUP` (5). */
|
|
221
|
+
export declare function spawnPickup(variant: PickupVariant | int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
222
|
+
/** Helper function to spawn a `EntityType.ENTITY_PICKUP` (5) with a specific seed. */
|
|
223
|
+
export declare function spawnPickupWithSeed(variant: PickupVariant | int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
224
|
+
/** Helper function to spawn a `EntityType.ENTITY_PROJECTILE` (9). */
|
|
225
|
+
export declare function spawnProjectile(variant: ProjectileVariant | int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityProjectile;
|
|
226
|
+
/** Helper function to spawn a `EntityType.ENTITY_PROJECTILE` (9) with a specific seed. */
|
|
227
|
+
export declare function spawnProjectileWithSeed(variant: ProjectileVariant | int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityProjectile;
|
|
228
|
+
/** Helper function to spawn a `EntityType.ENTITY_SLOT` (6). */
|
|
229
|
+
export declare function spawnSlot(variant: SlotVariant | int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): Entity;
|
|
230
|
+
/** Helper function to spawn a `EntityType.ENTITY_SLOT` (6) with a specific seed. */
|
|
231
|
+
export declare function spawnSlotWithSeed(variant: int | SlotVariant, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): Entity;
|
|
232
|
+
/** Helper function to spawn a `EntityType.ENTITY_TEAR` (2). */
|
|
233
|
+
export declare function spawnTear(variant: int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityTear;
|
|
234
|
+
/** Helper function to spawn a `EntityType.EntityType` (2) with a specific seed. */
|
|
235
|
+
export declare function spawnTearWithSeed(variant: TearVariant | int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityTear;
|