isaacscript-common 6.0.1 → 6.2.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/callbacks/postCollectibleEmpty.d.ts +1 -0
- package/callbacks/postCollectibleEmpty.lua +40 -0
- package/callbacks/subscriptions/postCollectibleEmpty.d.ts +5 -0
- package/callbacks/subscriptions/postCollectibleEmpty.lua +29 -0
- package/classes/DefaultMap.lua +2 -2
- package/enums/ModCallbackCustom.d.ts +92 -77
- package/enums/ModCallbackCustom.lua +79 -77
- package/features/customStage/exports.d.ts +3 -9
- package/features/customStage/exports.lua +86 -15
- package/features/customStage/init.d.ts +1 -0
- package/features/customStage/init.lua +48 -0
- package/features/customStage/metadata.lua +1 -0
- package/features/customStage/util.d.ts +11 -0
- package/features/customStage/util.lua +51 -0
- package/features/customStage/v.d.ts +6 -2
- package/features/customStage/v.lua +4 -1
- package/features/deployJSONRoom.d.ts +1 -1
- package/functions/boss.d.ts +2 -2
- package/functions/doors.d.ts +4 -0
- package/functions/doors.lua +14 -0
- package/functions/entity.d.ts +2 -2
- package/functions/entitySpecific.d.ts +20 -20
- package/functions/familiars.d.ts +2 -0
- package/functions/familiars.lua +16 -0
- package/functions/jsonRoom.d.ts +26 -4
- package/functions/jsonRoom.lua +64 -2
- package/functions/pickups.d.ts +16 -16
- package/functions/playerCenter.d.ts +6 -0
- package/functions/playerCenter.lua +57 -0
- package/functions/rooms.d.ts +1 -1
- package/functions/rooms.lua +2 -2
- package/functions/stage.d.ts +3 -3
- package/functions/stage.lua +5 -4
- package/functions/trinkets.lua +1 -1
- package/index.d.ts +1 -5
- package/initCustomCallbacks.lua +3 -0
- package/initFeatures.lua +3 -0
- package/interfaces/AddCallbackParameterCustom.d.ts +2 -0
- package/interfaces/CustomStage.d.ts +10 -0
- package/interfaces/{CustomStageData.lua → CustomStage.lua} +0 -0
- package/interfaces/CustomStageLua.d.ts +118 -0
- package/interfaces/{JSONDoor.lua → CustomStageLua.lua} +0 -0
- package/interfaces/JSONRoomsFile.d.ts +75 -0
- package/interfaces/{JSONEntity.lua → JSONRoomsFile.lua} +0 -0
- package/objects/callbackRegisterFunctions.lua +3 -0
- package/objects/roomTypeGotoPrefixes.lua +29 -29
- package/package.json +1 -1
- package/features/customStage/constants.d.ts +0 -18
- package/features/customStage/constants.lua +0 -29
- package/features/customStage/scripts/generateCustomStageRooms.d.ts +0 -27
- package/features/customStage/scripts/generateCustomStageRooms.lua +0 -126
- package/interfaces/CustomStageData.d.ts +0 -5
- package/interfaces/JSONDoor.d.ts +0 -11
- package/interfaces/JSONEntity.d.ts +0 -13
- package/interfaces/JSONRoom.d.ts +0 -26
- package/interfaces/JSONRoom.lua +0 -2
- package/interfaces/JSONRooms.d.ts +0 -11
- package/interfaces/JSONRooms.lua +0 -2
- package/interfaces/JSONSpawn.d.ts +0 -11
- package/interfaces/JSONSpawn.lua +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
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 postCollectibleEmptyHasSubscriptions = ____postCollectibleEmpty.postCollectibleEmptyHasSubscriptions
|
|
15
|
+
function hasSubscriptions(self)
|
|
16
|
+
return postCollectibleEmptyHasSubscriptions(nil)
|
|
17
|
+
end
|
|
18
|
+
function postPickupUpdateCollectible(self, pickup)
|
|
19
|
+
local collectible = pickup
|
|
20
|
+
local ptrHash = GetPtrHash(collectible)
|
|
21
|
+
local oldCollectibleType = v.room.collectibleTypeMap:get(ptrHash)
|
|
22
|
+
if oldCollectibleType == nil then
|
|
23
|
+
oldCollectibleType = collectible.SubType
|
|
24
|
+
end
|
|
25
|
+
v.room.collectibleTypeMap:set(ptrHash, collectible.SubType)
|
|
26
|
+
if oldCollectibleType == collectible.SubType then
|
|
27
|
+
return
|
|
28
|
+
end
|
|
29
|
+
if collectible.SubType == CollectibleType.NULL then
|
|
30
|
+
postCollectibleEmptyFire(nil, collectible, oldCollectibleType)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
v = {room = {collectibleTypeMap = __TS__New(Map)}}
|
|
34
|
+
---
|
|
35
|
+
-- @internal
|
|
36
|
+
function ____exports.postCollectibleEmptyInit(self, mod)
|
|
37
|
+
saveDataManager(nil, "postCollectibleEmpty", v, hasSubscriptions)
|
|
38
|
+
mod:AddCallback(ModCallback.POST_PICKUP_UPDATE, postPickupUpdateCollectible, PickupVariant.COLLECTIBLE)
|
|
39
|
+
end
|
|
40
|
+
return ____exports
|
|
@@ -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
|
package/classes/DefaultMap.lua
CHANGED
|
@@ -120,7 +120,7 @@ function DefaultMap.prototype.getDefaultValue(self, ...)
|
|
|
120
120
|
if self.defaultValueFactory ~= nil then
|
|
121
121
|
return self:defaultValueFactory(...)
|
|
122
122
|
end
|
|
123
|
-
|
|
123
|
+
error("A DefaultMap was incorrectly instantiated.")
|
|
124
124
|
end
|
|
125
125
|
function DefaultMap.prototype.getConstructorArg(self)
|
|
126
126
|
if self.defaultValue ~= nil then
|
|
@@ -129,6 +129,6 @@ function DefaultMap.prototype.getConstructorArg(self)
|
|
|
129
129
|
if self.defaultValueFactory ~= nil then
|
|
130
130
|
return self.defaultValueFactory
|
|
131
131
|
end
|
|
132
|
-
|
|
132
|
+
error("A DefaultMap was incorrectly instantiated.")
|
|
133
133
|
end
|
|
134
134
|
return ____exports
|