isaacscript-common 1.2.109 → 1.2.110
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.
|
@@ -8,7 +8,7 @@ local Set = ____lualib.Set
|
|
|
8
8
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
9
9
|
local __TS__ArrayFind = ____lualib.__TS__ArrayFind
|
|
10
10
|
local ____exports = {}
|
|
11
|
-
local hasSubscriptions, postUpdate, checkPickupsPurchased,
|
|
11
|
+
local hasSubscriptions, postUpdate, checkPickupsPurchased, getPlayerThatIsNoLongerHoldingAnItem, storePickupsInMap, storePlayersInMap, v
|
|
12
12
|
local ____exports = require("features.saveDataManager.exports")
|
|
13
13
|
local saveDataManager = ____exports.saveDataManager
|
|
14
14
|
local ____pickups = require("functions.pickups")
|
|
@@ -35,19 +35,9 @@ function postUpdate(self)
|
|
|
35
35
|
pickups,
|
|
36
36
|
function(____, pickup) return pickup:Exists() and pickup.Price ~= 0 end
|
|
37
37
|
)
|
|
38
|
-
local nonCollectiblesWithPrice = __TS__ArrayFilter(
|
|
39
|
-
pickupsWithPrice,
|
|
40
|
-
function(____, pickup) return pickup.Variant ~= PickupVariant.PICKUP_COLLECTIBLE end
|
|
41
|
-
)
|
|
42
|
-
local collectiblesWithPrice = __TS__ArrayFilter(
|
|
43
|
-
pickupsWithPrice,
|
|
44
|
-
function(____, pickup) return pickup.Variant == PickupVariant.PICKUP_COLLECTIBLE end
|
|
45
|
-
)
|
|
46
38
|
local players = getPlayers(nil)
|
|
47
|
-
checkPickupsPurchased(nil,
|
|
48
|
-
|
|
49
|
-
storePickupsInMap(nil, nonCollectiblesWithPrice)
|
|
50
|
-
storeCollectiblesInMap(nil, collectiblesWithPrice)
|
|
39
|
+
checkPickupsPurchased(nil, pickupsWithPrice, players)
|
|
40
|
+
storePickupsInMap(nil, pickupsWithPrice)
|
|
51
41
|
storePlayersInMap(nil, players)
|
|
52
42
|
end
|
|
53
43
|
function checkPickupsPurchased(self, nonCollectiblesWithPrice, players)
|
|
@@ -61,31 +51,14 @@ function checkPickupsPurchased(self, nonCollectiblesWithPrice, players)
|
|
|
61
51
|
local pickupDescription = ____value[2]
|
|
62
52
|
do
|
|
63
53
|
if pickupIndexSet:has(index) then
|
|
64
|
-
goto
|
|
54
|
+
goto __continue9
|
|
65
55
|
end
|
|
66
56
|
local player = getPlayerThatIsNoLongerHoldingAnItem(nil, players)
|
|
67
57
|
if player ~= nil then
|
|
68
58
|
postPurchaseFire(nil, player, pickupDescription)
|
|
69
59
|
end
|
|
70
60
|
end
|
|
71
|
-
::
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
function checkCollectiblesPurchased(self, collectiblesWithPrice, players)
|
|
75
|
-
for ____, collectible in ipairs(collectiblesWithPrice) do
|
|
76
|
-
do
|
|
77
|
-
local pickupDescription = v.room.collectibleMap:get(collectible.Index)
|
|
78
|
-
if pickupDescription == nil then
|
|
79
|
-
goto __continue16
|
|
80
|
-
end
|
|
81
|
-
if pickupDescription.subType ~= collectible.SubType and collectible.SubType == CollectibleType.COLLECTIBLE_NULL then
|
|
82
|
-
local player = getPlayerThatIsNoLongerHoldingAnItem(nil, players)
|
|
83
|
-
if player ~= nil then
|
|
84
|
-
postPurchaseFire(nil, player, pickupDescription)
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
::__continue16::
|
|
61
|
+
::__continue9::
|
|
89
62
|
end
|
|
90
63
|
end
|
|
91
64
|
function getPlayerThatIsNoLongerHoldingAnItem(self, players)
|
|
@@ -106,13 +79,6 @@ function storePickupsInMap(self, nonCollectiblesWithPrice)
|
|
|
106
79
|
v.room.pickupMap:set(pickup.Index, pickupDescription)
|
|
107
80
|
end
|
|
108
81
|
end
|
|
109
|
-
function storeCollectiblesInMap(self, collectiblesWithPrice)
|
|
110
|
-
v.room.collectibleMap:clear()
|
|
111
|
-
for ____, collectible in ipairs(collectiblesWithPrice) do
|
|
112
|
-
local pickupDescription = getPickupDescription(nil, collectible)
|
|
113
|
-
v.room.collectibleMap:set(collectible.Index, pickupDescription)
|
|
114
|
-
end
|
|
115
|
-
end
|
|
116
82
|
function storePlayersInMap(self, players)
|
|
117
83
|
for ____, player in ipairs(players) do
|
|
118
84
|
local playerIndex = getPlayerIndex(nil, player)
|
|
@@ -122,7 +88,6 @@ function storePlayersInMap(self, players)
|
|
|
122
88
|
end
|
|
123
89
|
v = {room = {
|
|
124
90
|
pickupMap = __TS__New(Map),
|
|
125
|
-
collectibleMap = __TS__New(Map),
|
|
126
91
|
playersHoldingItemOnLastFrameMap = __TS__New(DefaultMap, false)
|
|
127
92
|
}}
|
|
128
93
|
function ____exports.postPurchaseCallbackInit(self, mod)
|