isaacscript-common 1.2.133 → 1.2.134
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.d.ts +10 -0
- package/dist/functions/player.lua +31 -27
- package/package.json +1 -1
|
@@ -14,6 +14,16 @@ export declare function anyPlayerHasTrinket(trinketType: TrinketType | int): boo
|
|
|
14
14
|
* for. Returns true if any of the characters supplied are present.
|
|
15
15
|
*/
|
|
16
16
|
export declare function anyPlayerIs(...matchingCharacters: Array<PlayerType | int>): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Helper function to determine if a player will destroy a rock/pot/skull/etc. if they walk over it.
|
|
19
|
+
*
|
|
20
|
+
* The following things allow for this to be true:
|
|
21
|
+
* - the player has Leo (collectible 302)
|
|
22
|
+
* - the player has Thunder Thighs (collectible 314)
|
|
23
|
+
* - the player is under the effects of Mega Mush (collectible 625)
|
|
24
|
+
* - the player has Stompy (transformation 13)
|
|
25
|
+
*/
|
|
26
|
+
export declare function canPlayerCrushRocks(player: EntityPlayer): boolean;
|
|
17
27
|
/**
|
|
18
28
|
* Helper function to determine if the provided character can have red heart containers. Returns
|
|
19
29
|
* true for characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper,
|
|
@@ -100,15 +100,15 @@ end
|
|
|
100
100
|
function getPlayerIndexCollectibleType(self, player, differentiateForgottenAndSoul)
|
|
101
101
|
local character = player:GetPlayerType()
|
|
102
102
|
repeat
|
|
103
|
-
local
|
|
104
|
-
local
|
|
105
|
-
if
|
|
103
|
+
local ____switch69 = character
|
|
104
|
+
local ____cond69 = ____switch69 == PlayerType.PLAYER_THESOUL
|
|
105
|
+
if ____cond69 then
|
|
106
106
|
do
|
|
107
107
|
return differentiateForgottenAndSoul and CollectibleType.COLLECTIBLE_SPOON_BENDER or DEFAULT_COLLECTIBLE_TYPE
|
|
108
108
|
end
|
|
109
109
|
end
|
|
110
|
-
|
|
111
|
-
if
|
|
110
|
+
____cond69 = ____cond69 or ____switch69 == PlayerType.PLAYER_LAZARUS2_B
|
|
111
|
+
if ____cond69 then
|
|
112
112
|
do
|
|
113
113
|
return CollectibleType.COLLECTIBLE_INNER_EYE
|
|
114
114
|
end
|
|
@@ -139,39 +139,39 @@ end
|
|
|
139
139
|
function getAdjustedPlayerName(self, player)
|
|
140
140
|
local character = player:GetPlayerType()
|
|
141
141
|
repeat
|
|
142
|
-
local
|
|
143
|
-
local
|
|
144
|
-
if
|
|
142
|
+
local ____switch82 = character
|
|
143
|
+
local ____cond82 = ____switch82 == PlayerType.PLAYER_BLUEBABY or ____switch82 == PlayerType.PLAYER_BLUEBABY_B
|
|
144
|
+
if ____cond82 then
|
|
145
145
|
do
|
|
146
146
|
return "Blue Baby"
|
|
147
147
|
end
|
|
148
148
|
end
|
|
149
|
-
|
|
150
|
-
if
|
|
149
|
+
____cond82 = ____cond82 or ____switch82 == PlayerType.PLAYER_LAZARUS2
|
|
150
|
+
if ____cond82 then
|
|
151
151
|
do
|
|
152
152
|
return "Lazarus II"
|
|
153
153
|
end
|
|
154
154
|
end
|
|
155
|
-
|
|
156
|
-
if
|
|
155
|
+
____cond82 = ____cond82 or ____switch82 == PlayerType.PLAYER_BLACKJUDAS
|
|
156
|
+
if ____cond82 then
|
|
157
157
|
do
|
|
158
158
|
return "Dark Judas"
|
|
159
159
|
end
|
|
160
160
|
end
|
|
161
|
-
|
|
162
|
-
if
|
|
161
|
+
____cond82 = ____cond82 or ____switch82 == PlayerType.PLAYER_JACOB
|
|
162
|
+
if ____cond82 then
|
|
163
163
|
do
|
|
164
164
|
return "Jacob & Esau"
|
|
165
165
|
end
|
|
166
166
|
end
|
|
167
|
-
|
|
168
|
-
if
|
|
167
|
+
____cond82 = ____cond82 or ____switch82 == PlayerType.PLAYER_LAZARUS2_B
|
|
168
|
+
if ____cond82 then
|
|
169
169
|
do
|
|
170
170
|
return "Dead Tainted Lazarus"
|
|
171
171
|
end
|
|
172
172
|
end
|
|
173
|
-
|
|
174
|
-
if
|
|
173
|
+
____cond82 = ____cond82 or ____switch82 == PlayerType.PLAYER_JACOB2_B
|
|
174
|
+
if ____cond82 then
|
|
175
175
|
do
|
|
176
176
|
return "Dead Tainted Jacob"
|
|
177
177
|
end
|
|
@@ -292,6 +292,10 @@ function ____exports.anyPlayerIs(self, ...)
|
|
|
292
292
|
function(____, character) return matchingCharacterSet:has(character) end
|
|
293
293
|
)
|
|
294
294
|
end
|
|
295
|
+
function ____exports.canPlayerCrushRocks(self, player)
|
|
296
|
+
local effects = player:GetEffects()
|
|
297
|
+
return player:HasCollectible(CollectibleType.COLLECTIBLE_LEO) or player:HasCollectible(CollectibleType.COLLECTIBLE_THUNDER_THIGHS) or effects:HasCollectibleEffect(CollectibleType.COLLECTIBLE_MEGA_MUSH) or player:HasPlayerForm(PlayerForm.PLAYERFORM_STOMPY)
|
|
298
|
+
end
|
|
295
299
|
function ____exports.characterCanHaveRedHearts(self, character)
|
|
296
300
|
return not CHARACTERS_WITH_NO_RED_HEARTS:has(character)
|
|
297
301
|
end
|
|
@@ -616,9 +620,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
616
620
|
itemPool:RemoveCollectible(collectibleType)
|
|
617
621
|
end
|
|
618
622
|
repeat
|
|
619
|
-
local
|
|
620
|
-
local
|
|
621
|
-
if
|
|
623
|
+
local ____switch133 = activeSlot
|
|
624
|
+
local ____cond133 = ____switch133 == ActiveSlot.SLOT_PRIMARY
|
|
625
|
+
if ____cond133 then
|
|
622
626
|
do
|
|
623
627
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
624
628
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -627,8 +631,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
627
631
|
break
|
|
628
632
|
end
|
|
629
633
|
end
|
|
630
|
-
|
|
631
|
-
if
|
|
634
|
+
____cond133 = ____cond133 or ____switch133 == ActiveSlot.SLOT_SECONDARY
|
|
635
|
+
if ____cond133 then
|
|
632
636
|
do
|
|
633
637
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
634
638
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -643,16 +647,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
643
647
|
break
|
|
644
648
|
end
|
|
645
649
|
end
|
|
646
|
-
|
|
647
|
-
if
|
|
650
|
+
____cond133 = ____cond133 or ____switch133 == ActiveSlot.SLOT_POCKET
|
|
651
|
+
if ____cond133 then
|
|
648
652
|
do
|
|
649
653
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
650
654
|
player:SetActiveCharge(charge, activeSlot)
|
|
651
655
|
break
|
|
652
656
|
end
|
|
653
657
|
end
|
|
654
|
-
|
|
655
|
-
if
|
|
658
|
+
____cond133 = ____cond133 or ____switch133 == ActiveSlot.SLOT_POCKET2
|
|
659
|
+
if ____cond133 then
|
|
656
660
|
do
|
|
657
661
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
658
662
|
break
|