isaacscript-common 1.0.570 → 1.0.571
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/constants.d.ts +1 -0
- package/dist/constants.lua +1 -0
- package/dist/functions/player.d.ts +6 -0
- package/dist/functions/player.lua +19 -15
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare const BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.
|
|
|
12
12
|
/** Bombs explode when their frame count is equal to this value. */
|
|
13
13
|
export declare const BOMB_EXPLODE_FRAME = 45;
|
|
14
14
|
export declare const CHARACTERS_WITH_AN_ACTIVE_ITEM: Set<PlayerType>;
|
|
15
|
+
export declare const CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART: Set<PlayerType>;
|
|
15
16
|
/**
|
|
16
17
|
* The set of characters where red heart containers will be turned into soul hearts (e.g. Blue
|
|
17
18
|
* Baby). This includes The Lost and Tainted Lost. This does not include Keeper or Tainted Keeper.
|
package/dist/constants.lua
CHANGED
|
@@ -5,6 +5,7 @@ ____exports.AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125
|
|
|
5
5
|
____exports.BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png"
|
|
6
6
|
____exports.BOMB_EXPLODE_FRAME = 45
|
|
7
7
|
____exports.CHARACTERS_WITH_AN_ACTIVE_ITEM = __TS__New(Set, {PlayerType.PLAYER_ISAAC, PlayerType.PLAYER_MAGDALENE, PlayerType.PLAYER_JUDAS, PlayerType.PLAYER_BLUEBABY, PlayerType.PLAYER_EVE, PlayerType.PLAYER_EDEN, PlayerType.PLAYER_THELOST, PlayerType.PLAYER_LILITH, PlayerType.PLAYER_KEEPER, PlayerType.PLAYER_APOLLYON, PlayerType.PLAYER_EDEN_B})
|
|
8
|
+
____exports.CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART = __TS__New(Set, {PlayerType.PLAYER_BLACKJUDAS, PlayerType.PLAYER_JUDAS_B})
|
|
8
9
|
____exports.CHARACTERS_WITH_NO_RED_HEARTS = __TS__New(Set, {PlayerType.PLAYER_BLUEBABY, PlayerType.PLAYER_THELOST, PlayerType.PLAYER_BLACKJUDAS, PlayerType.PLAYER_JUDAS_B, PlayerType.PLAYER_BLUEBABY_B, PlayerType.PLAYER_THELOST_B, PlayerType.PLAYER_THEFORGOTTEN_B, PlayerType.PLAYER_BETHANY_B})
|
|
9
10
|
____exports.CHARACTERS_WITH_NO_SOUL_HEARTS = __TS__New(Set, {PlayerType.PLAYER_THELOST, PlayerType.PLAYER_KEEPER, PlayerType.PLAYER_BETHANY, PlayerType.PLAYER_THELOST_B, PlayerType.PLAYER_KEEPER_B})
|
|
10
11
|
____exports.COLORS = {
|
|
@@ -39,6 +39,12 @@ export declare function characterCanHaveRedHearts(character: PlayerType): boolea
|
|
|
39
39
|
* false for The Lost and Tainted Lost.
|
|
40
40
|
*/
|
|
41
41
|
export declare function characterCanHaveSoulHearts(character: PlayerType): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Normally, characters get a red heart container upon reaching a new floor with an eternal heart,
|
|
44
|
+
* but some characters grant a black heart instead. Returns true for Dark Judas and Tainted Judas.
|
|
45
|
+
* Otherwise, returns false.
|
|
46
|
+
*/
|
|
47
|
+
export declare function characterGetsBlackHeartFromEternalHeart(character: PlayerType): boolean;
|
|
42
48
|
/**
|
|
43
49
|
* Helper function to get how long Azazel's Brimstone laser should be. You can pass either an
|
|
44
50
|
* `EntityPlayer` object or a tear height stat.
|
|
@@ -3,6 +3,7 @@ require("lualib_bundle");
|
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local EXCLUDED_CHARACTERS
|
|
5
5
|
local ____constants = require("constants")
|
|
6
|
+
local CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART = ____constants.CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART
|
|
6
7
|
local CHARACTERS_WITH_NO_RED_HEARTS = ____constants.CHARACTERS_WITH_NO_RED_HEARTS
|
|
7
8
|
local CHARACTERS_WITH_NO_SOUL_HEARTS = ____constants.CHARACTERS_WITH_NO_SOUL_HEARTS
|
|
8
9
|
local LOST_STYLE_PLAYER_TYPES = ____constants.LOST_STYLE_PLAYER_TYPES
|
|
@@ -59,18 +60,18 @@ function ____exports.getPlayers(self, performExclusions)
|
|
|
59
60
|
do
|
|
60
61
|
local player = Isaac.GetPlayer(i)
|
|
61
62
|
if player == nil then
|
|
62
|
-
goto
|
|
63
|
+
goto __continue67
|
|
63
64
|
end
|
|
64
65
|
if ____exports.isChildPlayer(nil, player) then
|
|
65
|
-
goto
|
|
66
|
+
goto __continue67
|
|
66
67
|
end
|
|
67
68
|
local character = player:GetPlayerType()
|
|
68
69
|
if performExclusions and EXCLUDED_CHARACTERS:has(character) then
|
|
69
|
-
goto
|
|
70
|
+
goto __continue67
|
|
70
71
|
end
|
|
71
72
|
__TS__ArrayPush(players, player)
|
|
72
73
|
end
|
|
73
|
-
::
|
|
74
|
+
::__continue67::
|
|
74
75
|
i = i + 1
|
|
75
76
|
end
|
|
76
77
|
end
|
|
@@ -145,6 +146,9 @@ end
|
|
|
145
146
|
function ____exports.characterCanHaveSoulHearts(self, character)
|
|
146
147
|
return not CHARACTERS_WITH_NO_SOUL_HEARTS:has(character)
|
|
147
148
|
end
|
|
149
|
+
function ____exports.characterGetsBlackHeartFromEternalHeart(self, character)
|
|
150
|
+
return CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART:has(character)
|
|
151
|
+
end
|
|
148
152
|
function ____exports.getAzazelBrimstoneDistance(self, playerOrTearHeight)
|
|
149
153
|
local tearHeight = tonumber(playerOrTearHeight)
|
|
150
154
|
if tearHeight == nil then
|
|
@@ -295,14 +299,14 @@ function ____exports.getPlayerIndexVanilla(self, playerToFind)
|
|
|
295
299
|
do
|
|
296
300
|
local player = Isaac.GetPlayer(i)
|
|
297
301
|
if player == nil then
|
|
298
|
-
goto
|
|
302
|
+
goto __continue59
|
|
299
303
|
end
|
|
300
304
|
local playerHash = GetPtrHash(player)
|
|
301
305
|
if playerHash == playerToFindHash then
|
|
302
306
|
return i
|
|
303
307
|
end
|
|
304
308
|
end
|
|
305
|
-
::
|
|
309
|
+
::__continue59::
|
|
306
310
|
i = i + 1
|
|
307
311
|
end
|
|
308
312
|
end
|
|
@@ -423,9 +427,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
423
427
|
itemPool:RemoveCollectible(collectibleType)
|
|
424
428
|
end
|
|
425
429
|
repeat
|
|
426
|
-
local
|
|
427
|
-
local
|
|
428
|
-
if
|
|
430
|
+
local ____switch97 = activeSlot
|
|
431
|
+
local ____cond97 = ____switch97 == ActiveSlot.SLOT_PRIMARY
|
|
432
|
+
if ____cond97 then
|
|
429
433
|
do
|
|
430
434
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
431
435
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -434,8 +438,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
434
438
|
break
|
|
435
439
|
end
|
|
436
440
|
end
|
|
437
|
-
|
|
438
|
-
if
|
|
441
|
+
____cond97 = ____cond97 or (____switch97 == ActiveSlot.SLOT_SECONDARY)
|
|
442
|
+
if ____cond97 then
|
|
439
443
|
do
|
|
440
444
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
441
445
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -450,16 +454,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
450
454
|
break
|
|
451
455
|
end
|
|
452
456
|
end
|
|
453
|
-
|
|
454
|
-
if
|
|
457
|
+
____cond97 = ____cond97 or (____switch97 == ActiveSlot.SLOT_POCKET)
|
|
458
|
+
if ____cond97 then
|
|
455
459
|
do
|
|
456
460
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
457
461
|
player:SetActiveCharge(charge, activeSlot)
|
|
458
462
|
break
|
|
459
463
|
end
|
|
460
464
|
end
|
|
461
|
-
|
|
462
|
-
if
|
|
465
|
+
____cond97 = ____cond97 or (____switch97 == ActiveSlot.SLOT_POCKET2)
|
|
466
|
+
if ____cond97 then
|
|
463
467
|
do
|
|
464
468
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
465
469
|
break
|