isaacscript-common 72.7.1 → 72.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 +8 -0
- package/dist/isaacscript-common.lua +74 -3
- package/dist/src/functions/entities.d.ts.map +1 -1
- package/dist/src/functions/entities.lua +26 -2
- package/dist/src/functions/types.d.ts +8 -1
- package/dist/src/functions/types.d.ts.map +1 -1
- package/dist/src/functions/types.lua +7 -0
- package/package.json +2 -2
- package/src/functions/entities.ts +23 -2
- package/src/functions/types.ts +11 -0
package/dist/index.rollup.d.ts
CHANGED
|
@@ -1230,6 +1230,14 @@ export declare function asPillEffect(num: int): PillEffect;
|
|
|
1230
1230
|
*/
|
|
1231
1231
|
export declare function asPlayerType(num: int): PlayerType;
|
|
1232
1232
|
|
|
1233
|
+
/**
|
|
1234
|
+
* Helper function to safely cast an `int` to a `RoomType`. (This is better than using the `as`
|
|
1235
|
+
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
1236
|
+
*
|
|
1237
|
+
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
1238
|
+
*/
|
|
1239
|
+
export declare function asRoomType(num: int): RoomType;
|
|
1240
|
+
|
|
1233
1241
|
/**
|
|
1234
1242
|
* Helper function to throw an error (using the `error` Lua function) if the provided value is equal
|
|
1235
1243
|
* to `undefined`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 72.
|
|
3
|
+
isaacscript-common 72.9.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -10444,6 +10444,50 @@ ____exports.ColostomiaState.FART_ATTACK = 11
|
|
|
10444
10444
|
____exports.ColostomiaState[____exports.ColostomiaState.FART_ATTACK] = "FART_ATTACK"
|
|
10445
10445
|
____exports.ColostomiaState.TRANSITION_TO_PHASE_2 = 16
|
|
10446
10446
|
____exports.ColostomiaState[____exports.ColostomiaState.TRANSITION_TO_PHASE_2] = "TRANSITION_TO_PHASE_2"
|
|
10447
|
+
--- For `EntityType.ULTRA_GREED` (406), `UltraGreedVariant.ULTRA_GREED` (0).
|
|
10448
|
+
____exports.UltraGreedState = {}
|
|
10449
|
+
____exports.UltraGreedState.HANGING = 2
|
|
10450
|
+
____exports.UltraGreedState[____exports.UltraGreedState.HANGING] = "HANGING"
|
|
10451
|
+
____exports.UltraGreedState.IDLE = 3
|
|
10452
|
+
____exports.UltraGreedState[____exports.UltraGreedState.IDLE] = "IDLE"
|
|
10453
|
+
____exports.UltraGreedState.MOVE = 4
|
|
10454
|
+
____exports.UltraGreedState[____exports.UltraGreedState.MOVE] = "MOVE"
|
|
10455
|
+
____exports.UltraGreedState.GOLD_STATUE_BREAKING_OUT = 16
|
|
10456
|
+
____exports.UltraGreedState[____exports.UltraGreedState.GOLD_STATUE_BREAKING_OUT] = "GOLD_STATUE_BREAKING_OUT"
|
|
10457
|
+
____exports.UltraGreedState.EYES_SPINNING = 100
|
|
10458
|
+
____exports.UltraGreedState[____exports.UltraGreedState.EYES_SPINNING] = "EYES_SPINNING"
|
|
10459
|
+
____exports.UltraGreedState.STOMPING = 200
|
|
10460
|
+
____exports.UltraGreedState[____exports.UltraGreedState.STOMPING] = "STOMPING"
|
|
10461
|
+
____exports.UltraGreedState.BLOCKING_WITH_ARMS = 400
|
|
10462
|
+
____exports.UltraGreedState[____exports.UltraGreedState.BLOCKING_WITH_ARMS] = "BLOCKING_WITH_ARMS"
|
|
10463
|
+
____exports.UltraGreedState.SPIN_ATTACK = 510
|
|
10464
|
+
____exports.UltraGreedState[____exports.UltraGreedState.SPIN_ATTACK] = "SPIN_ATTACK"
|
|
10465
|
+
____exports.UltraGreedState.SHOOT_4_COINS = 600
|
|
10466
|
+
____exports.UltraGreedState[____exports.UltraGreedState.SHOOT_4_COINS] = "SHOOT_4_COINS"
|
|
10467
|
+
____exports.UltraGreedState.DYING = 9000
|
|
10468
|
+
____exports.UltraGreedState[____exports.UltraGreedState.DYING] = "DYING"
|
|
10469
|
+
____exports.UltraGreedState.GOLD_STATUE = 9001
|
|
10470
|
+
____exports.UltraGreedState[____exports.UltraGreedState.GOLD_STATUE] = "GOLD_STATUE"
|
|
10471
|
+
--- For `EntityType.ULTRA_GREED` (406), `UltraGreedVariant.ULTRA_GREEDIER` (1).
|
|
10472
|
+
____exports.UltraGreedierState = {}
|
|
10473
|
+
____exports.UltraGreedierState.IDLE = 3
|
|
10474
|
+
____exports.UltraGreedierState[____exports.UltraGreedierState.IDLE] = "IDLE"
|
|
10475
|
+
____exports.UltraGreedierState.MOVE = 4
|
|
10476
|
+
____exports.UltraGreedierState[____exports.UltraGreedierState.MOVE] = "MOVE"
|
|
10477
|
+
____exports.UltraGreedierState.JUMP = 6
|
|
10478
|
+
____exports.UltraGreedierState[____exports.UltraGreedierState.JUMP] = "JUMP"
|
|
10479
|
+
____exports.UltraGreedierState.STOMPING = 200
|
|
10480
|
+
____exports.UltraGreedierState[____exports.UltraGreedierState.STOMPING] = "STOMPING"
|
|
10481
|
+
____exports.UltraGreedierState.SHOOT_4_COINS = 600
|
|
10482
|
+
____exports.UltraGreedierState[____exports.UltraGreedierState.SHOOT_4_COINS] = "SHOOT_4_COINS"
|
|
10483
|
+
____exports.UltraGreedierState.FIST_POUND = 700
|
|
10484
|
+
____exports.UltraGreedierState[____exports.UltraGreedierState.FIST_POUND] = "FIST_POUND"
|
|
10485
|
+
____exports.UltraGreedierState.FIST_POUND_TRIPLE = 710
|
|
10486
|
+
____exports.UltraGreedierState[____exports.UltraGreedierState.FIST_POUND_TRIPLE] = "FIST_POUND_TRIPLE"
|
|
10487
|
+
____exports.UltraGreedierState.DYING = 9000
|
|
10488
|
+
____exports.UltraGreedierState[____exports.UltraGreedierState.DYING] = "DYING"
|
|
10489
|
+
____exports.UltraGreedierState.POST_EXPLOSION = 9001
|
|
10490
|
+
____exports.UltraGreedierState[____exports.UltraGreedierState.POST_EXPLOSION] = "POST_EXPLOSION"
|
|
10447
10491
|
return ____exports
|
|
10448
10492
|
end,
|
|
10449
10493
|
["lua_modules.isaac-typescript-definitions.dist.src.enums.WeaponType"] = function(...)
|
|
@@ -15827,6 +15871,9 @@ end
|
|
|
15827
15871
|
function ____exports.asPlayerType(self, num)
|
|
15828
15872
|
return num
|
|
15829
15873
|
end
|
|
15874
|
+
function ____exports.asRoomType(self, num)
|
|
15875
|
+
return num
|
|
15876
|
+
end
|
|
15830
15877
|
function ____exports.asString(self, str)
|
|
15831
15878
|
return str
|
|
15832
15879
|
end
|
|
@@ -23658,6 +23705,9 @@ local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
|
|
|
23658
23705
|
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
23659
23706
|
local MotherVariant = ____isaac_2Dtypescript_2Ddefinitions.MotherVariant
|
|
23660
23707
|
local NPCState = ____isaac_2Dtypescript_2Ddefinitions.NPCState
|
|
23708
|
+
local UltraGreedState = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedState
|
|
23709
|
+
local UltraGreedVariant = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedVariant
|
|
23710
|
+
local UltraGreedierState = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedierState
|
|
23661
23711
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
23662
23712
|
local game = ____cachedClasses.game
|
|
23663
23713
|
local ____constants = require("src.core.constants")
|
|
@@ -23924,8 +23974,29 @@ function ____exports.isActiveEnemy(self, entity)
|
|
|
23924
23974
|
if ____cond36 then
|
|
23925
23975
|
do
|
|
23926
23976
|
local npc = entity:ToNPC()
|
|
23927
|
-
if npc ~= nil
|
|
23928
|
-
|
|
23977
|
+
if npc ~= nil then
|
|
23978
|
+
local ultraGreedVariant = npc.Variant
|
|
23979
|
+
repeat
|
|
23980
|
+
local ____switch41 = ultraGreedVariant
|
|
23981
|
+
local ____cond41 = ____switch41 == UltraGreedVariant.ULTRA_GREED
|
|
23982
|
+
if ____cond41 then
|
|
23983
|
+
do
|
|
23984
|
+
if npc.State == asNPCState(nil, UltraGreedState.GOLD_STATUE) then
|
|
23985
|
+
return false
|
|
23986
|
+
end
|
|
23987
|
+
break
|
|
23988
|
+
end
|
|
23989
|
+
end
|
|
23990
|
+
____cond41 = ____cond41 or ____switch41 == UltraGreedVariant.ULTRA_GREEDIER
|
|
23991
|
+
if ____cond41 then
|
|
23992
|
+
do
|
|
23993
|
+
if npc.State == asNPCState(nil, UltraGreedierState.POST_EXPLOSION) then
|
|
23994
|
+
return false
|
|
23995
|
+
end
|
|
23996
|
+
break
|
|
23997
|
+
end
|
|
23998
|
+
end
|
|
23999
|
+
until true
|
|
23929
24000
|
end
|
|
23930
24001
|
break
|
|
23931
24002
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/functions/entities.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/functions/entities.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAMX,MAAM,8BAA8B,CAAC;AAItC,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;AA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B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAUzD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CACnB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,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,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"}
|
|
@@ -13,6 +13,9 @@ local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
|
|
|
13
13
|
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
14
14
|
local MotherVariant = ____isaac_2Dtypescript_2Ddefinitions.MotherVariant
|
|
15
15
|
local NPCState = ____isaac_2Dtypescript_2Ddefinitions.NPCState
|
|
16
|
+
local UltraGreedState = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedState
|
|
17
|
+
local UltraGreedVariant = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedVariant
|
|
18
|
+
local UltraGreedierState = ____isaac_2Dtypescript_2Ddefinitions.UltraGreedierState
|
|
16
19
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
17
20
|
local game = ____cachedClasses.game
|
|
18
21
|
local ____constants = require("src.core.constants")
|
|
@@ -367,8 +370,29 @@ function ____exports.isActiveEnemy(self, entity)
|
|
|
367
370
|
if ____cond36 then
|
|
368
371
|
do
|
|
369
372
|
local npc = entity:ToNPC()
|
|
370
|
-
if npc ~= nil
|
|
371
|
-
|
|
373
|
+
if npc ~= nil then
|
|
374
|
+
local ultraGreedVariant = npc.Variant
|
|
375
|
+
repeat
|
|
376
|
+
local ____switch41 = ultraGreedVariant
|
|
377
|
+
local ____cond41 = ____switch41 == UltraGreedVariant.ULTRA_GREED
|
|
378
|
+
if ____cond41 then
|
|
379
|
+
do
|
|
380
|
+
if npc.State == asNPCState(nil, UltraGreedState.GOLD_STATUE) then
|
|
381
|
+
return false
|
|
382
|
+
end
|
|
383
|
+
break
|
|
384
|
+
end
|
|
385
|
+
end
|
|
386
|
+
____cond41 = ____cond41 or ____switch41 == UltraGreedVariant.ULTRA_GREEDIER
|
|
387
|
+
if ____cond41 then
|
|
388
|
+
do
|
|
389
|
+
if npc.State == asNPCState(nil, UltraGreedierState.POST_EXPLOSION) then
|
|
390
|
+
return false
|
|
391
|
+
end
|
|
392
|
+
break
|
|
393
|
+
end
|
|
394
|
+
end
|
|
395
|
+
until true
|
|
372
396
|
end
|
|
373
397
|
break
|
|
374
398
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
2
2
|
/// <reference types="lua-types/5.3" />
|
|
3
|
-
import type { CardType, CollectibleType, LevelStage, NPCState, PillColor, PillEffect, PlayerType, TrinketType } from "isaac-typescript-definitions";
|
|
3
|
+
import type { CardType, CollectibleType, LevelStage, NPCState, PillColor, PillEffect, PlayerType, RoomType, TrinketType } from "isaac-typescript-definitions";
|
|
4
4
|
/**
|
|
5
5
|
* Helper function to safely cast an `int` to a `CardType`. (This is better than using the `as`
|
|
6
6
|
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
@@ -71,6 +71,13 @@ export declare function asPillEffect(num: int): PillEffect;
|
|
|
71
71
|
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
72
72
|
*/
|
|
73
73
|
export declare function asPlayerType(num: int): PlayerType;
|
|
74
|
+
/**
|
|
75
|
+
* Helper function to safely cast an `int` to a `RoomType`. (This is better than using the `as`
|
|
76
|
+
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
77
|
+
*
|
|
78
|
+
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
79
|
+
*/
|
|
80
|
+
export declare function asRoomType(num: int): RoomType;
|
|
74
81
|
/**
|
|
75
82
|
* Helper function to safely cast an enum to a `string`. (This is better than using the `as`
|
|
76
83
|
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/functions/types.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EACf,UAAU,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAEtC;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ,CAE7C;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,eAAe,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAE1C;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAEtC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,UAAU,CAEjD;AAED;;;;;GA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AG,WAAW,CAEnD;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,OAAO,CAEhE;AAGD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,QAAQ,CAElE;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,GAAG,CAM5D;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAE9D;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CACzB,QAAQ,EAAE,OAAO,GAChB,QAAQ,IAAI,OAAO,GAAG,MAAM,GAAG,MAAM,CAOvC;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAE9D;AAED,wBAAgB,OAAO,CACrB,QAAQ,EAAE,OAAO,GAChB,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAExC;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,WAAW,CAErE"}
|
|
@@ -72,6 +72,13 @@ end
|
|
|
72
72
|
function ____exports.asPlayerType(self, num)
|
|
73
73
|
return num
|
|
74
74
|
end
|
|
75
|
+
--- Helper function to safely cast an `int` to a `RoomType`. (This is better than using the `as`
|
|
76
|
+
-- TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
77
|
+
--
|
|
78
|
+
-- This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
79
|
+
function ____exports.asRoomType(self, num)
|
|
80
|
+
return num
|
|
81
|
+
end
|
|
75
82
|
--- Helper function to safely cast an enum to a `string`. (This is better than using the `as`
|
|
76
83
|
-- TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
77
84
|
--
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "72.
|
|
3
|
+
"version": "72.9.0",
|
|
4
4
|
"description": "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
"main": "dist/src/index",
|
|
26
26
|
"types": "dist/index.rollup.d.ts",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^36.
|
|
28
|
+
"isaac-typescript-definitions": "^36.2.0"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -3,6 +3,9 @@ import {
|
|
|
3
3
|
EntityType,
|
|
4
4
|
MotherVariant,
|
|
5
5
|
NPCState,
|
|
6
|
+
UltraGreedState,
|
|
7
|
+
UltraGreedVariant,
|
|
8
|
+
UltraGreedierState,
|
|
6
9
|
} from "isaac-typescript-definitions";
|
|
7
10
|
import { game } from "../core/cachedClasses";
|
|
8
11
|
import { VectorZero } from "../core/constants";
|
|
@@ -382,8 +385,26 @@ export function isActiveEnemy(entity: Entity): boolean {
|
|
|
382
385
|
// 406
|
|
383
386
|
case EntityType.ULTRA_GREED: {
|
|
384
387
|
const npc = entity.ToNPC();
|
|
385
|
-
if (npc !== undefined
|
|
386
|
-
|
|
388
|
+
if (npc !== undefined) {
|
|
389
|
+
const ultraGreedVariant = npc.Variant as UltraGreedVariant;
|
|
390
|
+
|
|
391
|
+
switch (ultraGreedVariant) {
|
|
392
|
+
case UltraGreedVariant.ULTRA_GREED: {
|
|
393
|
+
if (npc.State === asNPCState(UltraGreedState.GOLD_STATUE)) {
|
|
394
|
+
return false;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
case UltraGreedVariant.ULTRA_GREEDIER: {
|
|
401
|
+
if (npc.State === asNPCState(UltraGreedierState.POST_EXPLOSION)) {
|
|
402
|
+
return false;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
break;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
387
408
|
}
|
|
388
409
|
|
|
389
410
|
break;
|
package/src/functions/types.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
PillColor,
|
|
7
7
|
PillEffect,
|
|
8
8
|
PlayerType,
|
|
9
|
+
RoomType,
|
|
9
10
|
TrinketType,
|
|
10
11
|
} from "isaac-typescript-definitions";
|
|
11
12
|
|
|
@@ -109,6 +110,16 @@ export function asPlayerType(num: int): PlayerType {
|
|
|
109
110
|
return num;
|
|
110
111
|
}
|
|
111
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Helper function to safely cast an `int` to a `RoomType`. (This is better than using the `as`
|
|
115
|
+
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
116
|
+
*
|
|
117
|
+
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
118
|
+
*/
|
|
119
|
+
export function asRoomType(num: int): RoomType {
|
|
120
|
+
return num;
|
|
121
|
+
}
|
|
122
|
+
|
|
112
123
|
/**
|
|
113
124
|
* Helper function to safely cast an enum to a `string`. (This is better than using the `as`
|
|
114
125
|
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|