isaacscript-common 80.2.0 → 80.2.1
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/classes/callbacks/PostItemDischarge.d.ts.map +1 -1
- package/dist/classes/callbacks/PostItemDischarge.lua +1 -3
- package/dist/classes/features/other/CustomPickups.d.ts.map +1 -1
- package/dist/classes/features/other/CustomPickups.lua +1 -3
- package/dist/classes/features/other/CustomStages.d.ts.map +1 -1
- package/dist/classes/features/other/CustomStages.lua +1 -3
- package/dist/classes/features/other/DeployJSONRoom.d.ts.map +1 -1
- package/dist/classes/features/other/DeployJSONRoom.lua +4 -4
- package/dist/classes/features/other/ModdedElementDetection.d.ts +31 -20
- package/dist/classes/features/other/ModdedElementDetection.d.ts.map +1 -1
- package/dist/classes/features/other/ModdedElementDetection.lua +23 -49
- package/dist/classes/features/other/StageHistory.d.ts.map +1 -1
- package/dist/classes/features/other/StageHistory.lua +1 -3
- package/dist/classes/features/other/extraConsoleCommands/commands.d.ts.map +1 -1
- package/dist/classes/features/other/extraConsoleCommands/commands.lua +1 -6
- package/dist/core/constantsFirstLast.d.ts +29 -6
- package/dist/core/constantsFirstLast.d.ts.map +1 -1
- package/dist/core/constantsFirstLast.lua +18 -3
- package/dist/functions/bosses.d.ts.map +1 -1
- package/dist/functions/bosses.lua +1 -3
- package/dist/functions/doors.d.ts.map +1 -1
- package/dist/functions/doors.lua +5 -7
- package/dist/functions/gridEntities.lua +1 -2
- package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -1
- package/dist/functions/gridEntitiesSpecific.lua +5 -7
- package/dist/functions/nextStage.d.ts.map +1 -1
- package/dist/functions/nextStage.lua +4 -6
- package/dist/functions/npcs.d.ts.map +1 -1
- package/dist/functions/npcs.lua +3 -5
- package/dist/functions/pills.d.ts.map +1 -1
- package/dist/functions/pills.lua +8 -16
- package/dist/functions/pocketItems.d.ts.map +1 -1
- package/dist/functions/pocketItems.lua +1 -3
- package/dist/functions/rooms.d.ts.map +1 -1
- package/dist/functions/rooms.lua +13 -15
- package/dist/functions/stage.lua +2 -6
- package/dist/functions/trinkets.lua +2 -2
- package/dist/functions/types.d.ts +29 -0
- package/dist/functions/types.d.ts.map +1 -1
- package/dist/index.rollup.d.ts +56 -26
- package/dist/isaacscript-common.lua +96 -147
- package/package.json +2 -2
- package/src/classes/callbacks/PostItemDischarge.ts +1 -2
- package/src/classes/features/other/CustomPickups.ts +1 -2
- package/src/classes/features/other/CustomStages.ts +1 -4
- package/src/classes/features/other/DeployJSONRoom.ts +5 -9
- package/src/classes/features/other/ModdedElementDetection.ts +61 -77
- package/src/classes/features/other/StageHistory.ts +1 -2
- package/src/classes/features/other/extraConsoleCommands/commands.ts +2 -6
- package/src/core/constantsFirstLast.ts +29 -6
- package/src/functions/bosses.ts +1 -2
- package/src/functions/doors.ts +5 -6
- package/src/functions/gridEntities.ts +2 -2
- package/src/functions/gridEntitiesSpecific.ts +5 -6
- package/src/functions/nextStage.ts +4 -5
- package/src/functions/npcs.ts +3 -4
- package/src/functions/pills.ts +4 -6
- package/src/functions/pocketItems.ts +1 -2
- package/src/functions/rooms.ts +15 -17
- package/src/functions/stage.ts +3 -3
- package/src/functions/trinkets.ts +2 -2
- package/src/functions/types.ts +30 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EACL,MAAM,EACN,UAAU,EAGX,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EACL,MAAM,EACN,UAAU,EAGX,MAAM,8BAA8B,CAAC;AA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AAS,CACvB,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,EAC7C,WAAW,CAAC,EAAE,GAAG,GAChB,SAAS,CAiCX;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,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,EACvC,WAAW,CAAC,EAAE,GAAG,GAChB,SAAS,CAYX"}
|
|
@@ -41,8 +41,6 @@ local isRNG = ____rng.isRNG
|
|
|
41
41
|
local ____rooms = require("functions.rooms")
|
|
42
42
|
local inBeastRoom = ____rooms.inBeastRoom
|
|
43
43
|
local inDogmaRoom = ____rooms.inDogmaRoom
|
|
44
|
-
local ____types = require("functions.types")
|
|
45
|
-
local asNumber = ____types.asNumber
|
|
46
44
|
local ____utils = require("functions.utils")
|
|
47
45
|
local ____repeat = ____utils["repeat"]
|
|
48
46
|
local BOSSES_THAT_REQUIRE_MULTIPLE_SPAWNS = __TS__New(ReadonlySet, {
|
|
@@ -219,7 +217,7 @@ local function getNumBossSegments(self, entityType, variant, numSegments)
|
|
|
219
217
|
____cond22 = ____cond22 or ____switch22 == EntityType.LOKI
|
|
220
218
|
if ____cond22 then
|
|
221
219
|
do
|
|
222
|
-
return variant ==
|
|
220
|
+
return variant == LokiVariant.LOKII and 2 or 1
|
|
223
221
|
end
|
|
224
222
|
end
|
|
225
223
|
____cond22 = ____cond22 or ____switch22 == EntityType.GURGLING
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doors.d.ts","sourceRoot":"","sources":["../../src/functions/doors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,SAAS,EACV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,QAAQ,EAKR,QAAQ,EACT,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"doors.d.ts","sourceRoot":"","sources":["../../src/functions/doors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,SAAS,EACV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,QAAQ,EAKR,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAsBtC,wBAAgB,aAAa,IAAI,IAAI,CAIpC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAKxD;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,GAAG,QAAQ,CAG3E;AAED,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,QAAQ,CAAC,YAAY,CAAC,GACpC,QAAQ,EAAE,CAWZ;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAEjE;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAEvE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EACL,QAAQ,EAAE,GACV,SAAS,QAAQ,EAAE,GACnB,GAAG,CAAC,QAAQ,CAAC,GACb,WAAW,CAAC,QAAQ,CAAC,GACxB,QAAQ,CAAC,YAAY,CAAC,CASxB;AAED,wBAAgB,gBAAgB,IAAI,cAAc,GAAG,SAAS,CAG7D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,cAAc,GAAG,SAAS,CAG5D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,cAAc,GAAG,SAAS,CAG5D;AAED,wB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BAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAE9D;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAM9D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAUnD;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAMnC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAKvD;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,CAK5D;AAED,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAGrD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,KAAK,EAAE,cAAc,EAAE,GAAG,IAAI,CAI5D"}
|
package/dist/functions/doors.lua
CHANGED
|
@@ -46,8 +46,6 @@ local ____flag = require("functions.flag")
|
|
|
46
46
|
local hasFlag = ____flag.hasFlag
|
|
47
47
|
local ____tstlClass = require("functions.tstlClass")
|
|
48
48
|
local isTSTLSet = ____tstlClass.isTSTLSet
|
|
49
|
-
local ____types = require("functions.types")
|
|
50
|
-
local asNumber = ____types.asNumber
|
|
51
49
|
function ____exports.doorSlotToDirection(self, doorSlot)
|
|
52
50
|
return DOOR_SLOT_TO_DIRECTION[doorSlot]
|
|
53
51
|
end
|
|
@@ -101,22 +99,22 @@ end
|
|
|
101
99
|
-- contains the hole to the Blue Womb. (In vanilla, the door will only appear in the It Lives Boss
|
|
102
100
|
-- Room.)
|
|
103
101
|
function ____exports.isBlueWombDoor(self, door)
|
|
104
|
-
return door.TargetRoomIndex ==
|
|
102
|
+
return door.TargetRoomIndex == GridRoom.BLUE_WOMB
|
|
105
103
|
end
|
|
106
104
|
--- Helper function to check if the provided door is the one that leads to the Boss Rush room. (In
|
|
107
105
|
-- vanilla, the door will only appear in the Boss Room of the sixth floor.)
|
|
108
106
|
function ____exports.isBossRushDoor(self, door)
|
|
109
|
-
return door.TargetRoomIndex ==
|
|
107
|
+
return door.TargetRoomIndex == GridRoom.BOSS_RUSH
|
|
110
108
|
end
|
|
111
109
|
--- Helper function to check if the provided door is the one that leads to the Mega Satan Boss Room.
|
|
112
110
|
-- (In vanilla, the door will only appear in the starting room of The Chest / Dark Room.)
|
|
113
111
|
function ____exports.isMegaSatanDoor(self, door)
|
|
114
|
-
return door.TargetRoomIndex ==
|
|
112
|
+
return door.TargetRoomIndex == GridRoom.MEGA_SATAN
|
|
115
113
|
end
|
|
116
114
|
--- Helper function to check if the provided door leads to the "secret exit" off-grid room that takes
|
|
117
115
|
-- you to the Repentance floor.
|
|
118
116
|
function ____exports.isRepentanceDoor(self, door)
|
|
119
|
-
return door.TargetRoomIndex ==
|
|
117
|
+
return door.TargetRoomIndex == GridRoom.SECRET_EXIT
|
|
120
118
|
end
|
|
121
119
|
--- This refers to the hole in the wall that appears after bombing the entrance to a secret room.
|
|
122
120
|
-- Note that the door still exists before it has been bombed open. It has a sprite filename of
|
|
@@ -132,7 +130,7 @@ end
|
|
|
132
130
|
--- Helper function to check if the provided door is the one that leads to the off-grid room that
|
|
133
131
|
-- contains the portal to The Void. (In vanilla, the door will only appear in the Hush Boss Room.)
|
|
134
132
|
function ____exports.isVoidDoor(self, door)
|
|
135
|
-
return door.TargetRoomIndex ==
|
|
133
|
+
return door.TargetRoomIndex == GridRoom.VOID
|
|
136
134
|
end
|
|
137
135
|
--- Helper function to remove a single door.
|
|
138
136
|
function ____exports.removeDoor(self, door)
|
|
@@ -44,7 +44,6 @@ local isCircleIntersectingRectangle = ____math.isCircleIntersectingRectangle
|
|
|
44
44
|
local ____rooms = require("functions.rooms")
|
|
45
45
|
local roomUpdateSafe = ____rooms.roomUpdateSafe
|
|
46
46
|
local ____types = require("functions.types")
|
|
47
|
-
local asNumber = ____types.asNumber
|
|
48
47
|
local isInteger = ____types.isInteger
|
|
49
48
|
local ____utils = require("functions.utils")
|
|
50
49
|
local assertDefined = ____utils.assertDefined
|
|
@@ -402,7 +401,7 @@ function ____exports.removeGridEntity(self, gridEntityOrGridIndex, updateRoom)
|
|
|
402
401
|
roomUpdateSafe(nil)
|
|
403
402
|
end
|
|
404
403
|
if gridEntityType == GridEntityType.STATUE then
|
|
405
|
-
local effectVariant = variant ==
|
|
404
|
+
local effectVariant = variant == StatueVariant.DEVIL and EffectVariant.DEVIL or EffectVariant.ANGEL
|
|
406
405
|
local effects = getEffects(nil, effectVariant)
|
|
407
406
|
local effectsOnTile = __TS__ArrayFilter(
|
|
408
407
|
effects,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridEntitiesSpecific.d.ts","sourceRoot":"","sources":["../../src/functions/gridEntitiesSpecific.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,iBAAiB,EACjB,WAAW,EAEX,UAAU,EACV,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACZ,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"gridEntitiesSpecific.d.ts","sourceRoot":"","sources":["../../src/functions/gridEntitiesSpecific.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,iBAAiB,EACjB,WAAW,EAEX,UAAU,EACV,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAStC;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,iBAAiB,GAAE,iBAAiB,GAAG,CAAC,CAAM,GAC7C,UAAU,EAAE,CAMd;AAKD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,UAA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,GAAG,SAAS,CAc9B;AAED,4DAA4D;AAC5D,wBAAgB,QAAQ,CACtB,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,aAAa,GAAG,SAAS,CAE3B;AAED,oFAAoF;AACpF,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,aAAa,GAAG,SAAS,CAc3B;AAED,mEAAmE;AACnE,wBAAgB,eAAe,CAC7B,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,UAAU,GAAG,SAAS,CAExB;AAED,2FAA2F;AAC3F,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,UAAU,GAAG,SAAS,CAMxB;AAED,iEAAiE;AACjE,wBAAgB,aAAa,CAC3B,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,UAAU,GAAG,SAAS,CAKxB;AAED,yFAAyF;AACzF,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,eAAe,EAChC,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,UAAU,GAAG,SAAS,CAMxB"}
|
|
@@ -12,8 +12,6 @@ local getGridEntities = ____gridEntities.getGridEntities
|
|
|
12
12
|
local getMatchingGridEntities = ____gridEntities.getMatchingGridEntities
|
|
13
13
|
local removeGridEntities = ____gridEntities.removeGridEntities
|
|
14
14
|
local spawnGridEntityWithVariant = ____gridEntities.spawnGridEntityWithVariant
|
|
15
|
-
local ____types = require("functions.types")
|
|
16
|
-
local asNumber = ____types.asNumber
|
|
17
15
|
local ____utils = require("functions.utils")
|
|
18
16
|
local assertDefined = ____utils.assertDefined
|
|
19
17
|
--- Helper function to spawn a `GridEntityType.CRAWL_SPACE` (18) with a specific variant.
|
|
@@ -103,7 +101,7 @@ function ____exports.getCrawlSpaces(self, crawlSpaceVariant)
|
|
|
103
101
|
if crawlSpaceVariant == nil then
|
|
104
102
|
crawlSpaceVariant = -1
|
|
105
103
|
end
|
|
106
|
-
if
|
|
104
|
+
if crawlSpaceVariant == -1 then
|
|
107
105
|
return getGridEntities(nil, GridEntityType.CRAWL_SPACE)
|
|
108
106
|
end
|
|
109
107
|
return getMatchingGridEntities(nil, GridEntityType.CRAWL_SPACE, crawlSpaceVariant)
|
|
@@ -121,7 +119,7 @@ function ____exports.getPits(self, pitVariant)
|
|
|
121
119
|
local pit = gridEntity:ToPit()
|
|
122
120
|
if pit ~= nil then
|
|
123
121
|
local thisPitVariant = pit:GetVariant()
|
|
124
|
-
if
|
|
122
|
+
if pitVariant == -1 or pitVariant == thisPitVariant then
|
|
125
123
|
pits[#pits + 1] = pit
|
|
126
124
|
end
|
|
127
125
|
end
|
|
@@ -141,7 +139,7 @@ function ____exports.getPoops(self, poopVariant)
|
|
|
141
139
|
local poop = gridEntity:ToPoop()
|
|
142
140
|
if poop ~= nil then
|
|
143
141
|
local thisPoopVariant = poop:GetVariant()
|
|
144
|
-
if
|
|
142
|
+
if poopVariant == -1 or poopVariant == thisPoopVariant then
|
|
145
143
|
poops[#poops + 1] = poop
|
|
146
144
|
end
|
|
147
145
|
end
|
|
@@ -161,7 +159,7 @@ function ____exports.getPressurePlates(self, pressurePlateVariant)
|
|
|
161
159
|
local pressurePlate = gridEntity:ToPressurePlate()
|
|
162
160
|
if pressurePlate ~= nil then
|
|
163
161
|
local thisPressurePlateVariant = pressurePlate:GetVariant()
|
|
164
|
-
if
|
|
162
|
+
if pressurePlateVariant == -1 or pressurePlateVariant == thisPressurePlateVariant then
|
|
165
163
|
pressurePlates[#pressurePlates + 1] = pressurePlate
|
|
166
164
|
end
|
|
167
165
|
end
|
|
@@ -247,7 +245,7 @@ function ____exports.getTrapdoors(self, trapdoorVariant)
|
|
|
247
245
|
if trapdoorVariant == nil then
|
|
248
246
|
trapdoorVariant = -1
|
|
249
247
|
end
|
|
250
|
-
if
|
|
248
|
+
if trapdoorVariant == -1 then
|
|
251
249
|
return getGridEntities(nil, GridEntityType.TRAPDOOR)
|
|
252
250
|
end
|
|
253
251
|
return getMatchingGridEntities(nil, GridEntityType.TRAPDOOR, trapdoorVariant)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextStage.d.ts","sourceRoot":"","sources":["../../src/functions/nextStage.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,UAAU,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"nextStage.d.ts","sourceRoot":"","sources":["../../src/functions/nextStage.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,UAAU,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAUtC;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,UAAU,CA4FzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,UAAQ,GAAG,SAAS,CAiF3D"}
|
|
@@ -15,8 +15,6 @@ local ____stage = require("functions.stage")
|
|
|
15
15
|
local calculateStageType = ____stage.calculateStageType
|
|
16
16
|
local calculateStageTypeRepentance = ____stage.calculateStageTypeRepentance
|
|
17
17
|
local onRepentanceStage = ____stage.onRepentanceStage
|
|
18
|
-
local ____types = require("functions.types")
|
|
19
|
-
local asNumber = ____types.asNumber
|
|
20
18
|
--- Helper function to get the stage that a trapdoor or heaven door would take the player to, based
|
|
21
19
|
-- on the current stage, room, and game state flags.
|
|
22
20
|
--
|
|
@@ -31,7 +29,7 @@ function ____exports.getNextStage(self)
|
|
|
31
29
|
local repentanceStage = onRepentanceStage(nil)
|
|
32
30
|
local roomGridIndex = getRoomGridIndex(nil)
|
|
33
31
|
if backwardsPath then
|
|
34
|
-
local nextStage =
|
|
32
|
+
local nextStage = stage - 1
|
|
35
33
|
return nextStage == 0 and LevelStage.HOME or nextStage
|
|
36
34
|
end
|
|
37
35
|
repeat
|
|
@@ -52,7 +50,7 @@ function ____exports.getNextStage(self)
|
|
|
52
50
|
if ____cond4 then
|
|
53
51
|
do
|
|
54
52
|
if repentanceStage then
|
|
55
|
-
return
|
|
53
|
+
return stage + 1
|
|
56
54
|
end
|
|
57
55
|
if stage == LevelStage.DEPTHS_2 or stage == LevelStage.DEPTHS_1 and hasCurse(nil, LevelCurse.LABYRINTH) then
|
|
58
56
|
return LevelStage.DEPTHS_2
|
|
@@ -82,7 +80,7 @@ function ____exports.getNextStage(self)
|
|
|
82
80
|
if stage == LevelStage.VOID then
|
|
83
81
|
return LevelStage.VOID
|
|
84
82
|
end
|
|
85
|
-
return
|
|
83
|
+
return stage + 1
|
|
86
84
|
end
|
|
87
85
|
--- Helper function to get the stage type that a trapdoor or heaven door would take the player to,
|
|
88
86
|
-- based on the current stage, room, and game state flags.
|
|
@@ -108,7 +106,7 @@ function ____exports.getNextStageType(self, upwards)
|
|
|
108
106
|
if backwardsPath then
|
|
109
107
|
return calculateStageType(nil, nextStage)
|
|
110
108
|
end
|
|
111
|
-
if roomGridIndex ==
|
|
109
|
+
if roomGridIndex == GridRoom.SECRET_EXIT then
|
|
112
110
|
return calculateStageTypeRepentance(nil, nextStage)
|
|
113
111
|
end
|
|
114
112
|
if repentanceStage and (stage == LevelStage.BASEMENT_1 or stage == LevelStage.CAVES_1 or stage == LevelStage.DEPTHS_1 or stage == LevelStage.WOMB_1) then
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npcs.d.ts","sourceRoot":"","sources":["../../src/functions/npcs.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,UAAU,EASX,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"npcs.d.ts","sourceRoot":"","sources":["../../src/functions/npcs.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,UAAU,EASX,MAAM,8BAA8B,CAAC;AAgCtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,UAAU,GAAE,UAAU,GAAG,CAAC,CAAM,EAChC,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAiC3D;AAED;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAIvE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAMnD;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAOpE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAO3D"}
|
package/dist/functions/npcs.lua
CHANGED
|
@@ -26,8 +26,6 @@ local ____ReadonlySet = require("types.ReadonlySet")
|
|
|
26
26
|
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
27
27
|
local ____entitiesSpecific = require("functions.entitiesSpecific")
|
|
28
28
|
local getNPCs = ____entitiesSpecific.getNPCs
|
|
29
|
-
local ____types = require("functions.types")
|
|
30
|
-
local asNumber = ____types.asNumber
|
|
31
29
|
--- Checks for specific NPCs that have "CanShutDoors" set to true naturally by the game, but should
|
|
32
30
|
-- not actually keep the doors closed (like Death's scythes).
|
|
33
31
|
function ____exports.isAliveExceptionNPC(self, npc)
|
|
@@ -66,20 +64,20 @@ end
|
|
|
66
64
|
-- `NPCState.SPECIAL`, spit out their head, and then slowly fade away while shooting a burst of
|
|
67
65
|
-- tears.
|
|
68
66
|
function ____exports.isDyingDump(self, npc)
|
|
69
|
-
return npc.Type == EntityType.DUMP and npc.Variant ==
|
|
67
|
+
return npc.Type == EntityType.DUMP and npc.Variant == DumpVariant.DUMP and npc.State == NPCState.SPECIAL
|
|
70
68
|
end
|
|
71
69
|
--- Helper function to detect the custom death state of an Eggy. Eggies are never actually marked
|
|
72
70
|
-- dead by the game. Instead, when Eggies take fatal damage, they go into NPCState.STATE_SUICIDE and
|
|
73
71
|
-- spawn 14 Swarm Spiders while their StateFrame ticks upwards.
|
|
74
72
|
function ____exports.isDyingEggyWithNoSpidersLeft(self, npc)
|
|
75
|
-
return npc.Type == EntityType.HOPPER and npc.Variant ==
|
|
73
|
+
return npc.Type == EntityType.HOPPER and npc.Variant == HopperVariant.EGGY and npc.State == NPCState.SUICIDE and npc.StateFrame >= EGGY_STATE_FRAME_OF_FINAL_SPIDER
|
|
76
74
|
end
|
|
77
75
|
--- Helper function to detect the custom death state of a Rag Man Ragling. When Rag Man Raglings die,
|
|
78
76
|
-- they turn into a patch on the ground and can be revived by Rag Man at a later time. This causes
|
|
79
77
|
-- them to show up as an "alive" enemy, so they should usually be filtered out of lists of alive
|
|
80
78
|
-- enemies.
|
|
81
79
|
function ____exports.isRaglingDeathPatch(self, npc)
|
|
82
|
-
return npc.Type == EntityType.RAGLING and npc.Variant ==
|
|
80
|
+
return npc.Type == EntityType.RAGLING and npc.Variant == RaglingVariant.RAG_MANS_RAGLING and npc.State == NPCState.SPECIAL
|
|
83
81
|
end
|
|
84
82
|
NON_ALIVE_NPCS_TYPE_VARIANT = __TS__New(
|
|
85
83
|
ReadonlySet,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pills.d.ts","sourceRoot":"","sources":["../../src/functions/pills.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACxB,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAqCzD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,SAAS,SAAS,EAAE,CAEvD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAGxE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAEjE;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,IAAI,SAAS,SAAS,EAAE,CAEzD;AAED;;;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EvB;AAED,iGAAiG;AACjG,wBAAgB,UAAU,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAExD;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAEzD;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAElE;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAEnE"}
|
package/dist/functions/pills.lua
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__ArraySlice = ____lualib.__TS__ArraySlice
|
|
3
3
|
local ____exports = {}
|
|
4
|
+
local HORSE_PILL_ADJUSTMENT
|
|
4
5
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
5
6
|
local PillColor = ____isaac_2Dtypescript_2Ddefinitions.PillColor
|
|
6
7
|
local ____cachedEnumValues = require("arrays.cachedEnumValues")
|
|
@@ -34,15 +35,14 @@ local asNumber = ____types.asNumber
|
|
|
34
35
|
local asPillColor = ____types.asPillColor
|
|
35
36
|
local ____utils = require("functions.utils")
|
|
36
37
|
local iRange = ____utils.iRange
|
|
38
|
+
--- Helper function to see if the given pill color is a horse pill.
|
|
39
|
+
function ____exports.isHorsePill(self, pillColor)
|
|
40
|
+
return asNumber(nil, pillColor) > HORSE_PILL_ADJUSTMENT
|
|
41
|
+
end
|
|
37
42
|
function ____exports.isVanillaPillEffect(self, pillEffect)
|
|
38
43
|
return pillEffect <= LAST_VANILLA_PILL_EFFECT
|
|
39
44
|
end
|
|
40
|
-
|
|
41
|
-
--
|
|
42
|
-
-- Corresponds to the vanilla `PillColor.GIANT_FLAG` value.
|
|
43
|
-
--
|
|
44
|
-
-- 1 << 11
|
|
45
|
-
local HORSE_PILL_ADJUSTMENT = 2048
|
|
45
|
+
HORSE_PILL_ADJUSTMENT = 2048
|
|
46
46
|
--- Helper function to get an array with every non-null pill color. This includes all gold colors and
|
|
47
47
|
-- all horse colors.
|
|
48
48
|
function ____exports.getAllPillColors(self)
|
|
@@ -59,7 +59,7 @@ end
|
|
|
59
59
|
-- For example, passing `PillColor.BLUE_BLUE` would result in 2049, which is the value that
|
|
60
60
|
-- corresponds to the horse pill color for blue/blue.
|
|
61
61
|
function ____exports.getHorsePillColor(self, pillColor)
|
|
62
|
-
return
|
|
62
|
+
return pillColor + HORSE_PILL_ADJUSTMENT
|
|
63
63
|
end
|
|
64
64
|
--- Helper function to get an array with every non-gold horse pill color.
|
|
65
65
|
function ____exports.getHorsePillColors(self)
|
|
@@ -71,11 +71,7 @@ end
|
|
|
71
71
|
--
|
|
72
72
|
-- If called with a non-horse pill color, this function will return back the same color.
|
|
73
73
|
function ____exports.getNormalPillColorFromHorse(self, pillColor)
|
|
74
|
-
|
|
75
|
-
nil,
|
|
76
|
-
asNumber(nil, pillColor) - HORSE_PILL_ADJUSTMENT
|
|
77
|
-
)
|
|
78
|
-
return normalPillColor > PillColor.NULL and normalPillColor or pillColor
|
|
74
|
+
return ____exports.isHorsePill(nil, pillColor) and asPillColor(nil, pillColor - HORSE_PILL_ADJUSTMENT) or pillColor
|
|
79
75
|
end
|
|
80
76
|
--- Helper function to get an array with every non-gold and non-horse pill color.
|
|
81
77
|
function ____exports.getNormalPillColors(self)
|
|
@@ -156,10 +152,6 @@ end
|
|
|
156
152
|
function ____exports.isGoldPill(self, pillColor)
|
|
157
153
|
return pillColor == PillColor.GOLD or pillColor == PillColor.HORSE_GOLD
|
|
158
154
|
end
|
|
159
|
-
--- Helper function to see if the given pill color is a horse pill.
|
|
160
|
-
function ____exports.isHorsePill(self, pillColor)
|
|
161
|
-
return asNumber(nil, pillColor) > HORSE_PILL_ADJUSTMENT
|
|
162
|
-
end
|
|
163
155
|
function ____exports.isModdedPillEffect(self, pillEffect)
|
|
164
156
|
return not ____exports.isVanillaPillEffect(nil, pillEffect)
|
|
165
157
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pocketItems.d.ts","sourceRoot":"","sources":["../../src/functions/pocketItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAUnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"pocketItems.d.ts","sourceRoot":"","sources":["../../src/functions/pocketItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAUnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAGjF;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,GACnB,cAAc,GAAG,SAAS,CAS5B;AAED,6FAA6F;AAC7F,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,GACnB,qBAAqB,GAAG,SAAS,CAKnC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,GACnB,qBAAqB,GAAG,SAAS,CAOnC;AAED,6FAA6F;AAC7F,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,GACnB,qBAAqB,GAAG,SAAS,CAKnC;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,qBAAqB,EAAE,CA8D5E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CASnE;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAQzE;AAED,oFAAoF;AACpF,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,qBAAqB,EAAE,EACrC,YAAY,EAAE,qBAAqB,EAAE,GACpC,OAAO,CAqBT"}
|
|
@@ -15,8 +15,6 @@ local ____PocketItemType = require("enums.PocketItemType")
|
|
|
15
15
|
local PocketItemType = ____PocketItemType.PocketItemType
|
|
16
16
|
local ____players = require("functions.players")
|
|
17
17
|
local isCharacter = ____players.isCharacter
|
|
18
|
-
local ____types = require("functions.types")
|
|
19
|
-
local asNumber = ____types.asNumber
|
|
20
18
|
--- Use this helper function as a workaround for the `EntityPlayer.GetPocketItem` method not working
|
|
21
19
|
-- correctly.
|
|
22
20
|
--
|
|
@@ -52,7 +50,7 @@ function ____exports.getPocketItems(self, player)
|
|
|
52
50
|
else
|
|
53
51
|
pocketItems[#pocketItems + 1] = {slot = slot, type = PocketItemType.EMPTY, subType = 0}
|
|
54
52
|
end
|
|
55
|
-
if
|
|
53
|
+
if slot + 1 == maxPocketItems then
|
|
56
54
|
break
|
|
57
55
|
end
|
|
58
56
|
end
|
|
@@ -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,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,SAAS,EAQT,QAAQ,EAGT,MAAM,8BAA8B,CAAC;
|
|
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,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,SAAS,EAQT,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAsCtC;;;;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;;;;;;;;;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AIG;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,aAAa,EAAE,GAAG,GAAG,OAAO,CAExD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAExD;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"}
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -65,8 +65,6 @@ local ____roomTransition = require("functions.roomTransition")
|
|
|
65
65
|
local reloadRoom = ____roomTransition.reloadRoom
|
|
66
66
|
local ____stage = require("functions.stage")
|
|
67
67
|
local getGotoCommand = ____stage.getGotoCommand
|
|
68
|
-
local ____types = require("functions.types")
|
|
69
|
-
local asNumber = ____types.asNumber
|
|
70
68
|
local ____utils = require("functions.utils")
|
|
71
69
|
local assertDefined = ____utils.assertDefined
|
|
72
70
|
local iRange = ____utils.iRange
|
|
@@ -146,7 +144,7 @@ end
|
|
|
146
144
|
-- Under the hood, this checks the room type being equal to `RoomType.ANGEL` (15) and the sub-type
|
|
147
145
|
-- being equal to `AngelRoomSubType.SHOP` (1).
|
|
148
146
|
function ____exports.isAngelShop(self, roomData)
|
|
149
|
-
return roomData.Type == RoomType.ANGEL and roomData.Subtype ==
|
|
147
|
+
return roomData.Type == RoomType.ANGEL and roomData.Subtype == AngelRoomSubType.SHOP
|
|
150
148
|
end
|
|
151
149
|
--- Helper function to check to see if the provided room is the Boss Room for The Beast.
|
|
152
150
|
--
|
|
@@ -155,7 +153,7 @@ end
|
|
|
155
153
|
-- Under the hood, this checks the room type being equal to `RoomType.DUNGEON` (16) and the sub-type
|
|
156
154
|
-- being equal to `DungeonSubType.BEAST_ROOM` (4).
|
|
157
155
|
function ____exports.isBeastRoom(self, roomData)
|
|
158
|
-
return roomData.Type == RoomType.DUNGEON and roomData.Subtype ==
|
|
156
|
+
return roomData.Type == RoomType.DUNGEON and roomData.Subtype == DungeonSubType.BEAST_ROOM
|
|
159
157
|
end
|
|
160
158
|
--- Helper function to detect if the provided room is big. Specifically, this is all 1x2 rooms, 2x2
|
|
161
159
|
-- rooms, and L rooms.
|
|
@@ -165,13 +163,13 @@ end
|
|
|
165
163
|
--- Helper function to check if the provided room is the Boss Room for a particular boss. This will
|
|
166
164
|
-- only work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
167
165
|
function ____exports.isBossRoomOf(self, roomData, bossID)
|
|
168
|
-
return roomData.Type == RoomType.BOSS and roomData.StageID == StageID.SPECIAL_ROOMS and roomData.Subtype ==
|
|
166
|
+
return roomData.Type == RoomType.BOSS and roomData.StageID == StageID.SPECIAL_ROOMS and roomData.Subtype == bossID
|
|
169
167
|
end
|
|
170
168
|
--- Helper function for determining whether the provided room is a crawl space. Use this function
|
|
171
169
|
-- over comparing to `RoomType.DUNGEON` or `GridRoom.DUNGEON_IDX` since there is a special case of
|
|
172
170
|
-- the player being in a boss fight that takes place in a dungeon.
|
|
173
171
|
function ____exports.isCrawlSpace(self, roomData)
|
|
174
|
-
return roomData.Type == RoomType.DUNGEON and roomData.Subtype ==
|
|
172
|
+
return roomData.Type == RoomType.DUNGEON and roomData.Subtype == DungeonSubType.NORMAL
|
|
175
173
|
end
|
|
176
174
|
--- Helper function for checking whether the provided room is a crawl space with a door corresponding
|
|
177
175
|
-- to `DoorSlotFlag.RIGHT_0` (1 << 2).
|
|
@@ -180,7 +178,7 @@ function ____exports.isCrawlSpaceWithBlackMarketEntrance(self, roomData)
|
|
|
180
178
|
end
|
|
181
179
|
--- Helper function to detect if the provided room is one of the rooms in the Death Certificate area.
|
|
182
180
|
function ____exports.isDeathCertificateArea(self, roomData)
|
|
183
|
-
return roomData.StageID == StageID.HOME and (roomData.Subtype ==
|
|
181
|
+
return roomData.StageID == StageID.HOME and (roomData.Subtype == HomeRoomSubType.DEATH_CERTIFICATE_ENTRANCE or roomData.Subtype == HomeRoomSubType.DEATH_CERTIFICATE_ITEMS)
|
|
184
182
|
end
|
|
185
183
|
--- Helper function to detect if the provided room is a Treasure Room created when entering with a
|
|
186
184
|
-- Devil's Crown trinket.
|
|
@@ -201,7 +199,7 @@ end
|
|
|
201
199
|
-- Dogma Boss Room that exists in vanilla) and the sub-type being equal to
|
|
202
200
|
-- `HomeRoomSubType.LIVING_ROOM` (3).
|
|
203
201
|
function ____exports.isDogmaRoom(self, roomData)
|
|
204
|
-
return roomData.StageID == StageID.HOME and roomData.Type == RoomType.DEFAULT and roomData.Variant == 1000 and roomData.Subtype ==
|
|
202
|
+
return roomData.StageID == StageID.HOME and roomData.Type == RoomType.DEFAULT and roomData.Variant == 1000 and roomData.Subtype == HomeRoomSubType.LIVING_ROOM
|
|
205
203
|
end
|
|
206
204
|
--- Helper function to detect if the provided room is a Double Trouble Boss Room.
|
|
207
205
|
--
|
|
@@ -217,14 +215,14 @@ function ____exports.isDoubleTrouble(self, roomData)
|
|
|
217
215
|
end
|
|
218
216
|
--- Helper function to determine if the index of the provided room is equal to `GridRoom.GENESIS`.
|
|
219
217
|
function ____exports.isGenesisRoom(self, roomGridIndex)
|
|
220
|
-
return roomGridIndex ==
|
|
218
|
+
return roomGridIndex == GridRoom.GENESIS
|
|
221
219
|
end
|
|
222
220
|
--- Helper function to check if the provided room is either the left Home closet (behind the red
|
|
223
221
|
-- door) or the right Home closet (with one random pickup).
|
|
224
222
|
--
|
|
225
223
|
-- Home closets have a unique shape that is different from any other room in the game.
|
|
226
224
|
function ____exports.isHomeCloset(self, roomData)
|
|
227
|
-
return roomData.StageID == StageID.HOME and (roomData.Subtype ==
|
|
225
|
+
return roomData.StageID == StageID.HOME and (roomData.Subtype == HomeRoomSubType.CLOSET_LEFT or roomData.Subtype == HomeRoomSubType.CLOSET_RIGHT)
|
|
228
226
|
end
|
|
229
227
|
--- Helper function to determine if the provided room is one of the four L room shapes.
|
|
230
228
|
function ____exports.isLRoom(self, roomData)
|
|
@@ -232,7 +230,7 @@ function ____exports.isLRoom(self, roomData)
|
|
|
232
230
|
end
|
|
233
231
|
--- Helper function to determine if the index of the provided room is equal to `GridRoom.MEGA_SATAN`.
|
|
234
232
|
function ____exports.isMegaSatanRoom(self, roomGridIndex)
|
|
235
|
-
return roomGridIndex ==
|
|
233
|
+
return roomGridIndex == GridRoom.MEGA_SATAN
|
|
236
234
|
end
|
|
237
235
|
--- Helper function to determine if the provided room is part of the Repentance "escape sequence" in
|
|
238
236
|
-- the Mines/Ashpit.
|
|
@@ -242,12 +240,12 @@ end
|
|
|
242
240
|
--- Helper function to check if the provided room is a miniboss room for a particular miniboss. This
|
|
243
241
|
-- will only work for mini-bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
244
242
|
function ____exports.isMinibossRoomOf(self, roomData, minibossID)
|
|
245
|
-
return roomData.Type == RoomType.MINI_BOSS and roomData.StageID == StageID.SPECIAL_ROOMS and roomData.Subtype ==
|
|
243
|
+
return roomData.Type == RoomType.MINI_BOSS and roomData.StageID == StageID.SPECIAL_ROOMS and roomData.Subtype == minibossID
|
|
246
244
|
end
|
|
247
245
|
--- Helper function to check if the provided room is a "mirror room" in Downpour or Dross. (These
|
|
248
246
|
-- rooms are marked with a specific sub-type.)
|
|
249
247
|
function ____exports.isMirrorRoom(self, roomData)
|
|
250
|
-
return roomData.Type == RoomType.DEFAULT and (roomData.StageID == StageID.DOWNPOUR or roomData.StageID == StageID.DROSS) and roomData.Subtype ==
|
|
248
|
+
return roomData.Type == RoomType.DEFAULT and (roomData.StageID == StageID.DOWNPOUR or roomData.StageID == StageID.DROSS) and roomData.Subtype == DownpourRoomSubType.MIRROR
|
|
251
249
|
end
|
|
252
250
|
--- Helper function to check if the provided room matches one of the given room shapes.
|
|
253
251
|
--
|
|
@@ -266,7 +264,7 @@ end
|
|
|
266
264
|
--- Helper function for checking if the provided room is a secret exit that leads to a Repentance
|
|
267
265
|
-- floor.
|
|
268
266
|
function ____exports.isSecretExit(self, roomGridIndex)
|
|
269
|
-
return roomGridIndex ==
|
|
267
|
+
return roomGridIndex == GridRoom.SECRET_EXIT
|
|
270
268
|
end
|
|
271
269
|
--- Helper function for checking if the provided room is a secret shop (from the Member Card
|
|
272
270
|
-- collectible).
|
|
@@ -275,7 +273,7 @@ end
|
|
|
275
273
|
-- words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus,
|
|
276
274
|
-- the only way to detect them is by using the grid index.
|
|
277
275
|
function ____exports.isSecretShop(self, roomGridIndex)
|
|
278
|
-
return roomGridIndex ==
|
|
276
|
+
return roomGridIndex == GridRoom.SECRET_SHOP
|
|
279
277
|
end
|
|
280
278
|
local SECRET_ROOM_TYPES = __TS__New(ReadonlySet, {RoomType.SECRET, RoomType.SUPER_SECRET, RoomType.ULTRA_SECRET})
|
|
281
279
|
--- Helper function for quickly switching to a new room without playing a particular animation. Use
|
package/dist/functions/stage.lua
CHANGED
|
@@ -20,7 +20,6 @@ local ____log = require("functions.log")
|
|
|
20
20
|
local log = ____log.log
|
|
21
21
|
local ____types = require("functions.types")
|
|
22
22
|
local asLevelStage = ____types.asLevelStage
|
|
23
|
-
local asNumber = ____types.asNumber
|
|
24
23
|
local ____utils = require("functions.utils")
|
|
25
24
|
local inRange = ____utils.inRange
|
|
26
25
|
--- Helper function to check if the provided stage type is equal to `StageType.REPENTANCE` or
|
|
@@ -62,10 +61,7 @@ function ____exports.calculateStageTypeRepentance(self, stage)
|
|
|
62
61
|
return StageType.REPENTANCE
|
|
63
62
|
end
|
|
64
63
|
local seeds = game:GetSeeds()
|
|
65
|
-
local adjustedStage = asLevelStage(
|
|
66
|
-
nil,
|
|
67
|
-
asNumber(nil, stage) + 1
|
|
68
|
-
)
|
|
64
|
+
local adjustedStage = asLevelStage(nil, stage + 1)
|
|
69
65
|
local stageSeed = seeds:GetStageSeed(adjustedStage)
|
|
70
66
|
local halfStageSeed = math.floor(stageSeed / 2)
|
|
71
67
|
if halfStageSeed % 2 == 0 then
|
|
@@ -80,7 +76,7 @@ function ____exports.getEffectiveStage(self)
|
|
|
80
76
|
local level = game:GetLevel()
|
|
81
77
|
local stage = level:GetStage()
|
|
82
78
|
if ____exports.onRepentanceStage(nil) then
|
|
83
|
-
return
|
|
79
|
+
return stage + 1
|
|
84
80
|
end
|
|
85
81
|
return stage
|
|
86
82
|
end
|
|
@@ -46,7 +46,7 @@ local TRINKET_SPRITE_LAYER = 0
|
|
|
46
46
|
-- For example, passing `TrinketType.SWALLOWED_PENNY` would result in 32769, which is the value that
|
|
47
47
|
-- corresponds to the golden trinket sub-type for Swallowed Penny.
|
|
48
48
|
function ____exports.getGoldenTrinketType(self, trinketType)
|
|
49
|
-
return ____exports.isGoldenTrinketType(nil, trinketType) and trinketType or
|
|
49
|
+
return ____exports.isGoldenTrinketType(nil, trinketType) and trinketType or trinketType + GOLDEN_TRINKET_ADJUSTMENT
|
|
50
50
|
end
|
|
51
51
|
--- Helper function to get the current effect that the Mysterious Paper trinket is providing to the
|
|
52
52
|
-- player. Returns undefined if the player does not have the Mysterious Paper trinket.
|
|
@@ -80,7 +80,7 @@ end
|
|
|
80
80
|
-- If the provided trinket type is already a normal trinket type, then the trinket type will be
|
|
81
81
|
-- returned unmodified.
|
|
82
82
|
function ____exports.getNormalTrinketType(self, trinketType)
|
|
83
|
-
return ____exports.isGoldenTrinketType(nil, trinketType) and
|
|
83
|
+
return ____exports.isGoldenTrinketType(nil, trinketType) and trinketType - GOLDEN_TRINKET_ADJUSTMENT or trinketType
|
|
84
84
|
end
|
|
85
85
|
--- Helper function to get the in-game description for a trinket. Returns "Unknown" if the provided
|
|
86
86
|
-- trinket type was not valid.
|
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consider the following code that uses a number enum:
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* enum MyEnum {
|
|
6
|
+
* Value1,
|
|
7
|
+
* }
|
|
8
|
+
*
|
|
9
|
+
* function asMyEnum(num: number): MyEnum {}
|
|
10
|
+
*
|
|
11
|
+
* declare const something: unknown;
|
|
12
|
+
*
|
|
13
|
+
* const foo = something as MyEnum; // no error
|
|
14
|
+
* const bar: MyEnum = something; // error
|
|
15
|
+
* const baz = asMyEnum(something); // error
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Here, using `as` does not give an error because TypeScript allows you to assert a type to a
|
|
19
|
+
* supertype or a subtype. Thus, using `as` to perform a type assertion is not as safe as using a
|
|
20
|
+
* variable declaration or a helper function. However, if we use a variable declaration, then the
|
|
21
|
+
* `isaacscript/strict-enums` rule is triggered, which requires suppressing the lint rule with a `//
|
|
22
|
+
* eslint-disable-next-line`. Thus, the safest and more concise way to do a type assertion is to use
|
|
23
|
+
* a helper function.
|
|
24
|
+
*
|
|
25
|
+
* This file contains helper functions for various number enums that might require type assertions.
|
|
26
|
+
* It also contains helper functions for run-time type checks.
|
|
27
|
+
*
|
|
28
|
+
* @module
|
|
29
|
+
*/
|
|
1
30
|
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
2
31
|
/// <reference types="lua-types/5.3" />
|
|
3
32
|
import type { CardType, CollectibleType, LevelStage, NPCState, PillColor, PillEffect, PlayerType, RoomType, TrinketType } from "isaac-typescript-definitions";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/functions/types.ts"],"names":[],"m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