isaacscript-common 16.1.1 → 16.1.2
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.d.ts +10 -3
- package/dist/isaacscript-common.lua +5 -7
- package/dist/src/classes/features/other/ModdedElementSets.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementSets.lua +3 -3
- package/dist/src/functions/collectibles.d.ts +1 -1
- package/dist/src/functions/collectibles.lua +1 -1
- package/dist/src/functions/trinkets.d.ts +9 -2
- package/dist/src/functions/trinkets.d.ts.map +1 -1
- package/dist/src/functions/trinkets.lua +7 -2
- package/package.json +2 -2
- package/src/classes/features/other/ModdedElementSets.ts +7 -5
- package/src/functions/collectibles.ts +1 -1
- package/src/functions/trinkets.ts +9 -2
package/dist/index.d.ts
CHANGED
|
@@ -6496,15 +6496,22 @@ export declare function getVanillaCardTypes(): CardType[];
|
|
|
6496
6496
|
*
|
|
6497
6497
|
* This function is only useful when building collectible type objects. For most purposes, you
|
|
6498
6498
|
* should use the `getVanillaCollectibleArray` or `getVanillaCollectibleSet` helper functions
|
|
6499
|
-
* instead.
|
|
6499
|
+
* instead (which are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
6500
6500
|
*/
|
|
6501
6501
|
export declare function getVanillaCollectibleTypeRange(): CollectibleType[];
|
|
6502
6502
|
|
|
6503
6503
|
/** Helper function to get an array with every vanilla pill effect. */
|
|
6504
6504
|
export declare function getVanillaPillEffects(): PillEffect[];
|
|
6505
6505
|
|
|
6506
|
-
/**
|
|
6507
|
-
|
|
6506
|
+
/**
|
|
6507
|
+
* Helper function to get an array that represents the range from the first trinket type to the last
|
|
6508
|
+
* vanilla trinket type. This will include integers that do not represent any valid trinket types.
|
|
6509
|
+
*
|
|
6510
|
+
* This function is only useful when building collectible type objects. For most purposes, you
|
|
6511
|
+
* should use the `getVanillaTrinketArray` or `getVanillaTrinketSet` helper functions instead (which
|
|
6512
|
+
* are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
6513
|
+
*/
|
|
6514
|
+
export declare function getVanillaTrinketTypeRange(): TrinketType[];
|
|
6508
6515
|
|
|
6509
6516
|
/**
|
|
6510
6517
|
* Get how many hearts are currently being shown on the hearts UI.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 16.1.
|
|
3
|
+
isaacscript-common 16.1.2
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -7127,8 +7127,6 @@ ____exports.TrinketType.ACE_SPADES = 45
|
|
|
7127
7127
|
____exports.TrinketType[____exports.TrinketType.ACE_SPADES] = "ACE_SPADES"
|
|
7128
7128
|
____exports.TrinketType.ISAACS_FORK = 46
|
|
7129
7129
|
____exports.TrinketType[____exports.TrinketType.ISAACS_FORK] = "ISAACS_FORK"
|
|
7130
|
-
____exports.TrinketType.POLAROID_OBSOLETE = 47
|
|
7131
|
-
____exports.TrinketType[____exports.TrinketType.POLAROID_OBSOLETE] = "POLAROID_OBSOLETE"
|
|
7132
7130
|
____exports.TrinketType.MISSING_PAGE = 48
|
|
7133
7131
|
____exports.TrinketType[____exports.TrinketType.MISSING_PAGE] = "MISSING_PAGE"
|
|
7134
7132
|
____exports.TrinketType.BLOODY_PENNY = 49
|
|
@@ -27079,7 +27077,7 @@ function ____exports.getTrinketName(self, trinketType)
|
|
|
27079
27077
|
end
|
|
27080
27078
|
return DEFAULT_TRINKET_NAME
|
|
27081
27079
|
end
|
|
27082
|
-
function ____exports.
|
|
27080
|
+
function ____exports.getVanillaTrinketTypeRange(self)
|
|
27083
27081
|
return iRange(nil, FIRST_TRINKET_TYPE, LAST_VANILLA_TRINKET_TYPE)
|
|
27084
27082
|
end
|
|
27085
27083
|
function ____exports.hasOpenTrinketSlot(self, player)
|
|
@@ -32177,7 +32175,7 @@ local deleteSetsFromSet = ____set.deleteSetsFromSet
|
|
|
32177
32175
|
local getRandomSetElement = ____set.getRandomSetElement
|
|
32178
32176
|
local getSortedSetValues = ____set.getSortedSetValues
|
|
32179
32177
|
local ____trinkets = require("src.functions.trinkets")
|
|
32180
|
-
local
|
|
32178
|
+
local getVanillaTrinketTypeRange = ____trinkets.getVanillaTrinketTypeRange
|
|
32181
32179
|
local trinketHasCacheFlag = ____trinkets.trinketHasCacheFlag
|
|
32182
32180
|
local ____utils = require("src.functions.utils")
|
|
32183
32181
|
local ____repeat = ____utils["repeat"]
|
|
@@ -32268,8 +32266,8 @@ function ModdedElementSets.prototype.lazyInitVanillaTrinketTypes(self)
|
|
|
32268
32266
|
if #self.vanillaTrinketTypesArray > 0 then
|
|
32269
32267
|
return
|
|
32270
32268
|
end
|
|
32271
|
-
local
|
|
32272
|
-
for ____, trinketType in ipairs(
|
|
32269
|
+
local vanillaTrinketTypeRange = getVanillaTrinketTypeRange(nil)
|
|
32270
|
+
for ____, trinketType in ipairs(vanillaTrinketTypeRange) do
|
|
32273
32271
|
local itemConfigItem = itemConfig:GetTrinket(trinketType)
|
|
32274
32272
|
if itemConfigItem ~= nil then
|
|
32275
32273
|
local ____self_vanillaTrinketTypesArray_4 = self.vanillaTrinketTypesArray
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModdedElementSets.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ModdedElementSets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AA2BtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA4BhD,qBAAa,iBAAkB,SAAQ,OAAO;IAC5C,OAAO,CAAC,wBAAwB,CAAyB;IACzD,OAAO,CAAC,sBAAsB,CAA8B;IAE5D,OAAO,CAAC,4BAA4B,CAAyB;IAC7D,OAAO,CAAC,0BAA0B,CAA8B;IAEhE,OAAO,CAAC,2BAA2B,CAAyB;IAC5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,IAAI,SAAS,WAAW,EAAE;IAKhD;;;;;;;;;;OAUG;IAEI,aAAa,IAAI,WAAW,CAAC,WAAW,CAAC;IAKhD;;;;;;;;OAQG;IAEI,wBAAwB,CAC7B,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,WAAW,CAAC;IAW3B;;;;;;;OAOG;IAEI,0BAA0B,IAAI,SAAS,eAAe,EAAE;IAK/D;;;;;;;OAOG;IAEI,wBAAwB,IAAI,WAAW,CAAC,eAAe,CAAC;IAK/D;;;;;;;OAOG;IAEI,sBAAsB,IAAI,SAAS,WAAW,EAAE;IAKvD;;;;;;;OAOG;IAEI,oBAAoB,IAAI,WAAW,CAAC,WAAW,CAAC;CAIxD"}
|
|
@@ -41,7 +41,7 @@ local deleteSetsFromSet = ____set.deleteSetsFromSet
|
|
|
41
41
|
local getRandomSetElement = ____set.getRandomSetElement
|
|
42
42
|
local getSortedSetValues = ____set.getSortedSetValues
|
|
43
43
|
local ____trinkets = require("src.functions.trinkets")
|
|
44
|
-
local
|
|
44
|
+
local getVanillaTrinketTypeRange = ____trinkets.getVanillaTrinketTypeRange
|
|
45
45
|
local trinketHasCacheFlag = ____trinkets.trinketHasCacheFlag
|
|
46
46
|
local ____utils = require("src.functions.utils")
|
|
47
47
|
local ____repeat = ____utils["repeat"]
|
|
@@ -132,8 +132,8 @@ function ModdedElementSets.prototype.lazyInitVanillaTrinketTypes(self)
|
|
|
132
132
|
if #self.vanillaTrinketTypesArray > 0 then
|
|
133
133
|
return
|
|
134
134
|
end
|
|
135
|
-
local
|
|
136
|
-
for ____, trinketType in ipairs(
|
|
135
|
+
local vanillaTrinketTypeRange = getVanillaTrinketTypeRange(nil)
|
|
136
|
+
for ____, trinketType in ipairs(vanillaTrinketTypeRange) do
|
|
137
137
|
local itemConfigItem = itemConfig:GetTrinket(trinketType)
|
|
138
138
|
if itemConfigItem ~= nil then
|
|
139
139
|
local ____self_vanillaTrinketTypesArray_4 = self.vanillaTrinketTypesArray
|
|
@@ -140,7 +140,7 @@ export declare function getCollectibleTags(collectibleType: CollectibleType): Bi
|
|
|
140
140
|
*
|
|
141
141
|
* This function is only useful when building collectible type objects. For most purposes, you
|
|
142
142
|
* should use the `getVanillaCollectibleArray` or `getVanillaCollectibleSet` helper functions
|
|
143
|
-
* instead.
|
|
143
|
+
* instead (which are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
144
144
|
*/
|
|
145
145
|
export declare function getVanillaCollectibleTypeRange(): CollectibleType[];
|
|
146
146
|
/** Returns true if the item type in the item config is equal to `ItemType.ITEM_ACTIVE`. */
|
|
@@ -357,7 +357,7 @@ end
|
|
|
357
357
|
--
|
|
358
358
|
-- This function is only useful when building collectible type objects. For most purposes, you
|
|
359
359
|
-- should use the `getVanillaCollectibleArray` or `getVanillaCollectibleSet` helper functions
|
|
360
|
-
-- instead.
|
|
360
|
+
-- instead (which are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
361
361
|
function ____exports.getVanillaCollectibleTypeRange(self)
|
|
362
362
|
return iRange(nil, FIRST_COLLECTIBLE_TYPE, LAST_VANILLA_COLLECTIBLE_TYPE)
|
|
363
363
|
end
|
|
@@ -46,8 +46,15 @@ export declare function getTrinketGfxFilename(trinketType: TrinketType): string;
|
|
|
46
46
|
* This function works for both vanilla and modded trinkets.
|
|
47
47
|
*/
|
|
48
48
|
export declare function getTrinketName(trinketType: TrinketType): string;
|
|
49
|
-
/**
|
|
50
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Helper function to get an array that represents the range from the first trinket type to the last
|
|
51
|
+
* vanilla trinket type. This will include integers that do not represent any valid trinket types.
|
|
52
|
+
*
|
|
53
|
+
* This function is only useful when building collectible type objects. For most purposes, you
|
|
54
|
+
* should use the `getVanillaTrinketArray` or `getVanillaTrinketSet` helper functions instead (which
|
|
55
|
+
* are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
56
|
+
*/
|
|
57
|
+
export declare function getVanillaTrinketTypeRange(): TrinketType[];
|
|
51
58
|
/**
|
|
52
59
|
* Returns whether or not the player can hold an additional trinket, beyond what they are currently
|
|
53
60
|
* carrying. This takes into account items that modify the max number of trinkets, like Mom's Purse.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trinkets.d.ts","sourceRoot":"","sources":["../../../src/functions/trinkets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAGT,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAmCtC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAE1E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,GAAG,SAAS,CAkBxE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CActE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAOtE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAc/D;AAED
|
|
1
|
+
{"version":3,"file":"trinkets.d.ts","sourceRoot":"","sources":["../../../src/functions/trinkets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAGT,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAmCtC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAE1E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,GAAG,SAAS,CAkBxE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CActE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAOtE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAc/D;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,IAAI,WAAW,EAAE,CAE1D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAOhE;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAErE;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAErE;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAEtE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CASjE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,IAAI,CAeN;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,GACnB,OAAO,CAOT"}
|
|
@@ -120,8 +120,13 @@ function ____exports.getTrinketName(self, trinketType)
|
|
|
120
120
|
end
|
|
121
121
|
return DEFAULT_TRINKET_NAME
|
|
122
122
|
end
|
|
123
|
-
--- Helper function to get an array that represents
|
|
124
|
-
|
|
123
|
+
--- Helper function to get an array that represents the range from the first trinket type to the last
|
|
124
|
+
-- vanilla trinket type. This will include integers that do not represent any valid trinket types.
|
|
125
|
+
--
|
|
126
|
+
-- This function is only useful when building collectible type objects. For most purposes, you
|
|
127
|
+
-- should use the `getVanillaTrinketArray` or `getVanillaTrinketSet` helper functions instead (which
|
|
128
|
+
-- are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
129
|
+
function ____exports.getVanillaTrinketTypeRange(self)
|
|
125
130
|
return iRange(nil, FIRST_TRINKET_TYPE, LAST_VANILLA_TRINKET_TYPE)
|
|
126
131
|
end
|
|
127
132
|
--- Returns whether or not the player can hold an additional trinket, beyond what they are currently
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "16.1.
|
|
3
|
+
"version": "16.1.2",
|
|
4
4
|
"description": "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"main": "dist/src/index",
|
|
23
23
|
"types": "dist/src/index.d.ts",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"isaac-typescript-definitions": "^9.5.
|
|
25
|
+
"isaac-typescript-definitions": "^9.5.2"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
getSortedSetValues,
|
|
28
28
|
} from "../../../functions/set";
|
|
29
29
|
import {
|
|
30
|
-
|
|
30
|
+
getVanillaTrinketTypeRange,
|
|
31
31
|
trinketHasCacheFlag,
|
|
32
32
|
} from "../../../functions/trinkets";
|
|
33
33
|
import { repeat } from "../../../functions/utils";
|
|
@@ -115,7 +115,8 @@ export class ModdedElementSets extends Feature {
|
|
|
115
115
|
|
|
116
116
|
const vanillaCollectibleTypeRange = getVanillaCollectibleTypeRange();
|
|
117
117
|
for (const collectibleType of vanillaCollectibleTypeRange) {
|
|
118
|
-
// Vanilla collectible types are not contiguous, so we must check every value.
|
|
118
|
+
// Vanilla collectible types are not contiguous, so we must check every value. (There are
|
|
119
|
+
// several gaps, e.g. 666.)
|
|
119
120
|
const itemConfigItem = itemConfig.GetCollectible(collectibleType);
|
|
120
121
|
if (itemConfigItem !== undefined) {
|
|
121
122
|
this.vanillaCollectibleTypesArray.push(collectibleType);
|
|
@@ -156,9 +157,10 @@ export class ModdedElementSets extends Feature {
|
|
|
156
157
|
return;
|
|
157
158
|
}
|
|
158
159
|
|
|
159
|
-
const
|
|
160
|
-
for (const trinketType of
|
|
161
|
-
// Vanilla trinket types are contiguous,
|
|
160
|
+
const vanillaTrinketTypeRange = getVanillaTrinketTypeRange();
|
|
161
|
+
for (const trinketType of vanillaTrinketTypeRange) {
|
|
162
|
+
// Vanilla trinket types are not contiguous, so we must check every value. (The only gap is 47
|
|
163
|
+
// for `POLAROID_OBSOLETE`.)
|
|
162
164
|
const itemConfigItem = itemConfig.GetTrinket(trinketType);
|
|
163
165
|
if (itemConfigItem !== undefined) {
|
|
164
166
|
this.vanillaTrinketTypesArray.push(trinketType);
|
|
@@ -412,7 +412,7 @@ export function getCollectibleTags(
|
|
|
412
412
|
*
|
|
413
413
|
* This function is only useful when building collectible type objects. For most purposes, you
|
|
414
414
|
* should use the `getVanillaCollectibleArray` or `getVanillaCollectibleSet` helper functions
|
|
415
|
-
* instead.
|
|
415
|
+
* instead (which are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
416
416
|
*/
|
|
417
417
|
export function getVanillaCollectibleTypeRange(): CollectibleType[] {
|
|
418
418
|
return iRange(FIRST_COLLECTIBLE_TYPE, LAST_VANILLA_COLLECTIBLE_TYPE);
|
|
@@ -145,8 +145,15 @@ export function getTrinketName(trinketType: TrinketType): string {
|
|
|
145
145
|
return DEFAULT_TRINKET_NAME;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
/**
|
|
149
|
-
|
|
148
|
+
/**
|
|
149
|
+
* Helper function to get an array that represents the range from the first trinket type to the last
|
|
150
|
+
* vanilla trinket type. This will include integers that do not represent any valid trinket types.
|
|
151
|
+
*
|
|
152
|
+
* This function is only useful when building collectible type objects. For most purposes, you
|
|
153
|
+
* should use the `getVanillaTrinketArray` or `getVanillaTrinketSet` helper functions instead (which
|
|
154
|
+
* are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
155
|
+
*/
|
|
156
|
+
export function getVanillaTrinketTypeRange(): TrinketType[] {
|
|
150
157
|
return iRange(FIRST_TRINKET_TYPE, LAST_VANILLA_TRINKET_TYPE);
|
|
151
158
|
}
|
|
152
159
|
|