isaacscript-common 6.0.1 → 6.1.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.
Files changed (43) hide show
  1. package/callbacks/postCollectibleEmpty.d.ts +1 -0
  2. package/callbacks/postCollectibleEmpty.lua +41 -0
  3. package/callbacks/subscriptions/postCollectibleEmpty.d.ts +5 -0
  4. package/callbacks/subscriptions/postCollectibleEmpty.lua +29 -0
  5. package/enums/ModCallbackCustom.d.ts +92 -77
  6. package/enums/ModCallbackCustom.lua +79 -77
  7. package/features/customStage/exports.d.ts +1 -8
  8. package/features/customStage/exports.lua +6 -14
  9. package/features/customStage/init.d.ts +1 -0
  10. package/features/customStage/init.lua +18 -0
  11. package/features/customStage/metadata.lua +1 -0
  12. package/features/customStage/v.d.ts +2 -2
  13. package/features/customStage/v.lua +1 -1
  14. package/features/deployJSONRoom.d.ts +1 -1
  15. package/functions/boss.d.ts +2 -2
  16. package/functions/entity.d.ts +2 -2
  17. package/functions/entitySpecific.d.ts +20 -20
  18. package/functions/jsonRoom.d.ts +1 -1
  19. package/functions/pickups.d.ts +16 -16
  20. package/index.d.ts +1 -5
  21. package/initCustomCallbacks.lua +3 -0
  22. package/initFeatures.lua +3 -0
  23. package/interfaces/AddCallbackParameterCustom.d.ts +2 -0
  24. package/interfaces/CustomStage.d.ts +51 -0
  25. package/interfaces/{CustomStageData.lua → CustomStage.lua} +0 -0
  26. package/interfaces/JSONRoomsFile.d.ts +75 -0
  27. package/interfaces/{JSONDoor.lua → JSONRoomsFile.lua} +0 -0
  28. package/objects/callbackRegisterFunctions.lua +3 -0
  29. package/package.json +1 -1
  30. package/features/customStage/constants.d.ts +0 -18
  31. package/features/customStage/constants.lua +0 -29
  32. package/features/customStage/scripts/generateCustomStageRooms.d.ts +0 -27
  33. package/features/customStage/scripts/generateCustomStageRooms.lua +0 -126
  34. package/interfaces/CustomStageData.d.ts +0 -5
  35. package/interfaces/JSONDoor.d.ts +0 -11
  36. package/interfaces/JSONEntity.d.ts +0 -13
  37. package/interfaces/JSONEntity.lua +0 -2
  38. package/interfaces/JSONRoom.d.ts +0 -26
  39. package/interfaces/JSONRoom.lua +0 -2
  40. package/interfaces/JSONRooms.d.ts +0 -11
  41. package/interfaces/JSONRooms.lua +0 -2
  42. package/interfaces/JSONSpawn.d.ts +0 -11
  43. package/interfaces/JSONSpawn.lua +0 -2
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,41 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Map = ____lualib.Map
3
+ local __TS__New = ____lualib.__TS__New
4
+ local ____exports = {}
5
+ local hasSubscriptions, postPickupUpdateCollectible, v
6
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
+ local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
8
+ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
9
+ local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
10
+ local ____exports = require("features.saveDataManager.exports")
11
+ local saveDataManager = ____exports.saveDataManager
12
+ local ____postCollectibleEmpty = require("callbacks.subscriptions.postCollectibleEmpty")
13
+ local postCollectibleEmptyFire = ____postCollectibleEmpty.postCollectibleEmptyFire
14
+ local ____postCollectibleInitFirst = require("callbacks.subscriptions.postCollectibleInitFirst")
15
+ local postCollectibleInitFirstHasSubscriptions = ____postCollectibleInitFirst.postCollectibleInitFirstHasSubscriptions
16
+ function hasSubscriptions(self)
17
+ return postCollectibleInitFirstHasSubscriptions(nil)
18
+ end
19
+ function postPickupUpdateCollectible(self, pickup)
20
+ local collectible = pickup
21
+ local ptrHash = GetPtrHash(collectible)
22
+ local oldCollectibleType = v.room.collectibleTypeMap:get(ptrHash)
23
+ if oldCollectibleType == nil then
24
+ oldCollectibleType = collectible.SubType
25
+ end
26
+ v.room.collectibleTypeMap:set(ptrHash, collectible.SubType)
27
+ if oldCollectibleType == collectible.SubType then
28
+ return
29
+ end
30
+ if collectible.SubType == CollectibleType.NULL then
31
+ postCollectibleEmptyFire(nil, collectible, oldCollectibleType)
32
+ end
33
+ end
34
+ v = {room = {collectibleTypeMap = __TS__New(Map)}}
35
+ ---
36
+ -- @internal
37
+ function ____exports.postCollectibleEmptyInit(self, mod)
38
+ saveDataManager(nil, "postCollectibleEmpty", v, hasSubscriptions)
39
+ mod:AddCallback(ModCallback.POST_PICKUP_UPDATE, postPickupUpdateCollectible, PickupVariant.COLLECTIBLE)
40
+ end
41
+ return ____exports
@@ -0,0 +1,5 @@
1
+ import { CollectibleType } from "isaac-typescript-definitions";
2
+ export declare type PostCollectibleEmptyRegisterParameters = [
3
+ callback: (collectible: EntityPickup, oldCollectibleType: CollectibleType) => void,
4
+ collectibleType?: CollectibleType
5
+ ];
@@ -0,0 +1,29 @@
1
+ local ____exports = {}
2
+ local subscriptions = {}
3
+ ---
4
+ -- @internal
5
+ function ____exports.postCollectibleEmptyHasSubscriptions(self)
6
+ return #subscriptions > 0
7
+ end
8
+ ---
9
+ -- @internal
10
+ function ____exports.postCollectibleEmptyRegister(self, ...)
11
+ local args = {...}
12
+ subscriptions[#subscriptions + 1] = args
13
+ end
14
+ ---
15
+ -- @internal
16
+ function ____exports.postCollectibleEmptyFire(self, collectible, oldCollectibleType)
17
+ for ____, ____value in ipairs(subscriptions) do
18
+ local callback = ____value[1]
19
+ local collectibleType = ____value[2]
20
+ do
21
+ if collectibleType ~= nil and collectibleType ~= oldCollectibleType then
22
+ goto __continue5
23
+ end
24
+ callback(nil, collectible, oldCollectibleType)
25
+ end
26
+ ::__continue5::
27
+ end
28
+ end
29
+ return ____exports