isaacscript-common 57.7.0 → 57.9.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 +9 -0
- package/dist/isaacscript-common.lua +73 -44
- package/dist/src/functions/bosses.d.ts +12 -0
- package/dist/src/functions/bosses.d.ts.map +1 -1
- package/dist/src/functions/bosses.lua +24 -10
- package/dist/src/functions/entities.d.ts +0 -6
- package/dist/src/functions/entities.d.ts.map +1 -1
- package/dist/src/functions/entities.lua +0 -8
- package/dist/src/functions/pills.d.ts +1 -0
- package/dist/src/functions/pills.d.ts.map +1 -1
- package/dist/src/functions/pills.lua +7 -2
- package/dist/src/objects/pillEffectTypeToPillEffects.d.ts +9 -0
- package/dist/src/objects/pillEffectTypeToPillEffects.d.ts.map +1 -0
- package/dist/src/objects/pillEffectTypeToPillEffects.lua +28 -0
- package/dist/src/sets/bossSets.d.ts +3 -1
- package/dist/src/sets/bossSets.d.ts.map +1 -1
- package/dist/src/sets/bossSets.lua +18 -2
- package/package.json +1 -1
- package/src/functions/bosses.ts +23 -3
- package/src/functions/entities.ts +0 -10
- package/src/functions/pills.ts +9 -2
- package/src/objects/pillEffectTypeToPillEffects.ts +41 -0
- package/src/sets/bossSets.ts +23 -2
- package/dist/src/sets/storyBossEntityTypesSet.d.ts +0 -3
- package/dist/src/sets/storyBossEntityTypesSet.d.ts.map +0 -1
- package/dist/src/sets/storyBossEntityTypesSet.lua +0 -23
- package/src/sets/storyBossEntityTypesSet.ts +0 -18
package/dist/index.rollup.d.ts
CHANGED
|
@@ -7841,6 +7841,8 @@ export declare function getUsableActiveItemSlots(player: EntityPlayer, collectib
|
|
|
7841
7841
|
*/
|
|
7842
7842
|
export declare function getVanillaCollectibleTypesOfQuality(quality: Quality): ReadonlySet<CollectibleType>;
|
|
7843
7843
|
|
|
7844
|
+
export declare function getVanillaPillEffectsOfType(pillEffectType: ItemConfigPillEffectType): readonly PillEffect[];
|
|
7845
|
+
|
|
7844
7846
|
/**
|
|
7845
7847
|
* Helper function to get the set of grid indexes that represent where the walls are supposed to be
|
|
7846
7848
|
* in a given room shape.
|
|
@@ -9722,6 +9724,13 @@ export declare function isStageWithStoryBoss(stage: LevelStage): boolean;
|
|
|
9722
9724
|
*/
|
|
9723
9725
|
export declare function isStoryBoss(entityType: EntityType): boolean;
|
|
9724
9726
|
|
|
9727
|
+
/**
|
|
9728
|
+
* Helper function to determine if the specified boss ID is an end-game story boss, like Isaac, Blue
|
|
9729
|
+
* Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only apply
|
|
9730
|
+
* to non-story bosses, like Vanishing Twin.
|
|
9731
|
+
*/
|
|
9732
|
+
export declare function isStoryBossID(bossID: BossID): boolean;
|
|
9733
|
+
|
|
9725
9734
|
export declare function isString(variable: unknown): variable is string;
|
|
9726
9735
|
|
|
9727
9736
|
/** Returns true for card types that have `ItemConfigCardType.SUIT`. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 57.
|
|
3
|
+
isaacscript-common 57.9.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -21493,31 +21493,6 @@ ____exports.ENTITIES_WITH_ARMOR_SET = __TS__New(
|
|
|
21493
21493
|
(tostring(EntityType.BEAST) .. ".") .. tostring(BeastVariant.ULTRA_DEATH)
|
|
21494
21494
|
}
|
|
21495
21495
|
)
|
|
21496
|
-
return ____exports
|
|
21497
|
-
end,
|
|
21498
|
-
["src.sets.storyBossEntityTypesSet"] = function(...)
|
|
21499
|
-
local ____lualib = require("lualib_bundle")
|
|
21500
|
-
local __TS__New = ____lualib.__TS__New
|
|
21501
|
-
local ____exports = {}
|
|
21502
|
-
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
21503
|
-
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
21504
|
-
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
21505
|
-
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
21506
|
-
____exports.STORY_BOSS_ENTITY_TYPES_SET = __TS__New(ReadonlySet, {
|
|
21507
|
-
EntityType.MOM,
|
|
21508
|
-
EntityType.MOMS_HEART,
|
|
21509
|
-
EntityType.SATAN,
|
|
21510
|
-
EntityType.ISAAC,
|
|
21511
|
-
EntityType.LAMB,
|
|
21512
|
-
EntityType.MEGA_SATAN,
|
|
21513
|
-
EntityType.MEGA_SATAN_2,
|
|
21514
|
-
EntityType.ULTRA_GREED,
|
|
21515
|
-
EntityType.HUSH,
|
|
21516
|
-
EntityType.DELIRIUM,
|
|
21517
|
-
EntityType.MOTHER,
|
|
21518
|
-
EntityType.DOGMA,
|
|
21519
|
-
EntityType.BEAST
|
|
21520
|
-
})
|
|
21521
21496
|
return ____exports
|
|
21522
21497
|
end,
|
|
21523
21498
|
["src.types.AnyEntity"] = function(...)
|
|
@@ -21633,8 +21608,6 @@ local ____constants = require("src.core.constants")
|
|
|
21633
21608
|
local VectorZero = ____constants.VectorZero
|
|
21634
21609
|
local ____entitiesWithArmorSet = require("src.sets.entitiesWithArmorSet")
|
|
21635
21610
|
local ENTITIES_WITH_ARMOR_SET = ____entitiesWithArmorSet.ENTITIES_WITH_ARMOR_SET
|
|
21636
|
-
local ____storyBossEntityTypesSet = require("src.sets.storyBossEntityTypesSet")
|
|
21637
|
-
local STORY_BOSS_ENTITY_TYPES_SET = ____storyBossEntityTypesSet.STORY_BOSS_ENTITY_TYPES_SET
|
|
21638
21611
|
local ____isaacAPIClass = require("src.functions.isaacAPIClass")
|
|
21639
21612
|
local getIsaacAPIClassName = ____isaacAPIClass.getIsaacAPIClassName
|
|
21640
21613
|
local ____random = require("src.functions.random")
|
|
@@ -21875,9 +21848,6 @@ function ____exports.isEntityMoving(self, entity, threshold)
|
|
|
21875
21848
|
end
|
|
21876
21849
|
return doesVectorHaveLength(nil, entity.Velocity, threshold)
|
|
21877
21850
|
end
|
|
21878
|
-
function ____exports.isStoryBoss(self, entityType)
|
|
21879
|
-
return STORY_BOSS_ENTITY_TYPES_SET:has(entityType)
|
|
21880
|
-
end
|
|
21881
21851
|
function ____exports.parseEntityID(self, entityID)
|
|
21882
21852
|
local entityIDArray = __TS__StringSplit(entityID, ".")
|
|
21883
21853
|
if #entityIDArray ~= 3 then
|
|
@@ -33243,6 +33213,36 @@ ____exports.PILL_EFFECT_TYPES = {
|
|
|
33243
33213
|
[PillEffect.SHOT_SPEED_UP] = ItemConfigPillEffectType.POSITIVE,
|
|
33244
33214
|
[PillEffect.EXPERIMENTAL] = ItemConfigPillEffectType.NEUTRAL
|
|
33245
33215
|
}
|
|
33216
|
+
return ____exports
|
|
33217
|
+
end,
|
|
33218
|
+
["src.objects.pillEffectTypeToPillEffects"] = function(...)
|
|
33219
|
+
local ____exports = {}
|
|
33220
|
+
local getPillEffectsOfType
|
|
33221
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
33222
|
+
local ItemConfigPillEffectType = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigPillEffectType
|
|
33223
|
+
local ____constantsVanilla = require("src.core.constantsVanilla")
|
|
33224
|
+
local VANILLA_PILL_EFFECTS = ____constantsVanilla.VANILLA_PILL_EFFECTS
|
|
33225
|
+
local ____array = require("src.functions.array")
|
|
33226
|
+
local filterMap = ____array.filterMap
|
|
33227
|
+
local ____pillEffectTypes = require("src.objects.pillEffectTypes")
|
|
33228
|
+
local PILL_EFFECT_TYPES = ____pillEffectTypes.PILL_EFFECT_TYPES
|
|
33229
|
+
function getPillEffectsOfType(self, matchingPillEffectType)
|
|
33230
|
+
return filterMap(
|
|
33231
|
+
nil,
|
|
33232
|
+
VANILLA_PILL_EFFECTS,
|
|
33233
|
+
function(____, pillEffect)
|
|
33234
|
+
local pillEffectType = PILL_EFFECT_TYPES[pillEffect]
|
|
33235
|
+
return pillEffectType == matchingPillEffectType and pillEffect or nil
|
|
33236
|
+
end
|
|
33237
|
+
)
|
|
33238
|
+
end
|
|
33239
|
+
____exports.PILL_EFFECT_TYPE_TO_PILL_EFFECTS = {
|
|
33240
|
+
[ItemConfigPillEffectType.NULL] = getPillEffectsOfType(nil, ItemConfigPillEffectType.NULL),
|
|
33241
|
+
[ItemConfigPillEffectType.POSITIVE] = getPillEffectsOfType(nil, ItemConfigPillEffectType.POSITIVE),
|
|
33242
|
+
[ItemConfigPillEffectType.NEGATIVE] = getPillEffectsOfType(nil, ItemConfigPillEffectType.NEGATIVE),
|
|
33243
|
+
[ItemConfigPillEffectType.NEUTRAL] = getPillEffectsOfType(nil, ItemConfigPillEffectType.NEUTRAL),
|
|
33244
|
+
[ItemConfigPillEffectType.MODDED] = getPillEffectsOfType(nil, ItemConfigPillEffectType.MODDED)
|
|
33245
|
+
}
|
|
33246
33246
|
return ____exports
|
|
33247
33247
|
end,
|
|
33248
33248
|
["src.functions.pills"] = function(...)
|
|
@@ -33272,6 +33272,8 @@ local PILL_EFFECT_CLASSES = ____pillEffectClasses.PILL_EFFECT_CLASSES
|
|
|
33272
33272
|
local ____pillEffectNames = require("src.objects.pillEffectNames")
|
|
33273
33273
|
local DEFAULT_PILL_EFFECT_NAME = ____pillEffectNames.DEFAULT_PILL_EFFECT_NAME
|
|
33274
33274
|
local PILL_EFFECT_NAMES = ____pillEffectNames.PILL_EFFECT_NAMES
|
|
33275
|
+
local ____pillEffectTypeToPillEffects = require("src.objects.pillEffectTypeToPillEffects")
|
|
33276
|
+
local PILL_EFFECT_TYPE_TO_PILL_EFFECTS = ____pillEffectTypeToPillEffects.PILL_EFFECT_TYPE_TO_PILL_EFFECTS
|
|
33275
33277
|
local ____pillEffectTypes = require("src.objects.pillEffectTypes")
|
|
33276
33278
|
local DEFAULT_PILL_EFFECT_TYPE = ____pillEffectTypes.DEFAULT_PILL_EFFECT_TYPE
|
|
33277
33279
|
local PILL_EFFECT_TYPES = ____pillEffectTypes.PILL_EFFECT_TYPES
|
|
@@ -33338,8 +33340,11 @@ function ____exports.getPillEffectName(self, pillEffect)
|
|
|
33338
33340
|
return DEFAULT_PILL_EFFECT_NAME
|
|
33339
33341
|
end
|
|
33340
33342
|
function ____exports.getPillEffectType(self, pillEffect)
|
|
33341
|
-
local
|
|
33342
|
-
return
|
|
33343
|
+
local pillEffectType = PILL_EFFECT_TYPES[pillEffect]
|
|
33344
|
+
return pillEffectType or DEFAULT_PILL_EFFECT_TYPE
|
|
33345
|
+
end
|
|
33346
|
+
function ____exports.getVanillaPillEffectsOfType(self, pillEffectType)
|
|
33347
|
+
return PILL_EFFECT_TYPE_TO_PILL_EFFECTS[pillEffectType]
|
|
33343
33348
|
end
|
|
33344
33349
|
function ____exports.isGoldPill(self, pillColor)
|
|
33345
33350
|
return pillColor == PillColor.GOLD or pillColor == PillColor.HORSE_GOLD
|
|
@@ -44194,6 +44199,7 @@ local __TS__Spread = ____lualib.__TS__Spread
|
|
|
44194
44199
|
local ____exports = {}
|
|
44195
44200
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
44196
44201
|
local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
|
|
44202
|
+
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
44197
44203
|
local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
|
|
44198
44204
|
local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
|
|
44199
44205
|
local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
|
|
@@ -44510,7 +44516,7 @@ ____exports.ALL_BOSSES_SET = __TS__New(
|
|
|
44510
44516
|
function(____, bossID) return bossID ~= BossID.RAGLICH end
|
|
44511
44517
|
)
|
|
44512
44518
|
)
|
|
44513
|
-
|
|
44519
|
+
____exports.STORY_BOSS_IDS_SET = __TS__New(ReadonlySet, {
|
|
44514
44520
|
BossID.MOM,
|
|
44515
44521
|
BossID.MOMS_HEART,
|
|
44516
44522
|
BossID.SATAN,
|
|
@@ -44529,11 +44535,26 @@ local STORY_BOSS_IDS_SET = __TS__New(ReadonlySet, {
|
|
|
44529
44535
|
BossID.DOGMA,
|
|
44530
44536
|
BossID.BEAST
|
|
44531
44537
|
})
|
|
44538
|
+
____exports.STORY_BOSS_ENTITY_TYPES_SET = __TS__New(ReadonlySet, {
|
|
44539
|
+
EntityType.MOM,
|
|
44540
|
+
EntityType.MOMS_HEART,
|
|
44541
|
+
EntityType.SATAN,
|
|
44542
|
+
EntityType.ISAAC,
|
|
44543
|
+
EntityType.LAMB,
|
|
44544
|
+
EntityType.MEGA_SATAN,
|
|
44545
|
+
EntityType.MEGA_SATAN_2,
|
|
44546
|
+
EntityType.ULTRA_GREED,
|
|
44547
|
+
EntityType.HUSH,
|
|
44548
|
+
EntityType.DELIRIUM,
|
|
44549
|
+
EntityType.MOTHER,
|
|
44550
|
+
EntityType.DOGMA,
|
|
44551
|
+
EntityType.BEAST
|
|
44552
|
+
})
|
|
44532
44553
|
____exports.ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET = __TS__New(
|
|
44533
44554
|
ReadonlySet,
|
|
44534
44555
|
__TS__ArrayFilter(
|
|
44535
44556
|
{__TS__Spread(____exports.ALL_BOSSES_SET)},
|
|
44536
|
-
function(____, bossID) return not STORY_BOSS_IDS_SET:has(bossID) end
|
|
44557
|
+
function(____, bossID) return not ____exports.STORY_BOSS_IDS_SET:has(bossID) end
|
|
44537
44558
|
)
|
|
44538
44559
|
)
|
|
44539
44560
|
return ____exports
|
|
@@ -44733,6 +44754,8 @@ local ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET = ____bossSets.ALL_BOSSES_EXCLUDING_
|
|
|
44733
44754
|
local ALL_BOSSES_SET = ____bossSets.ALL_BOSSES_SET
|
|
44734
44755
|
local STAGE_TO_COMBINED_BOSS_SET_MAP = ____bossSets.STAGE_TO_COMBINED_BOSS_SET_MAP
|
|
44735
44756
|
local STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP = ____bossSets.STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP
|
|
44757
|
+
local STORY_BOSS_ENTITY_TYPES_SET = ____bossSets.STORY_BOSS_ENTITY_TYPES_SET
|
|
44758
|
+
local STORY_BOSS_IDS_SET = ____bossSets.STORY_BOSS_IDS_SET
|
|
44736
44759
|
local ____repentanceBossIDsSet = require("src.sets.repentanceBossIDsSet")
|
|
44737
44760
|
local REPENTANCE_ONLY_BOSS_IDS_SET = ____repentanceBossIDsSet.REPENTANCE_ONLY_BOSS_IDS_SET
|
|
44738
44761
|
local ____sinEntityTypesSet = require("src.sets.sinEntityTypesSet")
|
|
@@ -44841,26 +44864,29 @@ end
|
|
|
44841
44864
|
function ____exports.isRepentanceBoss(self, bossID)
|
|
44842
44865
|
return REPENTANCE_ONLY_BOSS_IDS_SET:has(bossID)
|
|
44843
44866
|
end
|
|
44867
|
+
function ____exports.isSin(self, npc)
|
|
44868
|
+
return SIN_ENTITY_TYPES_SET:has(npc.Type)
|
|
44869
|
+
end
|
|
44844
44870
|
local function getNumBossSegments(self, entityType, variant, numSegments)
|
|
44845
44871
|
if numSegments ~= nil then
|
|
44846
44872
|
return numSegments
|
|
44847
44873
|
end
|
|
44848
44874
|
repeat
|
|
44849
|
-
local
|
|
44850
|
-
local
|
|
44851
|
-
if
|
|
44875
|
+
local ____switch20 = entityType
|
|
44876
|
+
local ____cond20 = ____switch20 == EntityType.CHUB
|
|
44877
|
+
if ____cond20 then
|
|
44852
44878
|
do
|
|
44853
44879
|
return 3
|
|
44854
44880
|
end
|
|
44855
44881
|
end
|
|
44856
|
-
|
|
44857
|
-
if
|
|
44882
|
+
____cond20 = ____cond20 or ____switch20 == EntityType.LOKI
|
|
44883
|
+
if ____cond20 then
|
|
44858
44884
|
do
|
|
44859
44885
|
return variant == asNumber(nil, LokiVariant.LOKII) and 2 or 1
|
|
44860
44886
|
end
|
|
44861
44887
|
end
|
|
44862
|
-
|
|
44863
|
-
if
|
|
44888
|
+
____cond20 = ____cond20 or ____switch20 == EntityType.GURGLING
|
|
44889
|
+
if ____cond20 then
|
|
44864
44890
|
do
|
|
44865
44891
|
return 2
|
|
44866
44892
|
end
|
|
@@ -44872,8 +44898,11 @@ local function getNumBossSegments(self, entityType, variant, numSegments)
|
|
|
44872
44898
|
end
|
|
44873
44899
|
until true
|
|
44874
44900
|
end
|
|
44875
|
-
function ____exports.
|
|
44876
|
-
return
|
|
44901
|
+
function ____exports.isStoryBoss(self, entityType)
|
|
44902
|
+
return STORY_BOSS_ENTITY_TYPES_SET:has(entityType)
|
|
44903
|
+
end
|
|
44904
|
+
function ____exports.isStoryBossID(self, bossID)
|
|
44905
|
+
return STORY_BOSS_IDS_SET:has(bossID)
|
|
44877
44906
|
end
|
|
44878
44907
|
function ____exports.spawnBoss(self, entityType, variant, subType, positionOrGridIndex, velocity, spawner, seedOrRNG, numSegments)
|
|
44879
44908
|
if velocity == nil then
|
|
@@ -88,6 +88,18 @@ export declare function getEntityTypeVariantFromBossID(bossID: BossID): readonly
|
|
|
88
88
|
export declare function isRepentanceBoss(bossID: BossID): boolean;
|
|
89
89
|
/** Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust. */
|
|
90
90
|
export declare function isSin(npc: EntityNPC): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Helper function to determine if the specified entity type is an end-game story boss, like Isaac,
|
|
93
|
+
* Blue Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only
|
|
94
|
+
* apply to non-story bosses, like Vanishing Twin.
|
|
95
|
+
*/
|
|
96
|
+
export declare function isStoryBoss(entityType: EntityType): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Helper function to determine if the specified boss ID is an end-game story boss, like Isaac, Blue
|
|
99
|
+
* Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only apply
|
|
100
|
+
* to non-story bosses, like Vanishing Twin.
|
|
101
|
+
*/
|
|
102
|
+
export declare function isStoryBossID(bossID: BossID): boolean;
|
|
91
103
|
/**
|
|
92
104
|
* Helper function to spawn a boss.
|
|
93
105
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,UAAU,EAAe,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,UAAU,EAAe,MAAM,8BAA8B,CAAC;AAkC/E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,UAAU,GAAE,UAAU,GAAG,CAAC,CAAM,EAChC,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAC7B,kBAAkB,UAAO,GACxB,WAAW,CAAC,MAAM,CAAC,CAIrB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,CAAC,CAWtC;AAED,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,GACX,MAAM,GAAG,SAAS,CAGpB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIlD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAOjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS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C,EAAE,GAAG,GAChB,SAAS,CAYX"}
|
|
@@ -22,6 +22,8 @@ local ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET = ____bossSets.ALL_BOSSES_EXCLUDING_
|
|
|
22
22
|
local ALL_BOSSES_SET = ____bossSets.ALL_BOSSES_SET
|
|
23
23
|
local STAGE_TO_COMBINED_BOSS_SET_MAP = ____bossSets.STAGE_TO_COMBINED_BOSS_SET_MAP
|
|
24
24
|
local STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP = ____bossSets.STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP
|
|
25
|
+
local STORY_BOSS_ENTITY_TYPES_SET = ____bossSets.STORY_BOSS_ENTITY_TYPES_SET
|
|
26
|
+
local STORY_BOSS_IDS_SET = ____bossSets.STORY_BOSS_IDS_SET
|
|
25
27
|
local ____repentanceBossIDsSet = require("src.sets.repentanceBossIDsSet")
|
|
26
28
|
local REPENTANCE_ONLY_BOSS_IDS_SET = ____repentanceBossIDsSet.REPENTANCE_ONLY_BOSS_IDS_SET
|
|
27
29
|
local ____sinEntityTypesSet = require("src.sets.sinEntityTypesSet")
|
|
@@ -190,26 +192,30 @@ end
|
|
|
190
192
|
function ____exports.isRepentanceBoss(self, bossID)
|
|
191
193
|
return REPENTANCE_ONLY_BOSS_IDS_SET:has(bossID)
|
|
192
194
|
end
|
|
195
|
+
--- Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust.
|
|
196
|
+
function ____exports.isSin(self, npc)
|
|
197
|
+
return SIN_ENTITY_TYPES_SET:has(npc.Type)
|
|
198
|
+
end
|
|
193
199
|
local function getNumBossSegments(self, entityType, variant, numSegments)
|
|
194
200
|
if numSegments ~= nil then
|
|
195
201
|
return numSegments
|
|
196
202
|
end
|
|
197
203
|
repeat
|
|
198
|
-
local
|
|
199
|
-
local
|
|
200
|
-
if
|
|
204
|
+
local ____switch20 = entityType
|
|
205
|
+
local ____cond20 = ____switch20 == EntityType.CHUB
|
|
206
|
+
if ____cond20 then
|
|
201
207
|
do
|
|
202
208
|
return 3
|
|
203
209
|
end
|
|
204
210
|
end
|
|
205
|
-
|
|
206
|
-
if
|
|
211
|
+
____cond20 = ____cond20 or ____switch20 == EntityType.LOKI
|
|
212
|
+
if ____cond20 then
|
|
207
213
|
do
|
|
208
214
|
return variant == asNumber(nil, LokiVariant.LOKII) and 2 or 1
|
|
209
215
|
end
|
|
210
216
|
end
|
|
211
|
-
|
|
212
|
-
if
|
|
217
|
+
____cond20 = ____cond20 or ____switch20 == EntityType.GURGLING
|
|
218
|
+
if ____cond20 then
|
|
213
219
|
do
|
|
214
220
|
return 2
|
|
215
221
|
end
|
|
@@ -221,9 +227,17 @@ local function getNumBossSegments(self, entityType, variant, numSegments)
|
|
|
221
227
|
end
|
|
222
228
|
until true
|
|
223
229
|
end
|
|
224
|
-
--- Helper function to
|
|
225
|
-
|
|
226
|
-
|
|
230
|
+
--- Helper function to determine if the specified entity type is an end-game story boss, like Isaac,
|
|
231
|
+
-- Blue Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only
|
|
232
|
+
-- apply to non-story bosses, like Vanishing Twin.
|
|
233
|
+
function ____exports.isStoryBoss(self, entityType)
|
|
234
|
+
return STORY_BOSS_ENTITY_TYPES_SET:has(entityType)
|
|
235
|
+
end
|
|
236
|
+
--- Helper function to determine if the specified boss ID is an end-game story boss, like Isaac, Blue
|
|
237
|
+
-- Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only apply
|
|
238
|
+
-- to non-story bosses, like Vanishing Twin.
|
|
239
|
+
function ____exports.isStoryBossID(self, bossID)
|
|
240
|
+
return STORY_BOSS_IDS_SET:has(bossID)
|
|
227
241
|
end
|
|
228
242
|
--- Helper function to spawn a boss.
|
|
229
243
|
--
|
|
@@ -124,12 +124,6 @@ export declare function hasArmor(entity: Entity): boolean;
|
|
|
124
124
|
* @param threshold Optional. The threshold from 0 to consider to be moving. Default is 0.01.
|
|
125
125
|
*/
|
|
126
126
|
export declare function isEntityMoving(entity: Entity, threshold?: number): boolean;
|
|
127
|
-
/**
|
|
128
|
-
* Helper function to determine if the specified entity type is an end-game story boss, like Isaac,
|
|
129
|
-
* Blue Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only
|
|
130
|
-
* apply to non-story bosses, like Vanishing Twin.
|
|
131
|
-
*/
|
|
132
|
-
export declare function isStoryBoss(entityType: EntityType): boolean;
|
|
133
127
|
/**
|
|
134
128
|
* Helper function to parse a string that contains an entity type, a variant, and a sub-type,
|
|
135
129
|
* separated by periods.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/functions/entities.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/functions/entities.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAK/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAsBlD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,UAAU,GAAE,UAAU,GAAG,CAAC,CAAM,EAChC,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,GAAG,CA4BL;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EACP,UAAU,EAAE,GACZ,SAAS,UAAU,EAAE,GACrB,GAAG,CAAC,UAAU,CAAC,GACf,WAAW,CAAC,UAAU,CAAC,EAC3B,cAAc,UAAQ,GACrB,OAAO,CAQT;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,UAAU,GAAE,UAAU,GAAG,CAAC,CAAM,EAChC,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,G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Q,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,GAC5C,MAAM,CAoCR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,GAC5C,MAAM,CAWR;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,MAAM,CAUR"}
|
|
@@ -16,8 +16,6 @@ local ____constants = require("src.core.constants")
|
|
|
16
16
|
local VectorZero = ____constants.VectorZero
|
|
17
17
|
local ____entitiesWithArmorSet = require("src.sets.entitiesWithArmorSet")
|
|
18
18
|
local ENTITIES_WITH_ARMOR_SET = ____entitiesWithArmorSet.ENTITIES_WITH_ARMOR_SET
|
|
19
|
-
local ____storyBossEntityTypesSet = require("src.sets.storyBossEntityTypesSet")
|
|
20
|
-
local STORY_BOSS_ENTITY_TYPES_SET = ____storyBossEntityTypesSet.STORY_BOSS_ENTITY_TYPES_SET
|
|
21
19
|
local ____isaacAPIClass = require("src.functions.isaacAPIClass")
|
|
22
20
|
local getIsaacAPIClassName = ____isaacAPIClass.getIsaacAPIClassName
|
|
23
21
|
local ____random = require("src.functions.random")
|
|
@@ -351,12 +349,6 @@ function ____exports.isEntityMoving(self, entity, threshold)
|
|
|
351
349
|
end
|
|
352
350
|
return doesVectorHaveLength(nil, entity.Velocity, threshold)
|
|
353
351
|
end
|
|
354
|
-
--- Helper function to determine if the specified entity type is an end-game story boss, like Isaac,
|
|
355
|
-
-- Blue Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only
|
|
356
|
-
-- apply to non-story bosses, like Vanishing Twin.
|
|
357
|
-
function ____exports.isStoryBoss(self, entityType)
|
|
358
|
-
return STORY_BOSS_ENTITY_TYPES_SET:has(entityType)
|
|
359
|
-
end
|
|
360
352
|
--- Helper function to parse a string that contains an entity type, a variant, and a sub-type,
|
|
361
353
|
-- separated by periods.
|
|
362
354
|
--
|
|
@@ -78,6 +78,7 @@ export declare function getPillEffectName(pillEffect: PillEffect): string;
|
|
|
78
78
|
* will always return `DEFAULT_PILL_EFFECT_TYPE` in those cases.
|
|
79
79
|
*/
|
|
80
80
|
export declare function getPillEffectType(pillEffect: PillEffect): ItemConfigPillEffectType;
|
|
81
|
+
export declare function getVanillaPillEffectsOfType(pillEffectType: ItemConfigPillEffectType): readonly PillEffect[];
|
|
81
82
|
/** Helper function to see if the given pill color is either a gold pill or a horse gold pill. */
|
|
82
83
|
export declare function isGoldPill(pillColor: PillColor): boolean;
|
|
83
84
|
/** Helper function to see if the given pill color is a horse pill. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pills.d.ts","sourceRoot":"","sources":["../../../src/functions/pills.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACxB,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"pills.d.ts","sourceRoot":"","sources":["../../../src/functions/pills.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACxB,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAqCzD;;;GAGG;AACH,wBAAgB,gBAAgB,I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ffectClasses.PILL_EFFECT_CLASSES
|
|
|
24
24
|
local ____pillEffectNames = require("src.objects.pillEffectNames")
|
|
25
25
|
local DEFAULT_PILL_EFFECT_NAME = ____pillEffectNames.DEFAULT_PILL_EFFECT_NAME
|
|
26
26
|
local PILL_EFFECT_NAMES = ____pillEffectNames.PILL_EFFECT_NAMES
|
|
27
|
+
local ____pillEffectTypeToPillEffects = require("src.objects.pillEffectTypeToPillEffects")
|
|
28
|
+
local PILL_EFFECT_TYPE_TO_PILL_EFFECTS = ____pillEffectTypeToPillEffects.PILL_EFFECT_TYPE_TO_PILL_EFFECTS
|
|
27
29
|
local ____pillEffectTypes = require("src.objects.pillEffectTypes")
|
|
28
30
|
local DEFAULT_PILL_EFFECT_TYPE = ____pillEffectTypes.DEFAULT_PILL_EFFECT_TYPE
|
|
29
31
|
local PILL_EFFECT_TYPES = ____pillEffectTypes.PILL_EFFECT_TYPES
|
|
@@ -144,8 +146,11 @@ end
|
|
|
144
146
|
-- Due to limitations in the API, this function will not work properly for modded pill effects, and
|
|
145
147
|
-- will always return `DEFAULT_PILL_EFFECT_TYPE` in those cases.
|
|
146
148
|
function ____exports.getPillEffectType(self, pillEffect)
|
|
147
|
-
local
|
|
148
|
-
return
|
|
149
|
+
local pillEffectType = PILL_EFFECT_TYPES[pillEffect]
|
|
150
|
+
return pillEffectType or DEFAULT_PILL_EFFECT_TYPE
|
|
151
|
+
end
|
|
152
|
+
function ____exports.getVanillaPillEffectsOfType(self, pillEffectType)
|
|
153
|
+
return PILL_EFFECT_TYPE_TO_PILL_EFFECTS[pillEffectType]
|
|
149
154
|
end
|
|
150
155
|
--- Helper function to see if the given pill color is either a gold pill or a horse gold pill.
|
|
151
156
|
function ____exports.isGoldPill(self, pillColor)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PillEffect } from "isaac-typescript-definitions";
|
|
2
|
+
export declare const PILL_EFFECT_TYPE_TO_PILL_EFFECTS: {
|
|
3
|
+
readonly [-1]: readonly PillEffect[];
|
|
4
|
+
readonly 0: readonly PillEffect[];
|
|
5
|
+
readonly 1: readonly PillEffect[];
|
|
6
|
+
readonly 2: readonly PillEffect[];
|
|
7
|
+
readonly 3: readonly PillEffect[];
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=pillEffectTypeToPillEffects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pillEffectTypeToPillEffects.d.ts","sourceRoot":"","sources":["../../../src/objects/pillEffectTypeToPillEffects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAM/D,eAAO,MAAM,gCAAgC;;;;;;CAyB+B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local getPillEffectsOfType
|
|
3
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
4
|
+
local ItemConfigPillEffectType = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigPillEffectType
|
|
5
|
+
local ____constantsVanilla = require("src.core.constantsVanilla")
|
|
6
|
+
local VANILLA_PILL_EFFECTS = ____constantsVanilla.VANILLA_PILL_EFFECTS
|
|
7
|
+
local ____array = require("src.functions.array")
|
|
8
|
+
local filterMap = ____array.filterMap
|
|
9
|
+
local ____pillEffectTypes = require("src.objects.pillEffectTypes")
|
|
10
|
+
local PILL_EFFECT_TYPES = ____pillEffectTypes.PILL_EFFECT_TYPES
|
|
11
|
+
function getPillEffectsOfType(self, matchingPillEffectType)
|
|
12
|
+
return filterMap(
|
|
13
|
+
nil,
|
|
14
|
+
VANILLA_PILL_EFFECTS,
|
|
15
|
+
function(____, pillEffect)
|
|
16
|
+
local pillEffectType = PILL_EFFECT_TYPES[pillEffect]
|
|
17
|
+
return pillEffectType == matchingPillEffectType and pillEffect or nil
|
|
18
|
+
end
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
____exports.PILL_EFFECT_TYPE_TO_PILL_EFFECTS = {
|
|
22
|
+
[ItemConfigPillEffectType.NULL] = getPillEffectsOfType(nil, ItemConfigPillEffectType.NULL),
|
|
23
|
+
[ItemConfigPillEffectType.POSITIVE] = getPillEffectsOfType(nil, ItemConfigPillEffectType.POSITIVE),
|
|
24
|
+
[ItemConfigPillEffectType.NEGATIVE] = getPillEffectsOfType(nil, ItemConfigPillEffectType.NEGATIVE),
|
|
25
|
+
[ItemConfigPillEffectType.NEUTRAL] = getPillEffectsOfType(nil, ItemConfigPillEffectType.NEUTRAL),
|
|
26
|
+
[ItemConfigPillEffectType.MODDED] = getPillEffectsOfType(nil, ItemConfigPillEffectType.MODDED)
|
|
27
|
+
}
|
|
28
|
+
return ____exports
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { BossID, LevelStage } from "isaac-typescript-definitions";
|
|
1
|
+
import { BossID, EntityType, LevelStage } from "isaac-typescript-definitions";
|
|
2
2
|
export declare const STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP: ReadonlyMap<LevelStage, ReadonlyMap<int, ReadonlySet<BossID>>>;
|
|
3
3
|
export declare const STAGE_TO_COMBINED_BOSS_SET_MAP: ReadonlyMap<LevelStage, ReadonlySet<BossID>>;
|
|
4
4
|
export declare const ALL_BOSSES_SET: ReadonlySet<BossID>;
|
|
5
|
+
export declare const STORY_BOSS_IDS_SET: ReadonlySet<BossID>;
|
|
6
|
+
export declare const STORY_BOSS_ENTITY_TYPES_SET: ReadonlySet<EntityType>;
|
|
5
7
|
export declare const ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET: ReadonlySet<BossID>;
|
|
6
8
|
//# sourceMappingURL=bossSets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bossSets.d.ts","sourceRoot":"","sources":["../../../src/sets/bossSets.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"bossSets.d.ts","sourceRoot":"","sources":["../../../src/sets/bossSets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,UAAU,EAEX,MAAM,8BAA8B,CAAC;AA6etC,eAAO,MAAM,mCAAmC,gEAiB9C,CAAC;AAEH,eAAO,MAAM,8BAA8B,8CAiBzC,CAAC;AAEH,eAAO,MAAM,cAAc,qBAE1B,CAAC;AAEF,eAAO,MAAM,kBAAkB,qBAkB7B,CAAC;AAEH,eAAO,MAAM,2BAA2B,yBActC,CAAC;AAEH,eAAO,MAAM,qCAAqC,qBAEjD,CAAC"}
|
|
@@ -5,6 +5,7 @@ local __TS__Spread = ____lualib.__TS__Spread
|
|
|
5
5
|
local ____exports = {}
|
|
6
6
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
7
|
local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
|
|
8
|
+
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
8
9
|
local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
|
|
9
10
|
local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
|
|
10
11
|
local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
|
|
@@ -368,7 +369,7 @@ ____exports.ALL_BOSSES_SET = __TS__New(
|
|
|
368
369
|
function(____, bossID) return bossID ~= BossID.RAGLICH end
|
|
369
370
|
)
|
|
370
371
|
)
|
|
371
|
-
|
|
372
|
+
____exports.STORY_BOSS_IDS_SET = __TS__New(ReadonlySet, {
|
|
372
373
|
BossID.MOM,
|
|
373
374
|
BossID.MOMS_HEART,
|
|
374
375
|
BossID.SATAN,
|
|
@@ -387,11 +388,26 @@ local STORY_BOSS_IDS_SET = __TS__New(ReadonlySet, {
|
|
|
387
388
|
BossID.DOGMA,
|
|
388
389
|
BossID.BEAST
|
|
389
390
|
})
|
|
391
|
+
____exports.STORY_BOSS_ENTITY_TYPES_SET = __TS__New(ReadonlySet, {
|
|
392
|
+
EntityType.MOM,
|
|
393
|
+
EntityType.MOMS_HEART,
|
|
394
|
+
EntityType.SATAN,
|
|
395
|
+
EntityType.ISAAC,
|
|
396
|
+
EntityType.LAMB,
|
|
397
|
+
EntityType.MEGA_SATAN,
|
|
398
|
+
EntityType.MEGA_SATAN_2,
|
|
399
|
+
EntityType.ULTRA_GREED,
|
|
400
|
+
EntityType.HUSH,
|
|
401
|
+
EntityType.DELIRIUM,
|
|
402
|
+
EntityType.MOTHER,
|
|
403
|
+
EntityType.DOGMA,
|
|
404
|
+
EntityType.BEAST
|
|
405
|
+
})
|
|
390
406
|
____exports.ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET = __TS__New(
|
|
391
407
|
ReadonlySet,
|
|
392
408
|
__TS__ArrayFilter(
|
|
393
409
|
{__TS__Spread(____exports.ALL_BOSSES_SET)},
|
|
394
|
-
function(____, bossID) return not STORY_BOSS_IDS_SET:has(bossID) end
|
|
410
|
+
function(____, bossID) return not ____exports.STORY_BOSS_IDS_SET:has(bossID) end
|
|
395
411
|
)
|
|
396
412
|
)
|
|
397
413
|
return ____exports
|
package/package.json
CHANGED
package/src/functions/bosses.ts
CHANGED
|
@@ -10,6 +10,8 @@ import {
|
|
|
10
10
|
ALL_BOSSES_SET,
|
|
11
11
|
STAGE_TO_COMBINED_BOSS_SET_MAP,
|
|
12
12
|
STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP,
|
|
13
|
+
STORY_BOSS_ENTITY_TYPES_SET,
|
|
14
|
+
STORY_BOSS_IDS_SET,
|
|
13
15
|
} from "../sets/bossSets";
|
|
14
16
|
import { REPENTANCE_ONLY_BOSS_IDS_SET } from "../sets/repentanceBossIDsSet";
|
|
15
17
|
import { SIN_ENTITY_TYPES_SET } from "../sets/sinEntityTypesSet";
|
|
@@ -190,6 +192,11 @@ export function isRepentanceBoss(bossID: BossID): boolean {
|
|
|
190
192
|
return REPENTANCE_ONLY_BOSS_IDS_SET.has(bossID);
|
|
191
193
|
}
|
|
192
194
|
|
|
195
|
+
/** Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust. */
|
|
196
|
+
export function isSin(npc: EntityNPC): boolean {
|
|
197
|
+
return SIN_ENTITY_TYPES_SET.has(npc.Type);
|
|
198
|
+
}
|
|
199
|
+
|
|
193
200
|
function getNumBossSegments(
|
|
194
201
|
entityType: EntityType,
|
|
195
202
|
variant: int,
|
|
@@ -223,9 +230,22 @@ function getNumBossSegments(
|
|
|
223
230
|
}
|
|
224
231
|
}
|
|
225
232
|
|
|
226
|
-
/**
|
|
227
|
-
|
|
228
|
-
|
|
233
|
+
/**
|
|
234
|
+
* Helper function to determine if the specified entity type is an end-game story boss, like Isaac,
|
|
235
|
+
* Blue Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only
|
|
236
|
+
* apply to non-story bosses, like Vanishing Twin.
|
|
237
|
+
*/
|
|
238
|
+
export function isStoryBoss(entityType: EntityType): boolean {
|
|
239
|
+
return STORY_BOSS_ENTITY_TYPES_SET.has(entityType);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Helper function to determine if the specified boss ID is an end-game story boss, like Isaac, Blue
|
|
244
|
+
* Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only apply
|
|
245
|
+
* to non-story bosses, like Vanishing Twin.
|
|
246
|
+
*/
|
|
247
|
+
export function isStoryBossID(bossID: BossID): boolean {
|
|
248
|
+
return STORY_BOSS_IDS_SET.has(bossID);
|
|
229
249
|
}
|
|
230
250
|
|
|
231
251
|
/**
|
|
@@ -3,7 +3,6 @@ import { EntityFlag } from "isaac-typescript-definitions";
|
|
|
3
3
|
import { game } from "../core/cachedClasses";
|
|
4
4
|
import { VectorZero } from "../core/constants";
|
|
5
5
|
import { ENTITIES_WITH_ARMOR_SET } from "../sets/entitiesWithArmorSet";
|
|
6
|
-
import { STORY_BOSS_ENTITY_TYPES_SET } from "../sets/storyBossEntityTypesSet";
|
|
7
6
|
import type { AnyEntity } from "../types/AnyEntity";
|
|
8
7
|
import type { EntityID } from "../types/EntityID";
|
|
9
8
|
import { getIsaacAPIClassName } from "./isaacAPIClass";
|
|
@@ -364,15 +363,6 @@ export function isEntityMoving(entity: Entity, threshold = 0.01): boolean {
|
|
|
364
363
|
return doesVectorHaveLength(entity.Velocity, threshold);
|
|
365
364
|
}
|
|
366
365
|
|
|
367
|
-
/**
|
|
368
|
-
* Helper function to determine if the specified entity type is an end-game story boss, like Isaac,
|
|
369
|
-
* Blue Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only
|
|
370
|
-
* apply to non-story bosses, like Vanishing Twin.
|
|
371
|
-
*/
|
|
372
|
-
export function isStoryBoss(entityType: EntityType): boolean {
|
|
373
|
-
return STORY_BOSS_ENTITY_TYPES_SET.has(entityType);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
366
|
/**
|
|
377
367
|
* Helper function to parse a string that contains an entity type, a variant, and a sub-type,
|
|
378
368
|
* separated by periods.
|
package/src/functions/pills.ts
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
DEFAULT_PILL_EFFECT_NAME,
|
|
24
24
|
PILL_EFFECT_NAMES,
|
|
25
25
|
} from "../objects/pillEffectNames";
|
|
26
|
+
import { PILL_EFFECT_TYPE_TO_PILL_EFFECTS } from "../objects/pillEffectTypeToPillEffects";
|
|
26
27
|
import {
|
|
27
28
|
DEFAULT_PILL_EFFECT_TYPE,
|
|
28
29
|
PILL_EFFECT_TYPES,
|
|
@@ -188,11 +189,17 @@ export function getPillEffectType(
|
|
|
188
189
|
): ItemConfigPillEffectType {
|
|
189
190
|
// `ItemConfigPillEffect` does not contain the "class" tag, so we must manually compile a map of
|
|
190
191
|
// pill effect classes. Modded pill effects are not included in the map.
|
|
191
|
-
const
|
|
192
|
+
const pillEffectType = PILL_EFFECT_TYPES[pillEffect];
|
|
192
193
|
|
|
193
194
|
// Handle modded pill effects.
|
|
194
195
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
195
|
-
return
|
|
196
|
+
return pillEffectType ?? DEFAULT_PILL_EFFECT_TYPE;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export function getVanillaPillEffectsOfType(
|
|
200
|
+
pillEffectType: ItemConfigPillEffectType,
|
|
201
|
+
): readonly PillEffect[] {
|
|
202
|
+
return PILL_EFFECT_TYPE_TO_PILL_EFFECTS[pillEffectType];
|
|
196
203
|
}
|
|
197
204
|
|
|
198
205
|
/** Helper function to see if the given pill color is either a gold pill or a horse gold pill. */
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { PillEffect } from "isaac-typescript-definitions";
|
|
2
|
+
import { ItemConfigPillEffectType } from "isaac-typescript-definitions";
|
|
3
|
+
import { VANILLA_PILL_EFFECTS } from "../core/constantsVanilla";
|
|
4
|
+
import { filterMap } from "../functions/array";
|
|
5
|
+
import { PILL_EFFECT_TYPES } from "./pillEffectTypes";
|
|
6
|
+
|
|
7
|
+
export const PILL_EFFECT_TYPE_TO_PILL_EFFECTS = {
|
|
8
|
+
// -1
|
|
9
|
+
[ItemConfigPillEffectType.NULL]: getPillEffectsOfType(
|
|
10
|
+
ItemConfigPillEffectType.NULL,
|
|
11
|
+
),
|
|
12
|
+
|
|
13
|
+
// 0
|
|
14
|
+
[ItemConfigPillEffectType.POSITIVE]: getPillEffectsOfType(
|
|
15
|
+
ItemConfigPillEffectType.POSITIVE,
|
|
16
|
+
),
|
|
17
|
+
|
|
18
|
+
// 1
|
|
19
|
+
[ItemConfigPillEffectType.NEGATIVE]: getPillEffectsOfType(
|
|
20
|
+
ItemConfigPillEffectType.NEGATIVE,
|
|
21
|
+
),
|
|
22
|
+
|
|
23
|
+
// 2
|
|
24
|
+
[ItemConfigPillEffectType.NEUTRAL]: getPillEffectsOfType(
|
|
25
|
+
ItemConfigPillEffectType.NEUTRAL,
|
|
26
|
+
),
|
|
27
|
+
|
|
28
|
+
// 3
|
|
29
|
+
[ItemConfigPillEffectType.MODDED]: getPillEffectsOfType(
|
|
30
|
+
ItemConfigPillEffectType.MODDED,
|
|
31
|
+
),
|
|
32
|
+
} as const satisfies Record<ItemConfigPillEffectType, readonly PillEffect[]>;
|
|
33
|
+
|
|
34
|
+
function getPillEffectsOfType(
|
|
35
|
+
matchingPillEffectType: ItemConfigPillEffectType,
|
|
36
|
+
): readonly PillEffect[] {
|
|
37
|
+
return filterMap(VANILLA_PILL_EFFECTS, (pillEffect) => {
|
|
38
|
+
const pillEffectType = PILL_EFFECT_TYPES[pillEffect];
|
|
39
|
+
return pillEffectType === matchingPillEffectType ? pillEffect : undefined;
|
|
40
|
+
});
|
|
41
|
+
}
|
package/src/sets/bossSets.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
BossID,
|
|
3
|
+
EntityType,
|
|
4
|
+
LevelStage,
|
|
5
|
+
StageType,
|
|
6
|
+
} from "isaac-typescript-definitions";
|
|
2
7
|
import { BOSS_IDS } from "../arrays/cachedEnumValues";
|
|
3
8
|
import { combineSets } from "../functions/set";
|
|
4
9
|
import { ReadonlyMap } from "../types/ReadonlyMap";
|
|
@@ -533,7 +538,7 @@ export const ALL_BOSSES_SET = new ReadonlySet<BossID>(
|
|
|
533
538
|
BOSS_IDS.filter((bossID) => bossID !== BossID.RAGLICH),
|
|
534
539
|
);
|
|
535
540
|
|
|
536
|
-
const STORY_BOSS_IDS_SET = new ReadonlySet([
|
|
541
|
+
export const STORY_BOSS_IDS_SET = new ReadonlySet([
|
|
537
542
|
BossID.MOM, // 6
|
|
538
543
|
BossID.MOMS_HEART, // 8
|
|
539
544
|
BossID.SATAN, // 24
|
|
@@ -553,6 +558,22 @@ const STORY_BOSS_IDS_SET = new ReadonlySet([
|
|
|
553
558
|
BossID.BEAST, // 100
|
|
554
559
|
]);
|
|
555
560
|
|
|
561
|
+
export const STORY_BOSS_ENTITY_TYPES_SET = new ReadonlySet<EntityType>([
|
|
562
|
+
EntityType.MOM, // 45
|
|
563
|
+
EntityType.MOMS_HEART, // 78
|
|
564
|
+
EntityType.SATAN, // 84
|
|
565
|
+
EntityType.ISAAC, // 102
|
|
566
|
+
EntityType.LAMB, // 273
|
|
567
|
+
EntityType.MEGA_SATAN, // 274
|
|
568
|
+
EntityType.MEGA_SATAN_2, // 275
|
|
569
|
+
EntityType.ULTRA_GREED, // 406 (includes Ultra Greedier)
|
|
570
|
+
EntityType.HUSH, // 407
|
|
571
|
+
EntityType.DELIRIUM, // 412
|
|
572
|
+
EntityType.MOTHER, // 912
|
|
573
|
+
EntityType.DOGMA, // 950
|
|
574
|
+
EntityType.BEAST, // 951
|
|
575
|
+
]);
|
|
576
|
+
|
|
556
577
|
export const ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET = new ReadonlySet(
|
|
557
578
|
[...ALL_BOSSES_SET].filter((bossID) => !STORY_BOSS_IDS_SET.has(bossID)),
|
|
558
579
|
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storyBossEntityTypesSet.d.ts","sourceRoot":"","sources":["../../../src/sets/storyBossEntityTypesSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG1D,eAAO,MAAM,2BAA2B,yBActC,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local __TS__New = ____lualib.__TS__New
|
|
3
|
-
local ____exports = {}
|
|
4
|
-
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
5
|
-
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
6
|
-
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
7
|
-
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
8
|
-
____exports.STORY_BOSS_ENTITY_TYPES_SET = __TS__New(ReadonlySet, {
|
|
9
|
-
EntityType.MOM,
|
|
10
|
-
EntityType.MOMS_HEART,
|
|
11
|
-
EntityType.SATAN,
|
|
12
|
-
EntityType.ISAAC,
|
|
13
|
-
EntityType.LAMB,
|
|
14
|
-
EntityType.MEGA_SATAN,
|
|
15
|
-
EntityType.MEGA_SATAN_2,
|
|
16
|
-
EntityType.ULTRA_GREED,
|
|
17
|
-
EntityType.HUSH,
|
|
18
|
-
EntityType.DELIRIUM,
|
|
19
|
-
EntityType.MOTHER,
|
|
20
|
-
EntityType.DOGMA,
|
|
21
|
-
EntityType.BEAST
|
|
22
|
-
})
|
|
23
|
-
return ____exports
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { EntityType } from "isaac-typescript-definitions";
|
|
2
|
-
import { ReadonlySet } from "../types/ReadonlySet";
|
|
3
|
-
|
|
4
|
-
export const STORY_BOSS_ENTITY_TYPES_SET = new ReadonlySet<EntityType>([
|
|
5
|
-
EntityType.MOM, // 45
|
|
6
|
-
EntityType.MOMS_HEART, // 78
|
|
7
|
-
EntityType.SATAN, // 84
|
|
8
|
-
EntityType.ISAAC, // 102
|
|
9
|
-
EntityType.LAMB, // 273
|
|
10
|
-
EntityType.MEGA_SATAN, // 274
|
|
11
|
-
EntityType.MEGA_SATAN_2, // 275
|
|
12
|
-
EntityType.ULTRA_GREED, // 406
|
|
13
|
-
EntityType.HUSH, // 407
|
|
14
|
-
EntityType.DELIRIUM, // 412
|
|
15
|
-
EntityType.MOTHER, // 912
|
|
16
|
-
EntityType.DOGMA, // 950
|
|
17
|
-
EntityType.BEAST, // 951
|
|
18
|
-
]);
|