isaacscript-common 39.5.0 → 40.0.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 +22 -1
- package/dist/isaacscript-common.lua +95 -60
- package/dist/src/core/constants.d.ts +10 -1
- package/dist/src/core/constants.d.ts.map +1 -1
- package/dist/src/core/constants.lua +48 -0
- package/dist/src/functions/characters.d.ts +1 -1
- package/dist/src/functions/characters.d.ts.map +1 -1
- package/dist/src/functions/characters.lua +6 -46
- 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/core/constants.ts +54 -0
- package/src/functions/characters.ts +4 -47
- 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.).
|
|
@@ -4446,6 +4456,11 @@ declare class FlipDetection extends Feature {
|
|
|
4446
4456
|
private readonly postUseItemFlip;
|
|
4447
4457
|
}
|
|
4448
4458
|
|
|
4459
|
+
/**
|
|
4460
|
+
* An array containing every flying character. This includes non-main characters such as The Soul.
|
|
4461
|
+
*/
|
|
4462
|
+
export declare const FLYING_CHARACTERS: readonly [PlayerType.AZAZEL, PlayerType.LOST, PlayerType.SOUL, PlayerType.LOST_B, PlayerType.JACOB_2_B, PlayerType.SOUL_B];
|
|
4463
|
+
|
|
4449
4464
|
declare class FlyingDetection extends Feature {
|
|
4450
4465
|
private readonly moddedElementSets;
|
|
4451
4466
|
/**
|
|
@@ -8690,7 +8705,7 @@ export declare function isFirstPlayer(player: EntityPlayer): boolean;
|
|
|
8690
8705
|
*/
|
|
8691
8706
|
export declare function isFirstSlotPocketActiveItem(player: EntityPlayer): boolean;
|
|
8692
8707
|
|
|
8693
|
-
export declare function isFlyingCharacter(
|
|
8708
|
+
export declare function isFlyingCharacter(character: PlayerType): boolean;
|
|
8694
8709
|
|
|
8695
8710
|
/**
|
|
8696
8711
|
* Helper function to detect if a particular player is the Found Soul player provided by the
|
|
@@ -10000,6 +10015,12 @@ export declare function logVector(this: void, vector: Vector, name?: string, rou
|
|
|
10000
10015
|
/** Helper type to match all of the lowercase keys of an object. */
|
|
10001
10016
|
export declare type LowercaseKeys<T> = StartsWithLowercase<keyof T>;
|
|
10002
10017
|
|
|
10018
|
+
/**
|
|
10019
|
+
* An array containing every character that is selectable from the main menu (and has achievements
|
|
10020
|
+
* related to completing the various bosses and so on).
|
|
10021
|
+
*/
|
|
10022
|
+
export declare const MAIN_CHARACTERS: readonly [PlayerType.ISAAC, PlayerType.MAGDALENE, PlayerType.CAIN, PlayerType.JUDAS, PlayerType.BLUE_BABY, PlayerType.EVE, PlayerType.SAMSON, PlayerType.AZAZEL, PlayerType.LAZARUS, PlayerType.EDEN, PlayerType.LOST, PlayerType.LILITH, PlayerType.KEEPER, PlayerType.APOLLYON, PlayerType.FORGOTTEN, PlayerType.BETHANY, PlayerType.JACOB, PlayerType.ISAAC_B, PlayerType.MAGDALENE_B, PlayerType.CAIN_B, PlayerType.JUDAS_B, PlayerType.BLUE_BABY_B, PlayerType.EVE_B, PlayerType.SAMSON_B, PlayerType.AZAZEL_B, PlayerType.LAZARUS_B, PlayerType.EDEN_B, PlayerType.LOST_B, PlayerType.LILITH_B, PlayerType.KEEPER_B, PlayerType.APOLLYON_B, PlayerType.FORGOTTEN_B, PlayerType.BETHANY_B, PlayerType.JACOB_B];
|
|
10023
|
+
|
|
10003
10024
|
/**
|
|
10004
10025
|
* Helper function for non-TypeScript users to convert all of the elements in an array to something
|
|
10005
10026
|
* else.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 40.0.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -17938,6 +17938,7 @@ local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
|
17938
17938
|
local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
|
|
17939
17939
|
local DisplayFlag = ____isaac_2Dtypescript_2Ddefinitions.DisplayFlag
|
|
17940
17940
|
local ItemPoolType = ____isaac_2Dtypescript_2Ddefinitions.ItemPoolType
|
|
17941
|
+
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
17941
17942
|
local TrinketSlot = ____isaac_2Dtypescript_2Ddefinitions.TrinketSlot
|
|
17942
17943
|
local ____enums = require("src.functions.enums")
|
|
17943
17944
|
local getEnumLength = ____enums.getEnumLength
|
|
@@ -17963,8 +17964,52 @@ ____exports.DOOR_HITBOX_RADIUS = 11
|
|
|
17963
17964
|
____exports.EGGY_STATE_FRAME_OF_FINAL_SPIDER = 45
|
|
17964
17965
|
____exports.EMPTY_PNG_PATH = "gfx/none.png"
|
|
17965
17966
|
____exports.FIRST_GLITCHED_COLLECTIBLE_TYPE = asCollectibleType(nil, (1 << 32) - 1)
|
|
17967
|
+
____exports.FLYING_CHARACTERS = {
|
|
17968
|
+
PlayerType.AZAZEL,
|
|
17969
|
+
PlayerType.LOST,
|
|
17970
|
+
PlayerType.SOUL,
|
|
17971
|
+
PlayerType.LOST_B,
|
|
17972
|
+
PlayerType.JACOB_2_B,
|
|
17973
|
+
PlayerType.SOUL_B
|
|
17974
|
+
}
|
|
17966
17975
|
____exports.GAME_FRAMES_PER_SECOND = 30
|
|
17967
17976
|
____exports.GAME_FRAMES_PER_MINUTE = ____exports.GAME_FRAMES_PER_SECOND * 60
|
|
17977
|
+
____exports.MAIN_CHARACTERS = {
|
|
17978
|
+
PlayerType.ISAAC,
|
|
17979
|
+
PlayerType.MAGDALENE,
|
|
17980
|
+
PlayerType.CAIN,
|
|
17981
|
+
PlayerType.JUDAS,
|
|
17982
|
+
PlayerType.BLUE_BABY,
|
|
17983
|
+
PlayerType.EVE,
|
|
17984
|
+
PlayerType.SAMSON,
|
|
17985
|
+
PlayerType.AZAZEL,
|
|
17986
|
+
PlayerType.LAZARUS,
|
|
17987
|
+
PlayerType.EDEN,
|
|
17988
|
+
PlayerType.LOST,
|
|
17989
|
+
PlayerType.LILITH,
|
|
17990
|
+
PlayerType.KEEPER,
|
|
17991
|
+
PlayerType.APOLLYON,
|
|
17992
|
+
PlayerType.FORGOTTEN,
|
|
17993
|
+
PlayerType.BETHANY,
|
|
17994
|
+
PlayerType.JACOB,
|
|
17995
|
+
PlayerType.ISAAC_B,
|
|
17996
|
+
PlayerType.MAGDALENE_B,
|
|
17997
|
+
PlayerType.CAIN_B,
|
|
17998
|
+
PlayerType.JUDAS_B,
|
|
17999
|
+
PlayerType.BLUE_BABY_B,
|
|
18000
|
+
PlayerType.EVE_B,
|
|
18001
|
+
PlayerType.SAMSON_B,
|
|
18002
|
+
PlayerType.AZAZEL_B,
|
|
18003
|
+
PlayerType.LAZARUS_B,
|
|
18004
|
+
PlayerType.EDEN_B,
|
|
18005
|
+
PlayerType.LOST_B,
|
|
18006
|
+
PlayerType.LILITH_B,
|
|
18007
|
+
PlayerType.KEEPER_B,
|
|
18008
|
+
PlayerType.APOLLYON_B,
|
|
18009
|
+
PlayerType.FORGOTTEN_B,
|
|
18010
|
+
PlayerType.BETHANY_B,
|
|
18011
|
+
PlayerType.JACOB_B
|
|
18012
|
+
}
|
|
17968
18013
|
____exports.RENDER_FRAMES_PER_SECOND = 60
|
|
17969
18014
|
____exports.RENDER_FRAMES_PER_MINUTE = ____exports.RENDER_FRAMES_PER_SECOND * 60
|
|
17970
18015
|
____exports.GRID_INDEX_CENTER_OF_1X1_ROOM = 67
|
|
@@ -19269,6 +19314,9 @@ local __TS__New = ____lualib.__TS__New
|
|
|
19269
19314
|
local ____exports = {}
|
|
19270
19315
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
19271
19316
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
19317
|
+
local ____constants = require("src.core.constants")
|
|
19318
|
+
local FLYING_CHARACTERS = ____constants.FLYING_CHARACTERS
|
|
19319
|
+
local MAIN_CHARACTERS = ____constants.MAIN_CHARACTERS
|
|
19272
19320
|
local ____constantsFirstLast = require("src.core.constantsFirstLast")
|
|
19273
19321
|
local LAST_VANILLA_CHARACTER = ____constantsFirstLast.LAST_VANILLA_CHARACTER
|
|
19274
19322
|
local ____characterDamageMultipliers = require("src.objects.characterDamageMultipliers")
|
|
@@ -19297,50 +19345,8 @@ end
|
|
|
19297
19345
|
function ____exports.isVanillaCharacter(self, character)
|
|
19298
19346
|
return character <= LAST_VANILLA_CHARACTER
|
|
19299
19347
|
end
|
|
19300
|
-
local FLYING_CHARACTERS_SET = __TS__New(ReadonlySet,
|
|
19301
|
-
|
|
19302
|
-
PlayerType.LOST,
|
|
19303
|
-
PlayerType.SOUL,
|
|
19304
|
-
PlayerType.LOST_B,
|
|
19305
|
-
PlayerType.JACOB_2_B,
|
|
19306
|
-
PlayerType.SOUL_B
|
|
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
|
-
})
|
|
19348
|
+
local FLYING_CHARACTERS_SET = __TS__New(ReadonlySet, FLYING_CHARACTERS)
|
|
19349
|
+
local MAIN_CHARACTERS_SET = __TS__New(ReadonlySet, MAIN_CHARACTERS)
|
|
19344
19350
|
function ____exports.characterCanHaveRedHearts(self, character)
|
|
19345
19351
|
return not CHARACTERS_WITH_NO_RED_HEARTS_SET:has(character)
|
|
19346
19352
|
end
|
|
@@ -19398,8 +19404,7 @@ end
|
|
|
19398
19404
|
function ____exports.getCharacterStartingCollectibles(self, character)
|
|
19399
19405
|
return CHARACTER_STARTING_COLLECTIBLES[character]
|
|
19400
19406
|
end
|
|
19401
|
-
function ____exports.isFlyingCharacter(self,
|
|
19402
|
-
local character = player:GetPlayerType()
|
|
19407
|
+
function ____exports.isFlyingCharacter(self, character)
|
|
19403
19408
|
return FLYING_CHARACTERS_SET:has(character)
|
|
19404
19409
|
end
|
|
19405
19410
|
function ____exports.isMainCharacter(self, character)
|
|
@@ -21995,6 +22000,26 @@ function ____exports.anyPlayerHasCollectible(self, collectibleType, ignoreModifi
|
|
|
21995
22000
|
function(____, player) return player:HasCollectible(collectibleType, ignoreModifiers) end
|
|
21996
22001
|
)
|
|
21997
22002
|
end
|
|
22003
|
+
function ____exports.anyPlayerHasCollectibleEffect(self, collectibleType)
|
|
22004
|
+
local players = getAllPlayers(nil)
|
|
22005
|
+
return __TS__ArraySome(
|
|
22006
|
+
players,
|
|
22007
|
+
function(____, player)
|
|
22008
|
+
local effects = player:GetEffects()
|
|
22009
|
+
return effects:HasCollectibleEffect(collectibleType)
|
|
22010
|
+
end
|
|
22011
|
+
)
|
|
22012
|
+
end
|
|
22013
|
+
function ____exports.anyPlayerHasNullEffect(self, nullItemID)
|
|
22014
|
+
local players = getAllPlayers(nil)
|
|
22015
|
+
return __TS__ArraySome(
|
|
22016
|
+
players,
|
|
22017
|
+
function(____, player)
|
|
22018
|
+
local effects = player:GetEffects()
|
|
22019
|
+
return effects:HasNullEffect(nullItemID)
|
|
22020
|
+
end
|
|
22021
|
+
)
|
|
22022
|
+
end
|
|
21998
22023
|
function ____exports.anyPlayerHasTrinket(self, trinketType, ignoreModifiers)
|
|
21999
22024
|
local players = getAllPlayers(nil)
|
|
22000
22025
|
return __TS__ArraySome(
|
|
@@ -22002,6 +22027,16 @@ function ____exports.anyPlayerHasTrinket(self, trinketType, ignoreModifiers)
|
|
|
22002
22027
|
function(____, player) return player:HasTrinket(trinketType, ignoreModifiers) end
|
|
22003
22028
|
)
|
|
22004
22029
|
end
|
|
22030
|
+
function ____exports.anyPlayerHasTrinketEffect(self, trinketType)
|
|
22031
|
+
local players = getAllPlayers(nil)
|
|
22032
|
+
return __TS__ArraySome(
|
|
22033
|
+
players,
|
|
22034
|
+
function(____, player)
|
|
22035
|
+
local effects = player:GetEffects()
|
|
22036
|
+
return effects:HasTrinketEffect(trinketType)
|
|
22037
|
+
end
|
|
22038
|
+
)
|
|
22039
|
+
end
|
|
22005
22040
|
function ____exports.anyPlayerHoldingItem(self)
|
|
22006
22041
|
local players = getAllPlayers(nil)
|
|
22007
22042
|
return __TS__ArraySome(
|
|
@@ -22322,7 +22357,7 @@ function ____exports.removeAllActiveItems(self, player)
|
|
|
22322
22357
|
do
|
|
22323
22358
|
local collectibleType = player:GetActiveItem(activeSlot)
|
|
22324
22359
|
if collectibleType == CollectibleType.NULL then
|
|
22325
|
-
goto
|
|
22360
|
+
goto __continue104
|
|
22326
22361
|
end
|
|
22327
22362
|
local stillHasCollectible
|
|
22328
22363
|
repeat
|
|
@@ -22332,7 +22367,7 @@ function ____exports.removeAllActiveItems(self, player)
|
|
|
22332
22367
|
end
|
|
22333
22368
|
until not stillHasCollectible
|
|
22334
22369
|
end
|
|
22335
|
-
::
|
|
22370
|
+
::__continue104::
|
|
22336
22371
|
end
|
|
22337
22372
|
end
|
|
22338
22373
|
function ____exports.removeAllPlayerTrinkets(self, player)
|
|
@@ -22340,7 +22375,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
|
|
|
22340
22375
|
do
|
|
22341
22376
|
local trinketType = player:GetTrinket(trinketSlot)
|
|
22342
22377
|
if trinketType == TrinketType.NULL then
|
|
22343
|
-
goto
|
|
22378
|
+
goto __continue109
|
|
22344
22379
|
end
|
|
22345
22380
|
local alreadyHasTrinket
|
|
22346
22381
|
repeat
|
|
@@ -22350,7 +22385,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
|
|
|
22350
22385
|
end
|
|
22351
22386
|
until not alreadyHasTrinket
|
|
22352
22387
|
end
|
|
22353
|
-
::
|
|
22388
|
+
::__continue109::
|
|
22354
22389
|
end
|
|
22355
22390
|
end
|
|
22356
22391
|
function ____exports.removeCollectible(self, player, ...)
|
|
@@ -22410,9 +22445,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
22410
22445
|
itemPool:RemoveCollectible(collectibleType)
|
|
22411
22446
|
end
|
|
22412
22447
|
repeat
|
|
22413
|
-
local
|
|
22414
|
-
local
|
|
22415
|
-
if
|
|
22448
|
+
local ____switch131 = activeSlot
|
|
22449
|
+
local ____cond131 = ____switch131 == ActiveSlot.PRIMARY
|
|
22450
|
+
if ____cond131 then
|
|
22416
22451
|
do
|
|
22417
22452
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
22418
22453
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -22421,8 +22456,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
22421
22456
|
break
|
|
22422
22457
|
end
|
|
22423
22458
|
end
|
|
22424
|
-
|
|
22425
|
-
if
|
|
22459
|
+
____cond131 = ____cond131 or ____switch131 == ActiveSlot.SECONDARY
|
|
22460
|
+
if ____cond131 then
|
|
22426
22461
|
do
|
|
22427
22462
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
22428
22463
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -22437,16 +22472,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
22437
22472
|
break
|
|
22438
22473
|
end
|
|
22439
22474
|
end
|
|
22440
|
-
|
|
22441
|
-
if
|
|
22475
|
+
____cond131 = ____cond131 or ____switch131 == ActiveSlot.POCKET
|
|
22476
|
+
if ____cond131 then
|
|
22442
22477
|
do
|
|
22443
22478
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
22444
22479
|
player:SetActiveCharge(charge, activeSlot)
|
|
22445
22480
|
break
|
|
22446
22481
|
end
|
|
22447
22482
|
end
|
|
22448
|
-
|
|
22449
|
-
if
|
|
22483
|
+
____cond131 = ____cond131 or ____switch131 == ActiveSlot.POCKET_SINGLE_USE
|
|
22484
|
+
if ____cond131 then
|
|
22450
22485
|
do
|
|
22451
22486
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
22452
22487
|
break
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CollectibleType, ItemPoolType } from "isaac-typescript-definitions";
|
|
1
|
+
import { CollectibleType, ItemPoolType, PlayerType } from "isaac-typescript-definitions";
|
|
2
2
|
/**
|
|
3
3
|
* The combination of the following flags:
|
|
4
4
|
* - `DisplayFlag.VISIBLE` (1 << 0)
|
|
@@ -48,10 +48,19 @@ export declare const EMPTY_PNG_PATH = "gfx/none.png";
|
|
|
48
48
|
* This is equal to 4294967295.
|
|
49
49
|
*/
|
|
50
50
|
export declare const FIRST_GLITCHED_COLLECTIBLE_TYPE: CollectibleType;
|
|
51
|
+
/**
|
|
52
|
+
* An array containing every flying character. This includes non-main characters such as The Soul.
|
|
53
|
+
*/
|
|
54
|
+
export declare const FLYING_CHARACTERS: readonly [PlayerType.AZAZEL, PlayerType.LOST, PlayerType.SOUL, PlayerType.LOST_B, PlayerType.JACOB_2_B, PlayerType.SOUL_B];
|
|
51
55
|
/** Game frames are what is returned by the `Game.GetFrameCount` method. */
|
|
52
56
|
export declare const GAME_FRAMES_PER_SECOND = 30;
|
|
53
57
|
/** Game frames are what is returned by the `Game.GetFrameCount` method. */
|
|
54
58
|
export declare const GAME_FRAMES_PER_MINUTE: number;
|
|
59
|
+
/**
|
|
60
|
+
* An array containing every character that is selectable from the main menu (and has achievements
|
|
61
|
+
* related to completing the various bosses and so on).
|
|
62
|
+
*/
|
|
63
|
+
export declare const MAIN_CHARACTERS: readonly [PlayerType.ISAAC, PlayerType.MAGDALENE, PlayerType.CAIN, PlayerType.JUDAS, PlayerType.BLUE_BABY, PlayerType.EVE, PlayerType.SAMSON, PlayerType.AZAZEL, PlayerType.LAZARUS, PlayerType.EDEN, PlayerType.LOST, PlayerType.LILITH, PlayerType.KEEPER, PlayerType.APOLLYON, PlayerType.FORGOTTEN, PlayerType.BETHANY, PlayerType.JACOB, PlayerType.ISAAC_B, PlayerType.MAGDALENE_B, PlayerType.CAIN_B, PlayerType.JUDAS_B, PlayerType.BLUE_BABY_B, PlayerType.EVE_B, PlayerType.SAMSON_B, PlayerType.AZAZEL_B, PlayerType.LAZARUS_B, PlayerType.EDEN_B, PlayerType.LOST_B, PlayerType.LILITH_B, PlayerType.KEEPER_B, PlayerType.APOLLYON_B, PlayerType.FORGOTTEN_B, PlayerType.BETHANY_B, PlayerType.JACOB_B];
|
|
55
64
|
/** Render frames are what is returned by the `Isaac.GetFrameCount` method. */
|
|
56
65
|
export declare const RENDER_FRAMES_PER_SECOND = 60;
|
|
57
66
|
/** Render frames are what is returned by the `Isaac.GetFrameCount` method. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGf,YAAY,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGf,YAAY,EACZ,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAWtC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;EAI7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,SAAS,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,4CAA4C,CAAC;AAE7E,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,iGAAiG;AACjG,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D,gGAAgG;AAChG,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,KAAK,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C;;;;;;GAMG;AAEH,eAAO,MAAM,+BAA+B,iBAAmC,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,iBAAiB,4HAOpB,CAAC;AAEX,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,QAA8B,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,eAAe,qrBAmClB,CAAC;AAEX,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,KAAK,C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vD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAmB,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,6FAA6F;AAC7F,eAAO,MAAM,gDAAgD,QAAS,CAAC;AAEvE,4CAA4C;AAC5C,eAAO,MAAM,8BAA8B,QAA4B,CAAC;AAExE,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,KAAkB,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;;;GAKG;AACH,eAAO,MAAM,SAAS,kBAA0B,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,kBAA0B,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,iBAA4B,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,aAAa,kBAAgC,CAAC"}
|
|
@@ -4,6 +4,7 @@ local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
|
4
4
|
local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
|
|
5
5
|
local DisplayFlag = ____isaac_2Dtypescript_2Ddefinitions.DisplayFlag
|
|
6
6
|
local ItemPoolType = ____isaac_2Dtypescript_2Ddefinitions.ItemPoolType
|
|
7
|
+
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
7
8
|
local TrinketSlot = ____isaac_2Dtypescript_2Ddefinitions.TrinketSlot
|
|
8
9
|
local ____enums = require("src.functions.enums")
|
|
9
10
|
local getEnumLength = ____enums.getEnumLength
|
|
@@ -50,10 +51,57 @@ ____exports.EMPTY_PNG_PATH = "gfx/none.png"
|
|
|
50
51
|
--
|
|
51
52
|
-- This is equal to 4294967295.
|
|
52
53
|
____exports.FIRST_GLITCHED_COLLECTIBLE_TYPE = asCollectibleType(nil, (1 << 32) - 1)
|
|
54
|
+
--- An array containing every flying character. This includes non-main characters such as The Soul.
|
|
55
|
+
____exports.FLYING_CHARACTERS = {
|
|
56
|
+
PlayerType.AZAZEL,
|
|
57
|
+
PlayerType.LOST,
|
|
58
|
+
PlayerType.SOUL,
|
|
59
|
+
PlayerType.LOST_B,
|
|
60
|
+
PlayerType.JACOB_2_B,
|
|
61
|
+
PlayerType.SOUL_B
|
|
62
|
+
}
|
|
53
63
|
--- Game frames are what is returned by the `Game.GetFrameCount` method.
|
|
54
64
|
____exports.GAME_FRAMES_PER_SECOND = 30
|
|
55
65
|
--- Game frames are what is returned by the `Game.GetFrameCount` method.
|
|
56
66
|
____exports.GAME_FRAMES_PER_MINUTE = ____exports.GAME_FRAMES_PER_SECOND * 60
|
|
67
|
+
--- An array containing every character that is selectable from the main menu (and has achievements
|
|
68
|
+
-- related to completing the various bosses and so on).
|
|
69
|
+
____exports.MAIN_CHARACTERS = {
|
|
70
|
+
PlayerType.ISAAC,
|
|
71
|
+
PlayerType.MAGDALENE,
|
|
72
|
+
PlayerType.CAIN,
|
|
73
|
+
PlayerType.JUDAS,
|
|
74
|
+
PlayerType.BLUE_BABY,
|
|
75
|
+
PlayerType.EVE,
|
|
76
|
+
PlayerType.SAMSON,
|
|
77
|
+
PlayerType.AZAZEL,
|
|
78
|
+
PlayerType.LAZARUS,
|
|
79
|
+
PlayerType.EDEN,
|
|
80
|
+
PlayerType.LOST,
|
|
81
|
+
PlayerType.LILITH,
|
|
82
|
+
PlayerType.KEEPER,
|
|
83
|
+
PlayerType.APOLLYON,
|
|
84
|
+
PlayerType.FORGOTTEN,
|
|
85
|
+
PlayerType.BETHANY,
|
|
86
|
+
PlayerType.JACOB,
|
|
87
|
+
PlayerType.ISAAC_B,
|
|
88
|
+
PlayerType.MAGDALENE_B,
|
|
89
|
+
PlayerType.CAIN_B,
|
|
90
|
+
PlayerType.JUDAS_B,
|
|
91
|
+
PlayerType.BLUE_BABY_B,
|
|
92
|
+
PlayerType.EVE_B,
|
|
93
|
+
PlayerType.SAMSON_B,
|
|
94
|
+
PlayerType.AZAZEL_B,
|
|
95
|
+
PlayerType.LAZARUS_B,
|
|
96
|
+
PlayerType.EDEN_B,
|
|
97
|
+
PlayerType.LOST_B,
|
|
98
|
+
PlayerType.LILITH_B,
|
|
99
|
+
PlayerType.KEEPER_B,
|
|
100
|
+
PlayerType.APOLLYON_B,
|
|
101
|
+
PlayerType.FORGOTTEN_B,
|
|
102
|
+
PlayerType.BETHANY_B,
|
|
103
|
+
PlayerType.JACOB_B
|
|
104
|
+
}
|
|
57
105
|
--- Render frames are what is returned by the `Isaac.GetFrameCount` method.
|
|
58
106
|
____exports.RENDER_FRAMES_PER_SECOND = 60
|
|
59
107
|
--- Render frames are what is returned by the `Isaac.GetFrameCount` method.
|
|
@@ -54,7 +54,7 @@ export declare function getCharacterName(character: PlayerType): string;
|
|
|
54
54
|
* Note that this will return an empty array for Eden and Tainted Eden.
|
|
55
55
|
*/
|
|
56
56
|
export declare function getCharacterStartingCollectibles(character: PlayerType): readonly CollectibleType[];
|
|
57
|
-
export declare function isFlyingCharacter(
|
|
57
|
+
export declare function isFlyingCharacter(character: PlayerType): boolean;
|
|
58
58
|
/**
|
|
59
59
|
* Helper function to check if the provided character is one of the characters that are selectable
|
|
60
60
|
* from the main menu (and have achievements related to completing the various bosses and so on).
|
|
@@ -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,8BAA8B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAiB1D;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAExE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEzE;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CACrD,SAAS,EAAE,UAAU,GACpB,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE5E;AAED,8EAA8E;AAC9E,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,UAAU,EACrB,iBAAiB,UAAQ,GACxB,KAAK,CAMP;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAU5E;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,GAAG,CAsBzE;AAED,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAM9D;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,SAAS,EAAE,UAAU,GACpB,SAAS,eAAe,EAAE,CAE5B;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEhE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE9D;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEhE;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEjE"}
|
|
@@ -3,6 +3,9 @@ local __TS__New = ____lualib.__TS__New
|
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
5
5
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
6
|
+
local ____constants = require("src.core.constants")
|
|
7
|
+
local FLYING_CHARACTERS = ____constants.FLYING_CHARACTERS
|
|
8
|
+
local MAIN_CHARACTERS = ____constants.MAIN_CHARACTERS
|
|
6
9
|
local ____constantsFirstLast = require("src.core.constantsFirstLast")
|
|
7
10
|
local LAST_VANILLA_CHARACTER = ____constantsFirstLast.LAST_VANILLA_CHARACTER
|
|
8
11
|
local ____characterDamageMultipliers = require("src.objects.characterDamageMultipliers")
|
|
@@ -31,50 +34,8 @@ end
|
|
|
31
34
|
function ____exports.isVanillaCharacter(self, character)
|
|
32
35
|
return character <= LAST_VANILLA_CHARACTER
|
|
33
36
|
end
|
|
34
|
-
local FLYING_CHARACTERS_SET = __TS__New(ReadonlySet,
|
|
35
|
-
|
|
36
|
-
PlayerType.LOST,
|
|
37
|
-
PlayerType.SOUL,
|
|
38
|
-
PlayerType.LOST_B,
|
|
39
|
-
PlayerType.JACOB_2_B,
|
|
40
|
-
PlayerType.SOUL_B
|
|
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
|
-
})
|
|
37
|
+
local FLYING_CHARACTERS_SET = __TS__New(ReadonlySet, FLYING_CHARACTERS)
|
|
38
|
+
local MAIN_CHARACTERS_SET = __TS__New(ReadonlySet, MAIN_CHARACTERS)
|
|
78
39
|
--- Helper function to determine if the given character can have red heart containers. Returns true
|
|
79
40
|
-- for characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper, even
|
|
80
41
|
-- though coin containers are not technically the same as red heart containers. Returns false for
|
|
@@ -160,8 +121,7 @@ end
|
|
|
160
121
|
function ____exports.getCharacterStartingCollectibles(self, character)
|
|
161
122
|
return CHARACTER_STARTING_COLLECTIBLES[character]
|
|
162
123
|
end
|
|
163
|
-
function ____exports.isFlyingCharacter(self,
|
|
164
|
-
local character = player:GetPlayerType()
|
|
124
|
+
function ____exports.isFlyingCharacter(self, character)
|
|
165
125
|
return FLYING_CHARACTERS_SET:has(character)
|
|
166
126
|
end
|
|
167
127
|
--- Helper function to check if the provided character is one of the characters that are selectable
|
|
@@ -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;;;;;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CACtC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAQN;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAIlE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,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
package/src/core/constants.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
Dimension,
|
|
4
4
|
DisplayFlag,
|
|
5
5
|
ItemPoolType,
|
|
6
|
+
PlayerType,
|
|
6
7
|
TrinketSlot,
|
|
7
8
|
} from "isaac-typescript-definitions";
|
|
8
9
|
import { getEnumLength } from "../functions/enums";
|
|
@@ -77,12 +78,65 @@ export const EMPTY_PNG_PATH = "gfx/none.png";
|
|
|
77
78
|
|
|
78
79
|
export const FIRST_GLITCHED_COLLECTIBLE_TYPE = asCollectibleType((1 << 32) - 1);
|
|
79
80
|
|
|
81
|
+
/**
|
|
82
|
+
* An array containing every flying character. This includes non-main characters such as The Soul.
|
|
83
|
+
*/
|
|
84
|
+
export const FLYING_CHARACTERS = [
|
|
85
|
+
PlayerType.AZAZEL, // 7
|
|
86
|
+
PlayerType.LOST, // 10
|
|
87
|
+
PlayerType.SOUL, // 17
|
|
88
|
+
PlayerType.LOST_B, // 31
|
|
89
|
+
PlayerType.JACOB_2_B, // 39
|
|
90
|
+
PlayerType.SOUL_B, // 40
|
|
91
|
+
] as const;
|
|
92
|
+
|
|
80
93
|
/** Game frames are what is returned by the `Game.GetFrameCount` method. */
|
|
81
94
|
export const GAME_FRAMES_PER_SECOND = 30;
|
|
82
95
|
|
|
83
96
|
/** Game frames are what is returned by the `Game.GetFrameCount` method. */
|
|
84
97
|
export const GAME_FRAMES_PER_MINUTE = GAME_FRAMES_PER_SECOND * 60;
|
|
85
98
|
|
|
99
|
+
/**
|
|
100
|
+
* An array containing every character that is selectable from the main menu (and has achievements
|
|
101
|
+
* related to completing the various bosses and so on).
|
|
102
|
+
*/
|
|
103
|
+
export const MAIN_CHARACTERS = [
|
|
104
|
+
PlayerType.ISAAC, // 0
|
|
105
|
+
PlayerType.MAGDALENE, // 1
|
|
106
|
+
PlayerType.CAIN, // 2
|
|
107
|
+
PlayerType.JUDAS, // 3
|
|
108
|
+
PlayerType.BLUE_BABY, // 4
|
|
109
|
+
PlayerType.EVE, // 5
|
|
110
|
+
PlayerType.SAMSON, // 6
|
|
111
|
+
PlayerType.AZAZEL, // 7
|
|
112
|
+
PlayerType.LAZARUS, // 8
|
|
113
|
+
PlayerType.EDEN, // 9
|
|
114
|
+
PlayerType.LOST, // 10
|
|
115
|
+
PlayerType.LILITH, // 13
|
|
116
|
+
PlayerType.KEEPER, // 14
|
|
117
|
+
PlayerType.APOLLYON, // 15
|
|
118
|
+
PlayerType.FORGOTTEN, // 16
|
|
119
|
+
PlayerType.BETHANY, // 18
|
|
120
|
+
PlayerType.JACOB, // 19
|
|
121
|
+
PlayerType.ISAAC_B, // 21
|
|
122
|
+
PlayerType.MAGDALENE_B, // 22
|
|
123
|
+
PlayerType.CAIN_B, // 23
|
|
124
|
+
PlayerType.JUDAS_B, // 24
|
|
125
|
+
PlayerType.BLUE_BABY_B, // 25
|
|
126
|
+
PlayerType.EVE_B, // 26
|
|
127
|
+
PlayerType.SAMSON_B, // 27
|
|
128
|
+
PlayerType.AZAZEL_B, // 28
|
|
129
|
+
PlayerType.LAZARUS_B, // 29
|
|
130
|
+
PlayerType.EDEN_B, // 30
|
|
131
|
+
PlayerType.LOST_B, // 31
|
|
132
|
+
PlayerType.LILITH_B, // 32
|
|
133
|
+
PlayerType.KEEPER_B, // 33
|
|
134
|
+
PlayerType.APOLLYON_B, // 34
|
|
135
|
+
PlayerType.FORGOTTEN_B, // 35
|
|
136
|
+
PlayerType.BETHANY_B, // 36
|
|
137
|
+
PlayerType.JACOB_B, // 37
|
|
138
|
+
] as const;
|
|
139
|
+
|
|
86
140
|
/** Render frames are what is returned by the `Isaac.GetFrameCount` method. */
|
|
87
141
|
export const RENDER_FRAMES_PER_SECOND = 60;
|
|
88
142
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CollectibleType } from "isaac-typescript-definitions";
|
|
2
2
|
import { PlayerType } from "isaac-typescript-definitions";
|
|
3
|
+
import { FLYING_CHARACTERS, MAIN_CHARACTERS } from "../core/constants";
|
|
3
4
|
import { LAST_VANILLA_CHARACTER } from "../core/constantsFirstLast";
|
|
4
5
|
import { CHARACTER_DAMAGE_MULTIPLIERS } from "../objects/characterDamageMultipliers";
|
|
5
6
|
import { CHARACTER_NAMES } from "../objects/characterNames";
|
|
@@ -12,51 +13,8 @@ import { CHARACTERS_WITH_NO_SOUL_HEARTS_SET } from "../sets/charactersWithNoSoul
|
|
|
12
13
|
import { LOST_STYLE_CHARACTERS_SET } from "../sets/lostStyleCharactersSet";
|
|
13
14
|
import { ReadonlySet } from "../types/ReadonlySet";
|
|
14
15
|
|
|
15
|
-
const FLYING_CHARACTERS_SET = new ReadonlySet<PlayerType>(
|
|
16
|
-
|
|
17
|
-
PlayerType.LOST, // 10
|
|
18
|
-
PlayerType.SOUL, // 17
|
|
19
|
-
PlayerType.LOST_B, // 31
|
|
20
|
-
PlayerType.JACOB_2_B, // 39
|
|
21
|
-
PlayerType.SOUL_B, // 40
|
|
22
|
-
]);
|
|
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
|
-
]);
|
|
16
|
+
const FLYING_CHARACTERS_SET = new ReadonlySet<PlayerType>(FLYING_CHARACTERS);
|
|
17
|
+
const MAIN_CHARACTERS_SET = new ReadonlySet<PlayerType>(MAIN_CHARACTERS);
|
|
60
18
|
|
|
61
19
|
/**
|
|
62
20
|
* Helper function to determine if the given character can have red heart containers. Returns true
|
|
@@ -185,8 +143,7 @@ export function getCharacterStartingCollectibles(
|
|
|
185
143
|
return CHARACTER_STARTING_COLLECTIBLES[character];
|
|
186
144
|
}
|
|
187
145
|
|
|
188
|
-
export function isFlyingCharacter(
|
|
189
|
-
const character = player.GetPlayerType();
|
|
146
|
+
export function isFlyingCharacter(character: PlayerType): boolean {
|
|
190
147
|
return FLYING_CHARACTERS_SET.has(character);
|
|
191
148
|
}
|
|
192
149
|
|
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.).
|