isaacscript-common 38.0.0 → 39.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 +33 -20
- package/dist/isaacscript-common.lua +7 -14
- package/dist/src/classes/features/other/ModdedElementDetection.d.ts +23 -20
- package/dist/src/classes/features/other/ModdedElementDetection.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementDetection.lua +5 -12
- package/dist/src/classes/features/other/ModdedElementSets.lua +1 -1
- package/dist/src/functions/rooms.d.ts +10 -0
- package/dist/src/functions/rooms.d.ts.map +1 -1
- package/dist/src/functions/rooms.lua +6 -0
- package/package.json +1 -1
- package/src/classes/features/other/ModdedElementDetection.ts +27 -32
- package/src/classes/features/other/ModdedElementSets.ts +1 -1
- package/src/functions/rooms.ts +10 -0
package/dist/index.rollup.d.ts
CHANGED
|
@@ -7823,6 +7823,11 @@ export declare function in2x1Room(): boolean;
|
|
|
7823
7823
|
|
|
7824
7824
|
export declare function inAngelShop(): boolean;
|
|
7825
7825
|
|
|
7826
|
+
/**
|
|
7827
|
+
* Helper function to check to see if the current room is a boss room for The Beast.
|
|
7828
|
+
*
|
|
7829
|
+
* Under the hood, this checks the room type and sub-type.
|
|
7830
|
+
*/
|
|
7826
7831
|
export declare function inBeastRoom(): boolean;
|
|
7827
7832
|
|
|
7828
7833
|
/**
|
|
@@ -8187,6 +8192,11 @@ export declare function isArrayInArray<T>(arrayToMatch: T[] | readonly T[], pare
|
|
|
8187
8192
|
/** For `PickupVariant.LIL_BATTERY` (90). */
|
|
8188
8193
|
export declare function isBattery(pickup: EntityPickup): pickup is EntityPickupBattery;
|
|
8189
8194
|
|
|
8195
|
+
/**
|
|
8196
|
+
* Helper function to check to see if the provided room is a boss room for The Beast.
|
|
8197
|
+
*
|
|
8198
|
+
* Under the hood, this checks the room type and sub-type.
|
|
8199
|
+
*/
|
|
8190
8200
|
export declare function isBeastRoom(roomData: RoomConfig): boolean;
|
|
8191
8201
|
|
|
8192
8202
|
/**
|
|
@@ -12645,6 +12655,9 @@ declare class ModdedElementDetection extends Feature {
|
|
|
12645
12655
|
* Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like
|
|
12646
12656
|
* 666. We subtract one to account for `CollectibleType.NULL`.)
|
|
12647
12657
|
*
|
|
12658
|
+
* If there are no mods present that add any custom items, this function will return
|
|
12659
|
+
* `CollectibleType.MOMS_RING` (732).
|
|
12660
|
+
*
|
|
12648
12661
|
* This function can only be called if at least one callback has been executed. This is because
|
|
12649
12662
|
* not all collectibles will necessarily be present when a mod first loads (due to mod load
|
|
12650
12663
|
* order).
|
|
@@ -12654,7 +12667,7 @@ declare class ModdedElementDetection extends Feature {
|
|
|
12654
12667
|
*/
|
|
12655
12668
|
getLastCollectibleType(): CollectibleType;
|
|
12656
12669
|
/**
|
|
12657
|
-
* Helper function to get an array that represents
|
|
12670
|
+
* Helper function to get an array that represents every modded collectible type.
|
|
12658
12671
|
*
|
|
12659
12672
|
* Returns an empty array if there are no modded collectible types.
|
|
12660
12673
|
*
|
|
@@ -12675,6 +12688,10 @@ declare class ModdedElementDetection extends Feature {
|
|
|
12675
12688
|
*/
|
|
12676
12689
|
getModdedCollectibleTypes(): CollectibleType[];
|
|
12677
12690
|
/**
|
|
12691
|
+
* Returns the total number of collectibles in the item config, including both vanilla and modded
|
|
12692
|
+
* items. If you just need the number of vanilla collectible types, use the
|
|
12693
|
+
* `NUM_VANILLA_COLLECTIBLE_TYPES` constant.
|
|
12694
|
+
*
|
|
12678
12695
|
* This function can only be called if at least one callback has been executed. This is because
|
|
12679
12696
|
* not all collectibles will necessarily be present when a mod first loads (due to mod load
|
|
12680
12697
|
* order).
|
|
@@ -12707,8 +12724,11 @@ declare class ModdedElementDetection extends Feature {
|
|
|
12707
12724
|
/**
|
|
12708
12725
|
* Will change depending on how many modded trinkets there are.
|
|
12709
12726
|
*
|
|
12710
|
-
*
|
|
12711
|
-
*
|
|
12727
|
+
* Equal to `itemConfig.GetTrinkets().Size - 1`. (`Size` includes invalid trinkets, like 47. We
|
|
12728
|
+
* subtract one to account for `TrinketType.NULL`.)
|
|
12729
|
+
*
|
|
12730
|
+
* If there are no mods present that add any custom trinkets, this function will return
|
|
12731
|
+
* `TrinketType.SIGIL_OF_BAPHOMET` (189).
|
|
12712
12732
|
*
|
|
12713
12733
|
* This function can only be called if at least one callback has been executed. This is because
|
|
12714
12734
|
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -12722,9 +12742,11 @@ declare class ModdedElementDetection extends Feature {
|
|
|
12722
12742
|
*
|
|
12723
12743
|
* Returns an empty array if there are no modded trinket types.
|
|
12724
12744
|
*
|
|
12725
|
-
* This function is only useful when building
|
|
12726
|
-
*
|
|
12727
|
-
*
|
|
12745
|
+
* This function is only useful when building trinket type objects. For most purposes, you should
|
|
12746
|
+
* use the `getModdedTrinketArray` or `getModdedTrinketSet` helper function instead.
|
|
12747
|
+
*
|
|
12748
|
+
* (This function is named differently from the `getVanillaTrinketTypeRange` function because all
|
|
12749
|
+
* modded trinket types are contiguous. Thus, each value represents a real `TrinketType`.)
|
|
12728
12750
|
*
|
|
12729
12751
|
* This function can only be called if at least one callback has been executed. This is because
|
|
12730
12752
|
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -12734,10 +12756,9 @@ declare class ModdedElementDetection extends Feature {
|
|
|
12734
12756
|
*/
|
|
12735
12757
|
getModdedTrinketTypes(): TrinketType[];
|
|
12736
12758
|
/**
|
|
12737
|
-
*
|
|
12738
|
-
*
|
|
12739
|
-
*
|
|
12740
|
-
* `TrinketType.NULL`.)
|
|
12759
|
+
* Returns the total number of trinkets in the item config, including both vanilla and modded
|
|
12760
|
+
* items. If you just need the number of vanilla trinket types, use the
|
|
12761
|
+
* `NUM_VANILLA_TRINKET_TYPES` constant.
|
|
12741
12762
|
*
|
|
12742
12763
|
* This function can only be called if at least one callback has been executed. This is because
|
|
12743
12764
|
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -12747,15 +12768,7 @@ declare class ModdedElementDetection extends Feature {
|
|
|
12747
12768
|
*/
|
|
12748
12769
|
getNumTrinketTypes(): int;
|
|
12749
12770
|
/**
|
|
12750
|
-
*
|
|
12751
|
-
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
12752
|
-
*
|
|
12753
|
-
* In order to use this function, you must upgrade your mod with
|
|
12754
|
-
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
12755
|
-
*/
|
|
12756
|
-
getNumModdedTrinketTypes(): int;
|
|
12757
|
-
/**
|
|
12758
|
-
* Helper function to get an array that contains every trinket type.
|
|
12771
|
+
* Unlike vanilla trinket types, modded trinket types are always contiguous.
|
|
12759
12772
|
*
|
|
12760
12773
|
* This function can only be called if at least one callback has been executed. This is because
|
|
12761
12774
|
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -12763,7 +12776,7 @@ declare class ModdedElementDetection extends Feature {
|
|
|
12763
12776
|
* In order to use this function, you must upgrade your mod with
|
|
12764
12777
|
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
12765
12778
|
*/
|
|
12766
|
-
|
|
12779
|
+
getNumModdedTrinketTypes(): int;
|
|
12767
12780
|
/**
|
|
12768
12781
|
* Helper function to get an array with every valid card sub-type. This includes modded cards.
|
|
12769
12782
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 39.0.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -38327,7 +38327,6 @@ local itemConfig = ____cachedClasses.itemConfig
|
|
|
38327
38327
|
local ____constantsFirstLast = require("src.core.constantsFirstLast")
|
|
38328
38328
|
local FIRST_CARD_TYPE = ____constantsFirstLast.FIRST_CARD_TYPE
|
|
38329
38329
|
local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
|
|
38330
|
-
local FIRST_TRINKET_TYPE = ____constantsFirstLast.FIRST_TRINKET_TYPE
|
|
38331
38330
|
local LAST_VANILLA_CARD_TYPE = ____constantsFirstLast.LAST_VANILLA_CARD_TYPE
|
|
38332
38331
|
local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
|
|
38333
38332
|
local LAST_VANILLA_PILL_EFFECT = ____constantsFirstLast.LAST_VANILLA_PILL_EFFECT
|
|
@@ -38426,8 +38425,7 @@ end
|
|
|
38426
38425
|
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getFirstModdedTrinketType", true)
|
|
38427
38426
|
function ModdedElementDetection.prototype.getLastTrinketType(self)
|
|
38428
38427
|
self:errorIfNoCallbacksFired("trinket")
|
|
38429
|
-
|
|
38430
|
-
return asTrinketType(nil, numTrinketTypes)
|
|
38428
|
+
return itemConfig:GetTrinkets().Size - 1
|
|
38431
38429
|
end
|
|
38432
38430
|
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastTrinketType", true)
|
|
38433
38431
|
function ModdedElementDetection.prototype.getModdedTrinketTypes(self)
|
|
@@ -38442,21 +38440,16 @@ end
|
|
|
38442
38440
|
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getModdedTrinketTypes", true)
|
|
38443
38441
|
function ModdedElementDetection.prototype.getNumTrinketTypes(self)
|
|
38444
38442
|
self:errorIfNoCallbacksFired("trinket")
|
|
38445
|
-
|
|
38443
|
+
local numModdedTrinketTypes = self:getNumModdedTrinketTypes()
|
|
38444
|
+
return NUM_VANILLA_TRINKET_TYPES + numModdedTrinketTypes
|
|
38446
38445
|
end
|
|
38447
38446
|
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumTrinketTypes", true)
|
|
38448
38447
|
function ModdedElementDetection.prototype.getNumModdedTrinketTypes(self)
|
|
38449
|
-
self:errorIfNoCallbacksFired("trinket")
|
|
38450
|
-
local numTrinketTypes = self:getNumTrinketTypes()
|
|
38451
|
-
return numTrinketTypes - NUM_VANILLA_TRINKET_TYPES
|
|
38452
|
-
end
|
|
38453
|
-
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedTrinketTypes", true)
|
|
38454
|
-
function ModdedElementDetection.prototype.getTrinketTypes(self)
|
|
38455
38448
|
self:errorIfNoCallbacksFired("trinket")
|
|
38456
38449
|
local lastTrinketType = self:getLastTrinketType()
|
|
38457
|
-
return
|
|
38450
|
+
return lastTrinketType - LAST_VANILLA_TRINKET_TYPE
|
|
38458
38451
|
end
|
|
38459
|
-
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "
|
|
38452
|
+
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedTrinketTypes", true)
|
|
38460
38453
|
function ModdedElementDetection.prototype.getAllCardTypes(self)
|
|
38461
38454
|
self:errorIfNoCallbacksFired("card")
|
|
38462
38455
|
local lastCardType = self:getLastCardType()
|
|
@@ -38831,7 +38824,7 @@ function ModdedElementSets.prototype.lazyInitCacheFlagToTrinketTypesMap(self)
|
|
|
38831
38824
|
end
|
|
38832
38825
|
for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
|
|
38833
38826
|
local trinketsSet = __TS__New(Set)
|
|
38834
|
-
for ____, trinketType in ipairs(self
|
|
38827
|
+
for ____, trinketType in ipairs(self:getTrinketArray()) do
|
|
38835
38828
|
if trinketHasCacheFlag(nil, trinketType, cacheFlag) then
|
|
38836
38829
|
trinketsSet:add(trinketType)
|
|
38837
38830
|
end
|
|
@@ -31,6 +31,9 @@ export declare class ModdedElementDetection extends Feature {
|
|
|
31
31
|
* Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like
|
|
32
32
|
* 666. We subtract one to account for `CollectibleType.NULL`.)
|
|
33
33
|
*
|
|
34
|
+
* If there are no mods present that add any custom items, this function will return
|
|
35
|
+
* `CollectibleType.MOMS_RING` (732).
|
|
36
|
+
*
|
|
34
37
|
* This function can only be called if at least one callback has been executed. This is because
|
|
35
38
|
* not all collectibles will necessarily be present when a mod first loads (due to mod load
|
|
36
39
|
* order).
|
|
@@ -40,7 +43,7 @@ export declare class ModdedElementDetection extends Feature {
|
|
|
40
43
|
*/
|
|
41
44
|
getLastCollectibleType(): CollectibleType;
|
|
42
45
|
/**
|
|
43
|
-
* Helper function to get an array that represents
|
|
46
|
+
* Helper function to get an array that represents every modded collectible type.
|
|
44
47
|
*
|
|
45
48
|
* Returns an empty array if there are no modded collectible types.
|
|
46
49
|
*
|
|
@@ -61,6 +64,10 @@ export declare class ModdedElementDetection extends Feature {
|
|
|
61
64
|
*/
|
|
62
65
|
getModdedCollectibleTypes(): CollectibleType[];
|
|
63
66
|
/**
|
|
67
|
+
* Returns the total number of collectibles in the item config, including both vanilla and modded
|
|
68
|
+
* items. If you just need the number of vanilla collectible types, use the
|
|
69
|
+
* `NUM_VANILLA_COLLECTIBLE_TYPES` constant.
|
|
70
|
+
*
|
|
64
71
|
* This function can only be called if at least one callback has been executed. This is because
|
|
65
72
|
* not all collectibles will necessarily be present when a mod first loads (due to mod load
|
|
66
73
|
* order).
|
|
@@ -93,8 +100,11 @@ export declare class ModdedElementDetection extends Feature {
|
|
|
93
100
|
/**
|
|
94
101
|
* Will change depending on how many modded trinkets there are.
|
|
95
102
|
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
103
|
+
* Equal to `itemConfig.GetTrinkets().Size - 1`. (`Size` includes invalid trinkets, like 47. We
|
|
104
|
+
* subtract one to account for `TrinketType.NULL`.)
|
|
105
|
+
*
|
|
106
|
+
* If there are no mods present that add any custom trinkets, this function will return
|
|
107
|
+
* `TrinketType.SIGIL_OF_BAPHOMET` (189).
|
|
98
108
|
*
|
|
99
109
|
* This function can only be called if at least one callback has been executed. This is because
|
|
100
110
|
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -108,9 +118,11 @@ export declare class ModdedElementDetection extends Feature {
|
|
|
108
118
|
*
|
|
109
119
|
* Returns an empty array if there are no modded trinket types.
|
|
110
120
|
*
|
|
111
|
-
* This function is only useful when building
|
|
112
|
-
*
|
|
113
|
-
*
|
|
121
|
+
* This function is only useful when building trinket type objects. For most purposes, you should
|
|
122
|
+
* use the `getModdedTrinketArray` or `getModdedTrinketSet` helper function instead.
|
|
123
|
+
*
|
|
124
|
+
* (This function is named differently from the `getVanillaTrinketTypeRange` function because all
|
|
125
|
+
* modded trinket types are contiguous. Thus, each value represents a real `TrinketType`.)
|
|
114
126
|
*
|
|
115
127
|
* This function can only be called if at least one callback has been executed. This is because
|
|
116
128
|
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -120,10 +132,9 @@ export declare class ModdedElementDetection extends Feature {
|
|
|
120
132
|
*/
|
|
121
133
|
getModdedTrinketTypes(): TrinketType[];
|
|
122
134
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* `TrinketType.NULL`.)
|
|
135
|
+
* Returns the total number of trinkets in the item config, including both vanilla and modded
|
|
136
|
+
* items. If you just need the number of vanilla trinket types, use the
|
|
137
|
+
* `NUM_VANILLA_TRINKET_TYPES` constant.
|
|
127
138
|
*
|
|
128
139
|
* This function can only be called if at least one callback has been executed. This is because
|
|
129
140
|
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -133,15 +144,7 @@ export declare class ModdedElementDetection extends Feature {
|
|
|
133
144
|
*/
|
|
134
145
|
getNumTrinketTypes(): int;
|
|
135
146
|
/**
|
|
136
|
-
*
|
|
137
|
-
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
138
|
-
*
|
|
139
|
-
* In order to use this function, you must upgrade your mod with
|
|
140
|
-
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
141
|
-
*/
|
|
142
|
-
getNumModdedTrinketTypes(): int;
|
|
143
|
-
/**
|
|
144
|
-
* Helper function to get an array that contains every trinket type.
|
|
147
|
+
* Unlike vanilla trinket types, modded trinket types are always contiguous.
|
|
145
148
|
*
|
|
146
149
|
* This function can only be called if at least one callback has been executed. This is because
|
|
147
150
|
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -149,7 +152,7 @@ export declare class ModdedElementDetection extends Feature {
|
|
|
149
152
|
* In order to use this function, you must upgrade your mod with
|
|
150
153
|
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
151
154
|
*/
|
|
152
|
-
|
|
155
|
+
getNumModdedTrinketTypes(): int;
|
|
153
156
|
/**
|
|
154
157
|
* Helper function to get an array with every valid card sub-type. This includes modded cards.
|
|
155
158
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModdedElementDetection.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ModdedElementDetection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EACf,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"ModdedElementDetection.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ModdedElementDetection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EACf,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAwBtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD;;;;;;;;;GASG;AACH,qBAAa,sBAAuB,SAAQ,OAAO;IACjD,OAAO,CAAC,uBAAuB,CAAS;IAaxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAE7B;IAEF,OAAO,CAAC,uBAAuB;IAY/B;;;;;;;;;OASG;IAEI,6BAA6B,IAAI,eAAe,GAAG,SAAS;IAcnE;;;;;;;;;;;;;;;OAeG;IAEI,sBAAsB,IAAI,eAAe;IAMhD;;;;;;;;;;;;;;;;;;;OAmBG;IAEI,yBAAyB,IAAI,eAAe,EAAE;IAYrD;;;;;;;;;;;OAWG;IAEI,sBAAsB,IAAI,GAAG;IAOpC;;;;;;;;;OASG;IAEI,4BAA4B,IAAI,GAAG;IAW1C;;;;;;;;OAQG;IAEI,yBAAyB,IAAI,WAAW,GAAG,SAAS;IAU3D;;;;;;;;;;;;;;OAcG;IAEI,kBAAkB,IAAI,WAAW;IAMxC;;;;;;;;;;;;;;;;OAgBG;IAEI,qBAAqB,IAAI,WAAW,EAAE;IAY7C;;;;;;;;;;OAUG;IAEI,kBAAkB,IAAI,GAAG;IAOhC;;;;;;;;OAQG;IAEI,wBAAwB,IAAI,GAAG;IAWtC;;;;;;;;OAQG;IAEI,eAAe,IAAI,QAAQ,EAAE;IAOpC;;;;;;;;OAQG;IAEI,sBAAsB,IAAI,QAAQ,GAAG,SAAS;IAUrD;;;;;;;;;;;OAWG;IAEI,eAAe,IAAI,QAAQ;IAOlC;;;;;;;;;;OAUG;IAEI,kBAAkB,IAAI,QAAQ,EAAE;IAYvC;;;;;;;;;;OAUG;IAEI,eAAe,IAAI,GAAG;IAM7B;;;;;;OAMG;IAEI,qBAAqB,IAAI,GAAG;IAWnC;;;;;;;;;;OAUG;IAEI,iBAAiB,IAAI,UAAU,EAAE;IAOxC;;;;;;;;;OASG;IAEI,wBAAwB,IAAI,UAAU,GAAG,SAAS;IAczD;;;;;;;;;;;;OAYG;IAEI,iBAAiB,IAAI,UAAU;IAOtC;;;;;;;;;;;OAWG;IAEI,oBAAoB,IAAI,UAAU,EAAE;IAY3C;;;;;;;;;;;;OAYG;IAEI,iBAAiB,IAAI,GAAG;IAM/B;;;;;;;OAOG;IAEI,uBAAuB,IAAI,GAAG;CAMtC"}
|
|
@@ -10,7 +10,6 @@ local itemConfig = ____cachedClasses.itemConfig
|
|
|
10
10
|
local ____constantsFirstLast = require("src.core.constantsFirstLast")
|
|
11
11
|
local FIRST_CARD_TYPE = ____constantsFirstLast.FIRST_CARD_TYPE
|
|
12
12
|
local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
|
|
13
|
-
local FIRST_TRINKET_TYPE = ____constantsFirstLast.FIRST_TRINKET_TYPE
|
|
14
13
|
local LAST_VANILLA_CARD_TYPE = ____constantsFirstLast.LAST_VANILLA_CARD_TYPE
|
|
15
14
|
local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
|
|
16
15
|
local LAST_VANILLA_PILL_EFFECT = ____constantsFirstLast.LAST_VANILLA_PILL_EFFECT
|
|
@@ -117,8 +116,7 @@ end
|
|
|
117
116
|
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getFirstModdedTrinketType", true)
|
|
118
117
|
function ModdedElementDetection.prototype.getLastTrinketType(self)
|
|
119
118
|
self:errorIfNoCallbacksFired("trinket")
|
|
120
|
-
|
|
121
|
-
return asTrinketType(nil, numTrinketTypes)
|
|
119
|
+
return itemConfig:GetTrinkets().Size - 1
|
|
122
120
|
end
|
|
123
121
|
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastTrinketType", true)
|
|
124
122
|
function ModdedElementDetection.prototype.getModdedTrinketTypes(self)
|
|
@@ -133,21 +131,16 @@ end
|
|
|
133
131
|
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getModdedTrinketTypes", true)
|
|
134
132
|
function ModdedElementDetection.prototype.getNumTrinketTypes(self)
|
|
135
133
|
self:errorIfNoCallbacksFired("trinket")
|
|
136
|
-
|
|
134
|
+
local numModdedTrinketTypes = self:getNumModdedTrinketTypes()
|
|
135
|
+
return NUM_VANILLA_TRINKET_TYPES + numModdedTrinketTypes
|
|
137
136
|
end
|
|
138
137
|
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumTrinketTypes", true)
|
|
139
138
|
function ModdedElementDetection.prototype.getNumModdedTrinketTypes(self)
|
|
140
|
-
self:errorIfNoCallbacksFired("trinket")
|
|
141
|
-
local numTrinketTypes = self:getNumTrinketTypes()
|
|
142
|
-
return numTrinketTypes - NUM_VANILLA_TRINKET_TYPES
|
|
143
|
-
end
|
|
144
|
-
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedTrinketTypes", true)
|
|
145
|
-
function ModdedElementDetection.prototype.getTrinketTypes(self)
|
|
146
139
|
self:errorIfNoCallbacksFired("trinket")
|
|
147
140
|
local lastTrinketType = self:getLastTrinketType()
|
|
148
|
-
return
|
|
141
|
+
return lastTrinketType - LAST_VANILLA_TRINKET_TYPE
|
|
149
142
|
end
|
|
150
|
-
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "
|
|
143
|
+
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedTrinketTypes", true)
|
|
151
144
|
function ModdedElementDetection.prototype.getAllCardTypes(self)
|
|
152
145
|
self:errorIfNoCallbacksFired("card")
|
|
153
146
|
local lastCardType = self:getLastCardType()
|
|
@@ -271,7 +271,7 @@ function ModdedElementSets.prototype.lazyInitCacheFlagToTrinketTypesMap(self)
|
|
|
271
271
|
end
|
|
272
272
|
for ____, cacheFlag in ipairs(CACHE_FLAG_VALUES) do
|
|
273
273
|
local trinketsSet = __TS__New(Set)
|
|
274
|
-
for ____, trinketType in ipairs(self
|
|
274
|
+
for ____, trinketType in ipairs(self:getTrinketArray()) do
|
|
275
275
|
if trinketHasCacheFlag(nil, trinketType, cacheFlag) then
|
|
276
276
|
trinketsSet:add(trinketType)
|
|
277
277
|
end
|
|
@@ -104,6 +104,11 @@ export declare function getRoomsOutsideGrid(): RoomDescriptor[];
|
|
|
104
104
|
*/
|
|
105
105
|
export declare function in2x1Room(): boolean;
|
|
106
106
|
export declare function inAngelShop(): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Helper function to check to see if the current room is a boss room for The Beast.
|
|
109
|
+
*
|
|
110
|
+
* Under the hood, this checks the room type and sub-type.
|
|
111
|
+
*/
|
|
107
112
|
export declare function inBeastRoom(): boolean;
|
|
108
113
|
/**
|
|
109
114
|
* Helper function to check if the current room is a boss room for a particular boss. This will only
|
|
@@ -219,6 +224,11 @@ export declare function is2x1Room(roomData: RoomConfig): boolean;
|
|
|
219
224
|
*/
|
|
220
225
|
export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[] | readonly RoomType[], includeSecretAndSuperSecretRoom?: boolean, includeUltraSecretRoom?: boolean): boolean;
|
|
221
226
|
export declare function isAngelShop(roomData: RoomConfig): boolean;
|
|
227
|
+
/**
|
|
228
|
+
* Helper function to check to see if the provided room is a boss room for The Beast.
|
|
229
|
+
*
|
|
230
|
+
* Under the hood, this checks the room type and sub-type.
|
|
231
|
+
*/
|
|
222
232
|
export declare function isBeastRoom(roomData: RoomConfig): boolean;
|
|
223
233
|
/**
|
|
224
234
|
* Helper function to check if the provided room is a boss room for a particular boss. This will
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,SAAS,EAOT,SAAS,EACT,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAuCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAcnD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAiBlE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,EAChB,oBAAoB,UAAO,EAC3B,iCAAiC,UAAQ,GACxC,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,CAclC;AAED;;;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AED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,UAAU,EACpB,GAAG,UAAU,EAAE,SAAS,EAAE,GACzB,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,UAAU,EACpB,GAAG,SAAS,EAAE,QAAQ,EAAE,GACvB,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAEpE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
|
|
@@ -142,6 +142,9 @@ end
|
|
|
142
142
|
function ____exports.isAngelShop(self, roomData)
|
|
143
143
|
return roomData.Type == RoomType.ANGEL and roomData.Subtype == asNumber(nil, AngelRoomSubType.SHOP)
|
|
144
144
|
end
|
|
145
|
+
--- Helper function to check to see if the provided room is a boss room for The Beast.
|
|
146
|
+
--
|
|
147
|
+
-- Under the hood, this checks the room type and sub-type.
|
|
145
148
|
function ____exports.isBeastRoom(self, roomData)
|
|
146
149
|
return roomData.Type == RoomType.DUNGEON and roomData.Subtype == asNumber(nil, DungeonSubType.BEAST_ROOM)
|
|
147
150
|
end
|
|
@@ -365,6 +368,9 @@ function ____exports.inAngelShop(self)
|
|
|
365
368
|
local roomData = getRoomData(nil)
|
|
366
369
|
return ____exports.isAngelShop(nil, roomData)
|
|
367
370
|
end
|
|
371
|
+
--- Helper function to check to see if the current room is a boss room for The Beast.
|
|
372
|
+
--
|
|
373
|
+
-- Under the hood, this checks the room type and sub-type.
|
|
368
374
|
function ____exports.inBeastRoom(self)
|
|
369
375
|
local roomData = getRoomData(nil)
|
|
370
376
|
return ____exports.isBeastRoom(nil, roomData)
|
package/package.json
CHANGED
|
@@ -9,7 +9,6 @@ import { itemConfig } from "../../../core/cachedClasses";
|
|
|
9
9
|
import {
|
|
10
10
|
FIRST_CARD_TYPE,
|
|
11
11
|
FIRST_PILL_EFFECT,
|
|
12
|
-
FIRST_TRINKET_TYPE,
|
|
13
12
|
LAST_VANILLA_CARD_TYPE,
|
|
14
13
|
LAST_VANILLA_COLLECTIBLE_TYPE,
|
|
15
14
|
LAST_VANILLA_PILL_EFFECT,
|
|
@@ -101,6 +100,9 @@ export class ModdedElementDetection extends Feature {
|
|
|
101
100
|
* Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like
|
|
102
101
|
* 666. We subtract one to account for `CollectibleType.NULL`.)
|
|
103
102
|
*
|
|
103
|
+
* If there are no mods present that add any custom items, this function will return
|
|
104
|
+
* `CollectibleType.MOMS_RING` (732).
|
|
105
|
+
*
|
|
104
106
|
* This function can only be called if at least one callback has been executed. This is because
|
|
105
107
|
* not all collectibles will necessarily be present when a mod first loads (due to mod load
|
|
106
108
|
* order).
|
|
@@ -116,7 +118,7 @@ export class ModdedElementDetection extends Feature {
|
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
/**
|
|
119
|
-
* Helper function to get an array that represents
|
|
121
|
+
* Helper function to get an array that represents every modded collectible type.
|
|
120
122
|
*
|
|
121
123
|
* Returns an empty array if there are no modded collectible types.
|
|
122
124
|
*
|
|
@@ -149,6 +151,10 @@ export class ModdedElementDetection extends Feature {
|
|
|
149
151
|
}
|
|
150
152
|
|
|
151
153
|
/**
|
|
154
|
+
* Returns the total number of collectibles in the item config, including both vanilla and modded
|
|
155
|
+
* items. If you just need the number of vanilla collectible types, use the
|
|
156
|
+
* `NUM_VANILLA_COLLECTIBLE_TYPES` constant.
|
|
157
|
+
*
|
|
152
158
|
* This function can only be called if at least one callback has been executed. This is because
|
|
153
159
|
* not all collectibles will necessarily be present when a mod first loads (due to mod load
|
|
154
160
|
* order).
|
|
@@ -209,8 +215,11 @@ export class ModdedElementDetection extends Feature {
|
|
|
209
215
|
/**
|
|
210
216
|
* Will change depending on how many modded trinkets there are.
|
|
211
217
|
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
218
|
+
* Equal to `itemConfig.GetTrinkets().Size - 1`. (`Size` includes invalid trinkets, like 47. We
|
|
219
|
+
* subtract one to account for `TrinketType.NULL`.)
|
|
220
|
+
*
|
|
221
|
+
* If there are no mods present that add any custom trinkets, this function will return
|
|
222
|
+
* `TrinketType.SIGIL_OF_BAPHOMET` (189).
|
|
214
223
|
*
|
|
215
224
|
* This function can only be called if at least one callback has been executed. This is because
|
|
216
225
|
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -222,8 +231,7 @@ export class ModdedElementDetection extends Feature {
|
|
|
222
231
|
public getLastTrinketType(): TrinketType {
|
|
223
232
|
this.errorIfNoCallbacksFired("trinket");
|
|
224
233
|
|
|
225
|
-
|
|
226
|
-
return asTrinketType(numTrinketTypes);
|
|
234
|
+
return itemConfig.GetTrinkets().Size - 1;
|
|
227
235
|
}
|
|
228
236
|
|
|
229
237
|
/**
|
|
@@ -231,9 +239,11 @@ export class ModdedElementDetection extends Feature {
|
|
|
231
239
|
*
|
|
232
240
|
* Returns an empty array if there are no modded trinket types.
|
|
233
241
|
*
|
|
234
|
-
* This function is only useful when building
|
|
235
|
-
*
|
|
236
|
-
*
|
|
242
|
+
* This function is only useful when building trinket type objects. For most purposes, you should
|
|
243
|
+
* use the `getModdedTrinketArray` or `getModdedTrinketSet` helper function instead.
|
|
244
|
+
*
|
|
245
|
+
* (This function is named differently from the `getVanillaTrinketTypeRange` function because all
|
|
246
|
+
* modded trinket types are contiguous. Thus, each value represents a real `TrinketType`.)
|
|
237
247
|
*
|
|
238
248
|
* This function can only be called if at least one callback has been executed. This is because
|
|
239
249
|
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -255,10 +265,9 @@ export class ModdedElementDetection extends Feature {
|
|
|
255
265
|
}
|
|
256
266
|
|
|
257
267
|
/**
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
* `TrinketType.NULL`.)
|
|
268
|
+
* Returns the total number of trinkets in the item config, including both vanilla and modded
|
|
269
|
+
* items. If you just need the number of vanilla trinket types, use the
|
|
270
|
+
* `NUM_VANILLA_TRINKET_TYPES` constant.
|
|
262
271
|
*
|
|
263
272
|
* This function can only be called if at least one callback has been executed. This is because
|
|
264
273
|
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -270,26 +279,12 @@ export class ModdedElementDetection extends Feature {
|
|
|
270
279
|
public getNumTrinketTypes(): int {
|
|
271
280
|
this.errorIfNoCallbacksFired("trinket");
|
|
272
281
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* This function can only be called if at least one callback has been executed. This is because
|
|
278
|
-
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
279
|
-
*
|
|
280
|
-
* In order to use this function, you must upgrade your mod with
|
|
281
|
-
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
282
|
-
*/
|
|
283
|
-
@Exported
|
|
284
|
-
public getNumModdedTrinketTypes(): int {
|
|
285
|
-
this.errorIfNoCallbacksFired("trinket");
|
|
286
|
-
|
|
287
|
-
const numTrinketTypes = this.getNumTrinketTypes();
|
|
288
|
-
return numTrinketTypes - NUM_VANILLA_TRINKET_TYPES;
|
|
282
|
+
const numModdedTrinketTypes = this.getNumModdedTrinketTypes();
|
|
283
|
+
return NUM_VANILLA_TRINKET_TYPES + numModdedTrinketTypes;
|
|
289
284
|
}
|
|
290
285
|
|
|
291
286
|
/**
|
|
292
|
-
*
|
|
287
|
+
* Unlike vanilla trinket types, modded trinket types are always contiguous.
|
|
293
288
|
*
|
|
294
289
|
* This function can only be called if at least one callback has been executed. This is because
|
|
295
290
|
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -298,11 +293,11 @@ export class ModdedElementDetection extends Feature {
|
|
|
298
293
|
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
299
294
|
*/
|
|
300
295
|
@Exported
|
|
301
|
-
public
|
|
296
|
+
public getNumModdedTrinketTypes(): int {
|
|
302
297
|
this.errorIfNoCallbacksFired("trinket");
|
|
303
298
|
|
|
304
299
|
const lastTrinketType = this.getLastTrinketType();
|
|
305
|
-
return
|
|
300
|
+
return lastTrinketType - LAST_VANILLA_TRINKET_TYPE;
|
|
306
301
|
}
|
|
307
302
|
|
|
308
303
|
// -----
|
|
@@ -333,7 +333,7 @@ export class ModdedElementSets extends Feature {
|
|
|
333
333
|
for (const cacheFlag of CACHE_FLAG_VALUES) {
|
|
334
334
|
const trinketsSet = new Set<TrinketType>();
|
|
335
335
|
|
|
336
|
-
for (const trinketType of this.
|
|
336
|
+
for (const trinketType of this.getTrinketArray()) {
|
|
337
337
|
if (trinketHasCacheFlag(trinketType, cacheFlag)) {
|
|
338
338
|
trinketsSet.add(trinketType);
|
|
339
339
|
}
|
package/src/functions/rooms.ts
CHANGED
|
@@ -298,6 +298,11 @@ export function inAngelShop(): boolean {
|
|
|
298
298
|
return isAngelShop(roomData);
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
/**
|
|
302
|
+
* Helper function to check to see if the current room is a boss room for The Beast.
|
|
303
|
+
*
|
|
304
|
+
* Under the hood, this checks the room type and sub-type.
|
|
305
|
+
*/
|
|
301
306
|
export function inBeastRoom(): boolean {
|
|
302
307
|
const roomData = getRoomData();
|
|
303
308
|
return isBeastRoom(roomData);
|
|
@@ -538,6 +543,11 @@ export function isAngelShop(roomData: RoomConfig): boolean {
|
|
|
538
543
|
);
|
|
539
544
|
}
|
|
540
545
|
|
|
546
|
+
/**
|
|
547
|
+
* Helper function to check to see if the provided room is a boss room for The Beast.
|
|
548
|
+
*
|
|
549
|
+
* Under the hood, this checks the room type and sub-type.
|
|
550
|
+
*/
|
|
541
551
|
export function isBeastRoom(roomData: RoomConfig): boolean {
|
|
542
552
|
return (
|
|
543
553
|
roomData.Type === RoomType.DUNGEON &&
|