isaacscript-common 7.1.1 → 7.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/callbacks/itemPickup.d.ts.map +1 -1
- package/dist/callbacks/itemPickup.lua +3 -1
- package/dist/callbacks/postCustomDoorEnter.d.ts.map +1 -1
- package/dist/callbacks/postCustomDoorEnter.lua +14 -11
- package/dist/callbacks/postDiceRoomActivated.d.ts.map +1 -1
- package/dist/callbacks/postDiceRoomActivated.lua +5 -4
- package/dist/callbacks/postItemDischarged.lua +2 -1
- package/dist/callbacks/postSlotDestroyed.lua +3 -3
- package/dist/classes/DefaultMap.d.ts +5 -5
- package/dist/classes/DefaultMap.d.ts.map +1 -1
- package/dist/core/constants.d.ts +2 -2
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.lua +3 -1
- package/dist/core/constantsFirstLast.d.ts +2 -0
- package/dist/core/constantsFirstLast.d.ts.map +1 -1
- package/dist/core/constantsFirstLast.lua +36 -9
- package/dist/enums/AmbushType.d.ts +1 -0
- package/dist/enums/AmbushType.d.ts.map +1 -1
- package/dist/enums/AmbushType.lua +1 -0
- package/dist/enums/CornerType.d.ts +1 -0
- package/dist/enums/CornerType.d.ts.map +1 -1
- package/dist/enums/CornerType.lua +1 -0
- package/dist/enums/PocketItemType.d.ts +1 -0
- package/dist/enums/PocketItemType.d.ts.map +1 -1
- package/dist/enums/PocketItemType.lua +1 -0
- package/dist/enums/RockAltType.d.ts +1 -0
- package/dist/enums/RockAltType.d.ts.map +1 -1
- package/dist/enums/RockAltType.lua +1 -0
- package/dist/enums/SaveDataKey.d.ts +11 -0
- package/dist/enums/SaveDataKey.d.ts.map +1 -0
- package/dist/enums/{private/SaveDataKey.lua → SaveDataKey.lua} +2 -0
- package/dist/enums/SerializationType.d.ts +1 -0
- package/dist/enums/SerializationType.d.ts.map +1 -1
- package/dist/enums/SerializationType.lua +1 -0
- package/dist/enums/SlotDestructionType.d.ts +1 -0
- package/dist/enums/SlotDestructionType.d.ts.map +1 -1
- package/dist/enums/SlotDestructionType.lua +1 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/index.d.ts.map +1 -1
- package/dist/enums/index.lua +8 -0
- package/dist/features/customGridEntity.d.ts.map +1 -1
- package/dist/features/customGridEntity.lua +3 -1
- package/dist/features/customStage/backdrop.d.ts +1 -1
- package/dist/features/customStage/backdrop.d.ts.map +1 -1
- package/dist/features/customStage/backdrop.lua +5 -3
- package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -1
- package/dist/features/customStage/customStageGridEntities.lua +3 -1
- package/dist/features/customStage/exports.d.ts.map +1 -1
- package/dist/features/customStage/exports.lua +3 -1
- package/dist/features/customStage/init.lua +2 -2
- package/dist/features/customStage/shadows.d.ts.map +1 -1
- package/dist/features/customStage/shadows.lua +2 -1
- package/dist/features/deployJSONRoom.lua +13 -10
- package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +8 -2
- package/dist/features/saveDataManager/exports.d.ts +2 -1
- package/dist/features/saveDataManager/exports.d.ts.map +1 -1
- package/dist/features/saveDataManager/main.d.ts +1 -1
- package/dist/features/saveDataManager/main.d.ts.map +1 -1
- package/dist/features/saveDataManager/main.lua +1 -1
- package/dist/functions/bitSet128.d.ts.map +1 -1
- package/dist/functions/bosses.d.ts.map +1 -1
- package/dist/functions/bosses.lua +3 -1
- package/dist/functions/cacheFlag.d.ts +23 -1
- package/dist/functions/cacheFlag.d.ts.map +1 -1
- package/dist/functions/cacheFlag.lua +78 -0
- package/dist/functions/collectibles.d.ts.map +1 -1
- package/dist/functions/deepCopy.lua +2 -1
- package/dist/functions/doors.d.ts.map +1 -1
- package/dist/functions/doors.lua +3 -1
- package/dist/functions/entities.lua +2 -1
- package/dist/functions/flying.lua +2 -2
- package/dist/functions/gridEntities.lua +2 -1
- package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -1
- package/dist/functions/gridEntitiesSpecific.lua +5 -3
- package/dist/functions/index.d.ts +0 -1
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.lua +0 -8
- package/dist/functions/input.d.ts +5 -2
- package/dist/functions/input.d.ts.map +1 -1
- package/dist/functions/input.lua +11 -3
- package/dist/functions/kColor.d.ts.map +1 -1
- package/dist/functions/levelGrid.d.ts.map +1 -1
- package/dist/functions/levelGrid.lua +3 -1
- package/dist/functions/nextStage.d.ts.map +1 -1
- package/dist/functions/nextStage.lua +7 -5
- package/dist/functions/npcs.d.ts.map +1 -1
- package/dist/functions/npcs.lua +4 -2
- package/dist/functions/pills.d.ts.map +1 -1
- package/dist/functions/pills.lua +9 -3
- package/dist/functions/playerIndex.d.ts.map +1 -1
- package/dist/functions/playerIndex.lua +2 -1
- package/dist/functions/players.d.ts +1 -1
- package/dist/functions/players.d.ts.map +1 -1
- package/dist/functions/players.lua +13 -15
- package/dist/functions/pocketItems.d.ts.map +1 -1
- package/dist/functions/pocketItems.lua +3 -1
- package/dist/functions/rng.d.ts.map +1 -1
- package/dist/functions/rng.lua +3 -0
- package/dist/functions/rockAlt.d.ts.map +1 -1
- package/dist/functions/rockAlt.lua +11 -20
- package/dist/functions/rooms.d.ts +4 -4
- package/dist/functions/rooms.d.ts.map +1 -1
- package/dist/functions/rooms.lua +18 -16
- package/dist/functions/spawnCollectible.d.ts.map +1 -1
- package/dist/functions/stage.d.ts.map +1 -1
- package/dist/functions/stage.lua +8 -2
- package/dist/functions/trinkets.d.ts.map +1 -1
- package/dist/functions/trinkets.lua +4 -2
- package/dist/functions/types.d.ts +64 -0
- package/dist/functions/types.d.ts.map +1 -1
- package/dist/functions/types.lua +63 -0
- package/dist/functions/vector.d.ts.map +1 -1
- package/dist/interfaces/ChargeBarSprites.d.ts +1 -1
- package/dist/interfaces/Corner.d.ts +5 -0
- package/dist/interfaces/Corner.d.ts.map +1 -1
- package/dist/interfaces/CustomStageLua.d.ts +57 -0
- package/dist/interfaces/CustomStageLua.d.ts.map +1 -1
- package/dist/interfaces/GridEntityCustomData.d.ts +6 -0
- package/dist/interfaces/GridEntityCustomData.d.ts.map +1 -1
- package/dist/interfaces/JSONRoomsFile.d.ts +7 -3
- package/dist/interfaces/JSONRoomsFile.d.ts.map +1 -1
- package/dist/interfaces/PlayerHealth.d.ts +1 -1
- package/dist/interfaces/PlayerHealth.d.ts.map +1 -1
- package/dist/interfaces/PocketItemDescription.d.ts +1 -1
- package/dist/interfaces/PocketItemDescription.d.ts.map +1 -1
- package/dist/interfaces/RoomDescription.d.ts +1 -1
- package/dist/interfaces/RoomDescription.d.ts.map +1 -1
- package/dist/interfaces/StatTypeType.d.ts +4 -0
- package/dist/interfaces/StatTypeType.d.ts.map +1 -1
- package/dist/interfaces/TrinketSituation.d.ts +1 -1
- package/dist/interfaces/TrinketSituation.d.ts.map +1 -1
- package/dist/maps/keyboardToString.d.ts +4 -0
- package/dist/maps/keyboardToString.d.ts.map +1 -0
- package/dist/maps/keyboardToString.lua +73 -0
- package/dist/types/AnyEntity.d.ts +5 -0
- package/dist/types/AnyEntity.d.ts.map +1 -1
- package/dist/types/AnyGridEntity.d.ts +5 -0
- package/dist/types/AnyGridEntity.d.ts.map +1 -1
- package/dist/types/CollectibleIndex.d.ts +4 -3
- package/dist/types/CollectibleIndex.d.ts.map +1 -1
- package/dist/types/Immutable.d.ts +3 -1
- package/dist/types/Immutable.d.ts.map +1 -1
- package/dist/types/PickupIndex.d.ts +4 -2
- package/dist/types/PickupIndex.d.ts.map +1 -1
- package/dist/types/PlayerIndex.d.ts +3 -2
- package/dist/types/PlayerIndex.d.ts.map +1 -1
- package/dist/types/SerializedIsaacAPIClass.d.ts +6 -0
- package/dist/types/SerializedIsaacAPIClass.d.ts.map +1 -1
- package/dist/types/TSTLClass.d.ts +5 -0
- package/dist/types/TSTLClass.d.ts.map +1 -1
- package/dist/types/TrapdoorDestination.d.ts +3 -0
- package/dist/types/TrapdoorDestination.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/callbacks/itemPickup.ts +5 -2
- package/src/callbacks/postCustomDoorEnter.ts +18 -11
- package/src/callbacks/postDiceRoomActivated.ts +7 -12
- package/src/callbacks/postItemDischarged.ts +3 -1
- package/src/callbacks/postSlotDestroyed.ts +3 -2
- package/src/callbacks/reorderedCallbacks.ts +2 -2
- package/src/classes/DefaultMap.ts +8 -8
- package/src/core/constants.ts +3 -3
- package/src/core/constantsFirstLast.ts +29 -14
- package/src/enums/AmbushType.ts +1 -0
- package/src/enums/CornerType.ts +1 -0
- package/src/enums/PocketItemType.ts +1 -0
- package/src/enums/RockAltType.ts +1 -0
- package/src/enums/SaveDataKey.ts +10 -0
- package/src/enums/SerializationType.ts +1 -0
- package/src/enums/SlotDestructionType.ts +1 -0
- package/src/enums/index.ts +1 -0
- package/src/enums/indexTypeDoc.ts +1 -0
- package/src/features/customGridEntity.ts +2 -1
- package/src/features/customStage/backdrop.ts +5 -3
- package/src/features/customStage/customStageGridEntities.ts +2 -1
- package/src/features/customStage/exports.ts +5 -4
- package/src/features/customStage/init.ts +2 -2
- package/src/features/customStage/shadows.ts +2 -1
- package/src/features/deployJSONRoom.ts +14 -19
- package/src/features/extraConsoleCommands/listCommands.ts +3 -2
- package/src/features/fastReset.ts +1 -1
- package/src/features/indexTypeDoc.ts +2 -1
- package/src/features/saveDataManager/exports.ts +4 -4
- package/src/features/saveDataManager/main.ts +1 -1
- package/src/features/saveDataManager/save.ts +1 -1
- package/src/functions/bitSet128.ts +1 -5
- package/src/functions/bosses.ts +2 -1
- package/src/functions/cacheFlag.ts +90 -1
- package/src/functions/cards.ts +3 -3
- package/src/functions/collectibles.ts +2 -8
- package/src/functions/color.ts +1 -1
- package/src/functions/deepCopy.ts +2 -2
- package/src/functions/dimensions.ts +1 -1
- package/src/functions/doors.ts +2 -2
- package/src/functions/entities.ts +2 -2
- package/src/functions/flying.ts +1 -1
- package/src/functions/gridEntities.ts +2 -2
- package/src/functions/gridEntitiesSpecific.ts +4 -3
- package/src/functions/index.ts +0 -1
- package/src/functions/indexTypeDoc.ts +0 -1
- package/src/functions/input.ts +17 -4
- package/src/functions/jsonHelpers.ts +1 -1
- package/src/functions/kColor.ts +1 -5
- package/src/functions/levelGrid.ts +3 -2
- package/src/functions/nextStage.ts +6 -5
- package/src/functions/npcs.ts +3 -2
- package/src/functions/pills.ts +11 -9
- package/src/functions/playerIndex.ts +3 -1
- package/src/functions/players.ts +5 -6
- package/src/functions/pocketItems.ts +4 -4
- package/src/functions/rng.ts +8 -5
- package/src/functions/rockAlt.ts +28 -13
- package/src/functions/rooms.ts +27 -26
- package/src/functions/spawnCollectible.ts +1 -2
- package/src/functions/stage.ts +3 -2
- package/src/functions/trinkets.ts +6 -5
- package/src/functions/types.ts +100 -0
- package/src/functions/vector.ts +1 -5
- package/src/interfaces/ChargeBarSprites.ts +1 -1
- package/src/interfaces/Corner.ts +5 -0
- package/src/interfaces/CustomStageLua.ts +66 -0
- package/src/interfaces/GridEntityCustomData.ts +6 -0
- package/src/interfaces/JSONRoomsFile.ts +7 -3
- package/src/interfaces/PlayerHealth.ts +1 -1
- package/src/interfaces/PocketItemDescription.ts +1 -1
- package/src/interfaces/RoomDescription.ts +1 -1
- package/src/interfaces/StatTypeType.ts +4 -0
- package/src/interfaces/TrinketSituation.ts +1 -1
- package/src/maps/keyboardToString.ts +77 -0
- package/src/types/AnyEntity.ts +5 -0
- package/src/types/AnyGridEntity.ts +5 -0
- package/src/types/CollectibleIndex.ts +4 -3
- package/src/types/Immutable.ts +3 -1
- package/src/types/PickupIndex.ts +4 -2
- package/src/types/PlayerIndex.ts +3 -2
- package/src/types/SerializedIsaacAPIClass.ts +6 -0
- package/src/types/TSTLClass.ts +5 -0
- package/src/types/TrapdoorDestination.ts +3 -0
- package/dist/enums/private/SaveDataKey.d.ts +0 -7
- package/dist/enums/private/SaveDataKey.d.ts.map +0 -1
- package/dist/functions/collectibleCacheFlag.d.ts +0 -24
- package/dist/functions/collectibleCacheFlag.d.ts.map +0 -1
- package/dist/functions/collectibleCacheFlag.lua +0 -80
- package/src/enums/private/SaveDataKey.ts +0 -6
- package/src/functions/collectibleCacheFlag.ts +0 -90
package/src/enums/RockAltType.ts
CHANGED
package/src/enums/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./HealthType";
|
|
|
4
4
|
export * from "./ModCallbackCustom";
|
|
5
5
|
export * from "./PocketItemType";
|
|
6
6
|
export * from "./RockAltType";
|
|
7
|
+
export * from "./SaveDataKey";
|
|
7
8
|
export * from "./SerializationType";
|
|
8
9
|
export * from "./SlotDestructionType";
|
|
9
10
|
export * from "./StatType";
|
|
@@ -4,6 +4,7 @@ export * as HealthType from "./HealthType";
|
|
|
4
4
|
export * as ModCallbackCustom from "./ModCallbackCustom";
|
|
5
5
|
export * as PocketItemType from "./PocketItemType";
|
|
6
6
|
export * as RockAltType from "./RockAltType";
|
|
7
|
+
export * as SaveDataKey from "./SaveDataKey";
|
|
7
8
|
export * as SerializationType from "./SerializationType";
|
|
8
9
|
export * as SlotDestructionType from "./SlotDestructionType";
|
|
9
10
|
export * as StatType from "./StatType";
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
spawnGridEntityWithVariant,
|
|
24
24
|
} from "../functions/gridEntities";
|
|
25
25
|
import { getRoomListIndex } from "../functions/roomData";
|
|
26
|
+
import { asNumber } from "../functions/types";
|
|
26
27
|
import { isVector } from "../functions/vector";
|
|
27
28
|
import { GridEntityCustomData } from "../interfaces/GridEntityCustomData";
|
|
28
29
|
import { runNextGameFrame } from "./runInNFrames";
|
|
@@ -251,7 +252,7 @@ export function spawnCustomGridEntity(
|
|
|
251
252
|
existingGridEntity !== undefined &&
|
|
252
253
|
existingGridEntity.GetType() === GridEntityType.DECORATION &&
|
|
253
254
|
existingGridEntity.GetVariant() ===
|
|
254
|
-
(DecorationVariant.CUSTOM_GRID_ENTITY
|
|
255
|
+
asNumber(DecorationVariant.CUSTOM_GRID_ENTITY);
|
|
255
256
|
const decoration = isExistingDecoration
|
|
256
257
|
? existingGridEntity
|
|
257
258
|
: spawnGridEntityWithVariant(
|
|
@@ -91,7 +91,7 @@ const BACKDROP_ROOM_TYPE_SET: ReadonlySet<RoomType> = new Set([
|
|
|
91
91
|
RoomType.MINI_BOSS,
|
|
92
92
|
]);
|
|
93
93
|
|
|
94
|
-
export function
|
|
94
|
+
export function setCustomStageBackdrop(customStage: CustomStage): void {
|
|
95
95
|
const room = game.GetRoom();
|
|
96
96
|
const roomType = room.GetType();
|
|
97
97
|
const decorationSeed = room.GetDecorationSeed();
|
|
@@ -131,11 +131,12 @@ function spawnWallEntity(
|
|
|
131
131
|
|
|
132
132
|
// We spawn an effect instead of simply rendering a static sprite in order to emulate how vanilla
|
|
133
133
|
// does this. (`EntityFlag.RENDER_WALL` is intended for this purpose.)
|
|
134
|
+
const seed = 1 as Seed;
|
|
134
135
|
const wallEffect = spawnEffectWithSeed(
|
|
135
136
|
BACKDROP_EFFECT_VARIANT,
|
|
136
137
|
BACKDROP_EFFECT_SUBTYPE,
|
|
137
138
|
VectorZero,
|
|
138
|
-
|
|
139
|
+
seed,
|
|
139
140
|
);
|
|
140
141
|
wallEffect.AddEntityFlags(EntityFlag.RENDER_WALL);
|
|
141
142
|
|
|
@@ -195,11 +196,12 @@ function spawnFloorEntity(customStage: CustomStage, rng: RNG) {
|
|
|
195
196
|
|
|
196
197
|
// We spawn an effect instead of simply rendering a static sprite in order to emulate how vanilla
|
|
197
198
|
// does this. (`EntityFlag.RENDER_FLOOR` is intended for this purpose.)
|
|
199
|
+
const seed = 1 as Seed;
|
|
198
200
|
const floorEffect = spawnEffectWithSeed(
|
|
199
201
|
BACKDROP_EFFECT_VARIANT,
|
|
200
202
|
0,
|
|
201
203
|
VectorZero,
|
|
202
|
-
|
|
204
|
+
seed,
|
|
203
205
|
);
|
|
204
206
|
floorEffect.AddEntityFlags(EntityFlag.RENDER_FLOOR);
|
|
205
207
|
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
getTrinkets,
|
|
16
16
|
} from "../../functions/pickupsSpecific";
|
|
17
17
|
import { calculateStageType } from "../../functions/stage";
|
|
18
|
+
import { asNumber } from "../../functions/types";
|
|
18
19
|
import { vectorEquals } from "../../functions/vector";
|
|
19
20
|
import { CustomStage } from "../../interfaces/private/CustomStage";
|
|
20
21
|
import { TrapdoorDestination } from "../../types/TrapdoorDestination";
|
|
@@ -40,7 +41,7 @@ export function setCustomDecorationGraphics(
|
|
|
40
41
|
|
|
41
42
|
// Ignore custom grid entities. (They are represented as decorations with a non-zero variant.)
|
|
42
43
|
const variant = gridEntity.GetVariant();
|
|
43
|
-
if (variant !== (DecorationVariant.VANILLA_DECORATION
|
|
44
|
+
if (variant !== asNumber(DecorationVariant.VANILLA_DECORATION)) {
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
47
|
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
getRoomsInsideGrid,
|
|
25
25
|
} from "../../functions/rooms";
|
|
26
26
|
import { setStage } from "../../functions/stage";
|
|
27
|
+
import { asNumber } from "../../functions/types";
|
|
27
28
|
import { CustomStage } from "../../interfaces/private/CustomStage";
|
|
28
29
|
import { getRandomCustomStageRoom } from "./customStageUtils";
|
|
29
30
|
import v, {
|
|
@@ -77,7 +78,7 @@ export function setCustomStage(
|
|
|
77
78
|
level.SetStage(LevelStage.BASEMENT_1, StageType.ORIGINAL);
|
|
78
79
|
}
|
|
79
80
|
|
|
80
|
-
let baseStage
|
|
81
|
+
let baseStage =
|
|
81
82
|
customStage.baseStage === undefined
|
|
82
83
|
? DEFAULT_BASE_STAGE
|
|
83
84
|
: customStage.baseStage;
|
|
@@ -88,11 +89,11 @@ export function setCustomStage(
|
|
|
88
89
|
const baseStageType =
|
|
89
90
|
customStage.baseStageType === undefined
|
|
90
91
|
? DEFAULT_BASE_STAGE_TYPE
|
|
91
|
-
:
|
|
92
|
+
: customStage.baseStageType;
|
|
92
93
|
|
|
93
|
-
const reseed = (stage
|
|
94
|
+
const reseed = asNumber(stage) >= baseStage;
|
|
94
95
|
|
|
95
|
-
setStage(baseStage as LevelStage, baseStageType, reseed);
|
|
96
|
+
setStage(baseStage as LevelStage, baseStageType as StageType, reseed);
|
|
96
97
|
|
|
97
98
|
setStageRoomsData(customStage, rng, verbose);
|
|
98
99
|
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "../../interfaces/CustomStageLua";
|
|
17
17
|
import { CustomStage, RoomTypeMap } from "../../interfaces/private/CustomStage";
|
|
18
18
|
import { saveDataManager } from "../saveDataManager/exports";
|
|
19
|
-
import {
|
|
19
|
+
import { setCustomStageBackdrop } from "./backdrop";
|
|
20
20
|
import {
|
|
21
21
|
convertVanillaTrapdoors,
|
|
22
22
|
removeUrnRewards,
|
|
@@ -196,7 +196,7 @@ function postNewRoomReordered() {
|
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
|
|
199
|
+
setCustomStageBackdrop(customStage);
|
|
200
200
|
setShadows(customStage);
|
|
201
201
|
playVersusScreenAnimation(customStage);
|
|
202
202
|
}
|
|
@@ -56,11 +56,12 @@ export function setShadows(customStage: CustomStage): void {
|
|
|
56
56
|
// We spawn an effect instead of simply rendering a static sprite so that the effect will properly
|
|
57
57
|
// slide in during a room transition animation. (It looks stupid if the shadow stays statically
|
|
58
58
|
// rendering throughout this animation.)
|
|
59
|
+
const seed = 1 as Seed;
|
|
59
60
|
const shadowEffect = spawnEffectWithSeed(
|
|
60
61
|
SHADOW_EFFECT_VARIANT,
|
|
61
62
|
SHADOW_EFFECT_SUBTYPE,
|
|
62
63
|
centerPos,
|
|
63
|
-
|
|
64
|
+
seed,
|
|
64
65
|
);
|
|
65
66
|
|
|
66
67
|
const sprite = shadowEffect.GetSprite();
|
|
@@ -40,7 +40,6 @@ import {
|
|
|
40
40
|
convertXMLGridEntityType,
|
|
41
41
|
getAllGridIndexes,
|
|
42
42
|
getGridEntities,
|
|
43
|
-
getGridEntityIDFromConstituents,
|
|
44
43
|
removeAllGridExcept,
|
|
45
44
|
removeGridEntity,
|
|
46
45
|
setGridEntityInvisible,
|
|
@@ -53,6 +52,7 @@ import { getRoomListIndex } from "../functions/roomData";
|
|
|
53
52
|
import { gridCoordinatesToWorldPosition } from "../functions/roomGrid";
|
|
54
53
|
import { setRoomCleared, setRoomUncleared } from "../functions/rooms";
|
|
55
54
|
import { spawnCollectible } from "../functions/spawnCollectible";
|
|
55
|
+
import { asCollectibleType, asNumber } from "../functions/types";
|
|
56
56
|
import { JSONRoom } from "../interfaces/JSONRoomsFile";
|
|
57
57
|
import { runNextGameFrame } from "./runInNFrames";
|
|
58
58
|
import { saveDataManager } from "./saveDataManager/exports";
|
|
@@ -462,8 +462,8 @@ function spawnAllEntities(
|
|
|
462
462
|
}
|
|
463
463
|
|
|
464
464
|
const entityTypeString = firstXMLEntity.$.type;
|
|
465
|
-
const
|
|
466
|
-
if (
|
|
465
|
+
const entityTypeNumber = tonumber(entityTypeString);
|
|
466
|
+
if (entityTypeNumber === undefined) {
|
|
467
467
|
error(
|
|
468
468
|
`Failed to convert the entity type to a number: ${entityTypeString}`,
|
|
469
469
|
);
|
|
@@ -482,31 +482,26 @@ function spawnAllEntities(
|
|
|
482
482
|
}
|
|
483
483
|
|
|
484
484
|
// Note that XML entity type 1000 is a rock, not an effect.
|
|
485
|
-
if (
|
|
485
|
+
if (entityTypeNumber >= 1000) {
|
|
486
|
+
const gridEntityXMLType = entityTypeNumber as GridEntityXMLType;
|
|
486
487
|
if (verbose) {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
variant,
|
|
488
|
+
log(
|
|
489
|
+
`Spawning grid entity ${gridEntityXMLType}.${variant} at: (${x}, ${y})`,
|
|
490
490
|
);
|
|
491
|
-
log(`Spawning grid entity ${gridEntityID} at: (${x}, ${y})`);
|
|
492
491
|
}
|
|
493
|
-
spawnGridEntityForJSONRoom(
|
|
494
|
-
entityType as GridEntityXMLType,
|
|
495
|
-
variant,
|
|
496
|
-
x,
|
|
497
|
-
y,
|
|
498
|
-
);
|
|
492
|
+
spawnGridEntityForJSONRoom(gridEntityXMLType, variant, x, y);
|
|
499
493
|
} else {
|
|
494
|
+
const entityType = entityTypeNumber as EntityType;
|
|
500
495
|
if (verbose) {
|
|
501
496
|
const entityID = getEntityIDFromConstituents(
|
|
502
|
-
entityType
|
|
497
|
+
entityType,
|
|
503
498
|
variant,
|
|
504
499
|
subType,
|
|
505
500
|
);
|
|
506
501
|
log(`Spawning normal entity ${entityID} at: (${x}, ${y})`);
|
|
507
502
|
}
|
|
508
503
|
const entity = spawnNormalEntityForJSONRoom(
|
|
509
|
-
entityType
|
|
504
|
+
entityType,
|
|
510
505
|
variant,
|
|
511
506
|
subType,
|
|
512
507
|
x,
|
|
@@ -589,11 +584,11 @@ function spawnNormalEntityForJSONRoom(
|
|
|
589
584
|
let entity: Entity;
|
|
590
585
|
if (
|
|
591
586
|
entityType === EntityType.PICKUP &&
|
|
592
|
-
|
|
587
|
+
variant === asNumber(PickupVariant.COLLECTIBLE)
|
|
593
588
|
) {
|
|
594
589
|
const options = roomType === RoomType.ANGEL;
|
|
595
590
|
entity = spawnCollectible(
|
|
596
|
-
subType
|
|
591
|
+
asCollectibleType(subType),
|
|
597
592
|
position,
|
|
598
593
|
seed,
|
|
599
594
|
options,
|
|
@@ -605,7 +600,7 @@ function spawnNormalEntityForJSONRoom(
|
|
|
605
600
|
// For some reason, Pitfalls do not spawn with the correct collision classes.
|
|
606
601
|
if (
|
|
607
602
|
entityType === EntityType.PITFALL &&
|
|
608
|
-
|
|
603
|
+
variant === asNumber(PitfallVariant.PITFALL)
|
|
609
604
|
) {
|
|
610
605
|
entity.EntityCollisionClass = EntityCollisionClass.ENEMIES;
|
|
611
606
|
entity.GridCollisionClass = EntityGridCollisionClass.WALLS;
|
|
@@ -89,6 +89,7 @@ import { gridCoordinatesToWorldPosition } from "../../functions/roomGrid";
|
|
|
89
89
|
import { changeRoom } from "../../functions/rooms";
|
|
90
90
|
import { onSetSeed, restart, setUnseeded } from "../../functions/run";
|
|
91
91
|
import { getGoldenTrinketType } from "../../functions/trinkets";
|
|
92
|
+
import { asCard } from "../../functions/types";
|
|
92
93
|
import { irange, printConsole, printEnabled } from "../../functions/utils";
|
|
93
94
|
import { CARD_MAP } from "../../maps/cardMap";
|
|
94
95
|
import { CHARACTER_MAP } from "../../maps/characterMap";
|
|
@@ -343,12 +344,12 @@ export function cards(): void {
|
|
|
343
344
|
let cardType = 1;
|
|
344
345
|
for (let y = 0; y <= 6; y++) {
|
|
345
346
|
for (let x = 0; x <= 12; x++) {
|
|
346
|
-
if ((cardType
|
|
347
|
+
if (asCard(cardType) === LAST_CARD) {
|
|
347
348
|
return;
|
|
348
349
|
}
|
|
349
350
|
|
|
350
351
|
const position = gridCoordinatesToWorldPosition(x, y);
|
|
351
|
-
spawnCard(cardType
|
|
352
|
+
spawnCard(asCard(cardType), position);
|
|
352
353
|
cardType++;
|
|
353
354
|
}
|
|
354
355
|
}
|
|
@@ -9,7 +9,8 @@ export * as DebugDisplay from "./debugDisplay/exports";
|
|
|
9
9
|
export * as DeployJSONRoom from "./deployJSONRoom";
|
|
10
10
|
export * as DisableAllSound from "./disableAllSound";
|
|
11
11
|
export * as DisableInputs from "./disableInputs";
|
|
12
|
-
export * as
|
|
12
|
+
export * as ExtraConsoleCommandsInit from "./extraConsoleCommands/exports";
|
|
13
|
+
export * as ExtraConsoleCommandsList from "./extraConsoleCommands/listCommands";
|
|
13
14
|
export * as FadeInRemover from "./fadeInRemover";
|
|
14
15
|
export * as FastReset from "./fastReset";
|
|
15
16
|
export * as ForgottenSwitch from "./forgottenSwitch";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SaveDataKey } from "../../enums/
|
|
1
|
+
import { SaveDataKey } from "../../enums/SaveDataKey";
|
|
2
2
|
import { SerializationType } from "../../enums/SerializationType";
|
|
3
3
|
import { errorIfFeaturesNotInitialized } from "../../featuresInitialized";
|
|
4
4
|
import { deepCopy } from "../../functions/deepCopy";
|
|
@@ -227,7 +227,7 @@ export function saveDataManagerSetGlobal(): void {
|
|
|
227
227
|
*/
|
|
228
228
|
export function saveDataManagerReset(
|
|
229
229
|
key: string,
|
|
230
|
-
childObjectKey:
|
|
230
|
+
childObjectKey: SaveDataKey,
|
|
231
231
|
): void {
|
|
232
232
|
errorIfFeaturesNotInitialized(SAVE_DATA_MANAGER_FEATURE_NAME);
|
|
233
233
|
|
|
@@ -237,12 +237,12 @@ export function saveDataManagerReset(
|
|
|
237
237
|
);
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
const saveData = saveDataMap.get(key)
|
|
240
|
+
const saveData = saveDataMap.get(key);
|
|
241
241
|
if (saveData === undefined) {
|
|
242
242
|
error(
|
|
243
243
|
`The ${SAVE_DATA_MANAGER_FEATURE_NAME} is not managing save data for a key of: ${key}`,
|
|
244
244
|
);
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
restoreDefaultSaveData(key, saveData, childObjectKey
|
|
247
|
+
restoreDefaultSaveData(key, saveData, childObjectKey);
|
|
248
248
|
}
|
|
@@ -2,7 +2,7 @@ import { ModCallback } from "isaac-typescript-definitions";
|
|
|
2
2
|
import { ModUpgraded } from "../../classes/ModUpgraded";
|
|
3
3
|
import { game } from "../../core/cachedClasses";
|
|
4
4
|
import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
|
|
5
|
-
import { SaveDataKey } from "../../enums/
|
|
5
|
+
import { SaveDataKey } from "../../enums/SaveDataKey";
|
|
6
6
|
import { SerializationType } from "../../enums/SerializationType";
|
|
7
7
|
import { deepCopy } from "../../functions/deepCopy";
|
|
8
8
|
import { logError } from "../../functions/log";
|
|
@@ -61,7 +61,7 @@ function getAllSaveDataToWriteToDisk(
|
|
|
61
61
|
// that is unnecessary. Make a copy of the data and recursively convert all TypeScriptToLua
|
|
62
62
|
// Maps into Lua tables.
|
|
63
63
|
const saveDataCopy = deepCopy(
|
|
64
|
-
saveDataWithoutRoom
|
|
64
|
+
saveDataWithoutRoom,
|
|
65
65
|
SerializationType.SERIALIZE,
|
|
66
66
|
subscriberName,
|
|
67
67
|
);
|
|
@@ -37,11 +37,7 @@ export function deserializeBitSet128(
|
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
const [l, h] = getNumbersFromTable(
|
|
41
|
-
bitSet128 as LuaMap<string, unknown>,
|
|
42
|
-
OBJECT_NAME,
|
|
43
|
-
...KEYS,
|
|
44
|
-
);
|
|
40
|
+
const [l, h] = getNumbersFromTable(bitSet128, OBJECT_NAME, ...KEYS);
|
|
45
41
|
|
|
46
42
|
if (l === undefined) {
|
|
47
43
|
error(
|
package/src/functions/bosses.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { getNPCs, spawnNPC } from "./entitiesSpecific";
|
|
|
14
14
|
import { getAliveNPCs } from "./npcs";
|
|
15
15
|
import { isRNG } from "./rng";
|
|
16
16
|
import { copySet } from "./set";
|
|
17
|
+
import { asNumber } from "./types";
|
|
17
18
|
import { repeat } from "./utils";
|
|
18
19
|
|
|
19
20
|
const BOSSES_THAT_REQUIRE_MULTIPLE_SPAWNS: ReadonlySet<EntityType> = new Set([
|
|
@@ -194,7 +195,7 @@ function getNumBossSegments(
|
|
|
194
195
|
|
|
195
196
|
// 69
|
|
196
197
|
case EntityType.LOKI: {
|
|
197
|
-
return
|
|
198
|
+
return variant === asNumber(LokiVariant.LOKII) ? 2 : 1;
|
|
198
199
|
}
|
|
199
200
|
|
|
200
201
|
// 237
|
|
@@ -1,5 +1,62 @@
|
|
|
1
|
-
import { CacheFlag } from "isaac-typescript-definitions";
|
|
1
|
+
import { CacheFlag, CollectibleType } from "isaac-typescript-definitions";
|
|
2
|
+
import { itemConfig } from "../core/cachedClasses";
|
|
2
3
|
import { DEFAULT_PLAYER_STAT_MAP } from "../maps/defaultPlayerStatMap";
|
|
4
|
+
import { getCollectibleArray } from "./collectibleSet";
|
|
5
|
+
import { getEnumValues } from "./enums";
|
|
6
|
+
import { hasFlag } from "./flag";
|
|
7
|
+
import { copySet, getSortedSetValues } from "./set";
|
|
8
|
+
import { repeat } from "./utils";
|
|
9
|
+
|
|
10
|
+
const CACHE_FLAG_TO_COLLECTIBLES_MAP = new Map<
|
|
11
|
+
CacheFlag,
|
|
12
|
+
Set<CollectibleType>
|
|
13
|
+
>();
|
|
14
|
+
|
|
15
|
+
function initCacheFlagMap() {
|
|
16
|
+
for (const cacheFlag of getEnumValues(CacheFlag)) {
|
|
17
|
+
const collectiblesSet = new Set<CollectibleType>();
|
|
18
|
+
|
|
19
|
+
for (const collectibleType of getCollectibleArray()) {
|
|
20
|
+
if (collectibleHasCacheFlag(collectibleType, cacheFlag)) {
|
|
21
|
+
collectiblesSet.add(collectibleType);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
CACHE_FLAG_TO_COLLECTIBLES_MAP.set(cacheFlag, collectiblesSet);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function collectibleHasCacheFlag(
|
|
30
|
+
collectibleType: CollectibleType,
|
|
31
|
+
cacheFlag: CacheFlag,
|
|
32
|
+
): boolean {
|
|
33
|
+
const itemConfigItem = itemConfig.GetCollectible(collectibleType);
|
|
34
|
+
if (itemConfigItem === undefined) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return hasFlag(itemConfigItem.CacheFlags, cacheFlag);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Returns a set containing every collectible type with the given cache flag, including modded
|
|
43
|
+
* collectibles.
|
|
44
|
+
*/
|
|
45
|
+
export function getCollectiblesForCacheFlag(
|
|
46
|
+
cacheFlag: CacheFlag,
|
|
47
|
+
): Set<CollectibleType> {
|
|
48
|
+
// Lazy initialize the map.
|
|
49
|
+
if (CACHE_FLAG_TO_COLLECTIBLES_MAP.size === 0) {
|
|
50
|
+
initCacheFlagMap();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const collectiblesSet = CACHE_FLAG_TO_COLLECTIBLES_MAP.get(cacheFlag);
|
|
54
|
+
if (collectiblesSet === undefined) {
|
|
55
|
+
return new Set();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return copySet(collectiblesSet);
|
|
59
|
+
}
|
|
3
60
|
|
|
4
61
|
/**
|
|
5
62
|
* Returns the starting stat that Isaac (the default character) starts with. For example, if you
|
|
@@ -10,3 +67,35 @@ import { DEFAULT_PLAYER_STAT_MAP } from "../maps/defaultPlayerStatMap";
|
|
|
10
67
|
export function getDefaultPlayerStat(cacheFlag: CacheFlag): number | undefined {
|
|
11
68
|
return DEFAULT_PLAYER_STAT_MAP.get(cacheFlag);
|
|
12
69
|
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Returns an array containing every collectible type that the player has that matches the provided
|
|
73
|
+
* CacheFlag.
|
|
74
|
+
*
|
|
75
|
+
* For example, if the cache flag is `CacheFlag.FLYING`, and the player has one Lord of the Pit and
|
|
76
|
+
* two Dead Doves, then this function would return:
|
|
77
|
+
*
|
|
78
|
+
* ```ts
|
|
79
|
+
* [
|
|
80
|
+
* CollectibleType.LORD_OF_THE_PIT,
|
|
81
|
+
* CollectibleType.DEAD_DOVE,
|
|
82
|
+
* CollectibleType.DEAD_DOVE,
|
|
83
|
+
* ]
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export function getPlayerCollectiblesForCacheFlag(
|
|
87
|
+
player: EntityPlayer,
|
|
88
|
+
cacheFlag: CacheFlag,
|
|
89
|
+
): CollectibleType[] {
|
|
90
|
+
const collectiblesForCacheFlag = getCollectiblesForCacheFlag(cacheFlag);
|
|
91
|
+
|
|
92
|
+
const playerCollectibles: CollectibleType[] = [];
|
|
93
|
+
for (const collectibleType of getSortedSetValues(collectiblesForCacheFlag)) {
|
|
94
|
+
const numCollectibles = player.GetCollectibleNum(collectibleType);
|
|
95
|
+
repeat(numCollectibles, () => {
|
|
96
|
+
playerCollectibles.push(collectibleType);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return playerCollectibles;
|
|
101
|
+
}
|
package/src/functions/cards.ts
CHANGED
|
@@ -59,7 +59,7 @@ function initCardObjects() {
|
|
|
59
59
|
|
|
60
60
|
/** Helper function to get an array with every valid card sub-type. This includes modded cards. */
|
|
61
61
|
export function getAllCards(): Card[] {
|
|
62
|
-
return irange(FIRST_CARD, LAST_CARD)
|
|
62
|
+
return irange(FIRST_CARD, LAST_CARD);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/**
|
|
@@ -159,7 +159,7 @@ export function getModdedCards(): Card[] {
|
|
|
159
159
|
return [];
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
return irange(FIRST_MODDED_CARD, LAST_CARD)
|
|
162
|
+
return irange(FIRST_MODDED_CARD, LAST_CARD);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
/**
|
|
@@ -216,7 +216,7 @@ export function getRandomRune(
|
|
|
216
216
|
|
|
217
217
|
/** Helper function to get an array with every valid vanilla card sub-type. */
|
|
218
218
|
export function getVanillaCards(): Card[] {
|
|
219
|
-
return irange(FIRST_CARD, MAX_VANILLA_CARD)
|
|
219
|
+
return irange(FIRST_CARD, MAX_VANILLA_CARD);
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
/**
|
|
@@ -389,10 +389,7 @@ export function getModdedCollectibleTypes(): CollectibleType[] {
|
|
|
389
389
|
return [];
|
|
390
390
|
}
|
|
391
391
|
|
|
392
|
-
return irange(
|
|
393
|
-
FIRST_MODDED_COLLECTIBLE_TYPE,
|
|
394
|
-
LAST_COLLECTIBLE_TYPE,
|
|
395
|
-
) as CollectibleType[];
|
|
392
|
+
return irange(FIRST_MODDED_COLLECTIBLE_TYPE, LAST_COLLECTIBLE_TYPE);
|
|
396
393
|
}
|
|
397
394
|
|
|
398
395
|
/**
|
|
@@ -404,10 +401,7 @@ export function getModdedCollectibleTypes(): CollectibleType[] {
|
|
|
404
401
|
* should use the `getVanillaCollectibleSet` helper function instead.
|
|
405
402
|
*/
|
|
406
403
|
export function getVanillaCollectibleTypeRange(): CollectibleType[] {
|
|
407
|
-
return irange(
|
|
408
|
-
FIRST_COLLECTIBLE_TYPE,
|
|
409
|
-
LAST_VANILLA_COLLECTIBLE_TYPE,
|
|
410
|
-
) as CollectibleType[];
|
|
404
|
+
return irange(FIRST_COLLECTIBLE_TYPE, LAST_VANILLA_COLLECTIBLE_TYPE);
|
|
411
405
|
}
|
|
412
406
|
|
|
413
407
|
/** Returns true if the item type in the item config is equal to `ItemType.ITEM_ACTIVE`. */
|
package/src/functions/color.ts
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
isUserDefinedTSTLClass,
|
|
24
24
|
newTSTLClass,
|
|
25
25
|
} from "./tstlClass";
|
|
26
|
-
import { isNumber, isPrimitive } from "./types";
|
|
26
|
+
import { asString, isNumber, isPrimitive } from "./types";
|
|
27
27
|
import { getTraversalDescription, twoDimensionalSort } from "./utils";
|
|
28
28
|
|
|
29
29
|
const COPYABLE_ISAAC_API_CLASS_TYPES_SET = new Set<string>(
|
|
@@ -575,7 +575,7 @@ function getCopiedEntries(
|
|
|
575
575
|
const convertStringKeysToNumbers =
|
|
576
576
|
serializationType === SerializationType.DESERIALIZE &&
|
|
577
577
|
entries.some(
|
|
578
|
-
([key]) => key === (SerializationBrand.OBJECT_WITH_NUMBER_KEYS
|
|
578
|
+
([key]) => key === asString(SerializationBrand.OBJECT_WITH_NUMBER_KEYS),
|
|
579
579
|
);
|
|
580
580
|
|
|
581
581
|
const hasNumberKeys = entries.some(([key]) => isNumber(key));
|
|
@@ -8,7 +8,7 @@ import { erange } from "./utils";
|
|
|
8
8
|
* Helper function to get an array with every valid `Dimension` (not including `Dimension.CURRENT`).
|
|
9
9
|
*/
|
|
10
10
|
export function getAllDimensions(): Dimension[] {
|
|
11
|
-
return erange(NUM_DIMENSIONS)
|
|
11
|
+
return erange(NUM_DIMENSIONS);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
package/src/functions/doors.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { arrayToBitFlags } from "./bitwise";
|
|
|
22
22
|
import { directionToVector } from "./direction";
|
|
23
23
|
import { getEnumValues } from "./enums";
|
|
24
24
|
import { isTSTLSet } from "./tstlClass";
|
|
25
|
+
import { asNumber } from "./types";
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* When players enter a room, they do not appear exactly on the location of the door, because then
|
|
@@ -341,8 +342,7 @@ export function isHiddenSecretRoomDoor(door: GridEntityDoor): boolean {
|
|
|
341
342
|
* you to the Repentance floor.
|
|
342
343
|
*/
|
|
343
344
|
export function isRepentanceDoor(door: GridEntityDoor): boolean {
|
|
344
|
-
|
|
345
|
-
return door.TargetRoomIndex === GridRoom.SECRET_EXIT;
|
|
345
|
+
return door.TargetRoomIndex === asNumber(GridRoom.SECRET_EXIT);
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
/**
|
|
@@ -6,7 +6,7 @@ import { AnyEntity } from "../types/AnyEntity";
|
|
|
6
6
|
import { getIsaacAPIClassName } from "./isaacAPIClass";
|
|
7
7
|
import { getRandom } from "./random";
|
|
8
8
|
import { isRNG, newRNG } from "./rng";
|
|
9
|
-
import { isPrimitive } from "./types";
|
|
9
|
+
import { asNumber, isPrimitive } from "./types";
|
|
10
10
|
import { isVector, vectorToString } from "./vector";
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -122,7 +122,7 @@ export function getEntities(
|
|
|
122
122
|
subType = -1,
|
|
123
123
|
ignoreFriendly = false,
|
|
124
124
|
): Entity[] {
|
|
125
|
-
if ((entityType
|
|
125
|
+
if (asNumber(entityType) === -1) {
|
|
126
126
|
return Isaac.GetRoomEntities();
|
|
127
127
|
}
|
|
128
128
|
|
package/src/functions/flying.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PlayerType,
|
|
6
6
|
TrinketType,
|
|
7
7
|
} from "isaac-typescript-definitions";
|
|
8
|
-
import { getCollectiblesForCacheFlag } from "./
|
|
8
|
+
import { getCollectiblesForCacheFlag } from "./cacheFlag";
|
|
9
9
|
import { copySet, deleteSetsFromSet } from "./set";
|
|
10
10
|
|
|
11
11
|
const FLYING_CHARACTERS: ReadonlySet<PlayerType> = new Set([
|
|
@@ -19,7 +19,7 @@ import { AnyGridEntity } from "../types/AnyGridEntity";
|
|
|
19
19
|
import { isCircleIntersectingRectangle } from "./math";
|
|
20
20
|
import { roomUpdateSafe } from "./rooms";
|
|
21
21
|
import { clearSprite } from "./sprites";
|
|
22
|
-
import { isNumber } from "./types";
|
|
22
|
+
import { asNumber, isNumber } from "./types";
|
|
23
23
|
import { erange } from "./utils";
|
|
24
24
|
import { isVector } from "./vector";
|
|
25
25
|
|
|
@@ -136,7 +136,7 @@ export function getCollidingEntitiesWithGridEntity(
|
|
|
136
136
|
export function getCrawlSpaces(
|
|
137
137
|
crawlSpaceVariant: CrawlSpaceVariant = -1,
|
|
138
138
|
): GridEntity[] {
|
|
139
|
-
if ((crawlSpaceVariant
|
|
139
|
+
if (asNumber(crawlSpaceVariant) === -1) {
|
|
140
140
|
return getGridEntities(GridEntityType.CRAWL_SPACE);
|
|
141
141
|
}
|
|
142
142
|
|