isaacscript-common 3.1.0 → 3.3.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/customRevive.lua +3 -3
- package/callbacks/postGridEntity.lua +5 -3
- package/callbacks/postPickupInitFirst.d.ts +1 -0
- package/callbacks/postPickupInitFirst.lua +55 -0
- package/callbacks/postRoomClearChanged.lua +5 -3
- package/callbacks/postSlotInitUpdate.lua +5 -3
- package/callbacks/subscriptions/postPickupInitFirst.d.ts +3 -0
- package/callbacks/subscriptions/postPickupInitFirst.lua +29 -0
- package/classes/DefaultMap.d.ts +1 -2
- package/classes/DefaultMap.lua +1 -4
- package/enums/ModCallbackCustom.d.ts +61 -39
- package/enums/ModCallbackCustom.lua +40 -38
- package/features/deployJSONRoom.lua +5 -4
- package/features/extraConsoleCommands/listCommands.lua +1 -0
- package/features/persistentEntities.d.ts +28 -0
- package/features/persistentEntities.lua +150 -0
- package/functions/bombs.d.ts +3 -0
- package/functions/bombs.lua +12 -0
- package/functions/collectibles.d.ts +7 -7
- package/functions/collectibles.lua +8 -8
- package/functions/color.d.ts +2 -16
- package/functions/color.lua +0 -9
- package/functions/direction.d.ts +7 -0
- package/functions/direction.lua +10 -5
- package/functions/entity.d.ts +10 -0
- package/functions/entity.lua +29 -0
- package/functions/log.lua +2 -2
- package/functions/player.d.ts +7 -0
- package/functions/player.lua +44 -9
- package/functions/playerHealth.d.ts +2 -0
- package/functions/playerHealth.lua +87 -68
- package/functions/saveFile.d.ts +15 -0
- package/functions/saveFile.lua +106 -0
- package/index.d.ts +3 -0
- package/index.lua +23 -0
- package/initCustomCallbacks.lua +3 -0
- package/initFeatures.lua +3 -0
- package/interfaces/AddCallbackParameterCustom.d.ts +2 -0
- package/objects/callbackRegisterFunctions.lua +3 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
2
3
|
local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
|
|
3
4
|
local ____exports = {}
|
|
4
5
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
@@ -16,6 +17,79 @@ local isCharacter = ____player.isCharacter
|
|
|
16
17
|
local ____utils = require("functions.utils")
|
|
17
18
|
local ensureAllCases = ____utils.ensureAllCases
|
|
18
19
|
local ____repeat = ____utils["repeat"]
|
|
20
|
+
function ____exports.removeAllPlayerHealth(self, player)
|
|
21
|
+
local goldenHearts = player:GetGoldenHearts()
|
|
22
|
+
local eternalHearts = player:GetEternalHearts()
|
|
23
|
+
local boneHearts = player:GetBoneHearts()
|
|
24
|
+
local brokenHearts = player:GetBrokenHearts()
|
|
25
|
+
player:AddGoldenHearts(goldenHearts * -1)
|
|
26
|
+
player:AddEternalHearts(eternalHearts * -1)
|
|
27
|
+
player:AddBoneHearts(boneHearts * -1)
|
|
28
|
+
player:AddBrokenHearts(brokenHearts * -1)
|
|
29
|
+
player:AddMaxHearts(MAX_PLAYER_HEART_CONTAINERS * -2, true)
|
|
30
|
+
player:AddSoulHearts(MAX_PLAYER_HEART_CONTAINERS * -2)
|
|
31
|
+
if isCharacter(nil, player, PlayerType.THE_SOUL) then
|
|
32
|
+
local forgotten = player:GetSubPlayer()
|
|
33
|
+
if forgotten ~= nil then
|
|
34
|
+
local forgottenBoneHearts = forgotten:GetBoneHearts()
|
|
35
|
+
forgotten:AddBoneHearts(forgottenBoneHearts * -1)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
--- Helper function to set a player's health to a specific state. You can use this in combination
|
|
40
|
+
-- with the `getPlayerHealth` function to restore the player's health back to a certain
|
|
41
|
+
-- configuration at a later time.
|
|
42
|
+
--
|
|
43
|
+
-- Based on the `REVEL.LoadHealth` function in the Revelations mod.
|
|
44
|
+
function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
45
|
+
local character = player:GetPlayerType()
|
|
46
|
+
local subPlayer = player:GetSubPlayer()
|
|
47
|
+
____exports.removeAllPlayerHealth(nil, player)
|
|
48
|
+
if character == PlayerType.THE_SOUL and subPlayer ~= nil then
|
|
49
|
+
subPlayer:AddMaxHearts(playerHealth.maxHearts, false)
|
|
50
|
+
else
|
|
51
|
+
player:AddMaxHearts(playerHealth.maxHearts, false)
|
|
52
|
+
end
|
|
53
|
+
player:AddEternalHearts(playerHealth.eternalHearts)
|
|
54
|
+
local soulHeartsRemaining = playerHealth.soulHearts
|
|
55
|
+
__TS__ArrayForEach(
|
|
56
|
+
playerHealth.soulHeartTypes,
|
|
57
|
+
function(____, heartType, i)
|
|
58
|
+
local isHalf = playerHealth.soulHearts + playerHealth.boneHearts * 2 < (i + 1) * 2
|
|
59
|
+
local addAmount = 2
|
|
60
|
+
if isHalf or heartType == HeartSubType.BONE or soulHeartsRemaining < 2 then
|
|
61
|
+
addAmount = 1
|
|
62
|
+
end
|
|
63
|
+
if heartType == HeartSubType.SOUL then
|
|
64
|
+
player:AddSoulHearts(addAmount)
|
|
65
|
+
soulHeartsRemaining = soulHeartsRemaining - addAmount
|
|
66
|
+
elseif heartType == HeartSubType.BLACK then
|
|
67
|
+
player:AddBlackHearts(addAmount)
|
|
68
|
+
soulHeartsRemaining = soulHeartsRemaining - addAmount
|
|
69
|
+
elseif heartType == HeartSubType.BONE then
|
|
70
|
+
player:AddBoneHearts(addAmount)
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
)
|
|
74
|
+
player:AddRottenHearts(playerHealth.rottenHearts)
|
|
75
|
+
____repeat(
|
|
76
|
+
nil,
|
|
77
|
+
playerHealth.hearts,
|
|
78
|
+
function()
|
|
79
|
+
player:AddHearts(1)
|
|
80
|
+
if character == PlayerType.MAGDALENE_B then
|
|
81
|
+
player:AddHearts(-1)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
)
|
|
85
|
+
player:AddGoldenHearts(playerHealth.goldenHearts)
|
|
86
|
+
player:AddBrokenHearts(playerHealth.brokenHearts)
|
|
87
|
+
if character == PlayerType.BETHANY then
|
|
88
|
+
player:SetSoulCharge(playerHealth.soulCharges)
|
|
89
|
+
elseif character == PlayerType.BETHANY_B then
|
|
90
|
+
player:SetBloodCharge(playerHealth.bloodCharges)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
19
93
|
function ____exports.addPlayerHealthType(self, player, healthType, numHearts)
|
|
20
94
|
repeat
|
|
21
95
|
local ____switch3 = healthType
|
|
@@ -220,77 +294,22 @@ function ____exports.getPlayerHealthType(self, player, healthType)
|
|
|
220
294
|
end
|
|
221
295
|
until true
|
|
222
296
|
end
|
|
223
|
-
function ____exports.
|
|
224
|
-
local
|
|
225
|
-
local eternalHearts = player:GetEternalHearts()
|
|
226
|
-
local boneHearts = player:GetBoneHearts()
|
|
227
|
-
local brokenHearts = player:GetBrokenHearts()
|
|
228
|
-
player:AddGoldenHearts(goldenHearts * -1)
|
|
229
|
-
player:AddEternalHearts(eternalHearts * -1)
|
|
230
|
-
player:AddBoneHearts(boneHearts * -1)
|
|
231
|
-
player:AddBrokenHearts(brokenHearts * -1)
|
|
232
|
-
player:AddMaxHearts(MAX_PLAYER_HEART_CONTAINERS * -2, true)
|
|
233
|
-
player:AddSoulHearts(MAX_PLAYER_HEART_CONTAINERS * -2)
|
|
234
|
-
if isCharacter(nil, player, PlayerType.THE_SOUL) then
|
|
235
|
-
local forgotten = player:GetSubPlayer()
|
|
236
|
-
if forgotten ~= nil then
|
|
237
|
-
local forgottenBoneHearts = forgotten:GetBoneHearts()
|
|
238
|
-
forgotten:AddBoneHearts(forgottenBoneHearts * -1)
|
|
239
|
-
end
|
|
240
|
-
end
|
|
241
|
-
end
|
|
242
|
-
--- Helper function to set a player's health to a specific state. You can use this in combination
|
|
243
|
-
-- with the `getPlayerHealth` function to restore the player's health back to a certain
|
|
244
|
-
-- configuration at a later time.
|
|
245
|
-
--
|
|
246
|
-
-- Based on the `REVEL.LoadHealth` function in the Revelations mod.
|
|
247
|
-
function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
248
|
-
local character = player:GetPlayerType()
|
|
249
|
-
local subPlayer = player:GetSubPlayer()
|
|
297
|
+
function ____exports.playerConvertBlackHeartsToSoulHearts(self, player)
|
|
298
|
+
local playerHealth = ____exports.getPlayerHealth(nil, player)
|
|
250
299
|
____exports.removeAllPlayerHealth(nil, player)
|
|
251
|
-
|
|
252
|
-
subPlayer:AddMaxHearts(playerHealth.maxHearts, false)
|
|
253
|
-
else
|
|
254
|
-
player:AddMaxHearts(playerHealth.maxHearts, false)
|
|
255
|
-
end
|
|
256
|
-
player:AddEternalHearts(playerHealth.eternalHearts)
|
|
257
|
-
local soulHeartsRemaining = playerHealth.soulHearts
|
|
258
|
-
__TS__ArrayForEach(
|
|
300
|
+
playerHealth.soulHeartTypes = __TS__ArrayMap(
|
|
259
301
|
playerHealth.soulHeartTypes,
|
|
260
|
-
function(____,
|
|
261
|
-
local isHalf = playerHealth.soulHearts + playerHealth.boneHearts * 2 < (i + 1) * 2
|
|
262
|
-
local addAmount = 2
|
|
263
|
-
if isHalf or heartType == HeartSubType.BONE or soulHeartsRemaining < 2 then
|
|
264
|
-
addAmount = 1
|
|
265
|
-
end
|
|
266
|
-
if heartType == HeartSubType.SOUL then
|
|
267
|
-
player:AddSoulHearts(addAmount)
|
|
268
|
-
soulHeartsRemaining = soulHeartsRemaining - addAmount
|
|
269
|
-
elseif heartType == HeartSubType.BLACK then
|
|
270
|
-
player:AddBlackHearts(addAmount)
|
|
271
|
-
soulHeartsRemaining = soulHeartsRemaining - addAmount
|
|
272
|
-
elseif heartType == HeartSubType.BONE then
|
|
273
|
-
player:AddBoneHearts(addAmount)
|
|
274
|
-
end
|
|
275
|
-
end
|
|
302
|
+
function(____, soulHeartType) return soulHeartType == HeartSubType.BLACK and HeartSubType.SOUL or soulHeartType end
|
|
276
303
|
)
|
|
277
|
-
player
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
end
|
|
286
|
-
end
|
|
304
|
+
____exports.setPlayerHealth(nil, player, playerHealth)
|
|
305
|
+
end
|
|
306
|
+
function ____exports.playerConvertSoulHeartsToBlackHearts(self, player)
|
|
307
|
+
local playerHealth = ____exports.getPlayerHealth(nil, player)
|
|
308
|
+
____exports.removeAllPlayerHealth(nil, player)
|
|
309
|
+
playerHealth.soulHeartTypes = __TS__ArrayMap(
|
|
310
|
+
playerHealth.soulHeartTypes,
|
|
311
|
+
function(____, soulHeartType) return soulHeartType == HeartSubType.SOUL and HeartSubType.BLACK or soulHeartType end
|
|
287
312
|
)
|
|
288
|
-
player
|
|
289
|
-
player:AddBrokenHearts(playerHealth.brokenHearts)
|
|
290
|
-
if character == PlayerType.BETHANY then
|
|
291
|
-
player:SetSoulCharge(playerHealth.soulCharges)
|
|
292
|
-
elseif character == PlayerType.BETHANY_B then
|
|
293
|
-
player:SetBloodCharge(playerHealth.bloodCharges)
|
|
294
|
-
end
|
|
313
|
+
____exports.setPlayerHealth(nil, player, playerHealth)
|
|
295
314
|
end
|
|
296
315
|
return ____exports
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CollectibleType, ItemPoolType } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to see if the given collectible is unlocked on the player's save file. This
|
|
4
|
+
* requires providing the corresponding item pool that the collectible is located in.
|
|
5
|
+
*
|
|
6
|
+
* - If any player currently has the item, then it is assumed to be unlocked. (This is because Eden
|
|
7
|
+
* may have randomly started with the provided collectible, and it will be subsequently removed
|
|
8
|
+
* from all pools.)
|
|
9
|
+
* - If the collectible is located in more than one item pool, then any item pool can be provided.
|
|
10
|
+
* - If the collectible is not located in any item pools, then this function will always return
|
|
11
|
+
* false.
|
|
12
|
+
* - If any player is Tainted Lost, they will be temporarily changed to Isaac and then temporarily
|
|
13
|
+
* changed back (because Tainted Lost is not able to retrieve some collectibles from item pools).
|
|
14
|
+
*/
|
|
15
|
+
export declare function isCollectibleUnlocked(collectibleTypeToCheckFor: CollectibleType, itemPoolToCheckFor: ItemPoolType): boolean;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local Set = ____lualib.Set
|
|
5
|
+
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
6
|
+
local ____exports = {}
|
|
7
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
8
|
+
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
9
|
+
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
10
|
+
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
11
|
+
local ____cachedClasses = require("cachedClasses")
|
|
12
|
+
local game = ____cachedClasses.game
|
|
13
|
+
local ____collectibleSet = require("functions.collectibleSet")
|
|
14
|
+
local getCollectibleSet = ____collectibleSet.getCollectibleSet
|
|
15
|
+
local ____player = require("functions.player")
|
|
16
|
+
local anyPlayerHasCollectible = ____player.anyPlayerHasCollectible
|
|
17
|
+
local getPlayersOfType = ____player.getPlayersOfType
|
|
18
|
+
local ____playerDataStructures = require("functions.playerDataStructures")
|
|
19
|
+
local mapGetPlayer = ____playerDataStructures.mapGetPlayer
|
|
20
|
+
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
21
|
+
local ____playerIndex = require("functions.playerIndex")
|
|
22
|
+
local getPlayers = ____playerIndex.getPlayers
|
|
23
|
+
local ____utils = require("functions.utils")
|
|
24
|
+
local ____repeat = ____utils["repeat"]
|
|
25
|
+
local COLLECTIBLES_THAT_AFFECT_ITEM_POOLS = {CollectibleType.CHAOS, CollectibleType.SACRED_ORB, CollectibleType.TMTRAINER}
|
|
26
|
+
local TRINKETS_THAT_AFFECT_ITEM_POOLS = {TrinketType.NO}
|
|
27
|
+
--- Helper function to see if the given collectible is unlocked on the player's save file. This
|
|
28
|
+
-- requires providing the corresponding item pool that the collectible is located in.
|
|
29
|
+
--
|
|
30
|
+
-- - If any player currently has the item, then it is assumed to be unlocked. (This is because Eden
|
|
31
|
+
-- may have randomly started with the provided collectible, and it will be subsequently removed
|
|
32
|
+
-- from all pools.)
|
|
33
|
+
-- - If the collectible is located in more than one item pool, then any item pool can be provided.
|
|
34
|
+
-- - If the collectible is not located in any item pools, then this function will always return
|
|
35
|
+
-- false.
|
|
36
|
+
-- - If any player is Tainted Lost, they will be temporarily changed to Isaac and then temporarily
|
|
37
|
+
-- changed back (because Tainted Lost is not able to retrieve some collectibles from item pools).
|
|
38
|
+
function ____exports.isCollectibleUnlocked(self, collectibleTypeToCheckFor, itemPoolToCheckFor)
|
|
39
|
+
if anyPlayerHasCollectible(nil, collectibleTypeToCheckFor) then
|
|
40
|
+
return true
|
|
41
|
+
end
|
|
42
|
+
local taintedLosts = getPlayersOfType(nil, PlayerType.THE_LOST_B)
|
|
43
|
+
for ____, player in ipairs(taintedLosts) do
|
|
44
|
+
player:ChangePlayerType(PlayerType.ISAAC)
|
|
45
|
+
end
|
|
46
|
+
local removedItemsMap = __TS__New(Map)
|
|
47
|
+
local removedTrinketsMap = __TS__New(Map)
|
|
48
|
+
for ____, player in ipairs(getPlayers(nil)) do
|
|
49
|
+
local removedItems = {}
|
|
50
|
+
for ____, itemToRemove in ipairs(COLLECTIBLES_THAT_AFFECT_ITEM_POOLS) do
|
|
51
|
+
if player:HasCollectible(itemToRemove) then
|
|
52
|
+
local numCollectibles = player:GetCollectibleNum(itemToRemove)
|
|
53
|
+
____repeat(
|
|
54
|
+
nil,
|
|
55
|
+
numCollectibles,
|
|
56
|
+
function()
|
|
57
|
+
player:RemoveCollectible(itemToRemove)
|
|
58
|
+
removedItems[#removedItems + 1] = itemToRemove
|
|
59
|
+
end
|
|
60
|
+
)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
mapSetPlayer(nil, removedItemsMap, player, removedItems)
|
|
64
|
+
local removedTrinkets = {}
|
|
65
|
+
for ____, trinketToRemove in ipairs(TRINKETS_THAT_AFFECT_ITEM_POOLS) do
|
|
66
|
+
if player:HasTrinket(trinketToRemove) then
|
|
67
|
+
local numTrinkets = player:GetTrinketMultiplier(trinketToRemove)
|
|
68
|
+
____repeat(
|
|
69
|
+
nil,
|
|
70
|
+
numTrinkets,
|
|
71
|
+
function()
|
|
72
|
+
player:TryRemoveTrinket(trinketToRemove)
|
|
73
|
+
removedTrinkets[#removedTrinkets + 1] = trinketToRemove
|
|
74
|
+
end
|
|
75
|
+
)
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
mapSetPlayer(nil, removedTrinketsMap, player, removedTrinkets)
|
|
79
|
+
end
|
|
80
|
+
local itemPool = game:GetItemPool()
|
|
81
|
+
local collectibleSet = getCollectibleSet(nil)
|
|
82
|
+
for ____, collectibleType in __TS__Iterator(collectibleSet:values()) do
|
|
83
|
+
if collectibleType ~= collectibleTypeToCheckFor then
|
|
84
|
+
itemPool:AddRoomBlacklist(collectibleType)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
local retrievedCollectibleType = itemPool:GetCollectible(itemPoolToCheckFor, false, 1)
|
|
88
|
+
local collectibleUnlocked = retrievedCollectibleType == collectibleTypeToCheckFor
|
|
89
|
+
itemPool:ResetRoomBlacklist()
|
|
90
|
+
for ____, player in ipairs(getPlayers(nil)) do
|
|
91
|
+
local removedItems = mapGetPlayer(nil, removedItemsMap, player)
|
|
92
|
+
if removedItems ~= nil then
|
|
93
|
+
for ____, collectibleType in ipairs(removedItems) do
|
|
94
|
+
player:AddCollectible(collectibleType, 0, false)
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
local removedTrinkets = mapGetPlayer(nil, removedTrinketsMap, player)
|
|
98
|
+
if removedTrinkets ~= nil then
|
|
99
|
+
for ____, trinketType in ipairs(removedTrinkets) do
|
|
100
|
+
player:AddTrinket(trinketType, false)
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
return collectibleUnlocked
|
|
105
|
+
end
|
|
106
|
+
return ____exports
|
package/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { removeFadeIn, restoreFadeIn } from "./features/fadeInRemover";
|
|
|
20
20
|
export { disableFastReset, enableFastReset } from "./features/fastReset";
|
|
21
21
|
export { forgottenSwitch } from "./features/forgottenSwitch";
|
|
22
22
|
export { getCollectibleItemPoolType } from "./features/getCollectibleItemPoolType";
|
|
23
|
+
export { removePersistentEntity, spawnPersistentEntity, } from "./features/persistentEntities";
|
|
23
24
|
export { addCollectible, getPlayerInventory } from "./features/playerInventory";
|
|
24
25
|
export * from "./features/ponyDetection";
|
|
25
26
|
export { preventCollectibleRotation } from "./features/preventCollectibleRotation";
|
|
@@ -30,6 +31,7 @@ export { getTaintedLazarusSubPlayer } from "./features/taintedLazarusPlayers";
|
|
|
30
31
|
export * from "./functions/array";
|
|
31
32
|
export * from "./functions/benchmark";
|
|
32
33
|
export * from "./functions/bitwise";
|
|
34
|
+
export * from "./functions/bombs";
|
|
33
35
|
export * from "./functions/boss";
|
|
34
36
|
export * from "./functions/cacheFlag";
|
|
35
37
|
export * from "./functions/cards";
|
|
@@ -88,6 +90,7 @@ export * from "./functions/roomGrid";
|
|
|
88
90
|
export * from "./functions/rooms";
|
|
89
91
|
export * from "./functions/roomShape";
|
|
90
92
|
export * from "./functions/run";
|
|
93
|
+
export * from "./functions/saveFile";
|
|
91
94
|
export * from "./functions/seeds";
|
|
92
95
|
export * from "./functions/serialization";
|
|
93
96
|
export * from "./functions/set";
|
package/index.lua
CHANGED
|
@@ -167,6 +167,13 @@ do
|
|
|
167
167
|
local getCollectibleItemPoolType = ____getCollectibleItemPoolType.getCollectibleItemPoolType
|
|
168
168
|
____exports.getCollectibleItemPoolType = getCollectibleItemPoolType
|
|
169
169
|
end
|
|
170
|
+
do
|
|
171
|
+
local ____persistentEntities = require("features.persistentEntities")
|
|
172
|
+
local removePersistentEntity = ____persistentEntities.removePersistentEntity
|
|
173
|
+
local spawnPersistentEntity = ____persistentEntities.spawnPersistentEntity
|
|
174
|
+
____exports.removePersistentEntity = removePersistentEntity
|
|
175
|
+
____exports.spawnPersistentEntity = spawnPersistentEntity
|
|
176
|
+
end
|
|
170
177
|
do
|
|
171
178
|
local ____playerInventory = require("features.playerInventory")
|
|
172
179
|
local addCollectible = ____playerInventory.addCollectible
|
|
@@ -242,6 +249,14 @@ do
|
|
|
242
249
|
end
|
|
243
250
|
end
|
|
244
251
|
end
|
|
252
|
+
do
|
|
253
|
+
local ____export = require("functions.bombs")
|
|
254
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
255
|
+
if ____exportKey ~= "default" then
|
|
256
|
+
____exports[____exportKey] = ____exportValue
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
end
|
|
245
260
|
do
|
|
246
261
|
local ____export = require("functions.boss")
|
|
247
262
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -697,6 +712,14 @@ do
|
|
|
697
712
|
end
|
|
698
713
|
end
|
|
699
714
|
end
|
|
715
|
+
do
|
|
716
|
+
local ____export = require("functions.saveFile")
|
|
717
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
718
|
+
if ____exportKey ~= "default" then
|
|
719
|
+
____exports[____exportKey] = ____exportValue
|
|
720
|
+
end
|
|
721
|
+
end
|
|
722
|
+
end
|
|
700
723
|
do
|
|
701
724
|
local ____export = require("functions.seeds")
|
|
702
725
|
for ____exportKey, ____exportValue in pairs(____export) do
|
package/initCustomCallbacks.lua
CHANGED
|
@@ -51,6 +51,8 @@ local ____postNPCStateChanged = require("callbacks.postNPCStateChanged")
|
|
|
51
51
|
local postNPCStateChangedCallbackInit = ____postNPCStateChanged.postNPCStateChangedCallbackInit
|
|
52
52
|
local ____postPickupCollect = require("callbacks.postPickupCollect")
|
|
53
53
|
local postPickupCollectCallbackInit = ____postPickupCollect.postPickupCollectCallbackInit
|
|
54
|
+
local ____postPickupInitFirst = require("callbacks.postPickupInitFirst")
|
|
55
|
+
local postPickupInitFirstCallbackInit = ____postPickupInitFirst.postPickupInitFirstCallbackInit
|
|
54
56
|
local ____postPickupInitLate = require("callbacks.postPickupInitLate")
|
|
55
57
|
local postPickupInitLateCallbackInit = ____postPickupInitLate.postPickupInitLateCallbackInit
|
|
56
58
|
local ____postPickupStateChanged = require("callbacks.postPickupStateChanged")
|
|
@@ -144,6 +146,7 @@ function ____exports.initCustomCallbacks(self, mod)
|
|
|
144
146
|
postNPCInitLateCallbackInit(nil, mod)
|
|
145
147
|
postNPCStateChangedCallbackInit(nil, mod)
|
|
146
148
|
postPickupCollectCallbackInit(nil, mod)
|
|
149
|
+
postPickupInitFirstCallbackInit(nil, mod)
|
|
147
150
|
postPickupInitLateCallbackInit(nil, mod)
|
|
148
151
|
postPickupStateChangedCallbackInit(nil, mod)
|
|
149
152
|
postPitRenderInit(nil, mod)
|
package/initFeatures.lua
CHANGED
|
@@ -17,6 +17,8 @@ local ____forgottenSwitch = require("features.forgottenSwitch")
|
|
|
17
17
|
local forgottenSwitchInit = ____forgottenSwitch.forgottenSwitchInit
|
|
18
18
|
local ____getCollectibleItemPoolType = require("features.getCollectibleItemPoolType")
|
|
19
19
|
local getCollectibleItemPoolTypeInit = ____getCollectibleItemPoolType.getCollectibleItemPoolTypeInit
|
|
20
|
+
local ____persistentEntities = require("features.persistentEntities")
|
|
21
|
+
local persistentEntitiesInit = ____persistentEntities.persistentEntitiesInit
|
|
20
22
|
local ____playerInventory = require("features.playerInventory")
|
|
21
23
|
local playerInventoryInit = ____playerInventory.playerInventoryInit
|
|
22
24
|
local ____ponyDetection = require("features.ponyDetection")
|
|
@@ -42,6 +44,7 @@ function ____exports.initFeaturesMinor(self, mod)
|
|
|
42
44
|
fastResetInit(nil, mod)
|
|
43
45
|
forgottenSwitchInit(nil, mod)
|
|
44
46
|
getCollectibleItemPoolTypeInit(nil, mod)
|
|
47
|
+
persistentEntitiesInit(nil, mod)
|
|
45
48
|
playerInventoryInit(nil, mod)
|
|
46
49
|
ponyDetectionInit(nil, mod)
|
|
47
50
|
preventCollectibleRotationInit(nil, mod)
|
|
@@ -35,6 +35,7 @@ import { PostNPCInitLateRegisterParameters } from "../callbacks/subscriptions/po
|
|
|
35
35
|
import { PostNPCStateChangedRegisterParameters } from "../callbacks/subscriptions/postNPCStateChanged";
|
|
36
36
|
import { PostPEffectUpdateReorderedRegisterParameters } from "../callbacks/subscriptions/postPEffectUpdateReordered";
|
|
37
37
|
import { PostPickupCollectRegisterParameters } from "../callbacks/subscriptions/postPickupCollect";
|
|
38
|
+
import { PostPickupInitFirstRegisterParameters } from "../callbacks/subscriptions/postPickupInitFirst";
|
|
38
39
|
import { PostPickupInitLateRegisterParameters } from "../callbacks/subscriptions/postPickupInitLate";
|
|
39
40
|
import { PostPickupStateChangedRegisterParameters } from "../callbacks/subscriptions/postPickupStateChanged";
|
|
40
41
|
import { PostPitRenderRegisterParameters } from "../callbacks/subscriptions/postPitRender";
|
|
@@ -112,6 +113,7 @@ export interface AddCallbackParameterCustom {
|
|
|
112
113
|
[ModCallbackCustom.POST_NPC_STATE_CHANGED]: PostNPCStateChangedRegisterParameters;
|
|
113
114
|
[ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED]: PostPEffectUpdateReorderedRegisterParameters;
|
|
114
115
|
[ModCallbackCustom.POST_PICKUP_COLLECT]: PostPickupCollectRegisterParameters;
|
|
116
|
+
[ModCallbackCustom.POST_PICKUP_INIT_FIRST]: PostPickupInitFirstRegisterParameters;
|
|
115
117
|
[ModCallbackCustom.POST_PICKUP_INIT_LATE]: PostPickupInitLateRegisterParameters;
|
|
116
118
|
[ModCallbackCustom.POST_PICKUP_STATE_CHANGED]: PostPickupStateChangedRegisterParameters;
|
|
117
119
|
[ModCallbackCustom.POST_PIT_RENDER]: PostPitRenderRegisterParameters;
|
|
@@ -73,6 +73,8 @@ local ____postPEffectUpdateReordered = require("callbacks.subscriptions.postPEff
|
|
|
73
73
|
local postPEffectUpdateReorderedRegister = ____postPEffectUpdateReordered.postPEffectUpdateReorderedRegister
|
|
74
74
|
local ____postPickupCollect = require("callbacks.subscriptions.postPickupCollect")
|
|
75
75
|
local postPickupCollectRegister = ____postPickupCollect.postPickupCollectRegister
|
|
76
|
+
local ____postPickupInitFirst = require("callbacks.subscriptions.postPickupInitFirst")
|
|
77
|
+
local postPickupInitFirstRegister = ____postPickupInitFirst.postPickupInitFirstRegister
|
|
76
78
|
local ____postPickupInitLate = require("callbacks.subscriptions.postPickupInitLate")
|
|
77
79
|
local postPickupInitLateRegister = ____postPickupInitLate.postPickupInitLateRegister
|
|
78
80
|
local ____postPickupStateChanged = require("callbacks.subscriptions.postPickupStateChanged")
|
|
@@ -189,6 +191,7 @@ ____exports.CALLBACK_REGISTER_FUNCTIONS = {
|
|
|
189
191
|
[ModCallbackCustom.POST_NPC_STATE_CHANGED] = postNPCStateChangedRegister,
|
|
190
192
|
[ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED] = postPEffectUpdateReorderedRegister,
|
|
191
193
|
[ModCallbackCustom.POST_PICKUP_COLLECT] = postPickupCollectRegister,
|
|
194
|
+
[ModCallbackCustom.POST_PICKUP_INIT_FIRST] = postPickupInitFirstRegister,
|
|
192
195
|
[ModCallbackCustom.POST_PICKUP_INIT_LATE] = postPickupInitLateRegister,
|
|
193
196
|
[ModCallbackCustom.POST_PICKUP_STATE_CHANGED] = postPickupStateChangedRegister,
|
|
194
197
|
[ModCallbackCustom.POST_PIT_RENDER] = postPitRenderRegister,
|