isaacscript-common 12.6.0 → 13.0.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/index.d.ts CHANGED
@@ -9489,22 +9489,6 @@ export declare function registerCharacterStats(playerType: PlayerType, statMap:
9489
9489
  */
9490
9490
  export declare function registerCustomPickup(pickupVariantCustom: PickupVariant, subType: int, collectFunc: (this: void, player: EntityPlayer) => void, collisionFunc?: (this: void, player: EntityPlayer) => boolean): void;
9491
9491
 
9492
- /**
9493
- * Helper function to run arbitrary code when you press and release a specific keyboard key.
9494
- *
9495
- * This can be used to easily set up custom hotkeys to facilitate custom game features or to assist
9496
- * in debugging.
9497
- *
9498
- * @param keyboardOrFunc Either the key that you want to trigger the hotkey or a function that
9499
- * returns the key that will trigger the hotkey. Normally, you would just
9500
- * specify the key directly, but you can use a function for situations where
9501
- * the key can change (like if end-users can specify a custom hotkey using Mod
9502
- * Config Menu).
9503
- * @param triggerFunc A function containing the arbitrary code that you want to execute when the
9504
- * hotkey is triggered.
9505
- */
9506
- export declare function registerHotkey(keyboardOrFunc: Keyboard | (() => Keyboard | undefined), triggerFunc: () => void): void;
9507
-
9508
9492
  /**
9509
9493
  * Helper function to reload the current room using `Game.StartRoomTransition`.
9510
9494
  *
@@ -10887,6 +10871,22 @@ export declare function setGridEntityInvisible(gridEntity: GridEntity): void;
10887
10871
  */
10888
10872
  export declare function setHasPlayer(set: Set<PlayerIndex>, player: EntityPlayer): boolean;
10889
10873
 
10874
+ /**
10875
+ * Helper function to run arbitrary code when you press and release a specific keyboard key.
10876
+ *
10877
+ * This can be used to easily set up custom hotkeys to facilitate custom game features or to assist
10878
+ * in debugging.
10879
+ *
10880
+ * @param keyboardOrFunc Either the key that you want to trigger the hotkey or a function that
10881
+ * returns the key that will trigger the hotkey. Normally, you would just
10882
+ * specify the key directly, but you can use a function for situations where
10883
+ * the key can change (like if end-users can specify a custom hotkey using Mod
10884
+ * Config Menu).
10885
+ * @param triggerFunc A function containing the arbitrary code that you want to execute when the
10886
+ * hotkey is triggered.
10887
+ */
10888
+ export declare function setHotkey(keyboardOrFunc: Keyboard | (() => Keyboard | undefined), triggerFunc: () => void): void;
10889
+
10890
10890
  /**
10891
10891
  * Supply a function to be repeatedly run on an interval of N game frames in the `POST_UPDATE`
10892
10892
  * callback. The function will continue to be fired until `false` is returned from the function.
@@ -12123,11 +12123,11 @@ export declare const UI_HEART_WIDTH = 12;
12123
12123
  export declare function unpause(): void;
12124
12124
 
12125
12125
  /**
12126
- * Helper function to remove a hotkey created with the `registerHotkey` function.
12126
+ * Helper function to remove a hotkey created with the `setHotkey` function.
12127
12127
  *
12128
12128
  * @param keyboardOrFunc Equal to the value that you passed when initially registering the hotkey.
12129
12129
  */
12130
- export declare function unregisterHotkey(keyboardOrFunc: Keyboard | (() => Keyboard | undefined)): void;
12130
+ export declare function unsetHotkey(keyboardOrFunc: Keyboard | (() => Keyboard | undefined)): void;
12131
12131
 
12132
12132
  /**
12133
12133
  * Use this function to enable the custom callbacks and other optional features provided by
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 12.6.0
3
+ isaacscript-common 13.0.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -41287,10 +41287,9 @@ local __TS__New = ____lualib.__TS__New
41287
41287
  local Map = ____lualib.Map
41288
41288
  local __TS__Iterator = ____lualib.__TS__Iterator
41289
41289
  local ____exports = {}
41290
- local preUseItemWeNeedToGoDeeper, postNewRoomReordered, setDecorationsInvisible, respawnPersistentEntities, removeSpecificNPCs, fillRoomWithDecorations, spawnAllEntities, spawnGridEntityForJSONRoom, spawnNormalEntityForJSONRoom, storePersistentEntity, fixPitGraphics, getPitMap, getPitFrame, FEATURE_NAME, NPC_TYPES_TO_NOT_REMOVE, PERSISTENT_ENTITY_TYPES, GRID_ENTITY_XML_TYPE_SET, v
41290
+ local preUseItemWeNeedToGoDeeper, postNewRoomReordered, setDecorationsInvisible, respawnPersistentEntities, emptyRoomEntities, emptyRoomGridEntities, fillRoomWithDecorations, spawnAllEntities, spawnGridEntityForJSONRoom, spawnNormalEntityForJSONRoom, storePersistentEntity, fixPitGraphics, getPitMap, getPitFrame, FEATURE_NAME, PERSISTENT_ENTITY_TYPES, GRID_ENTITY_XML_TYPE_SET, EMPTY_ROOM_BLACKLIST_ENTITY_SET, EMPTY_ROOM_BLACKLIST_GRID_ENTITY_SET, v
41291
41291
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
41292
41292
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
41293
- local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
41294
41293
  local EntityCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityCollisionClass
41295
41294
  local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
41296
41295
  local EntityGridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityGridCollisionClass
@@ -41312,21 +41311,16 @@ local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNot
41312
41311
  local ____array = require("src.functions.array")
41313
41312
  local emptyArray = ____array.emptyArray
41314
41313
  local ____entities = require("src.functions.entities")
41314
+ local getEntities = ____entities.getEntities
41315
41315
  local getEntityIDFromConstituents = ____entities.getEntityIDFromConstituents
41316
- local removeAllMatchingEntities = ____entities.removeAllMatchingEntities
41317
41316
  local spawn = ____entities.spawn
41318
41317
  local spawnWithSeed = ____entities.spawnWithSeed
41319
- local ____entitiesSpecific = require("src.functions.entitiesSpecific")
41320
- local getNPCs = ____entitiesSpecific.getNPCs
41321
- local removeAllBombs = ____entitiesSpecific.removeAllBombs
41322
- local removeAllPickups = ____entitiesSpecific.removeAllPickups
41323
41318
  local ____enums = require("src.functions.enums")
41324
41319
  local getEnumValues = ____enums.getEnumValues
41325
41320
  local ____gridEntities = require("src.functions.gridEntities")
41326
41321
  local convertXMLGridEntityType = ____gridEntities.convertXMLGridEntityType
41327
41322
  local getAllGridIndexes = ____gridEntities.getAllGridIndexes
41328
41323
  local getGridEntities = ____gridEntities.getGridEntities
41329
- local removeAllGridEntitiesExcept = ____gridEntities.removeAllGridEntitiesExcept
41330
41324
  local removeGridEntity = ____gridEntities.removeGridEntity
41331
41325
  local setGridEntityInvisible = ____gridEntities.setGridEntityInvisible
41332
41326
  local spawnGridEntityWithVariant = ____gridEntities.spawnGridEntityWithVariant
@@ -41344,6 +41338,7 @@ local getRoomListIndex = ____roomData.getRoomListIndex
41344
41338
  local ____roomGrid = require("src.functions.roomGrid")
41345
41339
  local gridCoordinatesToWorldPosition = ____roomGrid.gridCoordinatesToWorldPosition
41346
41340
  local ____rooms = require("src.functions.rooms")
41341
+ local roomUpdateSafe = ____rooms.roomUpdateSafe
41347
41342
  local setRoomCleared = ____rooms.setRoomCleared
41348
41343
  local setRoomUncleared = ____rooms.setRoomUncleared
41349
41344
  local ____spawnCollectible = require("src.functions.spawnCollectible")
@@ -41430,38 +41425,50 @@ function ____exports.emptyRoom(self, fillWithDecorations)
41430
41425
  errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
41431
41426
  local roomListIndex = getRoomListIndex(nil)
41432
41427
  v.level.deployedRoomListIndexes:add(roomListIndex)
41433
- removeAllBombs(nil)
41434
- removeAllPickups(nil)
41435
- removeAllMatchingEntities(nil, EntityType.SLOT)
41436
- removeSpecificNPCs(nil)
41437
- removeAllMatchingEntities(nil, EntityType.EFFECT, EffectVariant.DEVIL)
41438
- removeAllMatchingEntities(nil, EntityType.EFFECT, EffectVariant.ANGEL)
41439
- removeAllGridEntitiesExcept(nil, GridEntityType.WALL, GridEntityType.DOOR)
41428
+ emptyRoomEntities(nil)
41429
+ emptyRoomGridEntities(nil)
41440
41430
  setRoomCleared(nil)
41441
41431
  if fillWithDecorations then
41442
41432
  fillRoomWithDecorations(nil)
41443
41433
  end
41444
41434
  end
41445
- function removeSpecificNPCs(self)
41435
+ function emptyRoomEntities(self)
41446
41436
  local room = game:GetRoom()
41447
- for ____, npc in ipairs(getNPCs(nil)) do
41437
+ for ____, entity in ipairs(getEntities(nil)) do
41448
41438
  do
41449
- if NPC_TYPES_TO_NOT_REMOVE:has(npc.Type) then
41439
+ if EMPTY_ROOM_BLACKLIST_ENTITY_SET:has(entity.Type) then
41450
41440
  goto __continue33
41451
41441
  end
41452
- if npc:HasEntityFlags(EntityFlag.CHARM) or npc:HasEntityFlags(EntityFlag.FRIENDLY) or npc:HasEntityFlags(EntityFlag.PERSISTENT) then
41442
+ if entity:HasEntityFlags(EntityFlag.CHARM) or entity:HasEntityFlags(EntityFlag.FRIENDLY) or entity:HasEntityFlags(EntityFlag.PERSISTENT) then
41453
41443
  goto __continue33
41454
41444
  end
41455
- npc:ClearEntityFlags(EntityFlag.APPEAR)
41456
- npc:Remove()
41457
- if npc.Type == EntityType.FIREPLACE then
41458
- local gridIndex = room:GetGridIndex(npc.Position)
41445
+ entity:ClearEntityFlags(EntityFlag.APPEAR)
41446
+ entity:Remove()
41447
+ if entity.Type == EntityType.FIREPLACE then
41448
+ local gridIndex = room:GetGridIndex(entity.Position)
41459
41449
  room:SetGridPath(gridIndex, 0)
41460
41450
  end
41461
41451
  end
41462
41452
  ::__continue33::
41463
41453
  end
41464
41454
  end
41455
+ function emptyRoomGridEntities(self)
41456
+ local removedOneOrMoreGridEntities = false
41457
+ for ____, gridEntity in ipairs(getGridEntities(nil)) do
41458
+ do
41459
+ local gridEntityType = gridEntity:GetType()
41460
+ if EMPTY_ROOM_BLACKLIST_GRID_ENTITY_SET:has(gridEntityType) then
41461
+ goto __continue39
41462
+ end
41463
+ removeGridEntity(nil, gridEntity, false)
41464
+ removedOneOrMoreGridEntities = true
41465
+ end
41466
+ ::__continue39::
41467
+ end
41468
+ if removedOneOrMoreGridEntities then
41469
+ roomUpdateSafe(nil)
41470
+ end
41471
+ end
41465
41472
  function fillRoomWithDecorations(self)
41466
41473
  local room = game:GetRoom()
41467
41474
  local roomListIndex = getRoomListIndex(nil)
@@ -41470,7 +41477,7 @@ function fillRoomWithDecorations(self)
41470
41477
  do
41471
41478
  local existingGridEntity = room:GetGridEntity(gridIndex)
41472
41479
  if existingGridEntity ~= nil then
41473
- goto __continue39
41480
+ goto __continue44
41474
41481
  end
41475
41482
  local position = room:GetGridPosition(gridIndex)
41476
41483
  local decoration = Isaac.GridSpawn(GridEntityType.DECORATION, 0, position)
@@ -41479,7 +41486,7 @@ function fillRoomWithDecorations(self)
41479
41486
  end
41480
41487
  decorationGridIndexes[#decorationGridIndexes + 1] = gridIndex
41481
41488
  end
41482
- ::__continue39::
41489
+ ::__continue44::
41483
41490
  end
41484
41491
  end
41485
41492
  function spawnAllEntities(self, jsonRoom, rng, verbose)
@@ -41737,10 +41744,19 @@ function getPitFrame(self, L, R, U, D, UL, UR, DL, DR)
41737
41744
  return F
41738
41745
  end
41739
41746
  FEATURE_NAME = "deployJSONRoom"
41740
- NPC_TYPES_TO_NOT_REMOVE = __TS__New(Set, {EntityType.DARK_ESAU})
41741
41747
  PERSISTENT_ENTITY_TYPES = __TS__New(Set, {EntityType.WALL_HUGGER})
41742
41748
  local gridEntityXMLTypes = getEnumValues(nil, GridEntityXMLType)
41743
41749
  GRID_ENTITY_XML_TYPE_SET = __TS__New(Set, gridEntityXMLTypes)
41750
+ EMPTY_ROOM_BLACKLIST_ENTITY_SET = __TS__New(Set, {
41751
+ EntityType.PLAYER,
41752
+ EntityType.TEAR,
41753
+ EntityType.FAMILIAR,
41754
+ EntityType.LASER,
41755
+ EntityType.KNIFE,
41756
+ EntityType.PROJECTILE,
41757
+ EntityType.DARK_ESAU
41758
+ })
41759
+ EMPTY_ROOM_BLACKLIST_GRID_ENTITY_SET = __TS__New(Set, {GridEntityType.WALL, GridEntityType.DOOR})
41744
41760
  v = {
41745
41761
  level = {
41746
41762
  deployedRoomListIndexes = __TS__New(Set),
@@ -42506,7 +42522,7 @@ function ____exports.preventChildEntities(self, entity)
42506
42522
  end
42507
42523
  return ____exports
42508
42524
  end,
42509
- ["src.features.registerHotkey"] = function(...)
42525
+ ["src.features.setHotkey"] = function(...)
42510
42526
  local ____lualib = require("lualib_bundle")
42511
42527
  local Map = ____lualib.Map
42512
42528
  local __TS__New = ____lualib.__TS__New
@@ -42547,14 +42563,14 @@ function checkIfTriggered(self, keyboard, triggerFunc)
42547
42563
  triggerFunc(nil)
42548
42564
  end
42549
42565
  end
42550
- local FEATURE_NAME = "registerHotkeys"
42566
+ local FEATURE_NAME = "setHotkey"
42551
42567
  staticHotkeyFunctionMap = __TS__New(Map)
42552
42568
  dynamicHotkeyFunctionMap = __TS__New(Map)
42553
42569
  keyPressedMap = __TS__New(DefaultMap, false)
42554
- function ____exports.registerHotkeyInit(self, mod)
42570
+ function ____exports.setHotkeyInit(self, mod)
42555
42571
  mod:AddCallback(ModCallback.POST_RENDER, postRender)
42556
42572
  end
42557
- function ____exports.registerHotkey(self, keyboardOrFunc, triggerFunc)
42573
+ function ____exports.setHotkey(self, keyboardOrFunc, triggerFunc)
42558
42574
  errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
42559
42575
  if isFunction(nil, keyboardOrFunc) then
42560
42576
  if dynamicHotkeyFunctionMap:has(keyboardOrFunc) then
@@ -42568,7 +42584,7 @@ function ____exports.registerHotkey(self, keyboardOrFunc, triggerFunc)
42568
42584
  staticHotkeyFunctionMap:set(keyboardOrFunc, triggerFunc)
42569
42585
  end
42570
42586
  end
42571
- function ____exports.unregisterHotkey(self, keyboardOrFunc)
42587
+ function ____exports.unsetHotkey(self, keyboardOrFunc)
42572
42588
  errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
42573
42589
  if isFunction(nil, keyboardOrFunc) then
42574
42590
  if not dynamicHotkeyFunctionMap:has(keyboardOrFunc) then
@@ -42763,8 +42779,6 @@ local ____preventChildEntities = require("src.features.preventChildEntities")
42763
42779
  local preventChildEntitiesInit = ____preventChildEntities.preventChildEntitiesInit
42764
42780
  local ____preventCollectibleRotation = require("src.features.preventCollectibleRotation")
42765
42781
  local preventCollectibleRotationInit = ____preventCollectibleRotation.preventCollectibleRotationInit
42766
- local ____registerHotkey = require("src.features.registerHotkey")
42767
- local registerHotkeyInit = ____registerHotkey.registerHotkeyInit
42768
42782
  local ____roomClearFrame = require("src.features.roomClearFrame")
42769
42783
  local roomClearFrameInit = ____roomClearFrame.roomClearFrameInit
42770
42784
  local ____roomHistory = require("src.features.roomHistory")
@@ -42773,6 +42787,8 @@ local ____runInNFrames = require("src.features.runInNFrames")
42773
42787
  local runInNFramesInit = ____runInNFrames.runInNFramesInit
42774
42788
  local ____runNextRoom = require("src.features.runNextRoom")
42775
42789
  local runNextRoomInit = ____runNextRoom.runNextRoomInit
42790
+ local ____setHotkey = require("src.features.setHotkey")
42791
+ local setHotkeyInit = ____setHotkey.setHotkeyInit
42776
42792
  local ____sirenHelpers = require("src.features.sirenHelpers")
42777
42793
  local sirenHelpersInit = ____sirenHelpers.sirenHelpersInit
42778
42794
  local ____stageHistory = require("src.features.stageHistory")
@@ -42804,10 +42820,10 @@ function initFeaturesMinor(self, mod)
42804
42820
  ponyDetectionInit(nil, mod)
42805
42821
  preventChildEntitiesInit(nil, mod)
42806
42822
  preventCollectibleRotationInit(nil, mod)
42807
- registerHotkeyInit(nil, mod)
42808
42823
  roomClearFrameInit(nil, mod)
42809
42824
  roomHistoryInit(nil, mod)
42810
42825
  runNextRoomInit(nil, mod)
42826
+ setHotkeyInit(nil, mod)
42811
42827
  sirenHelpersInit(nil, mod)
42812
42828
  stageHistoryInit(nil, mod)
42813
42829
  taintedLazarusPlayersInit(nil, mod)
@@ -50105,7 +50121,7 @@ do
50105
50121
  end
50106
50122
  end
50107
50123
  do
50108
- local ____export = require("src.features.registerHotkey")
50124
+ local ____export = require("src.features.roomClearFrame")
50109
50125
  for ____exportKey, ____exportValue in pairs(____export) do
50110
50126
  if ____exportKey ~= "default" then
50111
50127
  ____exports[____exportKey] = ____exportValue
@@ -50113,7 +50129,7 @@ do
50113
50129
  end
50114
50130
  end
50115
50131
  do
50116
- local ____export = require("src.features.roomClearFrame")
50132
+ local ____export = require("src.features.roomHistory")
50117
50133
  for ____exportKey, ____exportValue in pairs(____export) do
50118
50134
  if ____exportKey ~= "default" then
50119
50135
  ____exports[____exportKey] = ____exportValue
@@ -50121,7 +50137,7 @@ do
50121
50137
  end
50122
50138
  end
50123
50139
  do
50124
- local ____export = require("src.features.roomHistory")
50140
+ local ____export = require("src.features.runInNFrames")
50125
50141
  for ____exportKey, ____exportValue in pairs(____export) do
50126
50142
  if ____exportKey ~= "default" then
50127
50143
  ____exports[____exportKey] = ____exportValue
@@ -50129,7 +50145,7 @@ do
50129
50145
  end
50130
50146
  end
50131
50147
  do
50132
- local ____export = require("src.features.runInNFrames")
50148
+ local ____export = require("src.features.saveDataManager.exports")
50133
50149
  for ____exportKey, ____exportValue in pairs(____export) do
50134
50150
  if ____exportKey ~= "default" then
50135
50151
  ____exports[____exportKey] = ____exportValue
@@ -50137,7 +50153,7 @@ do
50137
50153
  end
50138
50154
  end
50139
50155
  do
50140
- local ____export = require("src.features.saveDataManager.exports")
50156
+ local ____export = require("src.features.setHotkey")
50141
50157
  for ____exportKey, ____exportValue in pairs(____export) do
50142
50158
  if ____exportKey ~= "default" then
50143
50159
  ____exports[____exportKey] = ____exportValue
@@ -51381,7 +51397,7 @@ do
51381
51397
  end
51382
51398
  end
51383
51399
  do
51384
- local ____export = require("src.features.registerHotkey")
51400
+ local ____export = require("src.features.roomClearFrame")
51385
51401
  for ____exportKey, ____exportValue in pairs(____export) do
51386
51402
  if ____exportKey ~= "default" then
51387
51403
  ____exports[____exportKey] = ____exportValue
@@ -51389,7 +51405,7 @@ do
51389
51405
  end
51390
51406
  end
51391
51407
  do
51392
- local ____export = require("src.features.roomClearFrame")
51408
+ local ____export = require("src.features.roomHistory")
51393
51409
  for ____exportKey, ____exportValue in pairs(____export) do
51394
51410
  if ____exportKey ~= "default" then
51395
51411
  ____exports[____exportKey] = ____exportValue
@@ -51397,7 +51413,7 @@ do
51397
51413
  end
51398
51414
  end
51399
51415
  do
51400
- local ____export = require("src.features.roomHistory")
51416
+ local ____export = require("src.features.runInNFrames")
51401
51417
  for ____exportKey, ____exportValue in pairs(____export) do
51402
51418
  if ____exportKey ~= "default" then
51403
51419
  ____exports[____exportKey] = ____exportValue
@@ -51405,7 +51421,7 @@ do
51405
51421
  end
51406
51422
  end
51407
51423
  do
51408
- local ____export = require("src.features.runInNFrames")
51424
+ local ____export = require("src.features.saveDataManager.exports")
51409
51425
  for ____exportKey, ____exportValue in pairs(____export) do
51410
51426
  if ____exportKey ~= "default" then
51411
51427
  ____exports[____exportKey] = ____exportValue
@@ -51413,7 +51429,7 @@ do
51413
51429
  end
51414
51430
  end
51415
51431
  do
51416
- local ____export = require("src.features.saveDataManager.exports")
51432
+ local ____export = require("src.features.setHotkey")
51417
51433
  for ____exportKey, ____exportValue in pairs(____export) do
51418
51434
  if ____exportKey ~= "default" then
51419
51435
  ____exports[____exportKey] = ____exportValue
@@ -1 +1 @@
1
- {"version":3,"file":"deployJSONRoom.d.ts","sourceRoot":"","sources":["../../../src/features/deployJSONRoom.ts"],"names":[],"mappings":";;AAwDA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AA4KvD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,EACvC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAuBN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,QAAQ,EAAE,EACrB,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAaN;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAwB5D"}
1
+ {"version":3,"file":"deployJSONRoom.d.ts","sourceRoot":"","sources":["../../../src/features/deployJSONRoom.ts"],"names":[],"mappings":";;AAqDA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAwLvD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,EACvC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAuBN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,QAAQ,EAAE,EACrB,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAaN;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAa5D"}
@@ -4,10 +4,9 @@ local __TS__New = ____lualib.__TS__New
4
4
  local Map = ____lualib.Map
5
5
  local __TS__Iterator = ____lualib.__TS__Iterator
6
6
  local ____exports = {}
7
- local preUseItemWeNeedToGoDeeper, postNewRoomReordered, setDecorationsInvisible, respawnPersistentEntities, removeSpecificNPCs, fillRoomWithDecorations, spawnAllEntities, spawnGridEntityForJSONRoom, spawnNormalEntityForJSONRoom, storePersistentEntity, fixPitGraphics, getPitMap, getPitFrame, FEATURE_NAME, NPC_TYPES_TO_NOT_REMOVE, PERSISTENT_ENTITY_TYPES, GRID_ENTITY_XML_TYPE_SET, v
7
+ local preUseItemWeNeedToGoDeeper, postNewRoomReordered, setDecorationsInvisible, respawnPersistentEntities, emptyRoomEntities, emptyRoomGridEntities, fillRoomWithDecorations, spawnAllEntities, spawnGridEntityForJSONRoom, spawnNormalEntityForJSONRoom, storePersistentEntity, fixPitGraphics, getPitMap, getPitFrame, FEATURE_NAME, PERSISTENT_ENTITY_TYPES, GRID_ENTITY_XML_TYPE_SET, EMPTY_ROOM_BLACKLIST_ENTITY_SET, EMPTY_ROOM_BLACKLIST_GRID_ENTITY_SET, v
8
8
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
9
9
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
10
- local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
11
10
  local EntityCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityCollisionClass
12
11
  local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
13
12
  local EntityGridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityGridCollisionClass
@@ -29,21 +28,16 @@ local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNot
29
28
  local ____array = require("src.functions.array")
30
29
  local emptyArray = ____array.emptyArray
31
30
  local ____entities = require("src.functions.entities")
31
+ local getEntities = ____entities.getEntities
32
32
  local getEntityIDFromConstituents = ____entities.getEntityIDFromConstituents
33
- local removeAllMatchingEntities = ____entities.removeAllMatchingEntities
34
33
  local spawn = ____entities.spawn
35
34
  local spawnWithSeed = ____entities.spawnWithSeed
36
- local ____entitiesSpecific = require("src.functions.entitiesSpecific")
37
- local getNPCs = ____entitiesSpecific.getNPCs
38
- local removeAllBombs = ____entitiesSpecific.removeAllBombs
39
- local removeAllPickups = ____entitiesSpecific.removeAllPickups
40
35
  local ____enums = require("src.functions.enums")
41
36
  local getEnumValues = ____enums.getEnumValues
42
37
  local ____gridEntities = require("src.functions.gridEntities")
43
38
  local convertXMLGridEntityType = ____gridEntities.convertXMLGridEntityType
44
39
  local getAllGridIndexes = ____gridEntities.getAllGridIndexes
45
40
  local getGridEntities = ____gridEntities.getGridEntities
46
- local removeAllGridEntitiesExcept = ____gridEntities.removeAllGridEntitiesExcept
47
41
  local removeGridEntity = ____gridEntities.removeGridEntity
48
42
  local setGridEntityInvisible = ____gridEntities.setGridEntityInvisible
49
43
  local spawnGridEntityWithVariant = ____gridEntities.spawnGridEntityWithVariant
@@ -61,6 +55,7 @@ local getRoomListIndex = ____roomData.getRoomListIndex
61
55
  local ____roomGrid = require("src.functions.roomGrid")
62
56
  local gridCoordinatesToWorldPosition = ____roomGrid.gridCoordinatesToWorldPosition
63
57
  local ____rooms = require("src.functions.rooms")
58
+ local roomUpdateSafe = ____rooms.roomUpdateSafe
64
59
  local setRoomCleared = ____rooms.setRoomCleared
65
60
  local setRoomUncleared = ____rooms.setRoomUncleared
66
61
  local ____spawnCollectible = require("src.functions.spawnCollectible")
@@ -155,38 +150,50 @@ function ____exports.emptyRoom(self, fillWithDecorations)
155
150
  errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
156
151
  local roomListIndex = getRoomListIndex(nil)
157
152
  v.level.deployedRoomListIndexes:add(roomListIndex)
158
- removeAllBombs(nil)
159
- removeAllPickups(nil)
160
- removeAllMatchingEntities(nil, EntityType.SLOT)
161
- removeSpecificNPCs(nil)
162
- removeAllMatchingEntities(nil, EntityType.EFFECT, EffectVariant.DEVIL)
163
- removeAllMatchingEntities(nil, EntityType.EFFECT, EffectVariant.ANGEL)
164
- removeAllGridEntitiesExcept(nil, GridEntityType.WALL, GridEntityType.DOOR)
153
+ emptyRoomEntities(nil)
154
+ emptyRoomGridEntities(nil)
165
155
  setRoomCleared(nil)
166
156
  if fillWithDecorations then
167
157
  fillRoomWithDecorations(nil)
168
158
  end
169
159
  end
170
- function removeSpecificNPCs(self)
160
+ function emptyRoomEntities(self)
171
161
  local room = game:GetRoom()
172
- for ____, npc in ipairs(getNPCs(nil)) do
162
+ for ____, entity in ipairs(getEntities(nil)) do
173
163
  do
174
- if NPC_TYPES_TO_NOT_REMOVE:has(npc.Type) then
164
+ if EMPTY_ROOM_BLACKLIST_ENTITY_SET:has(entity.Type) then
175
165
  goto __continue33
176
166
  end
177
- if npc:HasEntityFlags(EntityFlag.CHARM) or npc:HasEntityFlags(EntityFlag.FRIENDLY) or npc:HasEntityFlags(EntityFlag.PERSISTENT) then
167
+ if entity:HasEntityFlags(EntityFlag.CHARM) or entity:HasEntityFlags(EntityFlag.FRIENDLY) or entity:HasEntityFlags(EntityFlag.PERSISTENT) then
178
168
  goto __continue33
179
169
  end
180
- npc:ClearEntityFlags(EntityFlag.APPEAR)
181
- npc:Remove()
182
- if npc.Type == EntityType.FIREPLACE then
183
- local gridIndex = room:GetGridIndex(npc.Position)
170
+ entity:ClearEntityFlags(EntityFlag.APPEAR)
171
+ entity:Remove()
172
+ if entity.Type == EntityType.FIREPLACE then
173
+ local gridIndex = room:GetGridIndex(entity.Position)
184
174
  room:SetGridPath(gridIndex, 0)
185
175
  end
186
176
  end
187
177
  ::__continue33::
188
178
  end
189
179
  end
180
+ function emptyRoomGridEntities(self)
181
+ local removedOneOrMoreGridEntities = false
182
+ for ____, gridEntity in ipairs(getGridEntities(nil)) do
183
+ do
184
+ local gridEntityType = gridEntity:GetType()
185
+ if EMPTY_ROOM_BLACKLIST_GRID_ENTITY_SET:has(gridEntityType) then
186
+ goto __continue39
187
+ end
188
+ removeGridEntity(nil, gridEntity, false)
189
+ removedOneOrMoreGridEntities = true
190
+ end
191
+ ::__continue39::
192
+ end
193
+ if removedOneOrMoreGridEntities then
194
+ roomUpdateSafe(nil)
195
+ end
196
+ end
190
197
  function fillRoomWithDecorations(self)
191
198
  local room = game:GetRoom()
192
199
  local roomListIndex = getRoomListIndex(nil)
@@ -195,7 +202,7 @@ function fillRoomWithDecorations(self)
195
202
  do
196
203
  local existingGridEntity = room:GetGridEntity(gridIndex)
197
204
  if existingGridEntity ~= nil then
198
- goto __continue39
205
+ goto __continue44
199
206
  end
200
207
  local position = room:GetGridPosition(gridIndex)
201
208
  local decoration = Isaac.GridSpawn(GridEntityType.DECORATION, 0, position)
@@ -204,7 +211,7 @@ function fillRoomWithDecorations(self)
204
211
  end
205
212
  decorationGridIndexes[#decorationGridIndexes + 1] = gridIndex
206
213
  end
207
- ::__continue39::
214
+ ::__continue44::
208
215
  end
209
216
  end
210
217
  function spawnAllEntities(self, jsonRoom, rng, verbose)
@@ -462,10 +469,19 @@ function getPitFrame(self, L, R, U, D, UL, UR, DL, DR)
462
469
  return F
463
470
  end
464
471
  FEATURE_NAME = "deployJSONRoom"
465
- NPC_TYPES_TO_NOT_REMOVE = __TS__New(Set, {EntityType.DARK_ESAU})
466
472
  PERSISTENT_ENTITY_TYPES = __TS__New(Set, {EntityType.WALL_HUGGER})
467
473
  local gridEntityXMLTypes = getEnumValues(nil, GridEntityXMLType)
468
474
  GRID_ENTITY_XML_TYPE_SET = __TS__New(Set, gridEntityXMLTypes)
475
+ EMPTY_ROOM_BLACKLIST_ENTITY_SET = __TS__New(Set, {
476
+ EntityType.PLAYER,
477
+ EntityType.TEAR,
478
+ EntityType.FAMILIAR,
479
+ EntityType.LASER,
480
+ EntityType.KNIFE,
481
+ EntityType.PROJECTILE,
482
+ EntityType.DARK_ESAU
483
+ })
484
+ EMPTY_ROOM_BLACKLIST_GRID_ENTITY_SET = __TS__New(Set, {GridEntityType.WALL, GridEntityType.DOOR})
469
485
  v = {
470
486
  level = {
471
487
  deployedRoomListIndexes = __TS__New(Set),
@@ -13,11 +13,11 @@ import { Keyboard } from "isaac-typescript-definitions";
13
13
  * @param triggerFunc A function containing the arbitrary code that you want to execute when the
14
14
  * hotkey is triggered.
15
15
  */
16
- export declare function registerHotkey(keyboardOrFunc: Keyboard | (() => Keyboard | undefined), triggerFunc: () => void): void;
16
+ export declare function setHotkey(keyboardOrFunc: Keyboard | (() => Keyboard | undefined), triggerFunc: () => void): void;
17
17
  /**
18
- * Helper function to remove a hotkey created with the `registerHotkey` function.
18
+ * Helper function to remove a hotkey created with the `setHotkey` function.
19
19
  *
20
20
  * @param keyboardOrFunc Equal to the value that you passed when initially registering the hotkey.
21
21
  */
22
- export declare function unregisterHotkey(keyboardOrFunc: Keyboard | (() => Keyboard | undefined)): void;
23
- //# sourceMappingURL=registerHotkey.d.ts.map
22
+ export declare function unsetHotkey(keyboardOrFunc: Keyboard | (() => Keyboard | undefined)): void;
23
+ //# sourceMappingURL=setHotkey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setHotkey.d.ts","sourceRoot":"","sources":["../../../src/features/setHotkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,MAAM,8BAA8B,CAAC;AAyDrE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CACvB,cAAc,EAAE,QAAQ,GAAG,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC,EACvD,WAAW,EAAE,MAAM,IAAI,GACtB,IAAI,CAoBN;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,cAAc,EAAE,QAAQ,GAAG,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC,GACtD,IAAI,CAoBN"}
@@ -38,13 +38,13 @@ function checkIfTriggered(self, keyboard, triggerFunc)
38
38
  triggerFunc(nil)
39
39
  end
40
40
  end
41
- local FEATURE_NAME = "registerHotkeys"
41
+ local FEATURE_NAME = "setHotkey"
42
42
  staticHotkeyFunctionMap = __TS__New(Map)
43
43
  dynamicHotkeyFunctionMap = __TS__New(Map)
44
44
  keyPressedMap = __TS__New(DefaultMap, false)
45
45
  ---
46
46
  -- @internal
47
- function ____exports.registerHotkeyInit(self, mod)
47
+ function ____exports.setHotkeyInit(self, mod)
48
48
  mod:AddCallback(ModCallback.POST_RENDER, postRender)
49
49
  end
50
50
  --- Helper function to run arbitrary code when you press and release a specific keyboard key.
@@ -59,7 +59,7 @@ end
59
59
  -- Config Menu).
60
60
  -- @param triggerFunc A function containing the arbitrary code that you want to execute when the
61
61
  -- hotkey is triggered.
62
- function ____exports.registerHotkey(self, keyboardOrFunc, triggerFunc)
62
+ function ____exports.setHotkey(self, keyboardOrFunc, triggerFunc)
63
63
  errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
64
64
  if isFunction(nil, keyboardOrFunc) then
65
65
  if dynamicHotkeyFunctionMap:has(keyboardOrFunc) then
@@ -73,10 +73,10 @@ function ____exports.registerHotkey(self, keyboardOrFunc, triggerFunc)
73
73
  staticHotkeyFunctionMap:set(keyboardOrFunc, triggerFunc)
74
74
  end
75
75
  end
76
- --- Helper function to remove a hotkey created with the `registerHotkey` function.
76
+ --- Helper function to remove a hotkey created with the `setHotkey` function.
77
77
  --
78
78
  -- @param keyboardOrFunc Equal to the value that you passed when initially registering the hotkey.
79
- function ____exports.unregisterHotkey(self, keyboardOrFunc)
79
+ function ____exports.unsetHotkey(self, keyboardOrFunc)
80
80
  errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
81
81
  if isFunction(nil, keyboardOrFunc) then
82
82
  if not dynamicHotkeyFunctionMap:has(keyboardOrFunc) then
@@ -38,11 +38,11 @@ export * from "./features/playerInventory";
38
38
  export * from "./features/ponyDetection";
39
39
  export * from "./features/preventChildEntities";
40
40
  export * from "./features/preventCollectibleRotation";
41
- export * from "./features/registerHotkey";
42
41
  export * from "./features/roomClearFrame";
43
42
  export * from "./features/roomHistory";
44
43
  export * from "./features/runInNFrames";
45
44
  export * from "./features/saveDataManager/exports";
45
+ export * from "./features/setHotkey";
46
46
  export * from "./features/sirenHelpers";
47
47
  export * from "./features/stageHistory";
48
48
  export * from "./features/taintedLazarusPlayers";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,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,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
@@ -320,7 +320,7 @@ do
320
320
  end
321
321
  end
322
322
  do
323
- local ____export = require("src.features.registerHotkey")
323
+ local ____export = require("src.features.roomClearFrame")
324
324
  for ____exportKey, ____exportValue in pairs(____export) do
325
325
  if ____exportKey ~= "default" then
326
326
  ____exports[____exportKey] = ____exportValue
@@ -328,7 +328,7 @@ do
328
328
  end
329
329
  end
330
330
  do
331
- local ____export = require("src.features.roomClearFrame")
331
+ local ____export = require("src.features.roomHistory")
332
332
  for ____exportKey, ____exportValue in pairs(____export) do
333
333
  if ____exportKey ~= "default" then
334
334
  ____exports[____exportKey] = ____exportValue
@@ -336,7 +336,7 @@ do
336
336
  end
337
337
  end
338
338
  do
339
- local ____export = require("src.features.roomHistory")
339
+ local ____export = require("src.features.runInNFrames")
340
340
  for ____exportKey, ____exportValue in pairs(____export) do
341
341
  if ____exportKey ~= "default" then
342
342
  ____exports[____exportKey] = ____exportValue
@@ -344,7 +344,7 @@ do
344
344
  end
345
345
  end
346
346
  do
347
- local ____export = require("src.features.runInNFrames")
347
+ local ____export = require("src.features.saveDataManager.exports")
348
348
  for ____exportKey, ____exportValue in pairs(____export) do
349
349
  if ____exportKey ~= "default" then
350
350
  ____exports[____exportKey] = ____exportValue
@@ -352,7 +352,7 @@ do
352
352
  end
353
353
  end
354
354
  do
355
- local ____export = require("src.features.saveDataManager.exports")
355
+ local ____export = require("src.features.setHotkey")
356
356
  for ____exportKey, ____exportValue in pairs(____export) do
357
357
  if ____exportKey ~= "default" then
358
358
  ____exports[____exportKey] = ____exportValue
@@ -42,8 +42,6 @@ local ____preventChildEntities = require("src.features.preventChildEntities")
42
42
  local preventChildEntitiesInit = ____preventChildEntities.preventChildEntitiesInit
43
43
  local ____preventCollectibleRotation = require("src.features.preventCollectibleRotation")
44
44
  local preventCollectibleRotationInit = ____preventCollectibleRotation.preventCollectibleRotationInit
45
- local ____registerHotkey = require("src.features.registerHotkey")
46
- local registerHotkeyInit = ____registerHotkey.registerHotkeyInit
47
45
  local ____roomClearFrame = require("src.features.roomClearFrame")
48
46
  local roomClearFrameInit = ____roomClearFrame.roomClearFrameInit
49
47
  local ____roomHistory = require("src.features.roomHistory")
@@ -52,6 +50,8 @@ local ____runInNFrames = require("src.features.runInNFrames")
52
50
  local runInNFramesInit = ____runInNFrames.runInNFramesInit
53
51
  local ____runNextRoom = require("src.features.runNextRoom")
54
52
  local runNextRoomInit = ____runNextRoom.runNextRoomInit
53
+ local ____setHotkey = require("src.features.setHotkey")
54
+ local setHotkeyInit = ____setHotkey.setHotkeyInit
55
55
  local ____sirenHelpers = require("src.features.sirenHelpers")
56
56
  local sirenHelpersInit = ____sirenHelpers.sirenHelpersInit
57
57
  local ____stageHistory = require("src.features.stageHistory")
@@ -83,10 +83,10 @@ function initFeaturesMinor(self, mod)
83
83
  ponyDetectionInit(nil, mod)
84
84
  preventChildEntitiesInit(nil, mod)
85
85
  preventCollectibleRotationInit(nil, mod)
86
- registerHotkeyInit(nil, mod)
87
86
  roomClearFrameInit(nil, mod)
88
87
  roomHistoryInit(nil, mod)
89
88
  runNextRoomInit(nil, mod)
89
+ setHotkeyInit(nil, mod)
90
90
  sirenHelpersInit(nil, mod)
91
91
  stageHistoryInit(nil, mod)
92
92
  taintedLazarusPlayersInit(nil, mod)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "12.6.0",
3
+ "version": "13.0.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -6,7 +6,6 @@
6
6
  import {
7
7
  ActiveSlot,
8
8
  CollectibleType,
9
- EffectVariant,
10
9
  EntityCollisionClass,
11
10
  EntityFlag,
12
11
  EntityGridCollisionClass,
@@ -26,22 +25,16 @@ import { ModCallbackCustom } from "../enums/ModCallbackCustom";
26
25
  import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
27
26
  import { emptyArray } from "../functions/array";
28
27
  import {
28
+ getEntities,
29
29
  getEntityIDFromConstituents,
30
- removeAllMatchingEntities,
31
30
  spawn,
32
31
  spawnWithSeed,
33
32
  } from "../functions/entities";
34
- import {
35
- getNPCs,
36
- removeAllBombs,
37
- removeAllPickups,
38
- } from "../functions/entitiesSpecific";
39
33
  import { getEnumValues } from "../functions/enums";
40
34
  import {
41
35
  convertXMLGridEntityType,
42
36
  getAllGridIndexes,
43
37
  getGridEntities,
44
- removeAllGridEntitiesExcept,
45
38
  removeGridEntity,
46
39
  setGridEntityInvisible,
47
40
  spawnGridEntityWithVariant,
@@ -51,7 +44,11 @@ import { log } from "../functions/log";
51
44
  import { getRandomSeed, isRNG, newRNG } from "../functions/rng";
52
45
  import { getRoomListIndex } from "../functions/roomData";
53
46
  import { gridCoordinatesToWorldPosition } from "../functions/roomGrid";
54
- import { setRoomCleared, setRoomUncleared } from "../functions/rooms";
47
+ import {
48
+ roomUpdateSafe,
49
+ setRoomCleared,
50
+ setRoomUncleared,
51
+ } from "../functions/rooms";
55
52
  import { spawnCollectible } from "../functions/spawnCollectible";
56
53
  import { asCollectibleType, asNumber } from "../functions/types";
57
54
  import { JSONRoom } from "../interfaces/JSONRoomsFile";
@@ -67,10 +64,6 @@ interface PersistentEntityDescription {
67
64
 
68
65
  const FEATURE_NAME = "deployJSONRoom";
69
66
 
70
- const NPC_TYPES_TO_NOT_REMOVE: ReadonlySet<EntityType> = new Set([
71
- EntityType.DARK_ESAU,
72
- ]);
73
-
74
67
  const PERSISTENT_ENTITY_TYPES: ReadonlySet<EntityType> = new Set([
75
68
  EntityType.WALL_HUGGER,
76
69
  ]);
@@ -80,6 +73,22 @@ const GRID_ENTITY_XML_TYPE_SET: ReadonlySet<number> = new Set(
80
73
  gridEntityXMLTypes,
81
74
  );
82
75
 
76
+ const EMPTY_ROOM_BLACKLIST_ENTITY_SET: ReadonlySet<EntityType> = new Set([
77
+ EntityType.PLAYER, // 1
78
+ EntityType.TEAR, // 2
79
+ EntityType.FAMILIAR, // 3
80
+ EntityType.LASER, // 7
81
+ EntityType.KNIFE, // 8
82
+ EntityType.PROJECTILE, // 9
83
+ EntityType.DARK_ESAU, // 866
84
+ ]);
85
+
86
+ const EMPTY_ROOM_BLACKLIST_GRID_ENTITY_SET: ReadonlySet<GridEntityType> =
87
+ new Set([
88
+ GridEntityType.WALL, // 15
89
+ GridEntityType.DOOR, // 16
90
+ ]);
91
+
83
92
  const v = {
84
93
  level: {
85
94
  deployedRoomListIndexes: new Set<int>(),
@@ -348,21 +357,10 @@ export function emptyRoom(fillWithDecorations: boolean): void {
348
357
  errorIfFeaturesNotInitialized(FEATURE_NAME);
349
358
 
350
359
  const roomListIndex = getRoomListIndex();
351
-
352
360
  v.level.deployedRoomListIndexes.add(roomListIndex);
353
361
 
354
- removeAllBombs(); // 4
355
- removeAllPickups(); // 5
356
- removeAllMatchingEntities(EntityType.SLOT); // 6
357
- removeSpecificNPCs();
358
- removeAllMatchingEntities(EntityType.EFFECT, EffectVariant.DEVIL);
359
- removeAllMatchingEntities(EntityType.EFFECT, EffectVariant.ANGEL);
360
-
361
- removeAllGridEntitiesExcept(
362
- GridEntityType.WALL, // 15
363
- GridEntityType.DOOR, // 16
364
- );
365
-
362
+ emptyRoomEntities();
363
+ emptyRoomGridEntities();
366
364
  setRoomCleared();
367
365
 
368
366
  if (fillWithDecorations) {
@@ -371,38 +369,54 @@ export function emptyRoom(fillWithDecorations: boolean): void {
371
369
  }
372
370
 
373
371
  /**
374
- * We remove entities in the `POST_NEW_ROOM` callback instead of in the PreRoomEntitySpawn callback
375
- * so that they will not re-appear when we re-enter the room.
372
+ * We remove entities in the `POST_NEW_ROOM` callback instead of in the `PRE_ROOM_ENTITY_SPAWN`
373
+ * callback so that they will not re-appear when we re-enter the room.
376
374
  */
377
- function removeSpecificNPCs() {
375
+ function emptyRoomEntities() {
378
376
  const room = game.GetRoom();
379
377
 
380
- for (const npc of getNPCs()) {
381
- if (NPC_TYPES_TO_NOT_REMOVE.has(npc.Type)) {
378
+ for (const entity of getEntities()) {
379
+ if (EMPTY_ROOM_BLACKLIST_ENTITY_SET.has(entity.Type)) {
382
380
  continue;
383
381
  }
384
382
 
385
383
  if (
386
- npc.HasEntityFlags(EntityFlag.CHARM) ||
387
- npc.HasEntityFlags(EntityFlag.FRIENDLY) ||
388
- npc.HasEntityFlags(EntityFlag.PERSISTENT)
384
+ entity.HasEntityFlags(EntityFlag.CHARM) ||
385
+ entity.HasEntityFlags(EntityFlag.FRIENDLY) ||
386
+ entity.HasEntityFlags(EntityFlag.PERSISTENT)
389
387
  ) {
390
388
  continue;
391
389
  }
392
390
 
393
- npc.ClearEntityFlags(EntityFlag.APPEAR);
394
- npc.Remove();
391
+ entity.ClearEntityFlags(EntityFlag.APPEAR);
392
+ entity.Remove();
395
393
 
396
394
  // When fire places are removed, they will leave behind a "path" that will prevent future grid
397
395
  // entities from being spawned on the same tile. Thus, reset the path for this tile if this is a
398
396
  // fire place.
399
- if (npc.Type === EntityType.FIREPLACE) {
400
- const gridIndex = room.GetGridIndex(npc.Position);
397
+ if (entity.Type === EntityType.FIREPLACE) {
398
+ const gridIndex = room.GetGridIndex(entity.Position);
401
399
  room.SetGridPath(gridIndex, 0);
402
400
  }
403
401
  }
404
402
  }
405
403
 
404
+ function emptyRoomGridEntities() {
405
+ let removedOneOrMoreGridEntities = false;
406
+ for (const gridEntity of getGridEntities()) {
407
+ const gridEntityType = gridEntity.GetType();
408
+ if (EMPTY_ROOM_BLACKLIST_GRID_ENTITY_SET.has(gridEntityType)) {
409
+ continue;
410
+ }
411
+
412
+ removeGridEntity(gridEntity, false);
413
+ removedOneOrMoreGridEntities = true;
414
+ }
415
+ if (removedOneOrMoreGridEntities) {
416
+ roomUpdateSafe();
417
+ }
418
+ }
419
+
406
420
  /**
407
421
  * We removed most normal entities, which should prevent them from respawning when the player
408
422
  * re-enters the room. However, this is not the case for grid entities; even if they are removed,
@@ -4,7 +4,7 @@ import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
4
4
  import { isKeyboardPressed } from "../functions/input";
5
5
  import { isFunction } from "../functions/types";
6
6
 
7
- const FEATURE_NAME = "registerHotkeys";
7
+ const FEATURE_NAME = "setHotkey";
8
8
 
9
9
  /**
10
10
  * The keys are the keyboard keys that trigger the hotkey. The values are the functions that contain
@@ -24,7 +24,7 @@ const dynamicHotkeyFunctionMap = new Map<
24
24
  const keyPressedMap = new DefaultMap<Keyboard, boolean>(false);
25
25
 
26
26
  /** @internal */
27
- export function registerHotkeyInit(mod: Mod): void {
27
+ export function setHotkeyInit(mod: Mod): void {
28
28
  mod.AddCallback(ModCallback.POST_RENDER, postRender); // 2
29
29
  }
30
30
 
@@ -69,7 +69,7 @@ function checkIfTriggered(keyboard: Keyboard, triggerFunc: () => void) {
69
69
  * @param triggerFunc A function containing the arbitrary code that you want to execute when the
70
70
  * hotkey is triggered.
71
71
  */
72
- export function registerHotkey(
72
+ export function setHotkey(
73
73
  keyboardOrFunc: Keyboard | (() => Keyboard | undefined),
74
74
  triggerFunc: () => void,
75
75
  ): void {
@@ -95,11 +95,11 @@ export function registerHotkey(
95
95
  }
96
96
 
97
97
  /**
98
- * Helper function to remove a hotkey created with the `registerHotkey` function.
98
+ * Helper function to remove a hotkey created with the `setHotkey` function.
99
99
  *
100
100
  * @param keyboardOrFunc Equal to the value that you passed when initially registering the hotkey.
101
101
  */
102
- export function unregisterHotkey(
102
+ export function unsetHotkey(
103
103
  keyboardOrFunc: Keyboard | (() => Keyboard | undefined),
104
104
  ): void {
105
105
  errorIfFeaturesNotInitialized(FEATURE_NAME);
package/src/index.ts CHANGED
@@ -38,11 +38,11 @@ export * from "./features/playerInventory";
38
38
  export * from "./features/ponyDetection";
39
39
  export * from "./features/preventChildEntities";
40
40
  export * from "./features/preventCollectibleRotation";
41
- export * from "./features/registerHotkey";
42
41
  export * from "./features/roomClearFrame";
43
42
  export * from "./features/roomHistory";
44
43
  export * from "./features/runInNFrames";
45
44
  export * from "./features/saveDataManager/exports";
45
+ export * from "./features/setHotkey";
46
46
  export * from "./features/sirenHelpers";
47
47
  export * from "./features/stageHistory";
48
48
  export * from "./features/taintedLazarusPlayers";
@@ -20,11 +20,11 @@ import { playerInventoryInit } from "./features/playerInventory";
20
20
  import { ponyDetectionInit } from "./features/ponyDetection";
21
21
  import { preventChildEntitiesInit } from "./features/preventChildEntities";
22
22
  import { preventCollectibleRotationInit } from "./features/preventCollectibleRotation";
23
- import { registerHotkeyInit } from "./features/registerHotkey";
24
23
  import { roomClearFrameInit } from "./features/roomClearFrame";
25
24
  import { roomHistoryInit } from "./features/roomHistory";
26
25
  import { runInNFramesInit } from "./features/runInNFrames";
27
26
  import { runNextRoomInit } from "./features/runNextRoom";
27
+ import { setHotkeyInit } from "./features/setHotkey";
28
28
  import { sirenHelpersInit } from "./features/sirenHelpers";
29
29
  import { stageHistoryInit } from "./features/stageHistory";
30
30
  import { taintedLazarusPlayersInit } from "./features/taintedLazarusPlayers";
@@ -60,10 +60,10 @@ function initFeaturesMinor(mod: ModUpgraded) {
60
60
  ponyDetectionInit(mod);
61
61
  preventChildEntitiesInit(mod);
62
62
  preventCollectibleRotationInit(mod);
63
- registerHotkeyInit(mod);
64
63
  roomClearFrameInit(mod);
65
64
  roomHistoryInit(mod);
66
65
  runNextRoomInit(mod);
66
+ setHotkeyInit(mod);
67
67
  sirenHelpersInit(mod);
68
68
  stageHistoryInit(mod);
69
69
  taintedLazarusPlayersInit(mod);
@@ -1 +0,0 @@
1
- {"version":3,"file":"registerHotkey.d.ts","sourceRoot":"","sources":["../../../src/features/registerHotkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,MAAM,8BAA8B,CAAC;AAyDrE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,cAAc,EAAE,QAAQ,GAAG,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC,EACvD,WAAW,EAAE,MAAM,IAAI,GACtB,IAAI,CAoBN;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,cAAc,EAAE,QAAQ,GAAG,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC,GACtD,IAAI,CAoBN"}