isaacscript-common 1.0.488 → 1.0.489
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/README.md +2 -0
- package/dist/callbacks/itemPickup.lua +2 -6
- package/dist/callbacks/postBombInitLate.lua +6 -8
- package/dist/callbacks/postCursedTeleport.lua +8 -10
- package/dist/callbacks/postEffectInitLate.lua +6 -8
- package/dist/callbacks/postEsauJr.lua +2 -4
- package/dist/callbacks/postFamiliarInitLate.lua +6 -8
- package/dist/callbacks/postFlip.lua +2 -4
- package/dist/callbacks/postGridEntity.lua +8 -18
- package/dist/callbacks/postKnifeInitLate.lua +6 -8
- package/dist/callbacks/postLaserInitLate.lua +6 -8
- package/dist/callbacks/postNPCInitLate.lua +6 -8
- package/dist/callbacks/postPickupCollect.lua +1 -5
- package/dist/callbacks/postPickupInitLate.lua +6 -8
- package/dist/callbacks/postPlayerChangeHealth.lua +9 -13
- package/dist/callbacks/postPlayerChangeType.lua +1 -5
- package/dist/callbacks/postPlayerFatalDamage.lua +2 -2
- package/dist/callbacks/postPlayerInitLate.lua +1 -5
- package/dist/callbacks/postPlayerReordered.lua +1 -1
- package/dist/callbacks/postProjectileInitLate.lua +6 -8
- package/dist/callbacks/postPurchase.lua +10 -14
- package/dist/callbacks/postSacrifice.lua +3 -3
- package/dist/callbacks/postSlotInitUpdate.lua +3 -11
- package/dist/callbacks/postSlotRenderBroken.lua +2 -8
- package/dist/callbacks/postTearInitLate.lua +6 -8
- package/dist/callbacks/postTransformation.lua +1 -5
- package/dist/callbacks/reorderedCallbacks.lua +4 -4
- package/dist/callbacks/subscriptions/postBombInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postCursedTeleport.lua +1 -1
- package/dist/callbacks/subscriptions/postCustomRevive.lua +3 -3
- package/dist/callbacks/subscriptions/postEffectInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postEsauJr.lua +1 -1
- package/dist/callbacks/subscriptions/postFamiliarInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postFirstEsauJr.lua +1 -1
- package/dist/callbacks/subscriptions/postFirstFlip.lua +1 -1
- package/dist/callbacks/subscriptions/postFlip.lua +1 -1
- package/dist/callbacks/subscriptions/postGameStartedReordered.lua +1 -1
- package/dist/callbacks/subscriptions/postGridEntityInit.lua +3 -3
- package/dist/callbacks/subscriptions/postGridEntityRemove.lua +3 -3
- package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postItemPickup.lua +5 -5
- package/dist/callbacks/subscriptions/postKnifeInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postLaserInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postNPCInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postNewLevelReordered.lua +1 -1
- package/dist/callbacks/subscriptions/postNewRoomReordered.lua +1 -1
- package/dist/callbacks/subscriptions/postPickupCollect.lua +3 -3
- package/dist/callbacks/subscriptions/postPickupInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerChangeType.lua +1 -1
- package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerInitReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerRenderReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerUpdateReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postProjectileInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPurchase.lua +8 -2
- package/dist/callbacks/subscriptions/postSacrifice.lua +1 -1
- package/dist/callbacks/subscriptions/postSlotDestroyed.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotInit.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotRender.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postTearInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postTransformation.lua +3 -3
- package/dist/callbacks/subscriptions/preCustomRevive.lua +1 -1
- package/dist/callbacks/subscriptions/preItemPickup.lua +5 -5
- package/dist/constants.lua +38 -4
- package/dist/features/deployJSONRoom.lua +90 -61
- package/dist/features/disableInputs.lua +9 -3
- package/dist/features/forgottenSwitch.lua +1 -1
- package/dist/features/getCollectibleItemPoolType.lua +10 -14
- package/dist/features/preventCollectibleRotate.lua +3 -9
- package/dist/features/saveDataManager/load.lua +2 -6
- package/dist/features/saveDataManager/main.lua +1 -1
- package/dist/features/saveDataManager/merge.lua +2 -4
- package/dist/features/sirenHelpers.lua +5 -5
- package/dist/functions/array.lua +5 -7
- package/dist/functions/bitwise.lua +1 -1
- package/dist/functions/charge.lua +10 -12
- package/dist/functions/collectibles.d.ts +1 -0
- package/dist/functions/collectibles.lua +26 -21
- package/dist/functions/color.lua +9 -1
- package/dist/functions/deepCopy.lua +42 -22
- package/dist/functions/deepCopyTests.lua +12 -20
- package/dist/functions/doors.lua +7 -19
- package/dist/functions/entity.lua +7 -1
- package/dist/functions/flag.lua +1 -1
- package/dist/functions/gridEntity.lua +13 -8
- package/dist/functions/input.lua +14 -18
- package/dist/functions/jsonRoom.lua +3 -9
- package/dist/functions/language.lua +9 -1
- package/dist/functions/log.lua +18 -46
- package/dist/functions/math.lua +15 -17
- package/dist/functions/npc.lua +15 -17
- package/dist/functions/pickups.lua +14 -1
- package/dist/functions/player.lua +25 -47
- package/dist/functions/playerHealth.lua +19 -9
- package/dist/functions/pocketItems.lua +4 -4
- package/dist/functions/random.lua +2 -2
- package/dist/functions/revive.lua +4 -4
- package/dist/functions/rooms.lua +13 -17
- package/dist/functions/spawnCollectible.lua +10 -2
- package/dist/functions/sprite.lua +2 -2
- package/dist/functions/stage.lua +6 -6
- package/dist/functions/tears.lua +1 -1
- package/dist/functions/transformations.lua +4 -10
- package/dist/functions/trinketGive.lua +2 -2
- package/dist/functions/trinkets.lua +3 -5
- package/dist/functions/ui.lua +3 -3
- package/dist/functions/util.lua +4 -8
- package/dist/functions/vector.lua +8 -8
- package/dist/lualib_bundle.lua +603 -555
- package/dist/maps/cardDescriptionMap.lua +99 -1
- package/dist/maps/cardNameMap.lua +99 -1
- package/dist/maps/collectibleDescriptionMap.lua +722 -1
- package/dist/maps/collectibleNameMap.lua +722 -1
- package/dist/maps/gridEntityXMLMap.lua +36 -1
- package/dist/maps/pillEffectNameMap.lua +52 -1
- package/dist/maps/roomTypeToItemPoolMap.lua +15 -1
- package/dist/maps/transformationMap.lua +19 -12
- package/dist/maps/trinketDescriptionMap.lua +190 -1
- package/dist/maps/trinketNameMap.lua +190 -1
- package/dist/sets/cards.lua +98 -2
- package/dist/types/ModUpgraded.lua +82 -166
- package/package.json +5 -5
|
@@ -30,9 +30,7 @@ function getJSONRoomWithChosenWeight(self, jsonRooms, chosenWeight)
|
|
|
30
30
|
end
|
|
31
31
|
chosenWeight = chosenWeight - roomWeight
|
|
32
32
|
end
|
|
33
|
-
error(
|
|
34
|
-
"Failed to get a room with chosen weight: " .. tostring(chosenWeight)
|
|
35
|
-
)
|
|
33
|
+
error("Failed to get a room with chosen weight: " .. tostring(chosenWeight))
|
|
36
34
|
return jsonRooms[1]
|
|
37
35
|
end
|
|
38
36
|
function ____exports.getJSONRoomOfVariant(self, jsonRooms, variant)
|
|
@@ -65,15 +63,11 @@ function ____exports.getRandomJSONRoom(self, jsonRooms, seed, verbose)
|
|
|
65
63
|
end
|
|
66
64
|
local totalWeight = getTotalWeightOfJSONRooms(nil, jsonRooms)
|
|
67
65
|
if verbose then
|
|
68
|
-
log(
|
|
69
|
-
"Total weight of the JSON rooms provided: " .. tostring(totalWeight)
|
|
70
|
-
)
|
|
66
|
+
log("Total weight of the JSON rooms provided: " .. tostring(totalWeight))
|
|
71
67
|
end
|
|
72
68
|
local chosenWeight = getRandomFloat(nil, 0, totalWeight, seed)
|
|
73
69
|
if verbose then
|
|
74
|
-
log(
|
|
75
|
-
"Randomly chose weight: " .. tostring(chosenWeight)
|
|
76
|
-
)
|
|
70
|
+
log("Randomly chose weight: " .. tostring(chosenWeight))
|
|
77
71
|
end
|
|
78
72
|
return getJSONRoomWithChosenWeight(nil, jsonRooms, chosenWeight)
|
|
79
73
|
end
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
local ____exports = {}
|
|
3
|
-
local LANGUAGE_NAMES = {
|
|
3
|
+
local LANGUAGE_NAMES = {
|
|
4
|
+
en = "English",
|
|
5
|
+
jp = "Japanese",
|
|
6
|
+
kr = "Korean",
|
|
7
|
+
zh = "Chinese (Simple)",
|
|
8
|
+
ru = "Russian",
|
|
9
|
+
de = "German",
|
|
10
|
+
es = "Spanish"
|
|
11
|
+
}
|
|
4
12
|
function ____exports.getLanguageName(self)
|
|
5
13
|
local languageAbbreviation = Options.Language
|
|
6
14
|
return LANGUAGE_NAMES[languageAbbreviation]
|
package/dist/functions/log.lua
CHANGED
|
@@ -16,9 +16,7 @@ function ____exports.getDebugPrependString(self, msg, numParentFunctions)
|
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
if getParentFunctionDescription ~= nil then
|
|
19
|
-
return (tostring(
|
|
20
|
-
getParentFunctionDescription(numParentFunctions + 1)
|
|
21
|
-
) .. " - ") .. msg
|
|
19
|
+
return (tostring(getParentFunctionDescription(numParentFunctions + 1)) .. " - ") .. msg
|
|
22
20
|
end
|
|
23
21
|
return msg
|
|
24
22
|
end
|
|
@@ -36,9 +34,7 @@ function ____exports.logAllFlags(flags, flagEnum, description)
|
|
|
36
34
|
____exports.log(("Logging all " .. description) .. "flags:")
|
|
37
35
|
for key, value in pairs(flagEnum) do
|
|
38
36
|
if hasFlag(nil, flags, value) then
|
|
39
|
-
____exports.log(
|
|
40
|
-
"- Has flag: " .. tostring(key)
|
|
41
|
-
)
|
|
37
|
+
____exports.log("- Has flag: " .. tostring(key))
|
|
42
38
|
end
|
|
43
39
|
end
|
|
44
40
|
end
|
|
@@ -51,12 +47,10 @@ end
|
|
|
51
47
|
function ____exports.logAllGameStateFlags()
|
|
52
48
|
local game = Game()
|
|
53
49
|
____exports.log("Logging all game state flags:")
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
) do
|
|
57
|
-
local key
|
|
50
|
+
local value
|
|
51
|
+
local key
|
|
52
|
+
for ____, ____value in ipairs(__TS__ObjectEntries(GameStateFlag)) do
|
|
58
53
|
key = ____value[1]
|
|
59
|
-
local value
|
|
60
54
|
value = ____value[2]
|
|
61
55
|
local gameStateFlag = value
|
|
62
56
|
local flagValue = game:GetStateFlag(gameStateFlag)
|
|
@@ -79,62 +73,40 @@ function ____exports.logArray(array)
|
|
|
79
73
|
____exports.log("Array: " .. arrayString)
|
|
80
74
|
end
|
|
81
75
|
function ____exports.logColor(color)
|
|
82
|
-
____exports.log(
|
|
83
|
-
(((((((((((("Color: R" .. tostring(color.R)) .. ", G") .. tostring(color.G)) .. ", B") .. tostring(color.B)) .. ", A") .. tostring(color.A)) .. ", RO") .. tostring(color.RO)) .. ", BO") .. tostring(color.BO)) .. ", GO") .. tostring(color.GO)
|
|
84
|
-
)
|
|
76
|
+
____exports.log((((((((((((("Color: R" .. tostring(color.R)) .. ", G") .. tostring(color.G)) .. ", B") .. tostring(color.B)) .. ", A") .. tostring(color.A)) .. ", RO") .. tostring(color.RO)) .. ", BO") .. tostring(color.BO)) .. ", GO") .. tostring(color.GO))
|
|
85
77
|
end
|
|
86
78
|
function ____exports.logEntity(entity)
|
|
87
|
-
____exports.log(
|
|
88
|
-
(((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType)
|
|
89
|
-
)
|
|
79
|
+
____exports.log((((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType))
|
|
90
80
|
end
|
|
91
81
|
function ____exports.logKColor(kColor)
|
|
92
|
-
____exports.log(
|
|
93
|
-
(((((("Color: R" .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha)
|
|
94
|
-
)
|
|
82
|
+
____exports.log((((((("Color: R" .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha))
|
|
95
83
|
end
|
|
96
84
|
function ____exports.logMap(map)
|
|
97
85
|
____exports.log("Printing out a TSTL Map:")
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
) do
|
|
101
|
-
local key
|
|
86
|
+
local value
|
|
87
|
+
local key
|
|
88
|
+
for ____, ____value in __TS__Iterator(map:entries()) do
|
|
102
89
|
key = ____value[1]
|
|
103
|
-
local value
|
|
104
90
|
value = ____value[2]
|
|
105
|
-
____exports.log(
|
|
106
|
-
((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value)
|
|
107
|
-
)
|
|
91
|
+
____exports.log(((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value))
|
|
108
92
|
end
|
|
109
|
-
____exports.log(
|
|
110
|
-
"The size of the map was: " .. tostring(map.size)
|
|
111
|
-
)
|
|
93
|
+
____exports.log("The size of the map was: " .. tostring(map.size))
|
|
112
94
|
end
|
|
113
95
|
function ____exports.logTable(____table)
|
|
114
96
|
____exports.log("Printing out a Lua table:")
|
|
115
97
|
for key, value in pairs(____table) do
|
|
116
|
-
____exports.log(
|
|
117
|
-
((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value)
|
|
118
|
-
)
|
|
98
|
+
____exports.log(((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value))
|
|
119
99
|
end
|
|
120
100
|
end
|
|
121
101
|
function ____exports.logSet(set)
|
|
122
102
|
____exports.log("Printing out a TSTL Set:")
|
|
123
|
-
for ____, value in __TS__Iterator(
|
|
124
|
-
|
|
125
|
-
) do
|
|
126
|
-
____exports.log(
|
|
127
|
-
" Value: " .. tostring(value)
|
|
128
|
-
)
|
|
103
|
+
for ____, value in __TS__Iterator(set:values()) do
|
|
104
|
+
____exports.log(" Value: " .. tostring(value))
|
|
129
105
|
end
|
|
130
|
-
____exports.log(
|
|
131
|
-
"The size of the set was: " .. tostring(set.size)
|
|
132
|
-
)
|
|
106
|
+
____exports.log("The size of the set was: " .. tostring(set.size))
|
|
133
107
|
end
|
|
134
108
|
function ____exports.logVector(vector)
|
|
135
|
-
____exports.log(
|
|
136
|
-
((("Vector: (" .. tostring(vector.X)) .. ", ") .. tostring(vector.Y)) .. ")"
|
|
137
|
-
)
|
|
109
|
+
____exports.log(((("Vector: (" .. tostring(vector.X)) .. ", ") .. tostring(vector.Y)) .. ")")
|
|
138
110
|
end
|
|
139
111
|
function ____exports.setLogFunctionsGlobal(self)
|
|
140
112
|
local globals = _G
|
package/dist/functions/math.lua
CHANGED
|
@@ -13,25 +13,25 @@ function getCircleInitialPosition(self, direction, radius)
|
|
|
13
13
|
return Vector.Zero
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
|
-
____cond6 = ____cond6 or
|
|
16
|
+
____cond6 = ____cond6 or ____switch6 == Direction.LEFT
|
|
17
17
|
if ____cond6 then
|
|
18
18
|
do
|
|
19
19
|
return Vector(-radius, 0)
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
|
-
____cond6 = ____cond6 or
|
|
22
|
+
____cond6 = ____cond6 or ____switch6 == Direction.UP
|
|
23
23
|
if ____cond6 then
|
|
24
24
|
do
|
|
25
25
|
return Vector(0, -radius)
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
|
-
____cond6 = ____cond6 or
|
|
28
|
+
____cond6 = ____cond6 or ____switch6 == Direction.RIGHT
|
|
29
29
|
if ____cond6 then
|
|
30
30
|
do
|
|
31
31
|
return Vector(radius, 0)
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
|
-
____cond6 = ____cond6 or
|
|
34
|
+
____cond6 = ____cond6 or ____switch6 == Direction.DOWN
|
|
35
35
|
if ____cond6 then
|
|
36
36
|
do
|
|
37
37
|
return Vector(0, radius)
|
|
@@ -47,7 +47,7 @@ function getCircleInitialPosition(self, direction, radius)
|
|
|
47
47
|
end
|
|
48
48
|
function ____exports.getAngleDifference(self, angle1, angle2)
|
|
49
49
|
local subtractedAngle = angle1 - angle2
|
|
50
|
-
return (
|
|
50
|
+
return (subtractedAngle + 180) % 360 - 180
|
|
51
51
|
end
|
|
52
52
|
function ____exports.getCircleDiscretizedPoints(self, centerPos, radius, numPoints, xMultiplier, yMultiplier, initialDirection)
|
|
53
53
|
if xMultiplier == nil then
|
|
@@ -64,7 +64,7 @@ function ____exports.getCircleDiscretizedPoints(self, centerPos, radius, numPoin
|
|
|
64
64
|
do
|
|
65
65
|
local i = 0
|
|
66
66
|
while i < numPoints do
|
|
67
|
-
local rotatedPosition = initialPosition:Rotated(
|
|
67
|
+
local rotatedPosition = initialPosition:Rotated(i * 360 / numPoints)
|
|
68
68
|
rotatedPosition.X = rotatedPosition.X * xMultiplier
|
|
69
69
|
rotatedPosition.Y = rotatedPosition.Y * yMultiplier
|
|
70
70
|
local positionFromCenter = centerPos + rotatedPosition
|
|
@@ -75,28 +75,26 @@ function ____exports.getCircleDiscretizedPoints(self, centerPos, radius, numPoin
|
|
|
75
75
|
return positions
|
|
76
76
|
end
|
|
77
77
|
function ____exports.isEven(self, num)
|
|
78
|
-
return
|
|
78
|
+
return num & 1 == 0
|
|
79
79
|
end
|
|
80
80
|
function ____exports.isOdd(self, num)
|
|
81
|
-
return
|
|
81
|
+
return num & 1 == 1
|
|
82
82
|
end
|
|
83
83
|
function ____exports.lerp(self, a, b, pos)
|
|
84
|
-
return a + (
|
|
84
|
+
return a + (b - a) * pos
|
|
85
85
|
end
|
|
86
86
|
function ____exports.lerpAngleDegrees(self, aStart, aEnd, percent)
|
|
87
|
-
return aStart +
|
|
87
|
+
return aStart + ____exports.getAngleDifference(nil, aStart, aEnd) * percent
|
|
88
88
|
end
|
|
89
89
|
function ____exports.round(self, num, numDecimalPlaces)
|
|
90
90
|
if numDecimalPlaces == nil then
|
|
91
91
|
numDecimalPlaces = 0
|
|
92
92
|
end
|
|
93
|
-
local roundedNum = tonumber(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
)
|
|
99
|
-
return ((roundedNum == nil) and 0) or roundedNum
|
|
93
|
+
local roundedNum = tonumber(string.format(
|
|
94
|
+
("%." .. tostring(numDecimalPlaces)) .. "f",
|
|
95
|
+
num
|
|
96
|
+
))
|
|
97
|
+
return roundedNum == nil and 0 or roundedNum
|
|
100
98
|
end
|
|
101
99
|
function ____exports.tanh(self, x)
|
|
102
100
|
return (math.exp(x) - math.exp(-x)) / (math.exp(x) + math.exp(-x))
|
package/dist/functions/npc.lua
CHANGED
|
@@ -8,9 +8,7 @@ local ____entity = require("functions.entity")
|
|
|
8
8
|
local getEntities = ____entity.getEntities
|
|
9
9
|
function ____exports.getBosses(self)
|
|
10
10
|
local bosses = {}
|
|
11
|
-
for ____, npc in ipairs(
|
|
12
|
-
____exports.getNPCs(nil)
|
|
13
|
-
) do
|
|
11
|
+
for ____, npc in ipairs(____exports.getNPCs(nil)) do
|
|
14
12
|
if npc:IsBoss() then
|
|
15
13
|
__TS__ArrayPush(bosses, npc)
|
|
16
14
|
end
|
|
@@ -21,7 +19,13 @@ function ____exports.getNPCs(self, matchingEntityType, matchingVariant, matching
|
|
|
21
19
|
if ignoreFriendly == nil then
|
|
22
20
|
ignoreFriendly = false
|
|
23
21
|
end
|
|
24
|
-
local entities = getEntities(
|
|
22
|
+
local entities = getEntities(
|
|
23
|
+
nil,
|
|
24
|
+
matchingEntityType,
|
|
25
|
+
matchingVariant,
|
|
26
|
+
matchingSubType,
|
|
27
|
+
ignoreFriendly
|
|
28
|
+
)
|
|
25
29
|
local npcs = {}
|
|
26
30
|
for ____, entity in ipairs(entities) do
|
|
27
31
|
local npc = entity:ToNPC()
|
|
@@ -49,10 +53,10 @@ function ____exports.isAliveExceptionNPC(self, npc)
|
|
|
49
53
|
return false
|
|
50
54
|
end
|
|
51
55
|
function ____exports.isDyingEggyWithNoSpidersLeft(self, npc)
|
|
52
|
-
return
|
|
56
|
+
return npc.State == NpcState.STATE_SUICIDE and npc.StateFrame >= EGGY_STATE_FRAME_OF_FINAL_SPIDER
|
|
53
57
|
end
|
|
54
58
|
function ____exports.isRaglingDeathPatch(self, npc)
|
|
55
|
-
return
|
|
59
|
+
return npc.Type == EntityType.ENTITY_RAGLING and npc.Variant == 1 and npc.State == NpcState.STATE_SPECIAL
|
|
56
60
|
end
|
|
57
61
|
NON_ALIVE_NPCS_TYPE_VARIANT = __TS__New(
|
|
58
62
|
Set,
|
|
@@ -70,16 +74,12 @@ NON_ALIVE_NPCS_TYPE_VARIANT = __TS__New(
|
|
|
70
74
|
)
|
|
71
75
|
NON_ALIVE_NPCS_TYPE_VARIANT_SUBTYPE = __TS__New(
|
|
72
76
|
Set,
|
|
73
|
-
{
|
|
74
|
-
(((tostring(EntityType.ENTITY_CHARGER) .. ".") .. 0) .. ".") .. 1
|
|
75
|
-
}
|
|
77
|
+
{(((tostring(EntityType.ENTITY_CHARGER) .. ".") .. 0) .. ".") .. 1}
|
|
76
78
|
)
|
|
77
79
|
function ____exports.getAliveBosses(self)
|
|
78
80
|
local aliveBosses = {}
|
|
79
|
-
for ____, boss in ipairs(
|
|
80
|
-
____exports.
|
|
81
|
-
) do
|
|
82
|
-
if (not boss:IsDead()) and (not ____exports.isAliveExceptionNPC(nil, boss)) then
|
|
81
|
+
for ____, boss in ipairs(____exports.getBosses(nil)) do
|
|
82
|
+
if not boss:IsDead() and not ____exports.isAliveExceptionNPC(nil, boss) then
|
|
83
83
|
__TS__ArrayPush(aliveBosses, boss)
|
|
84
84
|
end
|
|
85
85
|
end
|
|
@@ -87,10 +87,8 @@ function ____exports.getAliveBosses(self)
|
|
|
87
87
|
end
|
|
88
88
|
function ____exports.getAliveNPCs(self)
|
|
89
89
|
local aliveNPCs = {}
|
|
90
|
-
for ____, npc in ipairs(
|
|
91
|
-
____exports.
|
|
92
|
-
) do
|
|
93
|
-
if (not npc:IsDead()) and (not ____exports.isAliveExceptionNPC(nil, npc)) then
|
|
90
|
+
for ____, npc in ipairs(____exports.getNPCs(nil)) do
|
|
91
|
+
if not npc:IsDead() and not ____exports.isAliveExceptionNPC(nil, npc) then
|
|
94
92
|
__TS__ArrayPush(aliveNPCs, npc)
|
|
95
93
|
end
|
|
96
94
|
end
|
|
@@ -15,7 +15,20 @@ function ____exports.getRandomHeartSubType(self, seed, exceptions)
|
|
|
15
15
|
local heartSubTypes = getEnumValues(nil, HeartSubType)
|
|
16
16
|
return getRandomArrayElement(nil, heartSubTypes, seed, exceptions)
|
|
17
17
|
end
|
|
18
|
-
local CHEST_PICKUP_VARIANTS = __TS__New(Set, {
|
|
18
|
+
local CHEST_PICKUP_VARIANTS = __TS__New(Set, {
|
|
19
|
+
PickupVariant.PICKUP_CHEST,
|
|
20
|
+
PickupVariant.PICKUP_BOMBCHEST,
|
|
21
|
+
PickupVariant.PICKUP_SPIKEDCHEST,
|
|
22
|
+
PickupVariant.PICKUP_ETERNALCHEST,
|
|
23
|
+
PickupVariant.PICKUP_MIMICCHEST,
|
|
24
|
+
PickupVariant.PICKUP_OLDCHEST,
|
|
25
|
+
PickupVariant.PICKUP_WOODENCHEST,
|
|
26
|
+
PickupVariant.PICKUP_MEGACHEST,
|
|
27
|
+
PickupVariant.PICKUP_HAUNTEDCHEST,
|
|
28
|
+
PickupVariant.PICKUP_LOCKEDCHEST,
|
|
29
|
+
PickupVariant.PICKUP_REDCHEST,
|
|
30
|
+
PickupVariant.PICKUP_MOMSCHEST
|
|
31
|
+
})
|
|
19
32
|
function ____exports.isChest(self, pickup)
|
|
20
33
|
return CHEST_PICKUP_VARIANTS:has(pickup.Variant)
|
|
21
34
|
end
|
|
@@ -46,7 +46,7 @@ function ____exports.getPlayers(self, performExclusions)
|
|
|
46
46
|
end
|
|
47
47
|
function ____exports.getPlayerIndex(self, player)
|
|
48
48
|
local character = player:GetPlayerType()
|
|
49
|
-
local collectibleToUse =
|
|
49
|
+
local collectibleToUse = character == PlayerType.PLAYER_LAZARUS2_B and CollectibleType.COLLECTIBLE_INNER_EYE or CollectibleType.COLLECTIBLE_SAD_ONION
|
|
50
50
|
local collectibleRNG = player:GetCollectibleRNG(collectibleToUse)
|
|
51
51
|
local seed = collectibleRNG:GetSeed()
|
|
52
52
|
return seed
|
|
@@ -72,9 +72,7 @@ function ____exports.addTrinketCostume(self, player, trinketType)
|
|
|
72
72
|
player:AddCostume(itemConfigTrinket, false)
|
|
73
73
|
end
|
|
74
74
|
function ____exports.anyPlayerCloserThan(self, position, distance)
|
|
75
|
-
for ____, player in ipairs(
|
|
76
|
-
____exports.getPlayers(nil)
|
|
77
|
-
) do
|
|
75
|
+
for ____, player in ipairs(____exports.getPlayers(nil)) do
|
|
78
76
|
if player.Position:Distance(position) <= distance then
|
|
79
77
|
return true
|
|
80
78
|
end
|
|
@@ -82,9 +80,7 @@ function ____exports.anyPlayerCloserThan(self, position, distance)
|
|
|
82
80
|
return false
|
|
83
81
|
end
|
|
84
82
|
function ____exports.anyPlayerHasCollectible(self, collectibleType)
|
|
85
|
-
for ____, player in ipairs(
|
|
86
|
-
____exports.getPlayers(nil)
|
|
87
|
-
) do
|
|
83
|
+
for ____, player in ipairs(____exports.getPlayers(nil)) do
|
|
88
84
|
if player:HasCollectible(collectibleType) then
|
|
89
85
|
return true
|
|
90
86
|
end
|
|
@@ -92,9 +88,7 @@ function ____exports.anyPlayerHasCollectible(self, collectibleType)
|
|
|
92
88
|
return false
|
|
93
89
|
end
|
|
94
90
|
function ____exports.anyPlayerHasTrinket(self, trinketType)
|
|
95
|
-
for ____, player in ipairs(
|
|
96
|
-
____exports.getPlayers(nil)
|
|
97
|
-
) do
|
|
91
|
+
for ____, player in ipairs(____exports.getPlayers(nil)) do
|
|
98
92
|
if player:HasTrinket(trinketType) then
|
|
99
93
|
return true
|
|
100
94
|
end
|
|
@@ -102,9 +96,7 @@ function ____exports.anyPlayerHasTrinket(self, trinketType)
|
|
|
102
96
|
return false
|
|
103
97
|
end
|
|
104
98
|
function ____exports.anyPlayerIs(self, matchingCharacter)
|
|
105
|
-
for ____, player in ipairs(
|
|
106
|
-
____exports.getPlayers(nil)
|
|
107
|
-
) do
|
|
99
|
+
for ____, player in ipairs(____exports.getPlayers(nil)) do
|
|
108
100
|
local character = player:GetPlayerType()
|
|
109
101
|
if character == matchingCharacter then
|
|
110
102
|
return true
|
|
@@ -118,14 +110,12 @@ function ____exports.getAzazelBrimstoneDistance(self, playerOrTearHeight)
|
|
|
118
110
|
local player = playerOrTearHeight
|
|
119
111
|
tearHeight = player.TearHeight
|
|
120
112
|
end
|
|
121
|
-
return 32 -
|
|
113
|
+
return 32 - 2.5 * tearHeight
|
|
122
114
|
end
|
|
123
115
|
function ____exports.getClosestPlayer(self, position)
|
|
124
116
|
local closestPlayer = nil
|
|
125
117
|
local closestDistance = math.huge
|
|
126
|
-
for ____, player in ipairs(
|
|
127
|
-
____exports.getPlayers(nil)
|
|
128
|
-
) do
|
|
118
|
+
for ____, player in ipairs(____exports.getPlayers(nil)) do
|
|
129
119
|
local distance = position:Distance(player.Position)
|
|
130
120
|
if distance < closestDistance then
|
|
131
121
|
closestPlayer = player
|
|
@@ -156,10 +146,10 @@ function ____exports.getLastHeart(self, player)
|
|
|
156
146
|
local boneHearts = player:GetBoneHearts()
|
|
157
147
|
local rottenHearts = player:GetRottenHearts()
|
|
158
148
|
local soulHeartSlots = soulHearts / 2
|
|
159
|
-
local lastHeartIndex =
|
|
149
|
+
local lastHeartIndex = boneHearts + soulHeartSlots - 1
|
|
160
150
|
local isLastHeartBone = player:IsBoneHeart(lastHeartIndex)
|
|
161
151
|
if isLastHeartBone then
|
|
162
|
-
local isLastContainerEmpty = hearts <=
|
|
152
|
+
local isLastContainerEmpty = hearts <= effectiveMaxHearts - 2
|
|
163
153
|
if isLastContainerEmpty then
|
|
164
154
|
return HealthType.BONE
|
|
165
155
|
end
|
|
@@ -191,9 +181,7 @@ end
|
|
|
191
181
|
function ____exports.getNewestPlayer(self)
|
|
192
182
|
local newestPlayer = nil
|
|
193
183
|
local lowestFrame = math.huge
|
|
194
|
-
for ____, player in ipairs(
|
|
195
|
-
____exports.getPlayers(nil)
|
|
196
|
-
) do
|
|
184
|
+
for ____, player in ipairs(____exports.getPlayers(nil)) do
|
|
197
185
|
if player.FrameCount < lowestFrame then
|
|
198
186
|
newestPlayer = player
|
|
199
187
|
lowestFrame = player.FrameCount
|
|
@@ -209,9 +197,7 @@ function ____exports.getFinalPlayer(self)
|
|
|
209
197
|
return players[#players]
|
|
210
198
|
end
|
|
211
199
|
function ____exports.getPlayerCloserThan(self, position, distance)
|
|
212
|
-
for ____, player in ipairs(
|
|
213
|
-
____exports.getPlayers(nil)
|
|
214
|
-
) do
|
|
200
|
+
for ____, player in ipairs(____exports.getPlayers(nil)) do
|
|
215
201
|
if player.Position:Distance(position) <= distance then
|
|
216
202
|
return player
|
|
217
203
|
end
|
|
@@ -221,9 +207,7 @@ end
|
|
|
221
207
|
function ____exports.getPlayerCollectibleMap(self, player)
|
|
222
208
|
local collectibleSet = getCollectibleSet(nil)
|
|
223
209
|
local collectibleMap = __TS__New(Map)
|
|
224
|
-
for ____, collectibleType in __TS__Iterator(
|
|
225
|
-
collectibleSet:values()
|
|
226
|
-
) do
|
|
210
|
+
for ____, collectibleType in __TS__Iterator(collectibleSet:values()) do
|
|
227
211
|
local collectibleNum = player:GetCollectibleNum(collectibleType, true)
|
|
228
212
|
if collectibleNum > 0 then
|
|
229
213
|
collectibleMap:set(collectibleType, collectibleNum)
|
|
@@ -232,9 +216,7 @@ function ____exports.getPlayerCollectibleMap(self, player)
|
|
|
232
216
|
return collectibleMap
|
|
233
217
|
end
|
|
234
218
|
function ____exports.getPlayerFromIndex(self, playerIndex)
|
|
235
|
-
for ____, player in ipairs(
|
|
236
|
-
____exports.getPlayers(nil)
|
|
237
|
-
) do
|
|
219
|
+
for ____, player in ipairs(____exports.getPlayers(nil)) do
|
|
238
220
|
local existingPlayerIndex = ____exports.getPlayerIndex(nil, player)
|
|
239
221
|
if existingPlayerIndex == playerIndex then
|
|
240
222
|
return player
|
|
@@ -244,9 +226,7 @@ function ____exports.getPlayerFromIndex(self, playerIndex)
|
|
|
244
226
|
end
|
|
245
227
|
function ____exports.getPlayersOfType(self, playerType)
|
|
246
228
|
local players = {}
|
|
247
|
-
for ____, player in ipairs(
|
|
248
|
-
____exports.getPlayers(nil)
|
|
249
|
-
) do
|
|
229
|
+
for ____, player in ipairs(____exports.getPlayers(nil)) do
|
|
250
230
|
local character = player:GetPlayerType()
|
|
251
231
|
if character == playerType then
|
|
252
232
|
__TS__ArrayPush(players, player)
|
|
@@ -281,7 +261,7 @@ function ____exports.getPlayerNumAllHearts(self, player)
|
|
|
281
261
|
local soulHearts = player:GetSoulHearts()
|
|
282
262
|
local boneHearts = player:GetBoneHearts()
|
|
283
263
|
local eternalHearts = player:GetEternalHearts()
|
|
284
|
-
return
|
|
264
|
+
return hearts + soulHearts + boneHearts + eternalHearts
|
|
285
265
|
end
|
|
286
266
|
function ____exports.getTotalCharge(self, player, activeSlot)
|
|
287
267
|
local activeCharge = player:GetActiveCharge(activeSlot)
|
|
@@ -290,9 +270,7 @@ function ____exports.getTotalCharge(self, player, activeSlot)
|
|
|
290
270
|
end
|
|
291
271
|
function ____exports.getTotalPlayerCollectibles(self, collectibleType)
|
|
292
272
|
local numCollectibles = 0
|
|
293
|
-
for ____, player in ipairs(
|
|
294
|
-
____exports.getPlayers(nil)
|
|
295
|
-
) do
|
|
273
|
+
for ____, player in ipairs(____exports.getPlayers(nil)) do
|
|
296
274
|
numCollectibles = numCollectibles + player:GetCollectibleNum(collectibleType)
|
|
297
275
|
end
|
|
298
276
|
return numCollectibles
|
|
@@ -310,32 +288,32 @@ function ____exports.hasOpenActiveItemSlot(self, player)
|
|
|
310
288
|
local activeItemSecondary = player:GetActiveItem(ActiveSlot.SLOT_SECONDARY)
|
|
311
289
|
local hasSchoolbag = player:HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG)
|
|
312
290
|
if hasSchoolbag then
|
|
313
|
-
return
|
|
291
|
+
return activeItemPrimary == CollectibleType.COLLECTIBLE_NULL or activeItemSecondary == CollectibleType.COLLECTIBLE_NULL
|
|
314
292
|
end
|
|
315
293
|
return activeItemPrimary == CollectibleType.COLLECTIBLE_NULL
|
|
316
294
|
end
|
|
317
295
|
function ____exports.isBethany(self, player)
|
|
318
296
|
local character = player:GetPlayerType()
|
|
319
|
-
return
|
|
297
|
+
return character == PlayerType.PLAYER_BETHANY or character == PlayerType.PLAYER_BETHANY_B
|
|
320
298
|
end
|
|
321
299
|
function ____exports.isFirstPlayer(self, player)
|
|
322
300
|
return ____exports.getPlayerIndexVanilla(nil, player) == 0
|
|
323
301
|
end
|
|
324
302
|
function ____exports.isJacobOrEsau(self, player)
|
|
325
303
|
local character = player:GetPlayerType()
|
|
326
|
-
return
|
|
304
|
+
return character == PlayerType.PLAYER_JACOB or character == PlayerType.PLAYER_ESAU
|
|
327
305
|
end
|
|
328
306
|
function ____exports.isKeeper(self, player)
|
|
329
307
|
local character = player:GetPlayerType()
|
|
330
|
-
return
|
|
308
|
+
return character == PlayerType.PLAYER_KEEPER or character == PlayerType.PLAYER_KEEPER_B
|
|
331
309
|
end
|
|
332
310
|
function ____exports.isLost(self, player)
|
|
333
311
|
local character = player:GetPlayerType()
|
|
334
|
-
return
|
|
312
|
+
return character == PlayerType.PLAYER_THELOST or character == PlayerType.PLAYER_THELOST_B
|
|
335
313
|
end
|
|
336
314
|
function ____exports.isTaintedLazarus(self, player)
|
|
337
315
|
local character = player:GetPlayerType()
|
|
338
|
-
return
|
|
316
|
+
return character == PlayerType.PLAYER_LAZARUS_B or character == PlayerType.PLAYER_LAZARUS2_B
|
|
339
317
|
end
|
|
340
318
|
function ____exports.removeCollectibleCostume(self, player, collectibleType)
|
|
341
319
|
local itemConfig = Isaac.GetItemConfig()
|
|
@@ -389,7 +367,7 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
389
367
|
break
|
|
390
368
|
end
|
|
391
369
|
end
|
|
392
|
-
____cond87 = ____cond87 or
|
|
370
|
+
____cond87 = ____cond87 or ____switch87 == ActiveSlot.SLOT_SECONDARY
|
|
393
371
|
if ____cond87 then
|
|
394
372
|
do
|
|
395
373
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
@@ -405,7 +383,7 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
405
383
|
break
|
|
406
384
|
end
|
|
407
385
|
end
|
|
408
|
-
____cond87 = ____cond87 or
|
|
386
|
+
____cond87 = ____cond87 or ____switch87 == ActiveSlot.SLOT_POCKET
|
|
409
387
|
if ____cond87 then
|
|
410
388
|
do
|
|
411
389
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
@@ -413,7 +391,7 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
413
391
|
break
|
|
414
392
|
end
|
|
415
393
|
end
|
|
416
|
-
____cond87 = ____cond87 or
|
|
394
|
+
____cond87 = ____cond87 or ____switch87 == ActiveSlot.SLOT_POCKET2
|
|
417
395
|
if ____cond87 then
|
|
418
396
|
do
|
|
419
397
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
@@ -27,29 +27,29 @@ function ____exports.getPlayerHealth(self, player)
|
|
|
27
27
|
local rottenHearts = player:GetRottenHearts()
|
|
28
28
|
local brokenHearts = player:GetBrokenHearts()
|
|
29
29
|
local subPlayer = player:GetSubPlayer()
|
|
30
|
-
if
|
|
30
|
+
if character == PlayerType.PLAYER_THEFORGOTTEN and subPlayer ~= nil then
|
|
31
31
|
maxHearts = boneHearts * 2
|
|
32
32
|
boneHearts = 0
|
|
33
33
|
soulHearts = subPlayer:GetSoulHearts()
|
|
34
|
-
elseif
|
|
34
|
+
elseif character == PlayerType.PLAYER_THESOUL and subPlayer ~= nil then
|
|
35
35
|
maxHearts = subPlayer:GetBoneHearts() * 2
|
|
36
36
|
hearts = subPlayer:GetHearts()
|
|
37
37
|
end
|
|
38
|
-
hearts = hearts -
|
|
38
|
+
hearts = hearts - rottenHearts * 2
|
|
39
39
|
local extraHearts = math.ceil(soulHearts / 2) + boneHearts
|
|
40
40
|
local currentSoulHeart = 0
|
|
41
41
|
do
|
|
42
42
|
local i = 0
|
|
43
43
|
while i < extraHearts do
|
|
44
44
|
local isBoneHeart = player:IsBoneHeart(i)
|
|
45
|
-
if
|
|
45
|
+
if character == PlayerType.PLAYER_THEFORGOTTEN and subPlayer ~= nil then
|
|
46
46
|
isBoneHeart = subPlayer:IsBoneHeart(i)
|
|
47
47
|
end
|
|
48
48
|
if isBoneHeart then
|
|
49
49
|
__TS__ArrayPush(soulHeartTypes, HeartSubType.HEART_BONE)
|
|
50
50
|
else
|
|
51
51
|
local isBlackHeart = player:IsBlackHeart(currentSoulHeart + 1)
|
|
52
|
-
if
|
|
52
|
+
if character == PlayerType.PLAYER_THEFORGOTTEN and subPlayer ~= nil then
|
|
53
53
|
isBlackHeart = subPlayer:IsBlackHeart(currentSoulHeart + 1)
|
|
54
54
|
end
|
|
55
55
|
if isBlackHeart then
|
|
@@ -62,13 +62,23 @@ function ____exports.getPlayerHealth(self, player)
|
|
|
62
62
|
i = i + 1
|
|
63
63
|
end
|
|
64
64
|
end
|
|
65
|
-
return {
|
|
65
|
+
return {
|
|
66
|
+
soulHeartTypes = soulHeartTypes,
|
|
67
|
+
maxHearts = maxHearts,
|
|
68
|
+
hearts = hearts,
|
|
69
|
+
eternalHearts = eternalHearts,
|
|
70
|
+
soulHearts = soulHearts,
|
|
71
|
+
boneHearts = boneHearts,
|
|
72
|
+
goldenHearts = goldenHearts,
|
|
73
|
+
rottenHearts = rottenHearts,
|
|
74
|
+
brokenHearts = brokenHearts
|
|
75
|
+
}
|
|
66
76
|
end
|
|
67
77
|
function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
68
78
|
local character = player:GetPlayerType()
|
|
69
79
|
local subPlayer = player:GetSubPlayer()
|
|
70
80
|
____exports.removeAllPlayerHealth(nil, player)
|
|
71
|
-
if
|
|
81
|
+
if character == PlayerType.PLAYER_THESOUL and subPlayer ~= nil then
|
|
72
82
|
subPlayer:AddMaxHearts(playerHealth.maxHearts, false)
|
|
73
83
|
else
|
|
74
84
|
player:AddMaxHearts(playerHealth.maxHearts, false)
|
|
@@ -79,9 +89,9 @@ function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
|
79
89
|
local i = 0
|
|
80
90
|
while i < #playerHealth.soulHeartTypes do
|
|
81
91
|
local heartType = playerHealth.soulHeartTypes[i + 1]
|
|
82
|
-
local isHalf =
|
|
92
|
+
local isHalf = playerHealth.soulHearts + playerHealth.boneHearts * 2 < (i + 1) * 2
|
|
83
93
|
local addAmount = 2
|
|
84
|
-
if
|
|
94
|
+
if isHalf or heartType == HeartSubType.HEART_BONE or soulHeartsRemaining < 2 then
|
|
85
95
|
addAmount = 1
|
|
86
96
|
end
|
|
87
97
|
if heartType == HeartSubType.HEART_SOUL then
|
|
@@ -21,10 +21,10 @@ function ____exports.getPocketItems(self, player)
|
|
|
21
21
|
__TS__ArrayPush(pocketItems, {type = PocketItemType.CARD, id = card, slot = slot})
|
|
22
22
|
elseif pill ~= PillColor.PILL_NULL then
|
|
23
23
|
__TS__ArrayPush(pocketItems, {type = PocketItemType.PILL, id = pill, slot = slot})
|
|
24
|
-
elseif
|
|
24
|
+
elseif hasPocketItem and not hasPocketItem2 and not pocketItemIdentified then
|
|
25
25
|
pocketItemIdentified = true
|
|
26
26
|
__TS__ArrayPush(pocketItems, {type = PocketItemType.ACTIVE_ITEM, id = pocketItem, slot = slot})
|
|
27
|
-
elseif
|
|
27
|
+
elseif not hasPocketItem and hasPocketItem2 and not pocketItem2Identified then
|
|
28
28
|
pocketItem2Identified = true
|
|
29
29
|
__TS__ArrayPush(pocketItems, {type = PocketItemType.DICE_BAG_DICE, id = pocketItem2, slot = slot})
|
|
30
30
|
elseif hasPocketItem and hasPocketItem2 then
|
|
@@ -32,7 +32,7 @@ function ____exports.getPocketItems(self, player)
|
|
|
32
32
|
else
|
|
33
33
|
__TS__ArrayPush(pocketItems, {type = PocketItemType.EMPTY, id = 0, slot = slot})
|
|
34
34
|
end
|
|
35
|
-
if
|
|
35
|
+
if slot + 1 == maxPocketItems then
|
|
36
36
|
break
|
|
37
37
|
end
|
|
38
38
|
slot = slot + 1
|
|
@@ -43,7 +43,7 @@ end
|
|
|
43
43
|
function ____exports.getFirstCardOrPill(self, player)
|
|
44
44
|
local pocketItems = ____exports.getPocketItems(nil, player)
|
|
45
45
|
for ____, pocketItem in ipairs(pocketItems) do
|
|
46
|
-
if
|
|
46
|
+
if pocketItem.type == PocketItemType.CARD or pocketItem.type == PocketItemType.PILL then
|
|
47
47
|
return pocketItem
|
|
48
48
|
end
|
|
49
49
|
end
|