isaacscript-common 7.1.0 → 7.2.1
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/postPlayerChangeStat.d.ts.map +1 -1
- package/dist/callbacks/postPlayerChangeStat.lua +44 -15
- 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/StatType.d.ts +1 -3
- package/dist/enums/StatType.d.ts.map +1 -1
- package/dist/enums/StatType.lua +0 -2
- 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/playerStats.d.ts.map +1 -1
- package/dist/functions/playerStats.lua +1 -2
- 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 -1
- 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/postPlayerChangeStat.ts +45 -3
- 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/StatType.ts +7 -7
- 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/playerStats.ts +0 -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 -1
- 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/functions/rockAlt.ts
CHANGED
|
@@ -41,6 +41,13 @@ const ROCK_ALT_CHANCES = {
|
|
|
41
41
|
} as const;
|
|
42
42
|
|
|
43
43
|
const COIN_VELOCITY_MULTIPLIER = 2;
|
|
44
|
+
|
|
45
|
+
/** Matches the vanilla value, according to Fly's decompilation. */
|
|
46
|
+
const FIND_FREE_INITIAL_STEP = 70;
|
|
47
|
+
|
|
48
|
+
/** Matches the vanilla value, according to Fly's decompilation. */
|
|
49
|
+
const FART_RADIUS = DISTANCE_OF_GRID_TILE * 3;
|
|
50
|
+
|
|
44
51
|
const POLYP_PROJECTILE_SPEED = 10;
|
|
45
52
|
const POLYP_NUM_PROJECTILES = 6;
|
|
46
53
|
|
|
@@ -128,6 +135,8 @@ export function spawnRockAltReward(
|
|
|
128
135
|
}
|
|
129
136
|
|
|
130
137
|
function spawnRockAltRewardUrn(position: Vector, rng: RNG): boolean {
|
|
138
|
+
const room = game.GetRoom();
|
|
139
|
+
|
|
131
140
|
const chance = getRandom(rng);
|
|
132
141
|
let totalChance = 0;
|
|
133
142
|
|
|
@@ -171,11 +180,11 @@ function spawnRockAltRewardUrn(position: Vector, rng: RNG): boolean {
|
|
|
171
180
|
// Since the detrimental effect is the final option, we don't need to check the chance.
|
|
172
181
|
const numEnemiesChance = getRandom(rng);
|
|
173
182
|
const numEnemies = numEnemiesChance < 0.5 ? 1 : 2;
|
|
174
|
-
const length = DISTANCE_OF_GRID_TILE * 3;
|
|
175
183
|
repeat(numEnemies, () => {
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
184
|
+
const targetPos = room.FindFreePickupSpawnPosition(
|
|
185
|
+
position,
|
|
186
|
+
FIND_FREE_INITIAL_STEP,
|
|
187
|
+
);
|
|
179
188
|
EntityNPC.ThrowSpider(position, undefined, targetPos, false, 0);
|
|
180
189
|
});
|
|
181
190
|
return true;
|
|
@@ -253,7 +262,8 @@ function spawnRockAltRewardMushroom(position: Vector, rng: RNG): boolean {
|
|
|
253
262
|
}
|
|
254
263
|
|
|
255
264
|
// Since the detrimental effect is the final option, we don't need to check the chance.
|
|
256
|
-
|
|
265
|
+
game.Fart(position);
|
|
266
|
+
game.ButterBeanFart(position, FART_RADIUS, undefined);
|
|
257
267
|
return true;
|
|
258
268
|
}
|
|
259
269
|
|
|
@@ -383,6 +393,8 @@ function spawnRockAltRewardPolyp(position: Vector, rng: RNG): boolean {
|
|
|
383
393
|
}
|
|
384
394
|
|
|
385
395
|
function spawnRockAltRewardBucketDownpour(position: Vector, rng: RNG): boolean {
|
|
396
|
+
const room = game.GetRoom();
|
|
397
|
+
|
|
386
398
|
const chance = getRandom(rng);
|
|
387
399
|
let totalChance = 0;
|
|
388
400
|
|
|
@@ -430,11 +442,12 @@ function spawnRockAltRewardBucketDownpour(position: Vector, rng: RNG): boolean {
|
|
|
430
442
|
|
|
431
443
|
const numEnemiesChance = getRandom(rng);
|
|
432
444
|
const numEnemies = numEnemiesChance < 0.5 ? 1 : 2;
|
|
433
|
-
const jumpDistance = DISTANCE_OF_GRID_TILE * 3;
|
|
434
445
|
repeat(numEnemies, () => {
|
|
435
|
-
const
|
|
436
|
-
|
|
437
|
-
|
|
446
|
+
const targetPos = room.FindFreePickupSpawnPosition(
|
|
447
|
+
position,
|
|
448
|
+
FIND_FREE_INITIAL_STEP,
|
|
449
|
+
);
|
|
450
|
+
|
|
438
451
|
// If the room has water, Spiders will automatically be replaced with Striders.
|
|
439
452
|
const spider = EntityNPC.ThrowSpider(
|
|
440
453
|
position,
|
|
@@ -455,6 +468,8 @@ function spawnRockAltRewardBucketDownpour(position: Vector, rng: RNG): boolean {
|
|
|
455
468
|
}
|
|
456
469
|
|
|
457
470
|
function spawnRockAltRewardBucketDross(position: Vector, rng: RNG): boolean {
|
|
471
|
+
const room = game.GetRoom();
|
|
472
|
+
|
|
458
473
|
const chance = getRandom(rng);
|
|
459
474
|
let totalChance = 0;
|
|
460
475
|
|
|
@@ -502,11 +517,11 @@ function spawnRockAltRewardBucketDross(position: Vector, rng: RNG): boolean {
|
|
|
502
517
|
|
|
503
518
|
const numEnemiesChance = getRandom(rng);
|
|
504
519
|
const numEnemies = numEnemiesChance < 0.5 ? 1 : 2;
|
|
505
|
-
const jumpDistance = DISTANCE_OF_GRID_TILE * 3;
|
|
506
520
|
repeat(numEnemies, () => {
|
|
507
|
-
const
|
|
508
|
-
|
|
509
|
-
|
|
521
|
+
const targetPos = room.FindFreePickupSpawnPosition(
|
|
522
|
+
position,
|
|
523
|
+
FIND_FREE_INITIAL_STEP,
|
|
524
|
+
);
|
|
510
525
|
const spider = EntityNPC.ThrowSpider(
|
|
511
526
|
position,
|
|
512
527
|
undefined,
|
package/src/functions/rooms.ts
CHANGED
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
StageID,
|
|
17
17
|
} from "isaac-typescript-definitions";
|
|
18
18
|
import { game, sfxManager } from "../core/cachedClasses";
|
|
19
|
-
import { MAX_LEVEL_GRID_INDEX
|
|
19
|
+
import { MAX_LEVEL_GRID_INDEX } from "../core/constants";
|
|
20
20
|
import { ROOM_TYPE_NAMES } from "../objects/roomTypeNames";
|
|
21
21
|
import { MINE_SHAFT_ROOM_SUB_TYPE_SET } from "../sets/mineShaftRoomSubTypesSet";
|
|
22
|
-
import { inDimension } from "./dimensions";
|
|
22
|
+
import { getAllDimensions, inDimension } from "./dimensions";
|
|
23
23
|
import {
|
|
24
24
|
closeAllDoors,
|
|
25
25
|
getDoors,
|
|
@@ -45,7 +45,8 @@ import {
|
|
|
45
45
|
} from "./roomData";
|
|
46
46
|
import { reloadRoom } from "./roomTransition";
|
|
47
47
|
import { getGotoCommand } from "./stage";
|
|
48
|
-
import {
|
|
48
|
+
import { asNumber } from "./types";
|
|
49
|
+
import { irange } from "./utils";
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* Helper function for quickly switching to a new room without playing a particular animation. Use
|
|
@@ -207,7 +208,7 @@ export function getRoomsInsideGrid(
|
|
|
207
208
|
const level = game.GetLevel();
|
|
208
209
|
|
|
209
210
|
const dimensions = includeExtraDimensionalRooms
|
|
210
|
-
? (
|
|
211
|
+
? getAllDimensions()
|
|
211
212
|
: [Dimension.CURRENT];
|
|
212
213
|
|
|
213
214
|
/** We use a map instead of an array because room shapes occupy more than one room grid index. */
|
|
@@ -284,8 +285,10 @@ export function inAngelShop(): boolean {
|
|
|
284
285
|
const roomType = room.GetType();
|
|
285
286
|
const roomSubType = getRoomSubType();
|
|
286
287
|
|
|
287
|
-
|
|
288
|
-
|
|
288
|
+
return (
|
|
289
|
+
roomType === RoomType.ANGEL &&
|
|
290
|
+
roomSubType === asNumber(AngelRoomSubType.SHOP)
|
|
291
|
+
);
|
|
289
292
|
}
|
|
290
293
|
|
|
291
294
|
export function inBeastRoom(): boolean {
|
|
@@ -294,8 +297,8 @@ export function inBeastRoom(): boolean {
|
|
|
294
297
|
const roomSubType = getRoomSubType();
|
|
295
298
|
|
|
296
299
|
return (
|
|
297
|
-
|
|
298
|
-
|
|
300
|
+
roomType === RoomType.DUNGEON &&
|
|
301
|
+
roomSubType === asNumber(DungeonSubType.BEAST_ROOM)
|
|
299
302
|
);
|
|
300
303
|
}
|
|
301
304
|
|
|
@@ -312,7 +315,7 @@ export function inBossRoomOf(bossID: BossID): boolean {
|
|
|
312
315
|
return (
|
|
313
316
|
roomType === RoomType.BOSS &&
|
|
314
317
|
roomStageID === StageID.SPECIAL_ROOMS &&
|
|
315
|
-
roomSubType === bossID
|
|
318
|
+
roomSubType === asNumber(bossID)
|
|
316
319
|
);
|
|
317
320
|
}
|
|
318
321
|
|
|
@@ -326,13 +329,14 @@ export function inCrawlSpace(): boolean {
|
|
|
326
329
|
const roomType = room.GetType();
|
|
327
330
|
const roomSubType = getRoomSubType();
|
|
328
331
|
|
|
329
|
-
|
|
330
|
-
|
|
332
|
+
return (
|
|
333
|
+
roomType === RoomType.DUNGEON &&
|
|
334
|
+
roomSubType === asNumber(DungeonSubType.NORMAL)
|
|
335
|
+
);
|
|
331
336
|
}
|
|
332
337
|
|
|
333
338
|
/**
|
|
334
|
-
*
|
|
335
|
-
* with the Death Certificate area.
|
|
339
|
+
* Helper function to detect if the current room is one of the room in the Death Certificate area.
|
|
336
340
|
*/
|
|
337
341
|
export function inDeathCertificateArea(): boolean {
|
|
338
342
|
const roomStageID = getRoomStageID();
|
|
@@ -340,17 +344,16 @@ export function inDeathCertificateArea(): boolean {
|
|
|
340
344
|
|
|
341
345
|
return (
|
|
342
346
|
roomStageID === StageID.HOME &&
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
// eslint-disable-next-line isaacscript/strict-enums
|
|
346
|
-
roomSubType === HomeRoomSubType.DEATH_CERTIFICATE_ITEMS)
|
|
347
|
+
(roomSubType === asNumber(HomeRoomSubType.DEATH_CERTIFICATE_ENTRANCE) ||
|
|
348
|
+
roomSubType === asNumber(HomeRoomSubType.DEATH_CERTIFICATE_ITEMS))
|
|
347
349
|
);
|
|
348
350
|
}
|
|
349
351
|
|
|
350
352
|
/**
|
|
351
353
|
* Helper function to detect if the current room is a Treasure Room created when entering with a
|
|
352
|
-
* Devil's Crown trinket.
|
|
353
|
-
*
|
|
354
|
+
* Devil's Crown trinket.
|
|
355
|
+
*
|
|
356
|
+
* Under the hood, this checks for `RoomDescriptorFlag.DEVIL_TREASURE`.
|
|
354
357
|
*/
|
|
355
358
|
export function inDevilsCrownTreasureRoom(): boolean {
|
|
356
359
|
const roomDescriptor = getRoomDescriptorReadOnly();
|
|
@@ -368,8 +371,7 @@ export function inDoubleTrouble(): boolean {
|
|
|
368
371
|
export function inGenesisRoom(): boolean {
|
|
369
372
|
const roomGridIndex = getRoomGridIndex();
|
|
370
373
|
|
|
371
|
-
|
|
372
|
-
return roomGridIndex === GridRoom.GENESIS;
|
|
374
|
+
return roomGridIndex === asNumber(GridRoom.GENESIS);
|
|
373
375
|
}
|
|
374
376
|
|
|
375
377
|
/** Helper function to determine if the current room shape is one of the four L room shapes. */
|
|
@@ -388,8 +390,7 @@ export function inLRoom(): boolean {
|
|
|
388
390
|
export function inMegaSatanRoom(): boolean {
|
|
389
391
|
const roomGridIndex = getRoomGridIndex();
|
|
390
392
|
|
|
391
|
-
|
|
392
|
-
return roomGridIndex === GridRoom.MEGA_SATAN;
|
|
393
|
+
return roomGridIndex === asNumber(GridRoom.MEGA_SATAN);
|
|
393
394
|
}
|
|
394
395
|
|
|
395
396
|
/**
|
|
@@ -420,7 +421,7 @@ export function inMinibossRoomOf(minibossID: MinibossID): boolean {
|
|
|
420
421
|
return (
|
|
421
422
|
roomType === RoomType.MINI_BOSS &&
|
|
422
423
|
roomStageID === StageID.SPECIAL_ROOMS &&
|
|
423
|
-
roomSubType === minibossID
|
|
424
|
+
roomSubType === asNumber(minibossID)
|
|
424
425
|
);
|
|
425
426
|
}
|
|
426
427
|
|
|
@@ -434,8 +435,7 @@ export function inMinibossRoomOf(minibossID: MinibossID): boolean {
|
|
|
434
435
|
export function inSecretShop(): boolean {
|
|
435
436
|
const roomGridIndex = getRoomGridIndex();
|
|
436
437
|
|
|
437
|
-
|
|
438
|
-
return roomGridIndex === GridRoom.SECRET_SHOP;
|
|
438
|
+
return roomGridIndex === asNumber(GridRoom.SECRET_SHOP);
|
|
439
439
|
}
|
|
440
440
|
|
|
441
441
|
/**
|
|
@@ -498,6 +498,7 @@ export function roomUpdateSafe(): void {
|
|
|
498
498
|
/** Helper function to set the backdrop of the current room. */
|
|
499
499
|
export function setBackdrop(backdropType: BackdropType): void {
|
|
500
500
|
game.ShowHallucination(0, backdropType);
|
|
501
|
+
sfxManager.Stop(SoundEffect.DEATH_CARD);
|
|
501
502
|
}
|
|
502
503
|
|
|
503
504
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CollectibleType,
|
|
3
|
-
PickupPrice,
|
|
4
3
|
PickupVariant,
|
|
5
4
|
PlayerType,
|
|
6
5
|
} from "isaac-typescript-definitions";
|
|
@@ -65,7 +64,7 @@ export function spawnCollectible(
|
|
|
65
64
|
|
|
66
65
|
// We can set the price to any arbitrary value; it will auto-update to the true price on the
|
|
67
66
|
// next frame.
|
|
68
|
-
collectible.Price = 15
|
|
67
|
+
collectible.Price = 15;
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
if (isQuestCollectible(collectibleType) && areFeaturesInitialized()) {
|
package/src/functions/stage.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { game } from "../core/cachedClasses";
|
|
|
8
8
|
import { ROOM_TYPE_GOTO_PREFIXES } from "../objects/roomTypeGotoPrefixes";
|
|
9
9
|
import { STAGE_TYPE_SUFFIXES } from "../objects/stageTypeSuffixes";
|
|
10
10
|
import { STAGE_TYPE_TO_LETTER } from "../objects/stageTypeToLetter";
|
|
11
|
+
import { asLevelStage, asNumber } from "./types";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Helper function that calculates what the stage type should be for the provided stage. This
|
|
@@ -57,7 +58,7 @@ export function calculateStageTypeRepentance(stage: LevelStage): StageType {
|
|
|
57
58
|
// This algorithm is from Kilburn. We add one because the alt path is offset by 1 relative to the
|
|
58
59
|
// normal path.
|
|
59
60
|
const seeds = game.GetSeeds();
|
|
60
|
-
const adjustedStage = ((stage
|
|
61
|
+
const adjustedStage = asLevelStage(asNumber(stage) + 1);
|
|
61
62
|
const stageSeed = seeds.GetStageSeed(adjustedStage);
|
|
62
63
|
|
|
63
64
|
// Kilburn does not know why he divided the stage seed by 2 first.
|
|
@@ -79,7 +80,7 @@ export function getEffectiveStage(): int {
|
|
|
79
80
|
const stage = level.GetStage();
|
|
80
81
|
|
|
81
82
|
if (onRepentanceStage()) {
|
|
82
|
-
return stage + 1;
|
|
83
|
+
return asNumber(stage) + 1;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
return stage;
|
|
@@ -21,6 +21,7 @@ import { hasFlag } from "./flag";
|
|
|
21
21
|
import { isTrinket } from "./pickupVariants";
|
|
22
22
|
import { isCharacter } from "./players";
|
|
23
23
|
import { clearSprite } from "./sprites";
|
|
24
|
+
import { asNumber } from "./types";
|
|
24
25
|
import { irange } from "./utils";
|
|
25
26
|
|
|
26
27
|
/**
|
|
@@ -41,7 +42,7 @@ const TRINKET_SPRITE_LAYER = 0;
|
|
|
41
42
|
* corresponds to the golden trinket sub-type for Swallowed Penny.
|
|
42
43
|
*/
|
|
43
44
|
export function getGoldenTrinketType(trinketType: TrinketType): TrinketType {
|
|
44
|
-
return trinketType + GOLDEN_TRINKET_ADJUSTMENT;
|
|
45
|
+
return asNumber(trinketType) + GOLDEN_TRINKET_ADJUSTMENT;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
/**
|
|
@@ -54,7 +55,7 @@ export function getModdedTrinketTypes(): TrinketType[] {
|
|
|
54
55
|
return [];
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
return irange(FIRST_MODDED_TRINKET_TYPE, LAST_TRINKET_TYPE)
|
|
58
|
+
return irange(FIRST_MODDED_TRINKET_TYPE, LAST_TRINKET_TYPE);
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
/**
|
|
@@ -140,12 +141,12 @@ export function getTrinketName(trinketType: TrinketType): string {
|
|
|
140
141
|
|
|
141
142
|
/** Helper function to get an array that contains every trinket type. */
|
|
142
143
|
export function getTrinketTypes(): TrinketType[] {
|
|
143
|
-
return irange(FIRST_TRINKET_TYPE, LAST_TRINKET_TYPE)
|
|
144
|
+
return irange(FIRST_TRINKET_TYPE, LAST_TRINKET_TYPE);
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
/** Helper function to get an array that represents every vanilla trinket type. */
|
|
147
148
|
export function getVanillaTrinketTypes(): TrinketType[] {
|
|
148
|
-
return irange(FIRST_TRINKET_TYPE, LAST_VANILLA_TRINKET_TYPE)
|
|
149
|
+
return irange(FIRST_TRINKET_TYPE, LAST_VANILLA_TRINKET_TYPE);
|
|
149
150
|
}
|
|
150
151
|
|
|
151
152
|
/**
|
|
@@ -165,7 +166,7 @@ export function hasOpenTrinketSlot(player: EntityPlayer): boolean {
|
|
|
165
166
|
}
|
|
166
167
|
|
|
167
168
|
export function isGoldenTrinket(trinketType: TrinketType): boolean {
|
|
168
|
-
return trinketType >
|
|
169
|
+
return asNumber(trinketType) > GOLDEN_TRINKET_ADJUSTMENT;
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
/**
|
package/src/functions/types.ts
CHANGED
|
@@ -1,3 +1,103 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Card,
|
|
3
|
+
CollectibleType,
|
|
4
|
+
LevelStage,
|
|
5
|
+
PillColor,
|
|
6
|
+
PillEffect,
|
|
7
|
+
PlayerType,
|
|
8
|
+
TrinketType,
|
|
9
|
+
} from "isaac-typescript-definitions";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Helper function to safely cast a `number` to a `Card`. (This is better than using the `as`
|
|
13
|
+
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
14
|
+
*
|
|
15
|
+
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
16
|
+
*/
|
|
17
|
+
export function asCard(num: number): Card {
|
|
18
|
+
return num;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Helper function to safely cast a `number` to a `CollectibleType`. (This is better than using the
|
|
23
|
+
* `as` TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
24
|
+
*
|
|
25
|
+
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
26
|
+
*/
|
|
27
|
+
export function asCollectibleType(num: number): CollectibleType {
|
|
28
|
+
return num;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Helper function to safely cast a `number` to a `LevelStage`. (This is better than using the `as`
|
|
33
|
+
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
34
|
+
*
|
|
35
|
+
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
36
|
+
*/
|
|
37
|
+
export function asLevelStage(num: number): LevelStage {
|
|
38
|
+
return num;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Helper function to safely cast an enum to a `number`. (This is better than using the `as`
|
|
43
|
+
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
44
|
+
*
|
|
45
|
+
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
46
|
+
*/
|
|
47
|
+
export function asNumber(num: number): number {
|
|
48
|
+
return num;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Helper function to safely cast a `number` to a `PillColor`. (This is better than using the `as`
|
|
53
|
+
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
54
|
+
*
|
|
55
|
+
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
56
|
+
*/
|
|
57
|
+
export function asPillColor(num: number): PillColor {
|
|
58
|
+
return num;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Helper function to safely cast a `number` to a `PillEffect`. (This is better than using the `as`
|
|
63
|
+
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
64
|
+
*
|
|
65
|
+
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
66
|
+
*/
|
|
67
|
+
export function asPillEffect(num: number): PillEffect {
|
|
68
|
+
return num;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Helper function to safely cast a `number` to a `PlayerType`. (This is better than using the `as`
|
|
73
|
+
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
74
|
+
*
|
|
75
|
+
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
76
|
+
*/
|
|
77
|
+
export function asPlayerType(num: number): PlayerType {
|
|
78
|
+
return num;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Helper function to safely cast an enum to a `string`. (This is better than using the `as`
|
|
83
|
+
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
84
|
+
*
|
|
85
|
+
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
86
|
+
*/
|
|
87
|
+
export function asString(str: string): string {
|
|
88
|
+
return str;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Helper function to safely cast a `number` to a `TrinketType`. (This is better than using the `as`
|
|
93
|
+
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
94
|
+
*
|
|
95
|
+
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
96
|
+
*/
|
|
97
|
+
export function asTrinketType(num: number): TrinketType {
|
|
98
|
+
return num;
|
|
99
|
+
}
|
|
100
|
+
|
|
1
101
|
export function isBoolean(variable: unknown): variable is boolean {
|
|
2
102
|
return type(variable) === "boolean";
|
|
3
103
|
}
|
package/src/functions/vector.ts
CHANGED
|
@@ -36,11 +36,7 @@ export function deserializeVector(vector: SerializedVector): Vector {
|
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const [x, y] = getNumbersFromTable(
|
|
40
|
-
vector as LuaMap<string, unknown>,
|
|
41
|
-
OBJECT_NAME,
|
|
42
|
-
...KEYS,
|
|
43
|
-
);
|
|
39
|
+
const [x, y] = getNumbersFromTable(vector, OBJECT_NAME, ...KEYS);
|
|
44
40
|
|
|
45
41
|
if (x === undefined) {
|
|
46
42
|
error(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A collection of the four sprites necessary in order to render a charge bar.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* This is used in the `newChargeBarSprites` and related helper functions.
|
|
5
5
|
*/
|
|
6
6
|
export interface ChargeBarSprites {
|
|
7
7
|
back: Sprite;
|
package/src/interfaces/Corner.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { CornerType } from "../enums/CornerType";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* An interface representing a corner in the room.
|
|
5
|
+
*
|
|
6
|
+
* This is used by the `getRoomShapeCorners` helper function.
|
|
7
|
+
*/
|
|
3
8
|
export interface Corner {
|
|
4
9
|
readonly type: CornerType;
|
|
5
10
|
readonly position: Readonly<Vector>;
|
|
@@ -27,6 +27,9 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
27
27
|
* Make sure the chosen prefix does not conflict with any other mods. You can find a list of
|
|
28
28
|
* registered room variant prefixes on the IsaacScript website:
|
|
29
29
|
* https://isaacscript.github.io/main/custom-stages
|
|
30
|
+
*
|
|
31
|
+
* @minimum 101
|
|
32
|
+
* @maximum 109
|
|
30
33
|
*/
|
|
31
34
|
roomVariantPrefix: number;
|
|
32
35
|
|
|
@@ -39,6 +42,9 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
39
42
|
* method.)
|
|
40
43
|
*
|
|
41
44
|
* If not specified, `LevelStage.BASEMENT_2` (2) will be used.
|
|
45
|
+
*
|
|
46
|
+
* @minimum 2
|
|
47
|
+
* @maximum 13
|
|
42
48
|
*/
|
|
43
49
|
baseStage?: number;
|
|
44
50
|
|
|
@@ -48,6 +54,9 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
48
54
|
* generation algorithm.
|
|
49
55
|
*
|
|
50
56
|
* If not specified, `StageType.ORIGINAL` (0) will be used.
|
|
57
|
+
*
|
|
58
|
+
* @minimum 0
|
|
59
|
+
* @maximum 5
|
|
51
60
|
*/
|
|
52
61
|
baseStageType?: number;
|
|
53
62
|
|
|
@@ -331,9 +340,28 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
331
340
|
* `versusScreenBackgroundColors.ts`.
|
|
332
341
|
*/
|
|
333
342
|
backgroundColor?: Readonly<{
|
|
343
|
+
/**
|
|
344
|
+
* @minimum 0
|
|
345
|
+
* @maximum 1
|
|
346
|
+
*/
|
|
334
347
|
r: number;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* @minimum 0
|
|
351
|
+
* @maximum 1
|
|
352
|
+
*/
|
|
335
353
|
g: number;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* @minimum 0
|
|
357
|
+
* @maximum 1
|
|
358
|
+
*/
|
|
336
359
|
b: number;
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* @minimum 0
|
|
363
|
+
* @maximum 1
|
|
364
|
+
*/
|
|
337
365
|
a: number;
|
|
338
366
|
}>;
|
|
339
367
|
|
|
@@ -346,9 +374,28 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
346
374
|
* `versusScreenDirtSpotColors.ts`.
|
|
347
375
|
*/
|
|
348
376
|
dirtSpotColor?: Readonly<{
|
|
377
|
+
/**
|
|
378
|
+
* @minimum 0
|
|
379
|
+
* @maximum 1
|
|
380
|
+
*/
|
|
349
381
|
r: number;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* @minimum 0
|
|
385
|
+
* @maximum 1
|
|
386
|
+
*/
|
|
350
387
|
g: number;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* @minimum 0
|
|
391
|
+
* @maximum 1
|
|
392
|
+
*/
|
|
351
393
|
b: number;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* @minimum 0
|
|
397
|
+
* @maximum 1
|
|
398
|
+
*/
|
|
352
399
|
a: number;
|
|
353
400
|
}>;
|
|
354
401
|
}>;
|
|
@@ -376,9 +423,28 @@ export type CustomStageShadow = Readonly<{
|
|
|
376
423
|
* to 75% faded black).
|
|
377
424
|
*/
|
|
378
425
|
color?: Readonly<{
|
|
426
|
+
/**
|
|
427
|
+
* @minimum 0
|
|
428
|
+
* @maximum 1
|
|
429
|
+
*/
|
|
379
430
|
r: number;
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* @minimum 0
|
|
434
|
+
* @maximum 1
|
|
435
|
+
*/
|
|
380
436
|
g: number;
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* @minimum 0
|
|
440
|
+
* @maximum 1
|
|
441
|
+
*/
|
|
381
442
|
b: number;
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* @minimum 0
|
|
446
|
+
* @maximum 1
|
|
447
|
+
*/
|
|
382
448
|
a: number;
|
|
383
449
|
}>;
|
|
384
450
|
}>;
|
|
@@ -3,6 +3,12 @@ import {
|
|
|
3
3
|
GridEntityType,
|
|
4
4
|
} from "isaac-typescript-definitions";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* This is meta-data that describes a custom grid entity.
|
|
8
|
+
*
|
|
9
|
+
* (One of the extra features that the standard library offers is the ability to spawn custom grid
|
|
10
|
+
* entities with the `spawnCustomGridEntity` helper function.)
|
|
11
|
+
*/
|
|
6
12
|
export interface GridEntityCustomData {
|
|
7
13
|
/**
|
|
8
14
|
* This is not a real `GridEntityType`; rather it is an arbitrary integer selected by end-user
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* The standard library has the feature to deploy a new room on-the-fly with the `deployJSONRoom`
|
|
3
|
+
* helper function. It requires a `JSONRoomsFile` as an argument, which is simply an XML file
|
|
4
|
+
* converted to JSON. (You create XML room files using the Basement Renovator program.)
|
|
5
5
|
*
|
|
6
6
|
* You can convert your XML files using the following command:
|
|
7
7
|
*
|
|
8
8
|
* ```sh
|
|
9
9
|
* npx convert-xml-to-json foo.xml foo.json
|
|
10
10
|
* ```
|
|
11
|
+
*
|
|
12
|
+
* Note that the custom stages feature of the standard library uses real XML/STB files, not JSON
|
|
13
|
+
* rooms, so you would only need to do this if you are using the `deployJSONRoom` command
|
|
14
|
+
* specifically.
|
|
11
15
|
*/
|
|
12
16
|
export interface JSONRoomsFile {
|
|
13
17
|
rooms: JSONRooms;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HeartSubType } from "isaac-typescript-definitions";
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/** This is used by the `getPlayerHealth` and `setPlayerHealth` helper functions. */
|
|
4
4
|
export interface PlayerHealth {
|
|
5
5
|
maxHearts: int;
|
|
6
6
|
hearts: int;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PocketItemSlot } from "isaac-typescript-definitions";
|
|
2
2
|
import { PocketItemType } from "../enums/PocketItemType";
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/** This is used by the `getPocketItems` and related helper functions. */
|
|
5
5
|
export interface PocketItemDescription {
|
|
6
6
|
slot: PocketItemSlot;
|
|
7
7
|
type: PocketItemType;
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
StageType,
|
|
6
6
|
} from "isaac-typescript-definitions";
|
|
7
7
|
|
|
8
|
-
/**
|
|
8
|
+
/** This is used by the room history feature of the standard library. */
|
|
9
9
|
export interface RoomDescription {
|
|
10
10
|
stage: LevelStage;
|
|
11
11
|
stageType: StageType;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { TearFlag } from "isaac-typescript-definitions";
|
|
2
2
|
import { StatType } from "../enums/StatType";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* This is an interface mapping a stat type to the data type. For example, `StatType.DAMAGE` is a
|
|
6
|
+
* `float` type.
|
|
7
|
+
*/
|
|
4
8
|
export interface StatTypeType {
|
|
5
9
|
[StatType.DAMAGE]: float;
|
|
6
10
|
[StatType.FIRE_DELAY]: float;
|
|
@@ -14,5 +18,4 @@ export interface StatTypeType {
|
|
|
14
18
|
[StatType.TEAR_COLOR]: Color;
|
|
15
19
|
[StatType.FLYING]: boolean;
|
|
16
20
|
[StatType.LUCK]: float;
|
|
17
|
-
[StatType.SIZE]: Vector;
|
|
18
21
|
}
|