isaacscript-common 39.4.7 → 39.6.0
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/index.rollup.d.ts +16 -0
- package/dist/isaacscript-common.lua +85 -16
- package/dist/src/functions/characters.d.ts +5 -0
- package/dist/src/functions/characters.d.ts.map +1 -1
- package/dist/src/functions/characters.lua +43 -2
- package/dist/src/functions/players.d.ts +7 -1
- package/dist/src/functions/players.d.ts.map +1 -1
- package/dist/src/functions/players.lua +46 -13
- package/package.json +1 -1
- package/src/functions/characters.ts +47 -2
- package/src/functions/players.ts +32 -0
package/dist/index.rollup.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ import type { MinibossID } from 'isaac-typescript-definitions';
|
|
|
54
54
|
import { ModCallback } from 'isaac-typescript-definitions';
|
|
55
55
|
import type { Music } from 'isaac-typescript-definitions';
|
|
56
56
|
import type { NPCState } from 'isaac-typescript-definitions';
|
|
57
|
+
import { NullItemID } from 'isaac-typescript-definitions';
|
|
57
58
|
import { PickupPrice } from 'isaac-typescript-definitions';
|
|
58
59
|
import type { PickupVariant } from 'isaac-typescript-definitions';
|
|
59
60
|
import { PillColor } from 'isaac-typescript-definitions';
|
|
@@ -1018,6 +1019,12 @@ export declare function anyPlayerCloserThan(position: Vector, distance: float):
|
|
|
1018
1019
|
*/
|
|
1019
1020
|
export declare function anyPlayerHasCollectible(collectibleType: CollectibleType, ignoreModifiers?: boolean): boolean;
|
|
1020
1021
|
|
|
1022
|
+
/** Helper function to check to see if any player has a temporary collectible effect. */
|
|
1023
|
+
export declare function anyPlayerHasCollectibleEffect(collectibleType: CollectibleType): boolean;
|
|
1024
|
+
|
|
1025
|
+
/** Helper function to check to see if any player has a temporary null effect. */
|
|
1026
|
+
export declare function anyPlayerHasNullEffect(nullItemID: NullItemID): boolean;
|
|
1027
|
+
|
|
1021
1028
|
/**
|
|
1022
1029
|
* Helper function to check to see if any player has a particular trinket.
|
|
1023
1030
|
*
|
|
@@ -1027,6 +1034,9 @@ export declare function anyPlayerHasCollectible(collectibleType: CollectibleType
|
|
|
1027
1034
|
*/
|
|
1028
1035
|
export declare function anyPlayerHasTrinket(trinketType: TrinketType, ignoreModifiers?: boolean): boolean;
|
|
1029
1036
|
|
|
1037
|
+
/** Helper function to check to see if any player has a temporary trinket effect. */
|
|
1038
|
+
export declare function anyPlayerHasTrinketEffect(trinketType: TrinketType): boolean;
|
|
1039
|
+
|
|
1030
1040
|
/**
|
|
1031
1041
|
* Helper function to check to see if any player is holding up an item (from e.g. an active item
|
|
1032
1042
|
* activation, a poop from IBS, etc.).
|
|
@@ -8840,6 +8850,12 @@ export declare function isLRoomShape(roomShape: RoomShape): boolean;
|
|
|
8840
8850
|
*/
|
|
8841
8851
|
export declare function isLuaDebugEnabled(): boolean;
|
|
8842
8852
|
|
|
8853
|
+
/**
|
|
8854
|
+
* Helper function to check if the provided character is one of the characters that are selectable
|
|
8855
|
+
* from the main menu (and have achievements related to completing the various bosses and so on).
|
|
8856
|
+
*/
|
|
8857
|
+
export declare function isMainCharacter(character: PlayerType): boolean;
|
|
8858
|
+
|
|
8843
8859
|
/**
|
|
8844
8860
|
* Helper function to check if the provided door is the one that leads to the Mega Satan Boss Room.
|
|
8845
8861
|
* (In vanilla, the door will only appear in the starting room of The Chest / Dark Room.)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 39.
|
|
3
|
+
isaacscript-common 39.6.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -19297,7 +19297,7 @@ end
|
|
|
19297
19297
|
function ____exports.isVanillaCharacter(self, character)
|
|
19298
19298
|
return character <= LAST_VANILLA_CHARACTER
|
|
19299
19299
|
end
|
|
19300
|
-
local
|
|
19300
|
+
local FLYING_CHARACTERS_SET = __TS__New(ReadonlySet, {
|
|
19301
19301
|
PlayerType.AZAZEL,
|
|
19302
19302
|
PlayerType.LOST,
|
|
19303
19303
|
PlayerType.SOUL,
|
|
@@ -19305,6 +19305,42 @@ local FLYING_CHARACTERS = __TS__New(ReadonlySet, {
|
|
|
19305
19305
|
PlayerType.JACOB_2_B,
|
|
19306
19306
|
PlayerType.SOUL_B
|
|
19307
19307
|
})
|
|
19308
|
+
local MAIN_CHARACTERS_SET = __TS__New(ReadonlySet, {
|
|
19309
|
+
PlayerType.ISAAC,
|
|
19310
|
+
PlayerType.MAGDALENE,
|
|
19311
|
+
PlayerType.CAIN,
|
|
19312
|
+
PlayerType.JUDAS,
|
|
19313
|
+
PlayerType.BLUE_BABY,
|
|
19314
|
+
PlayerType.EVE,
|
|
19315
|
+
PlayerType.SAMSON,
|
|
19316
|
+
PlayerType.AZAZEL,
|
|
19317
|
+
PlayerType.LAZARUS,
|
|
19318
|
+
PlayerType.EDEN,
|
|
19319
|
+
PlayerType.LOST,
|
|
19320
|
+
PlayerType.LILITH,
|
|
19321
|
+
PlayerType.KEEPER,
|
|
19322
|
+
PlayerType.APOLLYON,
|
|
19323
|
+
PlayerType.FORGOTTEN,
|
|
19324
|
+
PlayerType.BETHANY,
|
|
19325
|
+
PlayerType.JACOB,
|
|
19326
|
+
PlayerType.ISAAC_B,
|
|
19327
|
+
PlayerType.MAGDALENE_B,
|
|
19328
|
+
PlayerType.CAIN_B,
|
|
19329
|
+
PlayerType.JUDAS_B,
|
|
19330
|
+
PlayerType.BLUE_BABY_B,
|
|
19331
|
+
PlayerType.EVE_B,
|
|
19332
|
+
PlayerType.SAMSON_B,
|
|
19333
|
+
PlayerType.AZAZEL_B,
|
|
19334
|
+
PlayerType.LAZARUS_B,
|
|
19335
|
+
PlayerType.EDEN_B,
|
|
19336
|
+
PlayerType.LOST_B,
|
|
19337
|
+
PlayerType.LILITH_B,
|
|
19338
|
+
PlayerType.KEEPER_B,
|
|
19339
|
+
PlayerType.APOLLYON_B,
|
|
19340
|
+
PlayerType.FORGOTTEN_B,
|
|
19341
|
+
PlayerType.BETHANY_B,
|
|
19342
|
+
PlayerType.JACOB_B
|
|
19343
|
+
})
|
|
19308
19344
|
function ____exports.characterCanHaveRedHearts(self, character)
|
|
19309
19345
|
return not CHARACTERS_WITH_NO_RED_HEARTS_SET:has(character)
|
|
19310
19346
|
end
|
|
@@ -19364,7 +19400,10 @@ function ____exports.getCharacterStartingCollectibles(self, character)
|
|
|
19364
19400
|
end
|
|
19365
19401
|
function ____exports.isFlyingCharacter(self, player)
|
|
19366
19402
|
local character = player:GetPlayerType()
|
|
19367
|
-
return
|
|
19403
|
+
return FLYING_CHARACTERS_SET:has(character)
|
|
19404
|
+
end
|
|
19405
|
+
function ____exports.isMainCharacter(self, character)
|
|
19406
|
+
return MAIN_CHARACTERS_SET:has(character)
|
|
19368
19407
|
end
|
|
19369
19408
|
return ____exports
|
|
19370
19409
|
end,
|
|
@@ -21956,6 +21995,26 @@ function ____exports.anyPlayerHasCollectible(self, collectibleType, ignoreModifi
|
|
|
21956
21995
|
function(____, player) return player:HasCollectible(collectibleType, ignoreModifiers) end
|
|
21957
21996
|
)
|
|
21958
21997
|
end
|
|
21998
|
+
function ____exports.anyPlayerHasCollectibleEffect(self, collectibleType)
|
|
21999
|
+
local players = getAllPlayers(nil)
|
|
22000
|
+
return __TS__ArraySome(
|
|
22001
|
+
players,
|
|
22002
|
+
function(____, player)
|
|
22003
|
+
local effects = player:GetEffects()
|
|
22004
|
+
return effects:HasCollectibleEffect(collectibleType)
|
|
22005
|
+
end
|
|
22006
|
+
)
|
|
22007
|
+
end
|
|
22008
|
+
function ____exports.anyPlayerHasNullEffect(self, nullItemID)
|
|
22009
|
+
local players = getAllPlayers(nil)
|
|
22010
|
+
return __TS__ArraySome(
|
|
22011
|
+
players,
|
|
22012
|
+
function(____, player)
|
|
22013
|
+
local effects = player:GetEffects()
|
|
22014
|
+
return effects:HasNullEffect(nullItemID)
|
|
22015
|
+
end
|
|
22016
|
+
)
|
|
22017
|
+
end
|
|
21959
22018
|
function ____exports.anyPlayerHasTrinket(self, trinketType, ignoreModifiers)
|
|
21960
22019
|
local players = getAllPlayers(nil)
|
|
21961
22020
|
return __TS__ArraySome(
|
|
@@ -21963,6 +22022,16 @@ function ____exports.anyPlayerHasTrinket(self, trinketType, ignoreModifiers)
|
|
|
21963
22022
|
function(____, player) return player:HasTrinket(trinketType, ignoreModifiers) end
|
|
21964
22023
|
)
|
|
21965
22024
|
end
|
|
22025
|
+
function ____exports.anyPlayerHasTrinketEffect(self, trinketType)
|
|
22026
|
+
local players = getAllPlayers(nil)
|
|
22027
|
+
return __TS__ArraySome(
|
|
22028
|
+
players,
|
|
22029
|
+
function(____, player)
|
|
22030
|
+
local effects = player:GetEffects()
|
|
22031
|
+
return effects:HasTrinketEffect(trinketType)
|
|
22032
|
+
end
|
|
22033
|
+
)
|
|
22034
|
+
end
|
|
21966
22035
|
function ____exports.anyPlayerHoldingItem(self)
|
|
21967
22036
|
local players = getAllPlayers(nil)
|
|
21968
22037
|
return __TS__ArraySome(
|
|
@@ -22283,7 +22352,7 @@ function ____exports.removeAllActiveItems(self, player)
|
|
|
22283
22352
|
do
|
|
22284
22353
|
local collectibleType = player:GetActiveItem(activeSlot)
|
|
22285
22354
|
if collectibleType == CollectibleType.NULL then
|
|
22286
|
-
goto
|
|
22355
|
+
goto __continue104
|
|
22287
22356
|
end
|
|
22288
22357
|
local stillHasCollectible
|
|
22289
22358
|
repeat
|
|
@@ -22293,7 +22362,7 @@ function ____exports.removeAllActiveItems(self, player)
|
|
|
22293
22362
|
end
|
|
22294
22363
|
until not stillHasCollectible
|
|
22295
22364
|
end
|
|
22296
|
-
::
|
|
22365
|
+
::__continue104::
|
|
22297
22366
|
end
|
|
22298
22367
|
end
|
|
22299
22368
|
function ____exports.removeAllPlayerTrinkets(self, player)
|
|
@@ -22301,7 +22370,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
|
|
|
22301
22370
|
do
|
|
22302
22371
|
local trinketType = player:GetTrinket(trinketSlot)
|
|
22303
22372
|
if trinketType == TrinketType.NULL then
|
|
22304
|
-
goto
|
|
22373
|
+
goto __continue109
|
|
22305
22374
|
end
|
|
22306
22375
|
local alreadyHasTrinket
|
|
22307
22376
|
repeat
|
|
@@ -22311,7 +22380,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
|
|
|
22311
22380
|
end
|
|
22312
22381
|
until not alreadyHasTrinket
|
|
22313
22382
|
end
|
|
22314
|
-
::
|
|
22383
|
+
::__continue109::
|
|
22315
22384
|
end
|
|
22316
22385
|
end
|
|
22317
22386
|
function ____exports.removeCollectible(self, player, ...)
|
|
@@ -22371,9 +22440,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
22371
22440
|
itemPool:RemoveCollectible(collectibleType)
|
|
22372
22441
|
end
|
|
22373
22442
|
repeat
|
|
22374
|
-
local
|
|
22375
|
-
local
|
|
22376
|
-
if
|
|
22443
|
+
local ____switch131 = activeSlot
|
|
22444
|
+
local ____cond131 = ____switch131 == ActiveSlot.PRIMARY
|
|
22445
|
+
if ____cond131 then
|
|
22377
22446
|
do
|
|
22378
22447
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
22379
22448
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -22382,8 +22451,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
22382
22451
|
break
|
|
22383
22452
|
end
|
|
22384
22453
|
end
|
|
22385
|
-
|
|
22386
|
-
if
|
|
22454
|
+
____cond131 = ____cond131 or ____switch131 == ActiveSlot.SECONDARY
|
|
22455
|
+
if ____cond131 then
|
|
22387
22456
|
do
|
|
22388
22457
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
22389
22458
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -22398,16 +22467,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
22398
22467
|
break
|
|
22399
22468
|
end
|
|
22400
22469
|
end
|
|
22401
|
-
|
|
22402
|
-
if
|
|
22470
|
+
____cond131 = ____cond131 or ____switch131 == ActiveSlot.POCKET
|
|
22471
|
+
if ____cond131 then
|
|
22403
22472
|
do
|
|
22404
22473
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
22405
22474
|
player:SetActiveCharge(charge, activeSlot)
|
|
22406
22475
|
break
|
|
22407
22476
|
end
|
|
22408
22477
|
end
|
|
22409
|
-
|
|
22410
|
-
if
|
|
22478
|
+
____cond131 = ____cond131 or ____switch131 == ActiveSlot.POCKET_SINGLE_USE
|
|
22479
|
+
if ____cond131 then
|
|
22411
22480
|
do
|
|
22412
22481
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
22413
22482
|
break
|
|
@@ -55,6 +55,11 @@ export declare function getCharacterName(character: PlayerType): string;
|
|
|
55
55
|
*/
|
|
56
56
|
export declare function getCharacterStartingCollectibles(character: PlayerType): readonly CollectibleType[];
|
|
57
57
|
export declare function isFlyingCharacter(player: EntityPlayer): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Helper function to check if the provided character is one of the characters that are selectable
|
|
60
|
+
* from the main menu (and have achievements related to completing the various bosses and so on).
|
|
61
|
+
*/
|
|
62
|
+
export declare function isMainCharacter(character: PlayerType): boolean;
|
|
58
63
|
export declare function isModdedCharacter(character: PlayerType): boolean;
|
|
59
64
|
export declare function isVanillaCharacter(character: PlayerType): boolean;
|
|
60
65
|
//# sourceMappingURL=characters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"characters.d.ts","sourceRoot":"","sources":["../../../src/functions/characters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"characters.d.ts","sourceRoot":"","sources":["../../../src/functions/characters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BA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character)
|
|
32
32
|
return character <= LAST_VANILLA_CHARACTER
|
|
33
33
|
end
|
|
34
|
-
local
|
|
34
|
+
local FLYING_CHARACTERS_SET = __TS__New(ReadonlySet, {
|
|
35
35
|
PlayerType.AZAZEL,
|
|
36
36
|
PlayerType.LOST,
|
|
37
37
|
PlayerType.SOUL,
|
|
@@ -39,6 +39,42 @@ local FLYING_CHARACTERS = __TS__New(ReadonlySet, {
|
|
|
39
39
|
PlayerType.JACOB_2_B,
|
|
40
40
|
PlayerType.SOUL_B
|
|
41
41
|
})
|
|
42
|
+
local MAIN_CHARACTERS_SET = __TS__New(ReadonlySet, {
|
|
43
|
+
PlayerType.ISAAC,
|
|
44
|
+
PlayerType.MAGDALENE,
|
|
45
|
+
PlayerType.CAIN,
|
|
46
|
+
PlayerType.JUDAS,
|
|
47
|
+
PlayerType.BLUE_BABY,
|
|
48
|
+
PlayerType.EVE,
|
|
49
|
+
PlayerType.SAMSON,
|
|
50
|
+
PlayerType.AZAZEL,
|
|
51
|
+
PlayerType.LAZARUS,
|
|
52
|
+
PlayerType.EDEN,
|
|
53
|
+
PlayerType.LOST,
|
|
54
|
+
PlayerType.LILITH,
|
|
55
|
+
PlayerType.KEEPER,
|
|
56
|
+
PlayerType.APOLLYON,
|
|
57
|
+
PlayerType.FORGOTTEN,
|
|
58
|
+
PlayerType.BETHANY,
|
|
59
|
+
PlayerType.JACOB,
|
|
60
|
+
PlayerType.ISAAC_B,
|
|
61
|
+
PlayerType.MAGDALENE_B,
|
|
62
|
+
PlayerType.CAIN_B,
|
|
63
|
+
PlayerType.JUDAS_B,
|
|
64
|
+
PlayerType.BLUE_BABY_B,
|
|
65
|
+
PlayerType.EVE_B,
|
|
66
|
+
PlayerType.SAMSON_B,
|
|
67
|
+
PlayerType.AZAZEL_B,
|
|
68
|
+
PlayerType.LAZARUS_B,
|
|
69
|
+
PlayerType.EDEN_B,
|
|
70
|
+
PlayerType.LOST_B,
|
|
71
|
+
PlayerType.LILITH_B,
|
|
72
|
+
PlayerType.KEEPER_B,
|
|
73
|
+
PlayerType.APOLLYON_B,
|
|
74
|
+
PlayerType.FORGOTTEN_B,
|
|
75
|
+
PlayerType.BETHANY_B,
|
|
76
|
+
PlayerType.JACOB_B
|
|
77
|
+
})
|
|
42
78
|
--- Helper function to determine if the given character can have red heart containers. Returns true
|
|
43
79
|
-- for characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper, even
|
|
44
80
|
-- though coin containers are not technically the same as red heart containers. Returns false for
|
|
@@ -126,6 +162,11 @@ function ____exports.getCharacterStartingCollectibles(self, character)
|
|
|
126
162
|
end
|
|
127
163
|
function ____exports.isFlyingCharacter(self, player)
|
|
128
164
|
local character = player:GetPlayerType()
|
|
129
|
-
return
|
|
165
|
+
return FLYING_CHARACTERS_SET:has(character)
|
|
166
|
+
end
|
|
167
|
+
--- Helper function to check if the provided character is one of the characters that are selectable
|
|
168
|
+
-- from the main menu (and have achievements related to completing the various bosses and so on).
|
|
169
|
+
function ____exports.isMainCharacter(self, character)
|
|
170
|
+
return MAIN_CHARACTERS_SET:has(character)
|
|
130
171
|
end
|
|
131
172
|
return ____exports
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActiveSlot, CollectibleType, ControllerIndex, PlayerForm, PlayerType, TrinketType } from "isaac-typescript-definitions";
|
|
1
|
+
import { ActiveSlot, CollectibleType, ControllerIndex, NullItemID, PlayerForm, PlayerType, TrinketType } from "isaac-typescript-definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to add one or more collectibles to a player.
|
|
4
4
|
*
|
|
@@ -17,6 +17,10 @@ export declare function addTrinketCostume(player: EntityPlayer, trinketType: Tri
|
|
|
17
17
|
* Default is false.
|
|
18
18
|
*/
|
|
19
19
|
export declare function anyPlayerHasCollectible(collectibleType: CollectibleType, ignoreModifiers?: boolean): boolean;
|
|
20
|
+
/** Helper function to check to see if any player has a temporary collectible effect. */
|
|
21
|
+
export declare function anyPlayerHasCollectibleEffect(collectibleType: CollectibleType): boolean;
|
|
22
|
+
/** Helper function to check to see if any player has a temporary null effect. */
|
|
23
|
+
export declare function anyPlayerHasNullEffect(nullItemID: NullItemID): boolean;
|
|
20
24
|
/**
|
|
21
25
|
* Helper function to check to see if any player has a particular trinket.
|
|
22
26
|
*
|
|
@@ -25,6 +29,8 @@ export declare function anyPlayerHasCollectible(collectibleType: CollectibleType
|
|
|
25
29
|
* effects granted by other items. Default is false.
|
|
26
30
|
*/
|
|
27
31
|
export declare function anyPlayerHasTrinket(trinketType: TrinketType, ignoreModifiers?: boolean): boolean;
|
|
32
|
+
/** Helper function to check to see if any player has a temporary trinket effect. */
|
|
33
|
+
export declare function anyPlayerHasTrinketEffect(trinketType: TrinketType): boolean;
|
|
28
34
|
/**
|
|
29
35
|
* Helper function to check to see if any player is holding up an item (from e.g. an active item
|
|
30
36
|
* activation, a poop from IBS, etc.).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,eAAe,EACf,eAAe,
|
|
1
|
+
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,eAAe,EACf,eAAe,EACf,UAAU,EACV,UAAU,EACV,UAAU,EAEV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAmBtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAIN;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,e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B,IAAI,CAON;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,UAAU,aAAqB,EAC/B,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ,GAClB,IAAI,CA6DN;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN"}
|
|
@@ -105,6 +105,28 @@ function ____exports.anyPlayerHasCollectible(self, collectibleType, ignoreModifi
|
|
|
105
105
|
function(____, player) return player:HasCollectible(collectibleType, ignoreModifiers) end
|
|
106
106
|
)
|
|
107
107
|
end
|
|
108
|
+
--- Helper function to check to see if any player has a temporary collectible effect.
|
|
109
|
+
function ____exports.anyPlayerHasCollectibleEffect(self, collectibleType)
|
|
110
|
+
local players = getAllPlayers(nil)
|
|
111
|
+
return __TS__ArraySome(
|
|
112
|
+
players,
|
|
113
|
+
function(____, player)
|
|
114
|
+
local effects = player:GetEffects()
|
|
115
|
+
return effects:HasCollectibleEffect(collectibleType)
|
|
116
|
+
end
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
--- Helper function to check to see if any player has a temporary null effect.
|
|
120
|
+
function ____exports.anyPlayerHasNullEffect(self, nullItemID)
|
|
121
|
+
local players = getAllPlayers(nil)
|
|
122
|
+
return __TS__ArraySome(
|
|
123
|
+
players,
|
|
124
|
+
function(____, player)
|
|
125
|
+
local effects = player:GetEffects()
|
|
126
|
+
return effects:HasNullEffect(nullItemID)
|
|
127
|
+
end
|
|
128
|
+
)
|
|
129
|
+
end
|
|
108
130
|
--- Helper function to check to see if any player has a particular trinket.
|
|
109
131
|
--
|
|
110
132
|
-- @param trinketType The trinket type to check for.
|
|
@@ -117,6 +139,17 @@ function ____exports.anyPlayerHasTrinket(self, trinketType, ignoreModifiers)
|
|
|
117
139
|
function(____, player) return player:HasTrinket(trinketType, ignoreModifiers) end
|
|
118
140
|
)
|
|
119
141
|
end
|
|
142
|
+
--- Helper function to check to see if any player has a temporary trinket effect.
|
|
143
|
+
function ____exports.anyPlayerHasTrinketEffect(self, trinketType)
|
|
144
|
+
local players = getAllPlayers(nil)
|
|
145
|
+
return __TS__ArraySome(
|
|
146
|
+
players,
|
|
147
|
+
function(____, player)
|
|
148
|
+
local effects = player:GetEffects()
|
|
149
|
+
return effects:HasTrinketEffect(trinketType)
|
|
150
|
+
end
|
|
151
|
+
)
|
|
152
|
+
end
|
|
120
153
|
--- Helper function to check to see if any player is holding up an item (from e.g. an active item
|
|
121
154
|
-- activation, a poop from IBS, etc.).
|
|
122
155
|
function ____exports.anyPlayerHoldingItem(self)
|
|
@@ -584,7 +617,7 @@ function ____exports.removeAllActiveItems(self, player)
|
|
|
584
617
|
do
|
|
585
618
|
local collectibleType = player:GetActiveItem(activeSlot)
|
|
586
619
|
if collectibleType == CollectibleType.NULL then
|
|
587
|
-
goto
|
|
620
|
+
goto __continue104
|
|
588
621
|
end
|
|
589
622
|
local stillHasCollectible
|
|
590
623
|
repeat
|
|
@@ -594,7 +627,7 @@ function ____exports.removeAllActiveItems(self, player)
|
|
|
594
627
|
end
|
|
595
628
|
until not stillHasCollectible
|
|
596
629
|
end
|
|
597
|
-
::
|
|
630
|
+
::__continue104::
|
|
598
631
|
end
|
|
599
632
|
end
|
|
600
633
|
--- Helper function to remove all of the held trinkets from a player.
|
|
@@ -606,7 +639,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
|
|
|
606
639
|
do
|
|
607
640
|
local trinketType = player:GetTrinket(trinketSlot)
|
|
608
641
|
if trinketType == TrinketType.NULL then
|
|
609
|
-
goto
|
|
642
|
+
goto __continue109
|
|
610
643
|
end
|
|
611
644
|
local alreadyHasTrinket
|
|
612
645
|
repeat
|
|
@@ -616,7 +649,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
|
|
|
616
649
|
end
|
|
617
650
|
until not alreadyHasTrinket
|
|
618
651
|
end
|
|
619
|
-
::
|
|
652
|
+
::__continue109::
|
|
620
653
|
end
|
|
621
654
|
end
|
|
622
655
|
--- Helper function to remove one or more collectibles to a player.
|
|
@@ -707,9 +740,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
707
740
|
itemPool:RemoveCollectible(collectibleType)
|
|
708
741
|
end
|
|
709
742
|
repeat
|
|
710
|
-
local
|
|
711
|
-
local
|
|
712
|
-
if
|
|
743
|
+
local ____switch131 = activeSlot
|
|
744
|
+
local ____cond131 = ____switch131 == ActiveSlot.PRIMARY
|
|
745
|
+
if ____cond131 then
|
|
713
746
|
do
|
|
714
747
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
715
748
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -718,8 +751,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
718
751
|
break
|
|
719
752
|
end
|
|
720
753
|
end
|
|
721
|
-
|
|
722
|
-
if
|
|
754
|
+
____cond131 = ____cond131 or ____switch131 == ActiveSlot.SECONDARY
|
|
755
|
+
if ____cond131 then
|
|
723
756
|
do
|
|
724
757
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
725
758
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -734,16 +767,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
734
767
|
break
|
|
735
768
|
end
|
|
736
769
|
end
|
|
737
|
-
|
|
738
|
-
if
|
|
770
|
+
____cond131 = ____cond131 or ____switch131 == ActiveSlot.POCKET
|
|
771
|
+
if ____cond131 then
|
|
739
772
|
do
|
|
740
773
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
741
774
|
player:SetActiveCharge(charge, activeSlot)
|
|
742
775
|
break
|
|
743
776
|
end
|
|
744
777
|
end
|
|
745
|
-
|
|
746
|
-
if
|
|
778
|
+
____cond131 = ____cond131 or ____switch131 == ActiveSlot.POCKET_SINGLE_USE
|
|
779
|
+
if ____cond131 then
|
|
747
780
|
do
|
|
748
781
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
749
782
|
break
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@ import { CHARACTERS_WITH_NO_SOUL_HEARTS_SET } from "../sets/charactersWithNoSoul
|
|
|
12
12
|
import { LOST_STYLE_CHARACTERS_SET } from "../sets/lostStyleCharactersSet";
|
|
13
13
|
import { ReadonlySet } from "../types/ReadonlySet";
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const FLYING_CHARACTERS_SET = new ReadonlySet<PlayerType>([
|
|
16
16
|
PlayerType.AZAZEL, // 7
|
|
17
17
|
PlayerType.LOST, // 10
|
|
18
18
|
PlayerType.SOUL, // 17
|
|
@@ -21,6 +21,43 @@ const FLYING_CHARACTERS = new ReadonlySet<PlayerType>([
|
|
|
21
21
|
PlayerType.SOUL_B, // 40
|
|
22
22
|
]);
|
|
23
23
|
|
|
24
|
+
const MAIN_CHARACTERS_SET = new ReadonlySet<PlayerType>([
|
|
25
|
+
PlayerType.ISAAC, // 0
|
|
26
|
+
PlayerType.MAGDALENE, // 1
|
|
27
|
+
PlayerType.CAIN, // 2
|
|
28
|
+
PlayerType.JUDAS, // 3
|
|
29
|
+
PlayerType.BLUE_BABY, // 4
|
|
30
|
+
PlayerType.EVE, // 5
|
|
31
|
+
PlayerType.SAMSON, // 6
|
|
32
|
+
PlayerType.AZAZEL, // 7
|
|
33
|
+
PlayerType.LAZARUS, // 8
|
|
34
|
+
PlayerType.EDEN, // 9
|
|
35
|
+
PlayerType.LOST, // 10
|
|
36
|
+
PlayerType.LILITH, // 13
|
|
37
|
+
PlayerType.KEEPER, // 14
|
|
38
|
+
PlayerType.APOLLYON, // 15
|
|
39
|
+
PlayerType.FORGOTTEN, // 16
|
|
40
|
+
PlayerType.BETHANY, // 18
|
|
41
|
+
PlayerType.JACOB, // 19
|
|
42
|
+
PlayerType.ISAAC_B, // 21
|
|
43
|
+
PlayerType.MAGDALENE_B, // 22
|
|
44
|
+
PlayerType.CAIN_B, // 23
|
|
45
|
+
PlayerType.JUDAS_B, // 24
|
|
46
|
+
PlayerType.BLUE_BABY_B, // 25
|
|
47
|
+
PlayerType.EVE_B, // 26
|
|
48
|
+
PlayerType.SAMSON_B, // 27
|
|
49
|
+
PlayerType.AZAZEL_B, // 28
|
|
50
|
+
PlayerType.LAZARUS_B, // 29
|
|
51
|
+
PlayerType.EDEN_B, // 30
|
|
52
|
+
PlayerType.LOST_B, // 31
|
|
53
|
+
PlayerType.LILITH_B, // 32
|
|
54
|
+
PlayerType.KEEPER_B, // 33
|
|
55
|
+
PlayerType.APOLLYON_B, // 34
|
|
56
|
+
PlayerType.FORGOTTEN_B, // 35
|
|
57
|
+
PlayerType.BETHANY_B, // 36
|
|
58
|
+
PlayerType.JACOB_B, // 37
|
|
59
|
+
]);
|
|
60
|
+
|
|
24
61
|
/**
|
|
25
62
|
* Helper function to determine if the given character can have red heart containers. Returns true
|
|
26
63
|
* for characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper, even
|
|
@@ -150,7 +187,15 @@ export function getCharacterStartingCollectibles(
|
|
|
150
187
|
|
|
151
188
|
export function isFlyingCharacter(player: EntityPlayer): boolean {
|
|
152
189
|
const character = player.GetPlayerType();
|
|
153
|
-
return
|
|
190
|
+
return FLYING_CHARACTERS_SET.has(character);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Helper function to check if the provided character is one of the characters that are selectable
|
|
195
|
+
* from the main menu (and have achievements related to completing the various bosses and so on).
|
|
196
|
+
*/
|
|
197
|
+
export function isMainCharacter(character: PlayerType): boolean {
|
|
198
|
+
return MAIN_CHARACTERS_SET.has(character);
|
|
154
199
|
}
|
|
155
200
|
|
|
156
201
|
export function isModdedCharacter(character: PlayerType): boolean {
|
package/src/functions/players.ts
CHANGED
|
@@ -85,6 +85,28 @@ export function anyPlayerHasCollectible(
|
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
/** Helper function to check to see if any player has a temporary collectible effect. */
|
|
89
|
+
export function anyPlayerHasCollectibleEffect(
|
|
90
|
+
collectibleType: CollectibleType,
|
|
91
|
+
): boolean {
|
|
92
|
+
const players = getAllPlayers();
|
|
93
|
+
|
|
94
|
+
return players.some((player) => {
|
|
95
|
+
const effects = player.GetEffects();
|
|
96
|
+
return effects.HasCollectibleEffect(collectibleType);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Helper function to check to see if any player has a temporary null effect. */
|
|
101
|
+
export function anyPlayerHasNullEffect(nullItemID: NullItemID): boolean {
|
|
102
|
+
const players = getAllPlayers();
|
|
103
|
+
|
|
104
|
+
return players.some((player) => {
|
|
105
|
+
const effects = player.GetEffects();
|
|
106
|
+
return effects.HasNullEffect(nullItemID);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
88
110
|
/**
|
|
89
111
|
* Helper function to check to see if any player has a particular trinket.
|
|
90
112
|
*
|
|
@@ -103,6 +125,16 @@ export function anyPlayerHasTrinket(
|
|
|
103
125
|
);
|
|
104
126
|
}
|
|
105
127
|
|
|
128
|
+
/** Helper function to check to see if any player has a temporary trinket effect. */
|
|
129
|
+
export function anyPlayerHasTrinketEffect(trinketType: TrinketType): boolean {
|
|
130
|
+
const players = getAllPlayers();
|
|
131
|
+
|
|
132
|
+
return players.some((player) => {
|
|
133
|
+
const effects = player.GetEffects();
|
|
134
|
+
return effects.HasTrinketEffect(trinketType);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
106
138
|
/**
|
|
107
139
|
* Helper function to check to see if any player is holding up an item (from e.g. an active item
|
|
108
140
|
* activation, a poop from IBS, etc.).
|