isaacscript-common 28.3.0 → 28.5.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 +21 -0
- package/dist/isaacscript-common.lua +19 -1
- package/dist/src/functions/set.d.ts +8 -0
- package/dist/src/functions/set.d.ts.map +1 -1
- package/dist/src/functions/set.lua +13 -0
- package/dist/src/functions/stage.d.ts +10 -0
- package/dist/src/functions/stage.d.ts.map +1 -1
- package/dist/src/functions/stage.lua +14 -0
- package/package.json +1 -1
- package/src/functions/set.ts +14 -0
- package/src/functions/stage.ts +25 -0
package/dist/index.rollup.d.ts
CHANGED
|
@@ -12803,6 +12803,12 @@ export declare function onStageType(...stageTypes: StageType[]): boolean;
|
|
|
12803
12803
|
*/
|
|
12804
12804
|
export declare function onStageWithNaturalDevilRoom(): boolean;
|
|
12805
12805
|
|
|
12806
|
+
/**
|
|
12807
|
+
* After defeating the boss on most stages, a random collectible will spawn from the Boss Room pool.
|
|
12808
|
+
* However, this does not happen on Depths 2, Womb 2, and beyond.
|
|
12809
|
+
*/
|
|
12810
|
+
export declare function onStageWithRandomBossCollectible(): boolean;
|
|
12811
|
+
|
|
12806
12812
|
/**
|
|
12807
12813
|
* Helper function to check if the current stage will spawn a locked door to Downpour/Dross after
|
|
12808
12814
|
* defeating the boss.
|
|
@@ -12821,6 +12827,12 @@ export declare function onStageWithSecretExitToMausoleum(): boolean;
|
|
|
12821
12827
|
*/
|
|
12822
12828
|
export declare function onStageWithSecretExitToMines(): boolean;
|
|
12823
12829
|
|
|
12830
|
+
/**
|
|
12831
|
+
* Helper function to check if the current stage is one that would create a trapdoor if We Need to
|
|
12832
|
+
* Go Deeper was used.
|
|
12833
|
+
*/
|
|
12834
|
+
export declare function onStageWithShovelWorking(): boolean;
|
|
12835
|
+
|
|
12824
12836
|
/**
|
|
12825
12837
|
* For the purposes of this function, doors to Secret Rooms or Super Secret Rooms that have not been
|
|
12826
12838
|
* discovered yet will not be opened.
|
|
@@ -15120,6 +15132,15 @@ export declare function setFloorDisplayFlags(displayFlagsMap: Map<int, BitFlags<
|
|
|
15120
15132
|
*/
|
|
15121
15133
|
export declare function setGridEntityInvisible(gridEntity: GridEntity): void;
|
|
15122
15134
|
|
|
15135
|
+
/**
|
|
15136
|
+
* Helper function to check for one or more elements in a set at once without having to repeatedly
|
|
15137
|
+
* call the `Set.has` method.
|
|
15138
|
+
*
|
|
15139
|
+
* This function is variadic, meaning that you can pass as many things as you want to check for. It
|
|
15140
|
+
* will return true if one or more elements are found.
|
|
15141
|
+
*/
|
|
15142
|
+
export declare function setHas<T>(set: Set<T> | ReadonlySet<T>, ...elements: T[]): boolean;
|
|
15143
|
+
|
|
15123
15144
|
/**
|
|
15124
15145
|
* Helper function to make using sets with an type of `PlayerIndex` easier. Use this instead of the
|
|
15125
15146
|
* `Set.has` method if you have a set of this type.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 28.
|
|
3
|
+
isaacscript-common 28.5.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -26984,6 +26984,11 @@ function ____exports.onStageWithNaturalDevilRoom(self)
|
|
|
26984
26984
|
local effectiveStage = ____exports.getEffectiveStage(nil)
|
|
26985
26985
|
return inRange(nil, effectiveStage, LevelStage.BASEMENT_2, LevelStage.WOMB_2) and effectiveStage ~= LevelStage.BLUE_WOMB
|
|
26986
26986
|
end
|
|
26987
|
+
function ____exports.onStageWithRandomBossCollectible(self)
|
|
26988
|
+
local level = game:GetLevel()
|
|
26989
|
+
local stage = level:GetStage()
|
|
26990
|
+
return stage ~= LevelStage.DEPTHS_2 and stage < LevelStage.WOMB_2
|
|
26991
|
+
end
|
|
26987
26992
|
function ____exports.onStageWithSecretExitToDownpour(self)
|
|
26988
26993
|
local level = game:GetLevel()
|
|
26989
26994
|
local stage = level:GetStage()
|
|
@@ -27001,6 +27006,11 @@ function ____exports.onStageWithSecretExitToMines(self)
|
|
|
27001
27006
|
local repentanceStage = ____exports.onRepentanceStage(nil)
|
|
27002
27007
|
return stage == LevelStage.CAVES_1 and not repentanceStage or stage == LevelStage.BASEMENT_2 and repentanceStage
|
|
27003
27008
|
end
|
|
27009
|
+
function ____exports.onStageWithShovelWorking(self)
|
|
27010
|
+
local level = game:GetLevel()
|
|
27011
|
+
local stage = level:GetStage()
|
|
27012
|
+
return stage < LevelStage.WOMB_2 or stage == LevelStage.WOMB_2 and not ____exports.onRepentanceStage(nil)
|
|
27013
|
+
end
|
|
27004
27014
|
function ____exports.setStage(self, stage, stageType, reseed)
|
|
27005
27015
|
if reseed == nil then
|
|
27006
27016
|
reseed = false
|
|
@@ -28277,6 +28287,7 @@ local __TS__New = ____lualib.__TS__New
|
|
|
28277
28287
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
28278
28288
|
local __TS__Spread = ____lualib.__TS__Spread
|
|
28279
28289
|
local __TS__ArraySort = ____lualib.__TS__ArraySort
|
|
28290
|
+
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
28280
28291
|
local ____exports = {}
|
|
28281
28292
|
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
28282
28293
|
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
@@ -28358,6 +28369,13 @@ function ____exports.setAdd(self, set, ...)
|
|
|
28358
28369
|
set:add(element)
|
|
28359
28370
|
end
|
|
28360
28371
|
end
|
|
28372
|
+
function ____exports.setHas(self, set, ...)
|
|
28373
|
+
local elements = {...}
|
|
28374
|
+
return __TS__ArraySome(
|
|
28375
|
+
elements,
|
|
28376
|
+
function(____, element) return set:has(element) end
|
|
28377
|
+
)
|
|
28378
|
+
end
|
|
28361
28379
|
function ____exports.sumSet(self, set)
|
|
28362
28380
|
local values = {__TS__Spread(set:values())}
|
|
28363
28381
|
return sumArray(nil, values)
|
|
@@ -65,6 +65,14 @@ export declare function getSortedSetValues<T>(set: Set<T> | ReadonlySet<T>): T[]
|
|
|
65
65
|
* This function is variadic, meaning that you can pass as many things as you want to add.
|
|
66
66
|
*/
|
|
67
67
|
export declare function setAdd<T>(set: Set<T>, ...elements: T[]): void;
|
|
68
|
+
/**
|
|
69
|
+
* Helper function to check for one or more elements in a set at once without having to repeatedly
|
|
70
|
+
* call the `Set.has` method.
|
|
71
|
+
*
|
|
72
|
+
* This function is variadic, meaning that you can pass as many things as you want to check for. It
|
|
73
|
+
* will return true if one or more elements are found.
|
|
74
|
+
*/
|
|
75
|
+
export declare function setHas<T>(set: Set<T> | ReadonlySet<T>, ...elements: T[]): boolean;
|
|
68
76
|
/** Helper function to sum every value in a set together. */
|
|
69
77
|
export declare function sumSet(set: Set<number> | ReadonlySet<number>): number;
|
|
70
78
|
//# sourceMappingURL=set.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../src/functions/set.ts"],"names":[],"mappings":";;AAKA;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EACf,GAAG,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,GAC3C,IAAI,CAMN;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,GACtC,GAAG,CAAC,CAAC,CAAC,CASR;AAED,mGAAmG;AACnG,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAOlE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,OAAO,EAAE,G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wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC,EAAE,GAAG,IAAI,CAI7D;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,CAAC,EACtB,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,EAC5B,GAAG,QAAQ,EAAE,CAAC,EAAE,GACf,OAAO,CAET;AAED,4DAA4D;AAC5D,wBAAgB,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAGrE"}
|
|
@@ -5,6 +5,7 @@ local __TS__New = ____lualib.__TS__New
|
|
|
5
5
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
6
6
|
local __TS__Spread = ____lualib.__TS__Spread
|
|
7
7
|
local __TS__ArraySort = ____lualib.__TS__ArraySort
|
|
8
|
+
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
8
9
|
local ____exports = {}
|
|
9
10
|
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
10
11
|
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
@@ -129,6 +130,18 @@ function ____exports.setAdd(self, set, ...)
|
|
|
129
130
|
set:add(element)
|
|
130
131
|
end
|
|
131
132
|
end
|
|
133
|
+
--- Helper function to check for one or more elements in a set at once without having to repeatedly
|
|
134
|
+
-- call the `Set.has` method.
|
|
135
|
+
--
|
|
136
|
+
-- This function is variadic, meaning that you can pass as many things as you want to check for. It
|
|
137
|
+
-- will return true if one or more elements are found.
|
|
138
|
+
function ____exports.setHas(self, set, ...)
|
|
139
|
+
local elements = {...}
|
|
140
|
+
return __TS__ArraySome(
|
|
141
|
+
elements,
|
|
142
|
+
function(____, element) return set:has(element) end
|
|
143
|
+
)
|
|
144
|
+
end
|
|
132
145
|
--- Helper function to sum every value in a set together.
|
|
133
146
|
function ____exports.sumSet(self, set)
|
|
134
147
|
local values = {__TS__Spread(set:values())}
|
|
@@ -114,6 +114,11 @@ export declare function onStageType(...stageTypes: StageType[]): boolean;
|
|
|
114
114
|
* Devil Room or Angel Room after killing the boss.
|
|
115
115
|
*/
|
|
116
116
|
export declare function onStageWithNaturalDevilRoom(): boolean;
|
|
117
|
+
/**
|
|
118
|
+
* After defeating the boss on most stages, a random collectible will spawn from the Boss Room pool.
|
|
119
|
+
* However, this does not happen on Depths 2, Womb 2, and beyond.
|
|
120
|
+
*/
|
|
121
|
+
export declare function onStageWithRandomBossCollectible(): boolean;
|
|
117
122
|
/**
|
|
118
123
|
* Helper function to check if the current stage will spawn a locked door to Downpour/Dross after
|
|
119
124
|
* defeating the boss.
|
|
@@ -129,6 +134,11 @@ export declare function onStageWithSecretExitToMausoleum(): boolean;
|
|
|
129
134
|
* defeating the boss.
|
|
130
135
|
*/
|
|
131
136
|
export declare function onStageWithSecretExitToMines(): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Helper function to check if the current stage is one that would create a trapdoor if We Need to
|
|
139
|
+
* Go Deeper was used.
|
|
140
|
+
*/
|
|
141
|
+
export declare function onStageWithShovelWorking(): boolean;
|
|
132
142
|
/**
|
|
133
143
|
* Helper function to warp to a new stage/level.
|
|
134
144
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../../src/functions/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,EACV,MAAM,8BAA8B,CAAC;AAUtC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CA6B/D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAmBzE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAS9C;AAED;;;;;;;;;;GAUG;AACH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AED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,UAAQ,GACb,IAAI,CAUN;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAE9D"}
|
|
@@ -247,6 +247,13 @@ function ____exports.onStageWithNaturalDevilRoom(self)
|
|
|
247
247
|
local effectiveStage = ____exports.getEffectiveStage(nil)
|
|
248
248
|
return inRange(nil, effectiveStage, LevelStage.BASEMENT_2, LevelStage.WOMB_2) and effectiveStage ~= LevelStage.BLUE_WOMB
|
|
249
249
|
end
|
|
250
|
+
--- After defeating the boss on most stages, a random collectible will spawn from the Boss Room pool.
|
|
251
|
+
-- However, this does not happen on Depths 2, Womb 2, and beyond.
|
|
252
|
+
function ____exports.onStageWithRandomBossCollectible(self)
|
|
253
|
+
local level = game:GetLevel()
|
|
254
|
+
local stage = level:GetStage()
|
|
255
|
+
return stage ~= LevelStage.DEPTHS_2 and stage < LevelStage.WOMB_2
|
|
256
|
+
end
|
|
250
257
|
--- Helper function to check if the current stage will spawn a locked door to Downpour/Dross after
|
|
251
258
|
-- defeating the boss.
|
|
252
259
|
function ____exports.onStageWithSecretExitToDownpour(self)
|
|
@@ -270,6 +277,13 @@ function ____exports.onStageWithSecretExitToMines(self)
|
|
|
270
277
|
local repentanceStage = ____exports.onRepentanceStage(nil)
|
|
271
278
|
return stage == LevelStage.CAVES_1 and not repentanceStage or stage == LevelStage.BASEMENT_2 and repentanceStage
|
|
272
279
|
end
|
|
280
|
+
--- Helper function to check if the current stage is one that would create a trapdoor if We Need to
|
|
281
|
+
-- Go Deeper was used.
|
|
282
|
+
function ____exports.onStageWithShovelWorking(self)
|
|
283
|
+
local level = game:GetLevel()
|
|
284
|
+
local stage = level:GetStage()
|
|
285
|
+
return stage < LevelStage.WOMB_2 or stage == LevelStage.WOMB_2 and not ____exports.onRepentanceStage(nil)
|
|
286
|
+
end
|
|
273
287
|
--- Helper function to warp to a new stage/level.
|
|
274
288
|
--
|
|
275
289
|
-- @param stage The stage number to warp to.
|
package/package.json
CHANGED
package/src/functions/set.ts
CHANGED
|
@@ -149,6 +149,20 @@ export function setAdd<T>(set: Set<T>, ...elements: T[]): void {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Helper function to check for one or more elements in a set at once without having to repeatedly
|
|
154
|
+
* call the `Set.has` method.
|
|
155
|
+
*
|
|
156
|
+
* This function is variadic, meaning that you can pass as many things as you want to check for. It
|
|
157
|
+
* will return true if one or more elements are found.
|
|
158
|
+
*/
|
|
159
|
+
export function setHas<T>(
|
|
160
|
+
set: Set<T> | ReadonlySet<T>,
|
|
161
|
+
...elements: T[]
|
|
162
|
+
): boolean {
|
|
163
|
+
return elements.some((element) => set.has(element));
|
|
164
|
+
}
|
|
165
|
+
|
|
152
166
|
/** Helper function to sum every value in a set together. */
|
|
153
167
|
export function sumSet(set: Set<number> | ReadonlySet<number>): number {
|
|
154
168
|
const values = [...set.values()];
|
package/src/functions/stage.ts
CHANGED
|
@@ -339,6 +339,17 @@ export function onStageWithNaturalDevilRoom(): boolean {
|
|
|
339
339
|
);
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
+
/**
|
|
343
|
+
* After defeating the boss on most stages, a random collectible will spawn from the Boss Room pool.
|
|
344
|
+
* However, this does not happen on Depths 2, Womb 2, and beyond.
|
|
345
|
+
*/
|
|
346
|
+
export function onStageWithRandomBossCollectible(): boolean {
|
|
347
|
+
const level = game.GetLevel();
|
|
348
|
+
const stage = level.GetStage();
|
|
349
|
+
|
|
350
|
+
return stage !== LevelStage.DEPTHS_2 && stage < LevelStage.WOMB_2;
|
|
351
|
+
}
|
|
352
|
+
|
|
342
353
|
/**
|
|
343
354
|
* Helper function to check if the current stage will spawn a locked door to Downpour/Dross after
|
|
344
355
|
* defeating the boss.
|
|
@@ -380,6 +391,20 @@ export function onStageWithSecretExitToMines(): boolean {
|
|
|
380
391
|
);
|
|
381
392
|
}
|
|
382
393
|
|
|
394
|
+
/**
|
|
395
|
+
* Helper function to check if the current stage is one that would create a trapdoor if We Need to
|
|
396
|
+
* Go Deeper was used.
|
|
397
|
+
*/
|
|
398
|
+
export function onStageWithShovelWorking(): boolean {
|
|
399
|
+
const level = game.GetLevel();
|
|
400
|
+
const stage = level.GetStage();
|
|
401
|
+
|
|
402
|
+
return (
|
|
403
|
+
stage < LevelStage.WOMB_2 ||
|
|
404
|
+
(stage === LevelStage.WOMB_2 && !onRepentanceStage())
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
|
|
383
408
|
/**
|
|
384
409
|
* Helper function to warp to a new stage/level.
|
|
385
410
|
*
|