isaacscript-common 1.2.105 → 1.2.106
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/dist/functions/player.lua +47 -39
- package/dist/functions/rooms.d.ts +2 -2
- package/package.json +1 -1
|
@@ -17,7 +17,6 @@ local CHARACTERS_WITH_FREE_DEVIL_DEALS = ____constants.CHARACTERS_WITH_FREE_DEVI
|
|
|
17
17
|
local CHARACTERS_WITH_NO_RED_HEARTS = ____constants.CHARACTERS_WITH_NO_RED_HEARTS
|
|
18
18
|
local CHARACTERS_WITH_NO_SOUL_HEARTS = ____constants.CHARACTERS_WITH_NO_SOUL_HEARTS
|
|
19
19
|
local LOST_STYLE_PLAYER_TYPES = ____constants.LOST_STYLE_PLAYER_TYPES
|
|
20
|
-
local MAX_PLAYER_HEART_CONTAINERS = ____constants.MAX_PLAYER_HEART_CONTAINERS
|
|
21
20
|
local MAX_VANILLA_CHARACTER = ____constants.MAX_VANILLA_CHARACTER
|
|
22
21
|
local ____HealthType = require("types.HealthType")
|
|
23
22
|
local HealthType = ____HealthType.HealthType
|
|
@@ -56,6 +55,12 @@ function ____exports.getCharacterMaxHeartContainers(self, character)
|
|
|
56
55
|
if character == PlayerType.PLAYER_KEEPER then
|
|
57
56
|
return 3
|
|
58
57
|
end
|
|
58
|
+
if character == PlayerType.PLAYER_THEFORGOTTEN then
|
|
59
|
+
return 6
|
|
60
|
+
end
|
|
61
|
+
if character == PlayerType.PLAYER_THESOUL then
|
|
62
|
+
return 6
|
|
63
|
+
end
|
|
59
64
|
if character == PlayerType.PLAYER_KEEPER_B then
|
|
60
65
|
return 2
|
|
61
66
|
end
|
|
@@ -91,15 +96,15 @@ end
|
|
|
91
96
|
function getPlayerIndexCollectibleType(self, player, differentiateForgottenAndSoul)
|
|
92
97
|
local character = player:GetPlayerType()
|
|
93
98
|
repeat
|
|
94
|
-
local
|
|
95
|
-
local
|
|
96
|
-
if
|
|
99
|
+
local ____switch68 = character
|
|
100
|
+
local ____cond68 = ____switch68 == PlayerType.PLAYER_THESOUL
|
|
101
|
+
if ____cond68 then
|
|
97
102
|
do
|
|
98
103
|
return differentiateForgottenAndSoul and CollectibleType.COLLECTIBLE_SPOON_BENDER or DEFAULT_COLLECTIBLE_TYPE
|
|
99
104
|
end
|
|
100
105
|
end
|
|
101
|
-
|
|
102
|
-
if
|
|
106
|
+
____cond68 = ____cond68 or ____switch68 == PlayerType.PLAYER_LAZARUS2_B
|
|
107
|
+
if ____cond68 then
|
|
103
108
|
do
|
|
104
109
|
return CollectibleType.COLLECTIBLE_INNER_EYE
|
|
105
110
|
end
|
|
@@ -113,53 +118,56 @@ function getPlayerIndexCollectibleType(self, player, differentiateForgottenAndSo
|
|
|
113
118
|
end
|
|
114
119
|
function ____exports.getPlayerMaxHeartContainers(self, player)
|
|
115
120
|
local character = player:GetPlayerType()
|
|
116
|
-
local
|
|
121
|
+
local characterMaxHeartContainers = ____exports.getCharacterMaxHeartContainers(nil, character)
|
|
117
122
|
if character == PlayerType.PLAYER_MAGDALENE and player:HasCollectible(CollectibleType.COLLECTIBLE_BIRTHRIGHT) then
|
|
118
|
-
|
|
123
|
+
local extraMaxHeartContainersFromBirthright = 6
|
|
124
|
+
return characterMaxHeartContainers + extraMaxHeartContainersFromBirthright
|
|
119
125
|
end
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
126
|
+
if ____exports.isKeeper(nil, player) then
|
|
127
|
+
local numMothersKisses = player:GetTrinketMultiplier(TrinketType.TRINKET_MOTHERS_KISS)
|
|
128
|
+
local hasGreedsGullet = player:HasCollectible(CollectibleType.COLLECTIBLE_GREEDS_GULLET)
|
|
129
|
+
local coins = player:GetNumCoins()
|
|
130
|
+
local greedsGulletCoinContainers = hasGreedsGullet and math.floor(coins / 25) or 0
|
|
131
|
+
return characterMaxHeartContainers + numMothersKisses + greedsGulletCoinContainers
|
|
124
132
|
end
|
|
125
|
-
return
|
|
133
|
+
return characterMaxHeartContainers
|
|
126
134
|
end
|
|
127
135
|
function getAdjustedPlayerName(self, player)
|
|
128
136
|
local character = player:GetPlayerType()
|
|
129
137
|
repeat
|
|
130
|
-
local
|
|
131
|
-
local
|
|
132
|
-
if
|
|
138
|
+
local ____switch81 = character
|
|
139
|
+
local ____cond81 = ____switch81 == PlayerType.PLAYER_BLUEBABY or ____switch81 == PlayerType.PLAYER_BLUEBABY_B
|
|
140
|
+
if ____cond81 then
|
|
133
141
|
do
|
|
134
142
|
return "Blue Baby"
|
|
135
143
|
end
|
|
136
144
|
end
|
|
137
|
-
|
|
138
|
-
if
|
|
145
|
+
____cond81 = ____cond81 or ____switch81 == PlayerType.PLAYER_LAZARUS2
|
|
146
|
+
if ____cond81 then
|
|
139
147
|
do
|
|
140
148
|
return "Lazarus II"
|
|
141
149
|
end
|
|
142
150
|
end
|
|
143
|
-
|
|
144
|
-
if
|
|
151
|
+
____cond81 = ____cond81 or ____switch81 == PlayerType.PLAYER_BLACKJUDAS
|
|
152
|
+
if ____cond81 then
|
|
145
153
|
do
|
|
146
154
|
return "Dark Judas"
|
|
147
155
|
end
|
|
148
156
|
end
|
|
149
|
-
|
|
150
|
-
if
|
|
157
|
+
____cond81 = ____cond81 or ____switch81 == PlayerType.PLAYER_JACOB
|
|
158
|
+
if ____cond81 then
|
|
151
159
|
do
|
|
152
160
|
return "Jacob & Esau"
|
|
153
161
|
end
|
|
154
162
|
end
|
|
155
|
-
|
|
156
|
-
if
|
|
163
|
+
____cond81 = ____cond81 or ____switch81 == PlayerType.PLAYER_LAZARUS2_B
|
|
164
|
+
if ____cond81 then
|
|
157
165
|
do
|
|
158
166
|
return "Dead Tainted Lazarus"
|
|
159
167
|
end
|
|
160
168
|
end
|
|
161
|
-
|
|
162
|
-
if
|
|
169
|
+
____cond81 = ____cond81 or ____switch81 == PlayerType.PLAYER_JACOB2_B
|
|
170
|
+
if ____cond81 then
|
|
163
171
|
do
|
|
164
172
|
return "Dead Tainted Jacob"
|
|
165
173
|
end
|
|
@@ -207,6 +215,10 @@ end
|
|
|
207
215
|
function ____exports.isChildPlayer(self, player)
|
|
208
216
|
return player.Parent ~= nil
|
|
209
217
|
end
|
|
218
|
+
function ____exports.isKeeper(self, player)
|
|
219
|
+
local character = player:GetPlayerType()
|
|
220
|
+
return character == PlayerType.PLAYER_KEEPER or character == PlayerType.PLAYER_KEEPER_B
|
|
221
|
+
end
|
|
210
222
|
function ____exports.isTainted(self, player)
|
|
211
223
|
local character = player:GetPlayerType()
|
|
212
224
|
local ____isVanillaCharacter_result_1
|
|
@@ -532,10 +544,6 @@ function ____exports.isJacobOrEsau(self, player)
|
|
|
532
544
|
local character = player:GetPlayerType()
|
|
533
545
|
return character == PlayerType.PLAYER_JACOB or character == PlayerType.PLAYER_ESAU
|
|
534
546
|
end
|
|
535
|
-
function ____exports.isKeeper(self, player)
|
|
536
|
-
local character = player:GetPlayerType()
|
|
537
|
-
return character == PlayerType.PLAYER_KEEPER or character == PlayerType.PLAYER_KEEPER_B
|
|
538
|
-
end
|
|
539
547
|
function ____exports.isLost(self, player)
|
|
540
548
|
local character = player:GetPlayerType()
|
|
541
549
|
return character == PlayerType.PLAYER_THELOST or character == PlayerType.PLAYER_THELOST_B
|
|
@@ -589,9 +597,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
589
597
|
itemPool:RemoveCollectible(collectibleType)
|
|
590
598
|
end
|
|
591
599
|
repeat
|
|
592
|
-
local
|
|
593
|
-
local
|
|
594
|
-
if
|
|
600
|
+
local ____switch127 = activeSlot
|
|
601
|
+
local ____cond127 = ____switch127 == ActiveSlot.SLOT_PRIMARY
|
|
602
|
+
if ____cond127 then
|
|
595
603
|
do
|
|
596
604
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
597
605
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -600,8 +608,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
600
608
|
break
|
|
601
609
|
end
|
|
602
610
|
end
|
|
603
|
-
|
|
604
|
-
if
|
|
611
|
+
____cond127 = ____cond127 or ____switch127 == ActiveSlot.SLOT_SECONDARY
|
|
612
|
+
if ____cond127 then
|
|
605
613
|
do
|
|
606
614
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
607
615
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -616,16 +624,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
616
624
|
break
|
|
617
625
|
end
|
|
618
626
|
end
|
|
619
|
-
|
|
620
|
-
if
|
|
627
|
+
____cond127 = ____cond127 or ____switch127 == ActiveSlot.SLOT_POCKET
|
|
628
|
+
if ____cond127 then
|
|
621
629
|
do
|
|
622
630
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
623
631
|
player:SetActiveCharge(charge, activeSlot)
|
|
624
632
|
break
|
|
625
633
|
end
|
|
626
634
|
end
|
|
627
|
-
|
|
628
|
-
if
|
|
635
|
+
____cond127 = ____cond127 or ____switch127 == ActiveSlot.SLOT_POCKET2
|
|
636
|
+
if ____cond127 then
|
|
629
637
|
do
|
|
630
638
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
631
639
|
break
|
|
@@ -178,9 +178,9 @@ export declare function inMegaSatanRoom(): boolean;
|
|
|
178
178
|
*/
|
|
179
179
|
export declare function inMinibossRoomOf(minibossID: MinibossID): boolean;
|
|
180
180
|
/**
|
|
181
|
-
* Helper function for checking if the room
|
|
181
|
+
* Helper function for checking if the room is a secret shop (from the Member Card collectible).
|
|
182
182
|
*
|
|
183
|
-
* Secret shops are simply copies of normal shops but with the backdrop of a secret room. In other
|
|
183
|
+
* Secret shops are simply copies of normal shops, but with the backdrop of a secret room. In other
|
|
184
184
|
* words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus,
|
|
185
185
|
* the only way to detect them is by using the grid index.
|
|
186
186
|
*/
|