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
package/src/features/pause.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
ModCallback,
|
|
6
6
|
} from "isaac-typescript-definitions";
|
|
7
7
|
import { logError } from "../functions/log";
|
|
8
|
-
import { useActiveItemTemp } from "../functions/
|
|
8
|
+
import { useActiveItemTemp } from "../functions/players";
|
|
9
9
|
import { disableAllInputsExceptFor, enableAllInputs } from "./disableInputs";
|
|
10
10
|
import { saveDataManager } from "./saveDataManager/exports";
|
|
11
11
|
|
|
@@ -7,7 +7,7 @@ import { game } from "../cachedClasses";
|
|
|
7
7
|
import { ModUpgraded } from "../classes/ModUpgraded";
|
|
8
8
|
import { ModCallbackCustom } from "../enums/ModCallbackCustom";
|
|
9
9
|
import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
|
|
10
|
-
import { spawn } from "../functions/
|
|
10
|
+
import { spawn } from "../functions/entities";
|
|
11
11
|
import { getRoomListIndex } from "../functions/roomData";
|
|
12
12
|
import { saveDataManager } from "./saveDataManager/exports";
|
|
13
13
|
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import { game } from "../cachedClasses";
|
|
11
11
|
import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
|
|
12
12
|
import { setCollectibleSubType } from "../functions/collectibles";
|
|
13
|
-
import { getEntityID } from "../functions/
|
|
13
|
+
import { getEntityID } from "../functions/entities";
|
|
14
14
|
import { isCollectible } from "../functions/pickupVariants";
|
|
15
15
|
import { saveDataManager } from "./saveDataManager/exports";
|
|
16
16
|
|
|
@@ -169,8 +169,11 @@ export function saveDataManagerSave(): void {
|
|
|
169
169
|
forceSaveDataManagerSave();
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
|
|
173
|
-
declare let
|
|
172
|
+
/** "g" stands for "globals". */
|
|
173
|
+
declare let g: LuaTable<string, SaveData>; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
174
|
+
|
|
175
|
+
/** "gd" stands for "globals defaults". */
|
|
176
|
+
declare let gd: LuaTable<string, SaveData>; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
174
177
|
|
|
175
178
|
/**
|
|
176
179
|
* - Sets the global variable of "g" equal to all of the save data variables for this mod.
|
|
@@ -182,8 +185,8 @@ declare let gd: LuaTable<string, SaveData>; // Globals defaults
|
|
|
182
185
|
export function saveDataManagerSetGlobal(): void {
|
|
183
186
|
errorIfFeaturesNotInitialized(SAVE_DATA_MANAGER_FEATURE_NAME);
|
|
184
187
|
|
|
185
|
-
g = saveDataMap;
|
|
186
|
-
gd = saveDataDefaultsMap;
|
|
188
|
+
g = saveDataMap;
|
|
189
|
+
gd = saveDataDefaultsMap;
|
|
187
190
|
}
|
|
188
191
|
|
|
189
192
|
/**
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
ModCallback,
|
|
5
5
|
} from "isaac-typescript-definitions";
|
|
6
6
|
import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
|
|
7
|
-
import { getEntities } from "../functions/
|
|
7
|
+
import { getEntities } from "../functions/entities";
|
|
8
8
|
import { saveDataManager } from "./saveDataManager/exports";
|
|
9
9
|
|
|
10
10
|
const FEATURE_NAME = "sirenHelpers";
|
package/src/functions/ambush.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SackSubType } from "isaac-typescript-definitions";
|
|
2
2
|
import { runNextGameFrame } from "../features/runInNFrames";
|
|
3
|
-
import { removeEntities } from "./
|
|
4
|
-
import { getCoins, spawnSackWithSeed } from "./
|
|
3
|
+
import { removeEntities } from "./entities";
|
|
4
|
+
import { getCoins, spawnSackWithSeed } from "./pickupsSpecific";
|
|
5
5
|
|
|
6
6
|
/** Hard-coding this makes it easier to clean up the pickups afterwards. */
|
|
7
7
|
const SACK_SEED_THAT_SPAWNS_TWO_COINS = 6 as Seed;
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP,
|
|
11
11
|
} from "../sets/bossSets";
|
|
12
12
|
import { SIN_ENTITY_TYPES_SET } from "../sets/sinEntityTypesSet";
|
|
13
|
-
import { getNPCs, spawnNPC } from "./
|
|
14
|
-
import { getAliveNPCs } from "./
|
|
13
|
+
import { getNPCs, spawnNPC } from "./entitiesSpecific";
|
|
14
|
+
import { getAliveNPCs } from "./npcs";
|
|
15
15
|
import { isRNG } from "./rng";
|
|
16
16
|
import { copySet } from "./set";
|
|
17
17
|
import { repeat } from "./utils";
|
|
@@ -31,19 +31,22 @@ const DEFAULT_BOSS_MULTI_SEGMENTS = 4;
|
|
|
31
31
|
*
|
|
32
32
|
* This function will not include bosses on an internal blacklist, such as Death's scythes or Big
|
|
33
33
|
* Horn holes.
|
|
34
|
+
*
|
|
35
|
+
* @param entityType Optional. If specified, will only get the bosses that match the type. Default
|
|
36
|
+
* is -1, which matches every type.
|
|
37
|
+
* @param variant Optional. If specified, will only get the bosses that match the variant. Default
|
|
38
|
+
* is -1, which matches every variant.
|
|
39
|
+
* @param subType Optional. If specified, will only get the bosses that match the sub-type. Default
|
|
40
|
+
* is -1, which matches every sub-type.
|
|
41
|
+
* @param ignoreFriendly Optional. Default is false.
|
|
34
42
|
*/
|
|
35
43
|
export function getAliveBosses(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
entityType: EntityType = -1,
|
|
45
|
+
variant = -1,
|
|
46
|
+
subType = -1,
|
|
39
47
|
ignoreFriendly = false,
|
|
40
48
|
): EntityNPC[] {
|
|
41
|
-
const aliveNPCs = getAliveNPCs(
|
|
42
|
-
matchingEntityType,
|
|
43
|
-
matchingVariant,
|
|
44
|
-
matchingSubType,
|
|
45
|
-
ignoreFriendly,
|
|
46
|
-
);
|
|
49
|
+
const aliveNPCs = getAliveNPCs(entityType, variant, subType, ignoreFriendly);
|
|
47
50
|
return aliveNPCs.filter((aliveNPC) => aliveNPC.IsBoss());
|
|
48
51
|
}
|
|
49
52
|
|
|
@@ -83,19 +86,24 @@ export function getBossSet(
|
|
|
83
86
|
return copySet(bossSet);
|
|
84
87
|
}
|
|
85
88
|
|
|
86
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* Helper function to get all of the bosses in the room.
|
|
91
|
+
*
|
|
92
|
+
* @param entityType Optional. If specified, will only get the bosses that match the type. Default
|
|
93
|
+
* is -1, which matches every type.
|
|
94
|
+
* @param variant Optional. If specified, will only get the bosses that match the variant. Default
|
|
95
|
+
* is -1, which matches every variant.
|
|
96
|
+
* @param subType Optional. If specified, will only get the bosses that match the sub-type. Default
|
|
97
|
+
* is -1, which matches every sub-type.
|
|
98
|
+
* @param ignoreFriendly Optional. Default is false.
|
|
99
|
+
*/
|
|
87
100
|
export function getBosses(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
101
|
+
entityType?: EntityType,
|
|
102
|
+
variant?: int,
|
|
103
|
+
subType?: int,
|
|
91
104
|
ignoreFriendly = false,
|
|
92
105
|
): EntityNPC[] {
|
|
93
|
-
const npcs = getNPCs(
|
|
94
|
-
matchingEntityType,
|
|
95
|
-
matchingVariant,
|
|
96
|
-
matchingSubType,
|
|
97
|
-
ignoreFriendly,
|
|
98
|
-
);
|
|
106
|
+
const npcs = getNPCs(entityType, variant, subType, ignoreFriendly);
|
|
99
107
|
return npcs.filter((npc) => npc.IsBoss());
|
|
100
108
|
}
|
|
101
109
|
|
|
@@ -3,7 +3,7 @@ import { itemConfig } from "../cachedClasses";
|
|
|
3
3
|
import { getCollectibleArray } from "./collectibleSet";
|
|
4
4
|
import { getEnumValues } from "./enums";
|
|
5
5
|
import { getFlagName } from "./flag";
|
|
6
|
-
import { getPlayerCollectibleCount } from "./
|
|
6
|
+
import { getPlayerCollectibleCount } from "./players";
|
|
7
7
|
import { copySet } from "./set";
|
|
8
8
|
|
|
9
9
|
const TAG_TO_COLLECTIBLE_TYPES_MAP = new Map<
|
|
@@ -27,10 +27,10 @@ import {
|
|
|
27
27
|
} from "../maps/collectibleNameMap";
|
|
28
28
|
import { SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES_SET } from "../sets/singleUseActiveCollectibleTypesSet";
|
|
29
29
|
import { CollectibleIndex } from "../types/CollectibleIndex";
|
|
30
|
-
import { getEntityID } from "./
|
|
30
|
+
import { getEntityID } from "./entities";
|
|
31
31
|
import { isCollectible } from "./pickupVariants";
|
|
32
32
|
import { getRoomListIndex } from "./roomData";
|
|
33
|
-
import { clearSprite, spriteEquals } from "./
|
|
33
|
+
import { clearSprite, spriteEquals } from "./sprites";
|
|
34
34
|
import { irange } from "./utils";
|
|
35
35
|
|
|
36
36
|
const COLLECTIBLE_SPRITE_LAYER = 1;
|
|
@@ -13,10 +13,10 @@ import { isPrimitive } from "./types";
|
|
|
13
13
|
* `Isaac.CountEntities` method to avoid having to specify a spawner and to handle ignoring charmed
|
|
14
14
|
* enemies.
|
|
15
15
|
*
|
|
16
|
-
* @param entityType Default is -1
|
|
17
|
-
* @param variant Default is -1
|
|
18
|
-
* @param subType Default is -1
|
|
19
|
-
* @param ignoreFriendly Default is false.
|
|
16
|
+
* @param entityType Optional. Default is -1, which matches every entity type.
|
|
17
|
+
* @param variant Optional. Default is -1, which matches every variant.
|
|
18
|
+
* @param subType Optional. Default is -1, which matches every sub-type.
|
|
19
|
+
* @param ignoreFriendly Optional. Default is false.
|
|
20
20
|
*/
|
|
21
21
|
export function countEntities(
|
|
22
22
|
entityType: EntityType = -1,
|
|
@@ -43,10 +43,10 @@ export function countEntities(
|
|
|
43
43
|
* Helper function to check if one or more of a specific kind of entity is present in the current
|
|
44
44
|
* room. It uses the `countEntities` helper function to determine this.
|
|
45
45
|
*
|
|
46
|
-
* @param entityType Default is -1
|
|
47
|
-
* @param variant Default is -1
|
|
48
|
-
* @param subType Default is -1
|
|
49
|
-
* @param ignoreFriendly Default is false.
|
|
46
|
+
* @param entityType Optional. Default is -1, which matches every entity type.
|
|
47
|
+
* @param variant Optional. Default is -1, which matches every variant.
|
|
48
|
+
* @param subType Optional. Default is -1, which matches every sub-type.
|
|
49
|
+
* @param ignoreFriendly Optional. Default is false.
|
|
50
50
|
*/
|
|
51
51
|
export function doesEntityExist(
|
|
52
52
|
entityType: EntityType = -1,
|
|
@@ -99,28 +99,29 @@ export function getClosestEntityTo<T extends AnyEntity>(
|
|
|
99
99
|
* For example:
|
|
100
100
|
*
|
|
101
101
|
* ```ts
|
|
102
|
-
* // Make all of the entities in the room invisible
|
|
102
|
+
* // Make all of the entities in the room invisible.
|
|
103
103
|
* for (const entity of getEntities()) {
|
|
104
104
|
* entity.Visible = false;
|
|
105
105
|
* }
|
|
106
106
|
* ```
|
|
107
107
|
*
|
|
108
|
-
* @param entityType Optional. If specified, will only
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
108
|
+
* @param entityType Optional. If specified, will only get the entities that match the type. Default
|
|
109
|
+
* is -1, which matches every type.
|
|
110
|
+
* @param variant Optional. If specified, will only get the entities that match the variant. Default
|
|
111
|
+
* is -1, which matches every variant.
|
|
112
|
+
* @param subType Optional. If specified, will only get the entities that match the sub-type.
|
|
113
|
+
* Default is -1, which matches every sub-type.
|
|
113
114
|
* @param ignoreFriendly Optional. If set to true, it will exclude friendly NPCs from being
|
|
114
|
-
* returned. Default is false. Will only be taken into account if
|
|
115
|
-
* `
|
|
115
|
+
* returned. Default is false. Will only be taken into account if the
|
|
116
|
+
* `entityType` is specified.
|
|
116
117
|
*/
|
|
117
118
|
export function getEntities(
|
|
118
|
-
entityType
|
|
119
|
+
entityType: EntityType = -1,
|
|
119
120
|
variant = -1,
|
|
120
121
|
subType = -1,
|
|
121
122
|
ignoreFriendly = false,
|
|
122
123
|
): Entity[] {
|
|
123
|
-
if (entityType ===
|
|
124
|
+
if ((entityType as int) === -1) {
|
|
124
125
|
return Isaac.GetRoomEntities();
|
|
125
126
|
}
|
|
126
127
|
|
|
@@ -317,8 +318,9 @@ export function parseEntityTypeVariantString(
|
|
|
317
318
|
* Helper function to remove all of the matching entities in the room.
|
|
318
319
|
*
|
|
319
320
|
* @param entityType The entity type to match.
|
|
320
|
-
* @param entityVariant Optional. The variant to match. Default is -1
|
|
321
|
-
* @param entitySubType Optional. The sub-type to match. Default is -1
|
|
321
|
+
* @param entityVariant Optional. The variant to match. Default is -1, which matches every variant.
|
|
322
|
+
* @param entitySubType Optional. The sub-type to match. Default is -1, which matches every
|
|
323
|
+
* sub-type.
|
|
322
324
|
* @param cap Optional. If specified, will only remove the given amount of collectibles.
|
|
323
325
|
* @returns An array of the entities that were removed.
|
|
324
326
|
*/
|
|
@@ -353,7 +355,7 @@ export function removeEntities<T extends AnyEntity>(
|
|
|
353
355
|
|
|
354
356
|
entitiesRemoved.push(entity);
|
|
355
357
|
if (cap !== undefined && entitiesRemoved.length >= cap) {
|
|
356
|
-
|
|
358
|
+
break;
|
|
357
359
|
}
|
|
358
360
|
}
|
|
359
361
|
|