isaacscript-common 6.6.5 → 6.7.0
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 +4 -4
- package/dist/callbacks/postCursedTeleport.lua +2 -2
- package/dist/callbacks/postCustomDoorEnter.lua +5 -5
- package/dist/callbacks/postDiceRoomActivated.lua +2 -2
- package/dist/callbacks/postFlip.lua +3 -3
- package/dist/callbacks/postGridEntity.lua +3 -3
- package/dist/callbacks/postGridEntityCollision.lua +3 -3
- package/dist/callbacks/postGridEntityRender.lua +2 -2
- package/dist/callbacks/postNewRoomEarly.lua +5 -5
- package/dist/callbacks/postPickupCollect.lua +2 -2
- package/dist/callbacks/postPitRender.lua +2 -2
- package/dist/callbacks/postPitUpdate.lua +2 -2
- package/dist/callbacks/postPlayerCollectible.lua +2 -2
- package/dist/callbacks/postPoopRender.lua +2 -2
- package/dist/callbacks/postPoopUpdate.lua +2 -2
- package/dist/callbacks/postPressurePlateRender.lua +2 -2
- package/dist/callbacks/postPressurePlateUpdate.lua +2 -2
- package/dist/callbacks/postPurchase.lua +2 -2
- package/dist/callbacks/postRockRender.lua +2 -2
- package/dist/callbacks/postRockUpdate.lua +2 -2
- package/dist/callbacks/postSlotInitUpdate.lua +2 -2
- package/dist/callbacks/postSlotRender.lua +2 -2
- package/dist/callbacks/postSpikesRender.lua +2 -2
- package/dist/callbacks/postSpikesUpdate.lua +2 -2
- package/dist/callbacks/postTNTRender.lua +2 -2
- package/dist/callbacks/postTNTUpdate.lua +2 -2
- package/dist/callbacks/preBerserkDeath.lua +2 -2
- package/dist/callbacks/preNewLevel.lua +2 -2
- package/dist/callbacks/subscriptions/postDoorRender.d.ts +2 -3
- package/dist/callbacks/subscriptions/postDoorRender.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postDoorRender.lua +3 -3
- package/dist/callbacks/subscriptions/postDoorUpdate.d.ts +2 -3
- package/dist/callbacks/subscriptions/postDoorUpdate.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postDoorUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postPitRender.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPitRender.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPitRender.lua +3 -3
- package/dist/callbacks/subscriptions/postPitUpdate.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPitUpdate.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPitUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postPoopRender.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPoopRender.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPoopRender.lua +3 -3
- package/dist/callbacks/subscriptions/postPoopUpdate.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPoopUpdate.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPoopUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPressurePlateRender.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPressurePlateRender.lua +3 -3
- package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts +2 -3
- package/dist/callbacks/subscriptions/postPressurePlateUpdate.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPressurePlateUpdate.lua +3 -3
- package/dist/features/characterStats.lua +2 -2
- package/dist/features/collectibleItemPoolType.lua +2 -2
- package/dist/features/customGridEntity.d.ts.map +1 -1
- package/dist/features/customGridEntity.lua +5 -5
- package/dist/features/customStage/backdrop.lua +2 -2
- package/dist/features/customStage/{gridEntities.d.ts → customStageGridEntities.d.ts} +1 -1
- package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -0
- package/dist/features/customStage/{gridEntities.lua → customStageGridEntities.lua} +8 -8
- package/dist/features/customStage/{util.d.ts → customStageUtils.d.ts} +1 -1
- package/dist/features/customStage/customStageUtils.d.ts.map +1 -0
- package/dist/features/customStage/{util.lua → customStageUtils.lua} +0 -0
- package/dist/features/customStage/exports.lua +4 -4
- package/dist/features/customStage/init.lua +6 -6
- package/dist/features/customStage/shadows.lua +2 -2
- package/dist/features/customStage/versusScreen.lua +4 -4
- package/dist/features/debugDisplay/v.lua +4 -4
- package/dist/features/deployJSONRoom.lua +20 -20
- package/dist/features/extraConsoleCommands/commandsSubroutines.lua +3 -3
- package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +14 -14
- package/dist/features/pause.lua +2 -2
- package/dist/features/persistentEntities.lua +2 -2
- package/dist/features/preventCollectibleRotation.lua +2 -2
- package/dist/features/saveDataManager/exports.d.ts.map +1 -1
- package/dist/features/sirenHelpers.lua +2 -2
- package/dist/functions/ambush.lua +5 -5
- package/dist/functions/{boss.d.ts → bosses.d.ts} +22 -4
- package/dist/functions/bosses.d.ts.map +1 -0
- package/dist/functions/{boss.lua → bosses.lua} +38 -13
- package/dist/functions/collectibleTag.lua +2 -2
- package/dist/functions/collectibles.lua +5 -5
- package/dist/functions/{entity.d.ts → entities.d.ts} +21 -19
- package/dist/functions/entities.d.ts.map +1 -0
- package/dist/functions/{entity.lua → entities.lua} +25 -20
- package/dist/functions/{entitySpecific.d.ts → entitiesSpecific.d.ts} +145 -68
- package/dist/functions/entitiesSpecific.d.ts.map +1 -0
- package/dist/functions/{entitySpecific.lua → entitiesSpecific.lua} +203 -65
- package/dist/functions/familiars.lua +2 -2
- package/dist/functions/{gridEntity.d.ts → gridEntities.d.ts} +48 -17
- package/dist/functions/gridEntities.d.ts.map +1 -0
- package/dist/functions/{gridEntity.lua → gridEntities.lua} +140 -90
- package/dist/functions/gridEntitiesSpecific.d.ts +141 -0
- package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -0
- package/dist/functions/gridEntitiesSpecific.lua +366 -0
- package/dist/functions/log.lua +8 -8
- package/dist/functions/{npc.d.ts → npcs.d.ts} +24 -2
- package/dist/functions/npcs.d.ts.map +1 -0
- package/dist/functions/{npc.lua → npcs.lua} +44 -9
- package/dist/functions/pickups.d.ts +4 -119
- package/dist/functions/pickups.d.ts.map +1 -1
- package/dist/functions/pickups.lua +10 -439
- package/dist/functions/pickupsSpecific.d.ts +229 -0
- package/dist/functions/pickupsSpecific.d.ts.map +1 -0
- package/dist/functions/pickupsSpecific.lua +560 -0
- package/dist/functions/playerHealth.lua +6 -6
- package/dist/functions/{player.d.ts → players.d.ts} +1 -1
- package/dist/functions/players.d.ts.map +1 -0
- package/dist/functions/{player.lua → players.lua} +0 -0
- package/dist/functions/pocketItems.lua +2 -2
- package/dist/functions/positionVelocity.lua +6 -6
- package/dist/functions/pressurePlate.d.ts +10 -0
- package/dist/functions/pressurePlate.d.ts.map +1 -0
- package/dist/functions/pressurePlate.lua +29 -0
- package/dist/functions/revive.lua +7 -7
- package/dist/functions/rooms.lua +2 -2
- package/dist/functions/saveFile.lua +3 -3
- package/dist/functions/spawnCollectible.lua +4 -4
- package/dist/functions/{sprite.d.ts → sprites.d.ts} +1 -1
- package/dist/functions/sprites.d.ts.map +1 -0
- package/dist/functions/{sprite.lua → sprites.lua} +0 -0
- package/dist/functions/transformations.lua +2 -2
- package/dist/functions/trinketGive.lua +2 -2
- package/dist/functions/trinkets.lua +6 -6
- package/dist/functions/utils.d.ts +7 -0
- package/dist/functions/utils.d.ts.map +1 -1
- package/dist/functions/utils.lua +35 -22
- package/dist/index.d.ts +10 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +26 -10
- package/dist/types/AnyGridEntity.d.ts +10 -0
- package/dist/types/AnyGridEntity.d.ts.map +1 -0
- package/dist/types/AnyGridEntity.lua +2 -0
- package/package.json +2 -2
- package/src/callbacks/customRevive.ts +2 -2
- package/src/callbacks/postCursedTeleport.ts +1 -1
- package/src/callbacks/postCustomDoorEnter.ts +2 -2
- package/src/callbacks/postDiceRoomActivated.ts +1 -1
- package/src/callbacks/postFlip.ts +1 -1
- package/src/callbacks/postGridEntity.ts +1 -1
- package/src/callbacks/postGridEntityCollision.ts +1 -1
- package/src/callbacks/postGridEntityRender.ts +1 -1
- package/src/callbacks/postNewRoomEarly.ts +9 -3
- package/src/callbacks/postPickupCollect.ts +1 -1
- package/src/callbacks/postPitRender.ts +1 -1
- package/src/callbacks/postPitUpdate.ts +1 -1
- package/src/callbacks/postPlayerCollectible.ts +1 -1
- package/src/callbacks/postPoopRender.ts +1 -1
- package/src/callbacks/postPoopUpdate.ts +1 -1
- package/src/callbacks/postPressurePlateRender.ts +1 -1
- package/src/callbacks/postPressurePlateUpdate.ts +1 -1
- package/src/callbacks/postPurchase.ts +1 -1
- package/src/callbacks/postRockRender.ts +1 -1
- package/src/callbacks/postRockUpdate.ts +1 -1
- package/src/callbacks/postSlotInitUpdate.ts +1 -1
- package/src/callbacks/postSlotRender.ts +1 -1
- package/src/callbacks/postSpikesRender.ts +1 -1
- package/src/callbacks/postSpikesUpdate.ts +1 -1
- package/src/callbacks/postTNTRender.ts +1 -1
- package/src/callbacks/postTNTUpdate.ts +1 -1
- package/src/callbacks/preBerserkDeath.ts +1 -1
- package/src/callbacks/preNewLevel.ts +1 -1
- package/src/callbacks/subscriptions/postDoorRender.ts +7 -5
- package/src/callbacks/subscriptions/postDoorUpdate.ts +7 -5
- package/src/callbacks/subscriptions/postPitRender.ts +6 -7
- package/src/callbacks/subscriptions/postPitUpdate.ts +6 -7
- package/src/callbacks/subscriptions/postPoopRender.ts +7 -5
- package/src/callbacks/subscriptions/postPoopUpdate.ts +7 -5
- package/src/callbacks/subscriptions/postPressurePlateRender.ts +7 -5
- package/src/callbacks/subscriptions/postPressurePlateUpdate.ts +7 -5
- package/src/features/characterStats.ts +1 -1
- package/src/features/collectibleItemPoolType.ts +1 -1
- package/src/features/customGridEntity.ts +6 -3
- package/src/features/customStage/backdrop.ts +1 -1
- package/src/features/customStage/{gridEntities.ts → customStageGridEntities.ts} +3 -3
- package/src/features/customStage/{util.ts → customStageUtils.ts} +0 -0
- package/src/features/customStage/exports.ts +2 -2
- package/src/features/customStage/init.ts +1 -1
- package/src/features/customStage/shadows.ts +1 -1
- package/src/features/customStage/versusScreen.ts +2 -2
- package/src/features/debugDisplay/v.ts +2 -2
- package/src/features/deployJSONRoom.ts +11 -7
- package/src/features/extraConsoleCommands/commandsSubroutines.ts +2 -2
- package/src/features/extraConsoleCommands/listCommands.ts +10 -6
- package/src/features/pause.ts +1 -1
- package/src/features/persistentEntities.ts +1 -1
- package/src/features/preventCollectibleRotation.ts +1 -1
- package/src/features/saveDataManager/exports.ts +7 -4
- package/src/features/sirenHelpers.ts +1 -1
- package/src/functions/ambush.ts +2 -2
- package/src/functions/{boss.ts → bosses.ts} +29 -21
- package/src/functions/collectibleTag.ts +1 -1
- package/src/functions/collectibles.ts +2 -2
- package/src/functions/{entity.ts → entities.ts} +23 -21
- package/src/functions/{entitySpecific.ts → entitiesSpecific.ts} +170 -99
- package/src/functions/familiars.ts +1 -1
- package/src/functions/{gridEntity.ts → gridEntities.ts} +110 -34
- package/src/functions/gridEntitiesSpecific.ts +490 -0
- package/src/functions/log.ts +3 -3
- package/src/functions/{npc.ts → npcs.ts} +42 -11
- package/src/functions/pickups.ts +8 -475
- package/src/functions/pickupsSpecific.ts +613 -0
- package/src/functions/playerHealth.ts +1 -1
- package/src/functions/{player.ts → players.ts} +0 -0
- package/src/functions/pocketItems.ts +1 -1
- package/src/functions/positionVelocity.ts +3 -3
- package/src/functions/pressurePlate.ts +29 -0
- package/src/functions/revive.ts +2 -2
- package/src/functions/rooms.ts +1 -1
- package/src/functions/saveFile.ts +1 -1
- package/src/functions/spawnCollectible.ts +2 -2
- package/src/functions/{sprite.ts → sprites.ts} +0 -0
- package/src/functions/transformations.ts +1 -1
- package/src/functions/trinketGive.ts +1 -1
- package/src/functions/trinkets.ts +3 -3
- package/src/functions/utils.ts +32 -13
- package/src/index.ts +10 -8
- package/src/types/AnyGridEntity.ts +9 -0
- package/dist/features/customStage/gridEntities.d.ts.map +0 -1
- package/dist/features/customStage/util.d.ts.map +0 -1
- package/dist/functions/boss.d.ts.map +0 -1
- package/dist/functions/entity.d.ts.map +0 -1
- package/dist/functions/entitySpecific.d.ts.map +0 -1
- package/dist/functions/gridEntity.d.ts.map +0 -1
- package/dist/functions/gridEntitySpecific.d.ts +0 -29
- package/dist/functions/gridEntitySpecific.d.ts.map +0 -1
- package/dist/functions/gridEntitySpecific.lua +0 -114
- package/dist/functions/npc.d.ts.map +0 -1
- package/dist/functions/player.d.ts.map +0 -1
- package/dist/functions/sprite.d.ts.map +0 -1
- package/src/functions/gridEntitySpecific.ts +0 -143
|
@@ -15,11 +15,11 @@ local STAGE_TO_COMBINED_BOSS_SET_MAP = ____bossSets.STAGE_TO_COMBINED_BOSS_SET_M
|
|
|
15
15
|
local STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP = ____bossSets.STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP
|
|
16
16
|
local ____sinEntityTypesSet = require("sets.sinEntityTypesSet")
|
|
17
17
|
local SIN_ENTITY_TYPES_SET = ____sinEntityTypesSet.SIN_ENTITY_TYPES_SET
|
|
18
|
-
local
|
|
19
|
-
local getNPCs =
|
|
20
|
-
local spawnNPC =
|
|
21
|
-
local
|
|
22
|
-
local getAliveNPCs =
|
|
18
|
+
local ____entitiesSpecific = require("functions.entitiesSpecific")
|
|
19
|
+
local getNPCs = ____entitiesSpecific.getNPCs
|
|
20
|
+
local spawnNPC = ____entitiesSpecific.spawnNPC
|
|
21
|
+
local ____npcs = require("functions.npcs")
|
|
22
|
+
local getAliveNPCs = ____npcs.getAliveNPCs
|
|
23
23
|
local ____rng = require("functions.rng")
|
|
24
24
|
local isRNG = ____rng.isRNG
|
|
25
25
|
local ____set = require("functions.set")
|
|
@@ -69,15 +69,32 @@ DEFAULT_BOSS_MULTI_SEGMENTS = 4
|
|
|
69
69
|
--
|
|
70
70
|
-- This function will not include bosses on an internal blacklist, such as Death's scythes or Big
|
|
71
71
|
-- Horn holes.
|
|
72
|
-
|
|
72
|
+
--
|
|
73
|
+
-- @param entityType Optional. If specified, will only get the bosses that match the type. Default
|
|
74
|
+
-- is -1, which matches every type.
|
|
75
|
+
-- @param variant Optional. If specified, will only get the bosses that match the variant. Default
|
|
76
|
+
-- is -1, which matches every variant.
|
|
77
|
+
-- @param subType Optional. If specified, will only get the bosses that match the sub-type. Default
|
|
78
|
+
-- is -1, which matches every sub-type.
|
|
79
|
+
-- @param ignoreFriendly Optional. Default is false.
|
|
80
|
+
function ____exports.getAliveBosses(self, entityType, variant, subType, ignoreFriendly)
|
|
81
|
+
if entityType == nil then
|
|
82
|
+
entityType = -1
|
|
83
|
+
end
|
|
84
|
+
if variant == nil then
|
|
85
|
+
variant = -1
|
|
86
|
+
end
|
|
87
|
+
if subType == nil then
|
|
88
|
+
subType = -1
|
|
89
|
+
end
|
|
73
90
|
if ignoreFriendly == nil then
|
|
74
91
|
ignoreFriendly = false
|
|
75
92
|
end
|
|
76
93
|
local aliveNPCs = getAliveNPCs(
|
|
77
94
|
nil,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
95
|
+
entityType,
|
|
96
|
+
variant,
|
|
97
|
+
subType,
|
|
81
98
|
ignoreFriendly
|
|
82
99
|
)
|
|
83
100
|
return __TS__ArrayFilter(
|
|
@@ -111,15 +128,23 @@ function ____exports.getBossSet(self, stage, stageType)
|
|
|
111
128
|
return copySet(nil, bossSet)
|
|
112
129
|
end
|
|
113
130
|
--- Helper function to get all of the bosses in the room.
|
|
114
|
-
|
|
131
|
+
--
|
|
132
|
+
-- @param entityType Optional. If specified, will only get the bosses that match the type. Default
|
|
133
|
+
-- is -1, which matches every type.
|
|
134
|
+
-- @param variant Optional. If specified, will only get the bosses that match the variant. Default
|
|
135
|
+
-- is -1, which matches every variant.
|
|
136
|
+
-- @param subType Optional. If specified, will only get the bosses that match the sub-type. Default
|
|
137
|
+
-- is -1, which matches every sub-type.
|
|
138
|
+
-- @param ignoreFriendly Optional. Default is false.
|
|
139
|
+
function ____exports.getBosses(self, entityType, variant, subType, ignoreFriendly)
|
|
115
140
|
if ignoreFriendly == nil then
|
|
116
141
|
ignoreFriendly = false
|
|
117
142
|
end
|
|
118
143
|
local npcs = getNPCs(
|
|
119
144
|
nil,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
145
|
+
entityType,
|
|
146
|
+
variant,
|
|
147
|
+
subType,
|
|
123
148
|
ignoreFriendly
|
|
124
149
|
)
|
|
125
150
|
return __TS__ArrayFilter(
|
|
@@ -14,8 +14,8 @@ local ____enums = require("functions.enums")
|
|
|
14
14
|
local getEnumValues = ____enums.getEnumValues
|
|
15
15
|
local ____flag = require("functions.flag")
|
|
16
16
|
local getFlagName = ____flag.getFlagName
|
|
17
|
-
local
|
|
18
|
-
local getPlayerCollectibleCount =
|
|
17
|
+
local ____players = require("functions.players")
|
|
18
|
+
local getPlayerCollectibleCount = ____players.getPlayerCollectibleCount
|
|
19
19
|
local ____set = require("functions.set")
|
|
20
20
|
local copySet = ____set.copySet
|
|
21
21
|
function ____exports.collectibleHasTag(self, collectibleType, tag)
|
|
@@ -27,15 +27,15 @@ local COLLECTIBLE_NAME_MAP = ____collectibleNameMap.COLLECTIBLE_NAME_MAP
|
|
|
27
27
|
local DEFAULT_COLLECTIBLE_NAME = ____collectibleNameMap.DEFAULT_COLLECTIBLE_NAME
|
|
28
28
|
local ____singleUseActiveCollectibleTypesSet = require("sets.singleUseActiveCollectibleTypesSet")
|
|
29
29
|
local SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET = ____singleUseActiveCollectibleTypesSet.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET
|
|
30
|
-
local
|
|
31
|
-
local getEntityID =
|
|
30
|
+
local ____entities = require("functions.entities")
|
|
31
|
+
local getEntityID = ____entities.getEntityID
|
|
32
32
|
local ____pickupVariants = require("functions.pickupVariants")
|
|
33
33
|
local isCollectible = ____pickupVariants.isCollectible
|
|
34
34
|
local ____roomData = require("functions.roomData")
|
|
35
35
|
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
36
|
-
local
|
|
37
|
-
local clearSprite =
|
|
38
|
-
local spriteEquals =
|
|
36
|
+
local ____sprites = require("functions.sprites")
|
|
37
|
+
local clearSprite = ____sprites.clearSprite
|
|
38
|
+
local spriteEquals = ____sprites.spriteEquals
|
|
39
39
|
local ____utils = require("functions.utils")
|
|
40
40
|
local irange = ____utils.irange
|
|
41
41
|
function initQuestionMarkSprite(self)
|
|
@@ -6,20 +6,20 @@ import { AnyEntity } from "../types/AnyEntity";
|
|
|
6
6
|
* `Isaac.CountEntities` method to avoid having to specify a spawner and to handle ignoring charmed
|
|
7
7
|
* enemies.
|
|
8
8
|
*
|
|
9
|
-
* @param entityType Default is -1
|
|
10
|
-
* @param variant Default is -1
|
|
11
|
-
* @param subType Default is -1
|
|
12
|
-
* @param ignoreFriendly Default is false.
|
|
9
|
+
* @param entityType Optional. Default is -1, which matches every entity type.
|
|
10
|
+
* @param variant Optional. Default is -1, which matches every variant.
|
|
11
|
+
* @param subType Optional. Default is -1, which matches every sub-type.
|
|
12
|
+
* @param ignoreFriendly Optional. Default is false.
|
|
13
13
|
*/
|
|
14
14
|
export declare function countEntities(entityType?: EntityType, variant?: number, subType?: number, ignoreFriendly?: boolean): int;
|
|
15
15
|
/**
|
|
16
16
|
* Helper function to check if one or more of a specific kind of entity is present in the current
|
|
17
17
|
* room. It uses the `countEntities` helper function to determine this.
|
|
18
18
|
*
|
|
19
|
-
* @param entityType Default is -1
|
|
20
|
-
* @param variant Default is -1
|
|
21
|
-
* @param subType Default is -1
|
|
22
|
-
* @param ignoreFriendly Default is false.
|
|
19
|
+
* @param entityType Optional. Default is -1, which matches every entity type.
|
|
20
|
+
* @param variant Optional. Default is -1, which matches every variant.
|
|
21
|
+
* @param subType Optional. Default is -1, which matches every sub-type.
|
|
22
|
+
* @param ignoreFriendly Optional. Default is false.
|
|
23
23
|
*/
|
|
24
24
|
export declare function doesEntityExist(entityType?: EntityType, variant?: number, subType?: number, ignoreFriendly?: boolean): boolean;
|
|
25
25
|
/**
|
|
@@ -46,20 +46,21 @@ export declare function getClosestEntityTo<T extends AnyEntity>(referenceEntity:
|
|
|
46
46
|
* For example:
|
|
47
47
|
*
|
|
48
48
|
* ```ts
|
|
49
|
-
* // Make all of the entities in the room invisible
|
|
49
|
+
* // Make all of the entities in the room invisible.
|
|
50
50
|
* for (const entity of getEntities()) {
|
|
51
51
|
* entity.Visible = false;
|
|
52
52
|
* }
|
|
53
53
|
* ```
|
|
54
54
|
*
|
|
55
|
-
* @param entityType Optional. If specified, will only
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
55
|
+
* @param entityType Optional. If specified, will only get the entities that match the type. Default
|
|
56
|
+
* is -1, which matches every type.
|
|
57
|
+
* @param variant Optional. If specified, will only get the entities that match the variant. Default
|
|
58
|
+
* is -1, which matches every variant.
|
|
59
|
+
* @param subType Optional. If specified, will only get the entities that match the sub-type.
|
|
60
|
+
* Default is -1, which matches every sub-type.
|
|
60
61
|
* @param ignoreFriendly Optional. If set to true, it will exclude friendly NPCs from being
|
|
61
|
-
* returned. Default is false. Will only be taken into account if
|
|
62
|
-
* `
|
|
62
|
+
* returned. Default is false. Will only be taken into account if the
|
|
63
|
+
* `entityType` is specified.
|
|
63
64
|
*/
|
|
64
65
|
export declare function getEntities(entityType?: EntityType, variant?: number, subType?: number, ignoreFriendly?: boolean): Entity[];
|
|
65
66
|
/**
|
|
@@ -117,8 +118,9 @@ export declare function parseEntityTypeVariantString(entityTypeVariantString: st
|
|
|
117
118
|
* Helper function to remove all of the matching entities in the room.
|
|
118
119
|
*
|
|
119
120
|
* @param entityType The entity type to match.
|
|
120
|
-
* @param entityVariant Optional. The variant to match. Default is -1
|
|
121
|
-
* @param entitySubType Optional. The sub-type to match. Default is -1
|
|
121
|
+
* @param entityVariant Optional. The variant to match. Default is -1, which matches every variant.
|
|
122
|
+
* @param entitySubType Optional. The sub-type to match. Default is -1, which matches every
|
|
123
|
+
* sub-type.
|
|
122
124
|
* @param cap Optional. If specified, will only remove the given amount of collectibles.
|
|
123
125
|
* @returns An array of the entities that were removed.
|
|
124
126
|
*/
|
|
@@ -153,4 +155,4 @@ export declare function spawn(entityType: EntityType, variant: int, subType: int
|
|
|
153
155
|
* need to specify the velocity or spawner.
|
|
154
156
|
*/
|
|
155
157
|
export declare function spawnWithSeed(entityType: EntityType, variant: int, subType: int, position: Vector, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): Entity;
|
|
156
|
-
//# sourceMappingURL=
|
|
158
|
+
//# sourceMappingURL=entities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/functions/entities.ts"],"names":[],"mappings":"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"}
|
|
@@ -47,7 +47,7 @@ function ____exports.removeEntities(self, entities, cap)
|
|
|
47
47
|
entity:Remove()
|
|
48
48
|
entitiesRemoved[#entitiesRemoved + 1] = entity
|
|
49
49
|
if cap ~= nil and #entitiesRemoved >= cap then
|
|
50
|
-
|
|
50
|
+
break
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
return entitiesRemoved
|
|
@@ -56,10 +56,10 @@ end
|
|
|
56
56
|
-- `Isaac.CountEntities` method to avoid having to specify a spawner and to handle ignoring charmed
|
|
57
57
|
-- enemies.
|
|
58
58
|
--
|
|
59
|
-
-- @param entityType Default is -1
|
|
60
|
-
-- @param variant Default is -1
|
|
61
|
-
-- @param subType Default is -1
|
|
62
|
-
-- @param ignoreFriendly Default is false.
|
|
59
|
+
-- @param entityType Optional. Default is -1, which matches every entity type.
|
|
60
|
+
-- @param variant Optional. Default is -1, which matches every variant.
|
|
61
|
+
-- @param subType Optional. Default is -1, which matches every sub-type.
|
|
62
|
+
-- @param ignoreFriendly Optional. Default is false.
|
|
63
63
|
function ____exports.countEntities(self, entityType, variant, subType, ignoreFriendly)
|
|
64
64
|
if entityType == nil then
|
|
65
65
|
entityType = -1
|
|
@@ -88,10 +88,10 @@ end
|
|
|
88
88
|
--- Helper function to check if one or more of a specific kind of entity is present in the current
|
|
89
89
|
-- room. It uses the `countEntities` helper function to determine this.
|
|
90
90
|
--
|
|
91
|
-
-- @param entityType Default is -1
|
|
92
|
-
-- @param variant Default is -1
|
|
93
|
-
-- @param subType Default is -1
|
|
94
|
-
-- @param ignoreFriendly Default is false.
|
|
91
|
+
-- @param entityType Optional. Default is -1, which matches every entity type.
|
|
92
|
+
-- @param variant Optional. Default is -1, which matches every variant.
|
|
93
|
+
-- @param subType Optional. Default is -1, which matches every sub-type.
|
|
94
|
+
-- @param ignoreFriendly Optional. Default is false.
|
|
95
95
|
function ____exports.doesEntityExist(self, entityType, variant, subType, ignoreFriendly)
|
|
96
96
|
if entityType == nil then
|
|
97
97
|
entityType = -1
|
|
@@ -146,21 +146,25 @@ end
|
|
|
146
146
|
-- For example:
|
|
147
147
|
--
|
|
148
148
|
-- ```ts
|
|
149
|
-
-- // Make all of the entities in the room invisible
|
|
149
|
+
-- // Make all of the entities in the room invisible.
|
|
150
150
|
-- for (const entity of getEntities()) {
|
|
151
151
|
-- entity.Visible = false;
|
|
152
152
|
-- }
|
|
153
153
|
-- ```
|
|
154
154
|
--
|
|
155
|
-
-- @param entityType Optional. If specified, will only
|
|
156
|
-
--
|
|
157
|
-
--
|
|
158
|
-
--
|
|
159
|
-
--
|
|
155
|
+
-- @param entityType Optional. If specified, will only get the entities that match the type. Default
|
|
156
|
+
-- is -1, which matches every type.
|
|
157
|
+
-- @param variant Optional. If specified, will only get the entities that match the variant. Default
|
|
158
|
+
-- is -1, which matches every variant.
|
|
159
|
+
-- @param subType Optional. If specified, will only get the entities that match the sub-type.
|
|
160
|
+
-- Default is -1, which matches every sub-type.
|
|
160
161
|
-- @param ignoreFriendly Optional. If set to true, it will exclude friendly NPCs from being
|
|
161
|
-
-- returned. Default is false. Will only be taken into account if
|
|
162
|
-
-- `
|
|
162
|
+
-- returned. Default is false. Will only be taken into account if the
|
|
163
|
+
-- `entityType` is specified.
|
|
163
164
|
function ____exports.getEntities(self, entityType, variant, subType, ignoreFriendly)
|
|
165
|
+
if entityType == nil then
|
|
166
|
+
entityType = -1
|
|
167
|
+
end
|
|
164
168
|
if variant == nil then
|
|
165
169
|
variant = -1
|
|
166
170
|
end
|
|
@@ -170,7 +174,7 @@ function ____exports.getEntities(self, entityType, variant, subType, ignoreFrien
|
|
|
170
174
|
if ignoreFriendly == nil then
|
|
171
175
|
ignoreFriendly = false
|
|
172
176
|
end
|
|
173
|
-
if entityType ==
|
|
177
|
+
if entityType == -1 then
|
|
174
178
|
return Isaac.GetRoomEntities()
|
|
175
179
|
end
|
|
176
180
|
return Isaac.FindByType(entityType, variant, subType, ignoreFriendly)
|
|
@@ -290,8 +294,9 @@ end
|
|
|
290
294
|
--- Helper function to remove all of the matching entities in the room.
|
|
291
295
|
--
|
|
292
296
|
-- @param entityType The entity type to match.
|
|
293
|
-
-- @param entityVariant Optional. The variant to match. Default is -1
|
|
294
|
-
-- @param entitySubType Optional. The sub-type to match. Default is -1
|
|
297
|
+
-- @param entityVariant Optional. The variant to match. Default is -1, which matches every variant.
|
|
298
|
+
-- @param entitySubType Optional. The sub-type to match. Default is -1, which matches every
|
|
299
|
+
-- sub-type.
|
|
295
300
|
-- @param cap Optional. If specified, will only remove the given amount of collectibles.
|
|
296
301
|
-- @returns An array of the entities that were removed.
|
|
297
302
|
function ____exports.removeAllMatchingEntities(self, entityType, entityVariant, entitySubType, cap)
|