isaacscript-common 1.2.239 → 1.2.242
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/postNewRoomEarly.lua +3 -3
- package/dist/features/deployJSONRoom.lua +5 -5
- package/dist/features/extraConsoleCommands/commands.lua +2 -2
- package/dist/functions/entitySpecific.d.ts +4 -0
- package/dist/functions/entitySpecific.lua +44 -0
- package/dist/functions/gridEntity.d.ts +7 -7
- package/dist/functions/gridEntity.lua +24 -16
- package/dist/functions/pickups.d.ts +16 -0
- package/dist/functions/pickups.lua +45 -0
- package/dist/functions/roomGrid.lua +1 -1
- package/package.json +2 -2
|
@@ -5,7 +5,7 @@ local ____cachedClasses = require("cachedClasses")
|
|
|
5
5
|
local game = ____cachedClasses.game
|
|
6
6
|
local ____gridEntity = require("functions.gridEntity")
|
|
7
7
|
local getTopLeftWallGridIndex = ____gridEntity.getTopLeftWallGridIndex
|
|
8
|
-
local
|
|
8
|
+
local spawnGrid = ____gridEntity.spawnGrid
|
|
9
9
|
local ____log = require("functions.log")
|
|
10
10
|
local logError = ____log.logError
|
|
11
11
|
local ____postNewRoomEarly = require("callbacks.subscriptions.postNewRoomEarly")
|
|
@@ -33,14 +33,14 @@ function checkRoomChanged(self)
|
|
|
33
33
|
local topLeftWall = room:GetGridEntity(topLeftWallGridIndex)
|
|
34
34
|
local topLeftWall2 = room:GetGridEntity(rightOfTopWallGridIndex)
|
|
35
35
|
if topLeftWall == nil then
|
|
36
|
-
topLeftWall =
|
|
36
|
+
topLeftWall = spawnGrid(nil, GridEntityType.GRID_WALL, topLeftWallGridIndex)
|
|
37
37
|
if topLeftWall == nil then
|
|
38
38
|
logError("Failed to spawn a new wall (1) for the PostNewRoomEarly callback.")
|
|
39
39
|
return
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
42
|
if topLeftWall2 == nil then
|
|
43
|
-
topLeftWall2 =
|
|
43
|
+
topLeftWall2 = spawnGrid(nil, GridEntityType.GRID_WALL, rightOfTopWallGridIndex)
|
|
44
44
|
if topLeftWall2 == nil then
|
|
45
45
|
logError("Failed to spawn a new wall (2) for the PostNewRoomEarly callback.")
|
|
46
46
|
return
|
|
@@ -23,9 +23,9 @@ local removeAllPickups = ____entitySpecific.removeAllPickups
|
|
|
23
23
|
local ____gridEntity = require("functions.gridEntity")
|
|
24
24
|
local convertXMLGridEntityType = ____gridEntity.convertXMLGridEntityType
|
|
25
25
|
local getGridEntities = ____gridEntity.getGridEntities
|
|
26
|
-
local
|
|
26
|
+
local removeAllGridExcept = ____gridEntity.removeAllGridExcept
|
|
27
27
|
local setGridEntityInvisible = ____gridEntity.setGridEntityInvisible
|
|
28
|
-
local
|
|
28
|
+
local spawnGridWithVariant = ____gridEntity.spawnGridWithVariant
|
|
29
29
|
local ____jsonRoom = require("functions.jsonRoom")
|
|
30
30
|
local getRandomJSONRoom = ____jsonRoom.getRandomJSONRoom
|
|
31
31
|
local ____log = require("functions.log")
|
|
@@ -91,7 +91,7 @@ function ____exports.emptyRoom(self, fillWithDecorations)
|
|
|
91
91
|
removeSpecificNPCs(nil)
|
|
92
92
|
removeAllMatchingEntities(nil, EntityType.ENTITY_EFFECT, EffectVariant.DEVIL)
|
|
93
93
|
removeAllMatchingEntities(nil, EntityType.ENTITY_EFFECT, EffectVariant.ANGEL)
|
|
94
|
-
|
|
94
|
+
removeAllGridExcept(nil, GridEntityType.GRID_WALL, GridEntityType.GRID_DOOR)
|
|
95
95
|
setRoomCleared(nil)
|
|
96
96
|
if fillWithDecorations then
|
|
97
97
|
fillRoomWithDecorations(nil)
|
|
@@ -129,7 +129,7 @@ function fillRoomWithDecorations(self)
|
|
|
129
129
|
goto __continue30
|
|
130
130
|
end
|
|
131
131
|
local position = room:GetGridPosition(gridIndex)
|
|
132
|
-
local decoration = Isaac.GridSpawn(GridEntityType.GRID_DECORATION, 0, position
|
|
132
|
+
local decoration = Isaac.GridSpawn(GridEntityType.GRID_DECORATION, 0, position)
|
|
133
133
|
if decoration ~= nil then
|
|
134
134
|
setGridEntityInvisible(nil, decoration)
|
|
135
135
|
end
|
|
@@ -221,7 +221,7 @@ function spawnGridEntityForJSONRoom(self, xmlEntityType, xmlEntityVariant, x, y)
|
|
|
221
221
|
local gridEntityType, variant = table.unpack(gridEntityTuple)
|
|
222
222
|
local position = gridCoordinatesToWorldPosition(nil, x, y)
|
|
223
223
|
local gridIndex = room:GetGridIndex(position)
|
|
224
|
-
local gridEntity =
|
|
224
|
+
local gridEntity = spawnGridWithVariant(nil, gridEntityType, variant, gridIndex)
|
|
225
225
|
if gridEntity == nil then
|
|
226
226
|
return gridEntity
|
|
227
227
|
end
|
|
@@ -19,7 +19,7 @@ local getCharacterName = ____character.getCharacterName
|
|
|
19
19
|
local ____entitySpecific = require("functions.entitySpecific")
|
|
20
20
|
local getNPCs = ____entitySpecific.getNPCs
|
|
21
21
|
local ____gridEntity = require("functions.gridEntity")
|
|
22
|
-
local
|
|
22
|
+
local spawnGridWithVariant = ____gridEntity.spawnGridWithVariant
|
|
23
23
|
local ____log = require("functions.log")
|
|
24
24
|
local logEffects = ____log.logEffects
|
|
25
25
|
local logEntities = ____log.logEntities
|
|
@@ -195,7 +195,7 @@ function spawnTrapdoorOrCrawlspace(self, trapdoor)
|
|
|
195
195
|
local position = room:FindFreeTilePosition(player.Position, 0)
|
|
196
196
|
local gridIndex = room:GetGridIndex(position)
|
|
197
197
|
local gridEntityType = trapdoor and GridEntityType.GRID_TRAPDOOR or GridEntityType.GRID_STAIRS
|
|
198
|
-
|
|
198
|
+
spawnGridWithVariant(nil, gridEntityType, 0, gridIndex)
|
|
199
199
|
end
|
|
200
200
|
function warpToRoomType(self, roomType)
|
|
201
201
|
local roomTypeName = ROOM_TYPE_NAMES[roomType]
|
|
@@ -217,6 +217,10 @@ export declare function spawnKnifeWithSeed(variant: KnifeVariant | int, subType:
|
|
|
217
217
|
export declare function spawnLaser(variant: LaserVariant | int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityLaser;
|
|
218
218
|
/** Helper function to spawn a `EntityType.ENTITY_LASER` (7) with a specific seed. */
|
|
219
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 an NPC. */
|
|
221
|
+
export declare function spawnNPC(entityType: EntityType | int, variant: int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityNPC;
|
|
222
|
+
/** Helper function to spawn an NPC with a specific seed. */
|
|
223
|
+
export declare function spawnNPCWithSeed(entityType: EntityType | int, variant: int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityNPC;
|
|
220
224
|
/** Helper function to spawn a `EntityType.ENTITY_PICKUP` (5). */
|
|
221
225
|
export declare function spawnPickup(variant: PickupVariant | int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
222
226
|
/** Helper function to spawn a `EntityType.ENTITY_PICKUP` (5) with a specific seed. */
|
|
@@ -428,6 +428,50 @@ function ____exports.spawnLaserWithSeed(self, variant, subType, position, seed,
|
|
|
428
428
|
seed
|
|
429
429
|
)
|
|
430
430
|
end
|
|
431
|
+
function ____exports.spawnNPC(self, entityType, variant, subType, position, velocity, spawner, seed)
|
|
432
|
+
if velocity == nil then
|
|
433
|
+
velocity = VectorZero
|
|
434
|
+
end
|
|
435
|
+
if spawner == nil then
|
|
436
|
+
spawner = nil
|
|
437
|
+
end
|
|
438
|
+
if seed == nil then
|
|
439
|
+
seed = nil
|
|
440
|
+
end
|
|
441
|
+
local entity = spawn(
|
|
442
|
+
nil,
|
|
443
|
+
entityType,
|
|
444
|
+
variant,
|
|
445
|
+
subType,
|
|
446
|
+
position,
|
|
447
|
+
velocity,
|
|
448
|
+
spawner,
|
|
449
|
+
seed
|
|
450
|
+
)
|
|
451
|
+
local npc = entity:ToNPC()
|
|
452
|
+
if npc == nil then
|
|
453
|
+
error("Failed to spawn an NPC.")
|
|
454
|
+
end
|
|
455
|
+
return npc
|
|
456
|
+
end
|
|
457
|
+
function ____exports.spawnNPCWithSeed(self, entityType, variant, subType, position, seed, velocity, spawner)
|
|
458
|
+
if velocity == nil then
|
|
459
|
+
velocity = VectorZero
|
|
460
|
+
end
|
|
461
|
+
if spawner == nil then
|
|
462
|
+
spawner = nil
|
|
463
|
+
end
|
|
464
|
+
return ____exports.spawnNPC(
|
|
465
|
+
nil,
|
|
466
|
+
entityType,
|
|
467
|
+
variant,
|
|
468
|
+
subType,
|
|
469
|
+
position,
|
|
470
|
+
velocity,
|
|
471
|
+
spawner,
|
|
472
|
+
seed
|
|
473
|
+
)
|
|
474
|
+
end
|
|
431
475
|
function ____exports.spawnPickup(self, variant, subType, position, velocity, spawner, seed)
|
|
432
476
|
if velocity == nil then
|
|
433
477
|
velocity = VectorZero
|
|
@@ -85,7 +85,7 @@ export declare function isPostBossVoidPortal(gridEntity: GridEntity): boolean;
|
|
|
85
85
|
*
|
|
86
86
|
* @returns True if one or more grid entities were removed, false otherwise.
|
|
87
87
|
*/
|
|
88
|
-
export declare function
|
|
88
|
+
export declare function removeAllGridExcept(...gridEntityTypes: GridEntityType[]): boolean;
|
|
89
89
|
/**
|
|
90
90
|
* Helper function to remove all of the grid entities in the room that match the grid entity types
|
|
91
91
|
* provided.
|
|
@@ -112,7 +112,7 @@ export declare function removeAllMatchingGridEntities(...gridEntityType: GridEnt
|
|
|
112
112
|
* this is expensive, since it involves a call to `Isaac.GetRoomEntities`, so set it to false if you
|
|
113
113
|
* need to invoke this function multiple times.
|
|
114
114
|
*/
|
|
115
|
-
export declare function
|
|
115
|
+
export declare function removeGrid(gridEntity: GridEntity, updateRoom?: boolean): void;
|
|
116
116
|
/**
|
|
117
117
|
* Helper function to make a grid entity invisible. This is accomplished by setting its sprite to
|
|
118
118
|
* an empty/missing PNG file.
|
|
@@ -129,23 +129,23 @@ export declare function spawnGiantPoop(topLeftGridIndex: int): void;
|
|
|
129
129
|
* Helper function to spawn a grid entity.
|
|
130
130
|
*
|
|
131
131
|
* This function assumes you want to give the grid entity a variant of 0. If you want to specify a
|
|
132
|
-
* variant, use the `
|
|
132
|
+
* variant, use the `spawnGridWithVariant` helper function instead.
|
|
133
133
|
*
|
|
134
134
|
* Use this instead of the `Isaac.GridSpawn` method since it:
|
|
135
135
|
* - handles giving pits collision
|
|
136
136
|
* - removes existing grid entities on the same tile, if any
|
|
137
|
-
* - allows you to specify the grid index
|
|
137
|
+
* - allows you to specify either the grid index or the position
|
|
138
138
|
*/
|
|
139
|
-
export declare function
|
|
139
|
+
export declare function spawnGrid(gridEntityType: GridEntityType, gridIndexOrPosition: int): GridEntity | undefined;
|
|
140
140
|
/**
|
|
141
141
|
* Helper function to spawn a grid entity with a specific variant.
|
|
142
142
|
*
|
|
143
143
|
* Use this instead of the `Isaac.GridSpawn` method since it:
|
|
144
144
|
* - handles giving pits collision
|
|
145
145
|
* - removes existing grid entities on the same tile, if any
|
|
146
|
-
* - allows you to specify the grid index
|
|
146
|
+
* - allows you to specify the grid index or the position
|
|
147
147
|
*/
|
|
148
|
-
export declare function
|
|
148
|
+
export declare function spawnGridWithVariant(gridEntityType: GridEntityType, variant: int, gridIndexOrPosition: int): GridEntity | undefined;
|
|
149
149
|
/**
|
|
150
150
|
* Helper function to spawn a Void Portal. This is more complicated than simply spawning a trapdoor
|
|
151
151
|
* with the appropriate variant, as the game does not give it the correct sprite automatically.
|
|
@@ -25,6 +25,8 @@ local ____rooms = require("functions.rooms")
|
|
|
25
25
|
local roomUpdateSafe = ____rooms.roomUpdateSafe
|
|
26
26
|
local ____sprite = require("functions.sprite")
|
|
27
27
|
local clearSprite = ____sprite.clearSprite
|
|
28
|
+
local ____vector = require("functions.vector")
|
|
29
|
+
local isVector = ____vector.isVector
|
|
28
30
|
function getAllGridEntities(self)
|
|
29
31
|
local room = game:GetRoom()
|
|
30
32
|
local gridSize = room:GetGridSize()
|
|
@@ -43,7 +45,7 @@ function ____exports.getTopLeftWallGridIndex(self)
|
|
|
43
45
|
local topLeftWallGridIndex = ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP:get(roomShape)
|
|
44
46
|
return topLeftWallGridIndex == nil and DEFAULT_TOP_LEFT_WALL_GRID_INDEX or topLeftWallGridIndex
|
|
45
47
|
end
|
|
46
|
-
function ____exports.
|
|
48
|
+
function ____exports.removeGrid(self, gridEntity, updateRoom)
|
|
47
49
|
if updateRoom == nil then
|
|
48
50
|
updateRoom = true
|
|
49
51
|
end
|
|
@@ -54,14 +56,20 @@ function ____exports.removeGridEntity(self, gridEntity, updateRoom)
|
|
|
54
56
|
roomUpdateSafe(nil)
|
|
55
57
|
end
|
|
56
58
|
end
|
|
57
|
-
function ____exports.
|
|
59
|
+
function ____exports.spawnGridWithVariant(self, gridEntityType, variant, gridIndexOrPosition)
|
|
58
60
|
local room = game:GetRoom()
|
|
59
|
-
local
|
|
61
|
+
local ____isVector_result_0
|
|
62
|
+
if isVector(nil, gridIndexOrPosition) then
|
|
63
|
+
____isVector_result_0 = room:GetGridEntityFromPos(gridIndexOrPosition)
|
|
64
|
+
else
|
|
65
|
+
____isVector_result_0 = room:GetGridEntity(gridIndexOrPosition)
|
|
66
|
+
end
|
|
67
|
+
local existingGridEntity = ____isVector_result_0
|
|
60
68
|
if existingGridEntity ~= nil then
|
|
61
|
-
____exports.
|
|
69
|
+
____exports.removeGrid(nil, existingGridEntity)
|
|
62
70
|
end
|
|
63
|
-
local position = room:GetGridPosition(
|
|
64
|
-
local gridEntity = Isaac.GridSpawn(gridEntityType, variant, position
|
|
71
|
+
local position = isVector(nil, gridIndexOrPosition) and gridIndexOrPosition or room:GetGridPosition(gridIndexOrPosition)
|
|
72
|
+
local gridEntity = Isaac.GridSpawn(gridEntityType, variant, position)
|
|
65
73
|
if gridEntity == nil then
|
|
66
74
|
return gridEntity
|
|
67
75
|
end
|
|
@@ -201,7 +209,7 @@ function ____exports.isPostBossVoidPortal(self, gridEntity)
|
|
|
201
209
|
local saveState = gridEntity:GetSaveState()
|
|
202
210
|
return saveState.VarData == 1
|
|
203
211
|
end
|
|
204
|
-
function ____exports.
|
|
212
|
+
function ____exports.removeAllGridExcept(self, ...)
|
|
205
213
|
local gridEntityTypes = {...}
|
|
206
214
|
local gridEntityTypeExceptions = __TS__New(Set, gridEntityTypes)
|
|
207
215
|
local gridEntities = ____exports.getGridEntities(nil)
|
|
@@ -209,7 +217,7 @@ function ____exports.removeAllGridEntitiesExceptFor(self, ...)
|
|
|
209
217
|
for ____, gridEntity in ipairs(gridEntities) do
|
|
210
218
|
local gridEntityType = gridEntity:GetType()
|
|
211
219
|
if not gridEntityTypeExceptions:has(gridEntityType) then
|
|
212
|
-
____exports.
|
|
220
|
+
____exports.removeGrid(nil, gridEntity, false)
|
|
213
221
|
removedOneOrMoreGridEntities = true
|
|
214
222
|
end
|
|
215
223
|
end
|
|
@@ -224,7 +232,7 @@ function ____exports.removeAllMatchingGridEntities(self, ...)
|
|
|
224
232
|
return false
|
|
225
233
|
end
|
|
226
234
|
for ____, gridEntity in ipairs(gridEntities) do
|
|
227
|
-
____exports.
|
|
235
|
+
____exports.removeGrid(nil, gridEntity, false)
|
|
228
236
|
end
|
|
229
237
|
roomUpdateSafe(nil)
|
|
230
238
|
return true
|
|
@@ -239,16 +247,16 @@ function ____exports.spawnGiantPoop(self, topLeftGridIndex)
|
|
|
239
247
|
local topRightGridIndex = topLeftGridIndex + 1
|
|
240
248
|
local bottomLeftGridIndex = topLeftGridIndex + gridWidth
|
|
241
249
|
local bottomRightGridIndex = bottomLeftGridIndex + 1
|
|
242
|
-
____exports.
|
|
243
|
-
____exports.
|
|
244
|
-
____exports.
|
|
245
|
-
____exports.
|
|
250
|
+
____exports.spawnGridWithVariant(nil, GridEntityType.GRID_POOP, 7, topLeftGridIndex)
|
|
251
|
+
____exports.spawnGridWithVariant(nil, GridEntityType.GRID_POOP, 8, topRightGridIndex)
|
|
252
|
+
____exports.spawnGridWithVariant(nil, GridEntityType.GRID_POOP, 9, bottomLeftGridIndex)
|
|
253
|
+
____exports.spawnGridWithVariant(nil, GridEntityType.GRID_POOP, 10, bottomRightGridIndex)
|
|
246
254
|
end
|
|
247
|
-
function ____exports.
|
|
248
|
-
return ____exports.
|
|
255
|
+
function ____exports.spawnGrid(self, gridEntityType, gridIndexOrPosition)
|
|
256
|
+
return ____exports.spawnGridWithVariant(nil, gridEntityType, 0, gridIndexOrPosition)
|
|
249
257
|
end
|
|
250
258
|
function ____exports.spawnVoidPortal(self, gridIndex)
|
|
251
|
-
local voidPortal = ____exports.
|
|
259
|
+
local voidPortal = ____exports.spawnGridWithVariant(nil, GridEntityType.GRID_TRAPDOOR, 1, gridIndex)
|
|
252
260
|
if voidPortal == nil then
|
|
253
261
|
return voidPortal
|
|
254
262
|
end
|
|
@@ -15,6 +15,8 @@ export declare function getKeys(matchingSubType?: number): EntityPickup[];
|
|
|
15
15
|
export declare function getPills(matchingSubType?: number): EntityPickup[];
|
|
16
16
|
/** Helper function to get all of the red heart pickup entities in the room. */
|
|
17
17
|
export declare function getRedHearts(): EntityPickup[];
|
|
18
|
+
/** Helper function to get all of the sack (i.e. grab bag) entities in the room. */
|
|
19
|
+
export declare function getSacks(matchingSubType?: number): EntityPickup[];
|
|
18
20
|
/** Helper function to get all of the trinket entities in the room. */
|
|
19
21
|
export declare function getTrinkets(matchingSubType?: number): EntityPickup[];
|
|
20
22
|
export declare function isChest(pickup: EntityPickup): boolean;
|
|
@@ -76,6 +78,14 @@ export declare function removeAllKeys(keySubType?: KeySubType | int, cap?: int):
|
|
|
76
78
|
* @returns True if one or more pills were removed, false otherwise.
|
|
77
79
|
*/
|
|
78
80
|
export declare function removeAllPills(pillColor?: PillColor, cap?: int): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Helper function to remove all of the sacks (i.e. grab bags) in the room.
|
|
83
|
+
*
|
|
84
|
+
* @param sackSubType Optional. If specified, will only remove sacks that match this sub-type.
|
|
85
|
+
* @param cap Optional. If specified, will only remove the given amount of trinkets.
|
|
86
|
+
* @returns True if one or more trinkets were removed, false otherwise.
|
|
87
|
+
*/
|
|
88
|
+
export declare function removeAllSacks(sackSubType?: SackSubType | int, cap?: int): boolean;
|
|
79
89
|
/**
|
|
80
90
|
* Helper function to remove all of the trinkets in the room.
|
|
81
91
|
*
|
|
@@ -121,6 +131,12 @@ export declare function spawnKeyWithSeed(subType: KeySubType | int, position: Ve
|
|
|
121
131
|
*/
|
|
122
132
|
export declare function spawnPill(subType: PillColor | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
123
133
|
export declare function spawnPillWithSeed(subType: PillColor | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
134
|
+
/**
|
|
135
|
+
* Helper function to spawn a `EntityType.ENTITY_PICKUP` (5) with variant
|
|
136
|
+
* `PickupVariant.PICKUP_GRAB_BAG` (69).
|
|
137
|
+
*/
|
|
138
|
+
export declare function spawnSack(subType: SackSubType | int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityPickup;
|
|
139
|
+
export declare function spawnSackWithSeed(subType: SackSubType | int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityPickup;
|
|
124
140
|
/**
|
|
125
141
|
* Helper function to spawn a `EntityType.ENTITY_PICKUP` (5) with variant
|
|
126
142
|
* `PickupVariant.PICKUP_TRINKET` (350).
|
|
@@ -60,6 +60,12 @@ function ____exports.getRedHearts(self)
|
|
|
60
60
|
function(____, heart) return RED_HEART_SUB_TYPES_SET:has(heart.SubType) end
|
|
61
61
|
)
|
|
62
62
|
end
|
|
63
|
+
function ____exports.getSacks(self, matchingSubType)
|
|
64
|
+
if matchingSubType == nil then
|
|
65
|
+
matchingSubType = -1
|
|
66
|
+
end
|
|
67
|
+
return getPickups(nil, 69, matchingSubType)
|
|
68
|
+
end
|
|
63
69
|
function ____exports.getTrinkets(self, matchingSubType)
|
|
64
70
|
if matchingSubType == nil then
|
|
65
71
|
matchingSubType = -1
|
|
@@ -93,6 +99,9 @@ end
|
|
|
93
99
|
function ____exports.removeAllPills(self, pillColor, cap)
|
|
94
100
|
return removeAllPickups(nil, 70, pillColor, cap)
|
|
95
101
|
end
|
|
102
|
+
function ____exports.removeAllSacks(self, sackSubType, cap)
|
|
103
|
+
return removeAllPickups(nil, 350, sackSubType, cap)
|
|
104
|
+
end
|
|
96
105
|
function ____exports.removeAllTrinkets(self, trinketType, cap)
|
|
97
106
|
return removeAllPickups(nil, 350, trinketType, cap)
|
|
98
107
|
end
|
|
@@ -312,6 +321,42 @@ function ____exports.spawnPillWithSeed(self, subType, position, seed, velocity,
|
|
|
312
321
|
seed
|
|
313
322
|
)
|
|
314
323
|
end
|
|
324
|
+
function ____exports.spawnSack(self, subType, position, velocity, spawner, seed)
|
|
325
|
+
if velocity == nil then
|
|
326
|
+
velocity = VectorZero
|
|
327
|
+
end
|
|
328
|
+
if spawner == nil then
|
|
329
|
+
spawner = nil
|
|
330
|
+
end
|
|
331
|
+
if seed == nil then
|
|
332
|
+
seed = nil
|
|
333
|
+
end
|
|
334
|
+
return spawnPickup(
|
|
335
|
+
nil,
|
|
336
|
+
69,
|
|
337
|
+
subType,
|
|
338
|
+
position,
|
|
339
|
+
velocity,
|
|
340
|
+
spawner,
|
|
341
|
+
seed
|
|
342
|
+
)
|
|
343
|
+
end
|
|
344
|
+
function ____exports.spawnSackWithSeed(self, subType, position, seed, velocity, spawner)
|
|
345
|
+
if velocity == nil then
|
|
346
|
+
velocity = VectorZero
|
|
347
|
+
end
|
|
348
|
+
if spawner == nil then
|
|
349
|
+
spawner = nil
|
|
350
|
+
end
|
|
351
|
+
return ____exports.spawnSack(
|
|
352
|
+
nil,
|
|
353
|
+
subType,
|
|
354
|
+
position,
|
|
355
|
+
velocity,
|
|
356
|
+
spawner,
|
|
357
|
+
seed
|
|
358
|
+
)
|
|
359
|
+
end
|
|
315
360
|
function ____exports.spawnTrinket(self, subType, position, velocity, spawner, seed)
|
|
316
361
|
if velocity == nil then
|
|
317
362
|
velocity = VectorZero
|
|
@@ -26,7 +26,7 @@ function isValidGridPositionLRoom(self, gridPosition, roomShape)
|
|
|
26
26
|
return false
|
|
27
27
|
end
|
|
28
28
|
local verticalTopLeft, verticalBottomRight, horizontalTopLeft, horizontalBottomRight = table.unpack(rectangles)
|
|
29
|
-
return inRectangle(nil, gridPosition, verticalTopLeft, verticalBottomRight)
|
|
29
|
+
return inRectangle(nil, gridPosition, verticalTopLeft, verticalBottomRight) or inRectangle(nil, gridPosition, horizontalTopLeft, horizontalBottomRight)
|
|
30
30
|
end
|
|
31
31
|
function ____exports.gridCoordinatesToWorldPosition(self, x, y)
|
|
32
32
|
local gridPosition = Vector(x, y)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.242",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist/**/*.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^1.0.
|
|
28
|
+
"isaac-typescript-definitions": "^1.0.388",
|
|
29
29
|
"isaacscript-lint": "^1.0.95",
|
|
30
30
|
"isaacscript-tsconfig": "^1.1.8",
|
|
31
31
|
"typedoc": "^0.22.13",
|