isaacscript-common 1.2.268 → 1.2.270
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/functions/boss.d.ts +15 -3
- package/dist/functions/boss.lua +16 -2
- package/dist/sets/bossSets.d.ts +1 -0
- package/dist/sets/bossSets.lua +30 -0
- package/package.json +1 -1
package/dist/functions/boss.d.ts
CHANGED
|
@@ -6,11 +6,21 @@
|
|
|
6
6
|
* Horn holes.
|
|
7
7
|
*/
|
|
8
8
|
export declare function getAliveBosses(matchingEntityType?: EntityType | int, matchingVariant?: int, matchingSubType?: int, ignoreFriendly?: boolean): EntityNPC[];
|
|
9
|
+
/**
|
|
10
|
+
* Helper function to get the set of every boss in the game.
|
|
11
|
+
*
|
|
12
|
+
* The set contains strings with the entity type and variant, separated by a period.
|
|
13
|
+
*
|
|
14
|
+
* Also see the `getBossSet` and `getCombinedBossSet` functions.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getAllBossesSet(): Set<string>;
|
|
9
17
|
/**
|
|
10
18
|
* Helper function to get the set of vanilla bosses for a particular stage and stage type
|
|
11
19
|
* combination.
|
|
12
20
|
*
|
|
13
|
-
*
|
|
21
|
+
* The set contains strings with the entity type and variant, separated by a period.
|
|
22
|
+
*
|
|
23
|
+
* Also see the `getAllBossesSet` and `getCombinedBossSet` functions.
|
|
14
24
|
*/
|
|
15
25
|
export declare function getBossSet(stage: int, stageType: StageType): ReadonlySet<string> | undefined;
|
|
16
26
|
/** Helper function to get all of the bosses in the room. */
|
|
@@ -20,8 +30,10 @@ export declare function getBosses(matchingEntityType?: EntityType | int, matchin
|
|
|
20
30
|
* types. For example, specifying a stage of 2 will return a set with all of the bosses for
|
|
21
31
|
* Basement, Cellar, Burning Basement, Downpour, and Dross.
|
|
22
32
|
*
|
|
23
|
-
*
|
|
33
|
+
* The set contains strings with the entity type and variant, separated by a period.
|
|
34
|
+
*
|
|
35
|
+
* Also see the `getAllBossesSet` and `getBossSet` functions.
|
|
24
36
|
*/
|
|
25
|
-
export declare function getCombinedBossSet(stage: int):
|
|
37
|
+
export declare function getCombinedBossSet(stage: int): Set<string> | undefined;
|
|
26
38
|
/** Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust. */
|
|
27
39
|
export declare function isSin(npc: EntityNPC): boolean;
|
package/dist/functions/boss.lua
CHANGED
|
@@ -2,6 +2,7 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local ____bossSets = require("sets.bossSets")
|
|
5
|
+
local ALL_BOSSES_SET = ____bossSets.ALL_BOSSES_SET
|
|
5
6
|
local STAGE_TO_COMBINED_BOSS_SET_MAP = ____bossSets.STAGE_TO_COMBINED_BOSS_SET_MAP
|
|
6
7
|
local STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP = ____bossSets.STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP
|
|
7
8
|
local ____sinEntityTypesSet = require("sets.sinEntityTypesSet")
|
|
@@ -10,6 +11,8 @@ local ____entitySpecific = require("functions.entitySpecific")
|
|
|
10
11
|
local getNPCs = ____entitySpecific.getNPCs
|
|
11
12
|
local ____npc = require("functions.npc")
|
|
12
13
|
local getAliveNPCs = ____npc.getAliveNPCs
|
|
14
|
+
local ____set = require("functions.set")
|
|
15
|
+
local copySet = ____set.copySet
|
|
13
16
|
function ____exports.getAliveBosses(self, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
|
|
14
17
|
if ignoreFriendly == nil then
|
|
15
18
|
ignoreFriendly = false
|
|
@@ -26,12 +29,19 @@ function ____exports.getAliveBosses(self, matchingEntityType, matchingVariant, m
|
|
|
26
29
|
function(____, aliveNPC) return aliveNPC:IsBoss() end
|
|
27
30
|
)
|
|
28
31
|
end
|
|
32
|
+
function ____exports.getAllBossesSet(self)
|
|
33
|
+
return copySet(nil, ALL_BOSSES_SET)
|
|
34
|
+
end
|
|
29
35
|
function ____exports.getBossSet(self, stage, stageType)
|
|
30
36
|
local stageTypeMap = STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP:get(stage)
|
|
31
37
|
if stageTypeMap == nil then
|
|
32
38
|
return nil
|
|
33
39
|
end
|
|
34
|
-
|
|
40
|
+
local bossSet = stageTypeMap:get(stageType)
|
|
41
|
+
if bossSet == nil then
|
|
42
|
+
return nil
|
|
43
|
+
end
|
|
44
|
+
return copySet(nil, bossSet)
|
|
35
45
|
end
|
|
36
46
|
function ____exports.getBosses(self, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
|
|
37
47
|
if ignoreFriendly == nil then
|
|
@@ -50,7 +60,11 @@ function ____exports.getBosses(self, matchingEntityType, matchingVariant, matchi
|
|
|
50
60
|
)
|
|
51
61
|
end
|
|
52
62
|
function ____exports.getCombinedBossSet(self, stage)
|
|
53
|
-
|
|
63
|
+
local bossSet = STAGE_TO_COMBINED_BOSS_SET_MAP:get(stage)
|
|
64
|
+
if bossSet == nil then
|
|
65
|
+
return nil
|
|
66
|
+
end
|
|
67
|
+
return copySet(nil, bossSet)
|
|
54
68
|
end
|
|
55
69
|
function ____exports.isSin(self, npc)
|
|
56
70
|
return SIN_ENTITY_TYPES_SET:has(npc.Type)
|
package/dist/sets/bossSets.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
export declare const STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP: ReadonlyMap<int, ReadonlyMap<int, ReadonlySet<string>>>;
|
|
3
3
|
export declare const STAGE_TO_COMBINED_BOSS_SET_MAP: ReadonlyMap<int, ReadonlySet<string>>;
|
|
4
|
+
export declare const ALL_BOSSES_SET: ReadonlySet<string>;
|
package/dist/sets/bossSets.lua
CHANGED
|
@@ -468,4 +468,34 @@ ____exports.STAGE_TO_COMBINED_BOSS_SET_MAP = __TS__New(Map, {
|
|
|
468
468
|
{10, ALL_STAGE_10_BOSSES_SET},
|
|
469
469
|
{11, ALL_STAGE_11_BOSSES_SET}
|
|
470
470
|
})
|
|
471
|
+
local ____Set_13 = Set
|
|
472
|
+
local ____array_12 = __TS__SparseArrayNew(__TS__Spread(ALL_BASEMENT_BOSSES_SET:values()))
|
|
473
|
+
__TS__SparseArrayPush(
|
|
474
|
+
____array_12,
|
|
475
|
+
__TS__Spread(ALL_CAVES_BOSSES_SET:values())
|
|
476
|
+
)
|
|
477
|
+
__TS__SparseArrayPush(
|
|
478
|
+
____array_12,
|
|
479
|
+
__TS__Spread(ALL_DEPTHS_BOSSES_SET:values())
|
|
480
|
+
)
|
|
481
|
+
__TS__SparseArrayPush(
|
|
482
|
+
____array_12,
|
|
483
|
+
__TS__Spread(ALL_WOMB_BOSSES_SET:values())
|
|
484
|
+
)
|
|
485
|
+
__TS__SparseArrayPush(
|
|
486
|
+
____array_12,
|
|
487
|
+
__TS__Spread(BLUE_WOMB_BOSSES_SET:values())
|
|
488
|
+
)
|
|
489
|
+
__TS__SparseArrayPush(
|
|
490
|
+
____array_12,
|
|
491
|
+
__TS__Spread(ALL_STAGE_10_BOSSES_SET:values())
|
|
492
|
+
)
|
|
493
|
+
__TS__SparseArrayPush(
|
|
494
|
+
____array_12,
|
|
495
|
+
__TS__Spread(ALL_STAGE_11_BOSSES_SET:values())
|
|
496
|
+
)
|
|
497
|
+
____exports.ALL_BOSSES_SET = __TS__New(
|
|
498
|
+
____Set_13,
|
|
499
|
+
{__TS__SparseArraySpread(____array_12)}
|
|
500
|
+
)
|
|
471
501
|
return ____exports
|