isaacscript-common 7.3.0 → 7.4.3
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/features/customStage/exports.d.ts +4 -6
- package/dist/features/customStage/exports.d.ts.map +1 -1
- package/dist/features/customStage/exports.lua +4 -6
- package/dist/functions/gridEntities.d.ts +3 -0
- package/dist/functions/gridEntities.d.ts.map +1 -1
- package/dist/functions/gridEntities.lua +35 -4
- package/dist/index.d.ts +11037 -10
- package/dist/interfaces/CustomStageLua.d.ts +17 -33
- package/dist/interfaces/CustomStageLua.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/customStage/exports.ts +4 -6
- package/src/functions/gridEntities.ts +33 -1
- package/src/interfaces/CustomStageLua.ts +17 -33
|
@@ -29,12 +29,10 @@ export declare function setCustomStage(name: string, firstFloor?: boolean, verbo
|
|
|
29
29
|
* files for them.
|
|
30
30
|
*
|
|
31
31
|
* For reference:
|
|
32
|
-
* - The vanilla name sprite for Monstro is located at
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* (x86)\Steam\steamapps\common\The Binding of Isaac
|
|
37
|
-
* Rebirth\resources\gfx\ui\boss\portrait_20.0_monstro.png".
|
|
32
|
+
* - The vanilla name sprite for Monstro is located at:
|
|
33
|
+
* `resources/gfx/ui/boss/bossname_20.0_monstro.png`
|
|
34
|
+
* - The vanilla portrait sprite for Monstro is located at:
|
|
35
|
+
* `resources/gfx/ui/boss/portrait_20.0_monstro.png`
|
|
38
36
|
*
|
|
39
37
|
* (Note that boss metadata like this cannot be specified with the rest of the custom stage metadata
|
|
40
38
|
* in the "tsconfig.json" file because there is not a way to retrieve the name of an entity at
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/exports.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EACV,UAAU,EAGV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAoBtC,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAE1D,eAAO,MAAM,mBAAmB,YAAmB,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,UAAU,UAAO,EACjB,OAAO,UAAQ,GACd,IAAI,CAwDN;AA4ED
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/exports.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EACV,UAAU,EAGV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAoBtC,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAE1D,eAAO,MAAM,mBAAmB,YAAmB,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,UAAU,UAAO,EACjB,OAAO,UAAQ,GACd,IAAI,CAwDN;AA4ED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GACtB,IAAI,CAGN;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
|
|
@@ -130,12 +130,10 @@ end
|
|
|
130
130
|
-- files for them.
|
|
131
131
|
--
|
|
132
132
|
-- For reference:
|
|
133
|
-
-- - The vanilla name sprite for Monstro is located at
|
|
134
|
-
--
|
|
135
|
-
--
|
|
136
|
-
--
|
|
137
|
-
-- (x86)\Steam\steamapps\common\The Binding of Isaac
|
|
138
|
-
-- Rebirth\resources\gfx\ui\boss\portrait_20.0_monstro.png".
|
|
133
|
+
-- - The vanilla name sprite for Monstro is located at:
|
|
134
|
+
-- `resources/gfx/ui/boss/bossname_20.0_monstro.png`
|
|
135
|
+
-- - The vanilla portrait sprite for Monstro is located at:
|
|
136
|
+
-- `resources/gfx/ui/boss/portrait_20.0_monstro.png`
|
|
139
137
|
--
|
|
140
138
|
-- (Note that boss metadata like this cannot be specified with the rest of the custom stage metadata
|
|
141
139
|
-- in the "tsconfig.json" file because there is not a way to retrieve the name of an entity at
|
|
@@ -168,6 +168,9 @@ export declare function removeGridEntities<T extends AnyGridEntity>(gridEntities
|
|
|
168
168
|
* Helper function to remove a grid entity by providing the grid entity object or the grid index
|
|
169
169
|
* inside of the room.
|
|
170
170
|
*
|
|
171
|
+
* If removing a Devil Statue or an Angel Statue, this will also remove the associated effect
|
|
172
|
+
* (`EffectVariant.DEVIL` (6) or `EffectVariant.ANGEL` (9), respectively.)
|
|
173
|
+
*
|
|
171
174
|
* @param gridEntityOrGridIndex The grid entity or grid index to remove.
|
|
172
175
|
* @param updateRoom Whether or not to update the room after the grid entity is removed. This is
|
|
173
176
|
* generally a good idea because if the room is not updated, you will be unable to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridEntities.d.ts","sourceRoot":"","sources":["../../src/functions/gridEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,
|
|
1
|
+
{"version":3,"file":"gridEntities.d.ts","sourceRoot":"","sources":["../../src/functions/gridEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAGjB,cAAc,EACd,iBAAiB,EAGjB,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAStC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAgCvD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,GAAG,GACxB,CAAC,cAAc,EAAE,GAAG,CAAC,GAAG,SAAS,CAqBnC;AAED;;;;GAIG;A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 local Map = ____lualib.Map
|
|
|
6
6
|
local ____exports = {}
|
|
7
7
|
local getAllGridEntities
|
|
8
8
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
9
|
+
local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
|
|
9
10
|
local GridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.GridCollisionClass
|
|
10
11
|
local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
|
|
11
12
|
local PoopGridEntityVariant = ____isaac_2Dtypescript_2Ddefinitions.PoopGridEntityVariant
|
|
@@ -22,6 +23,10 @@ local GRID_ENTITY_XML_MAP = ____gridEntityXMLMap.GRID_ENTITY_XML_MAP
|
|
|
22
23
|
local ____roomShapeToTopLeftWallGridIndexMap = require("maps.roomShapeToTopLeftWallGridIndexMap")
|
|
23
24
|
local DEFAULT_TOP_LEFT_WALL_GRID_INDEX = ____roomShapeToTopLeftWallGridIndexMap.DEFAULT_TOP_LEFT_WALL_GRID_INDEX
|
|
24
25
|
local ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP = ____roomShapeToTopLeftWallGridIndexMap.ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP
|
|
26
|
+
local ____entities = require("functions.entities")
|
|
27
|
+
local removeEntities = ____entities.removeEntities
|
|
28
|
+
local ____entitiesSpecific = require("functions.entitiesSpecific")
|
|
29
|
+
local getEffects = ____entitiesSpecific.getEffects
|
|
25
30
|
local ____math = require("functions.math")
|
|
26
31
|
local isCircleIntersectingRectangle = ____math.isCircleIntersectingRectangle
|
|
27
32
|
local ____rooms = require("functions.rooms")
|
|
@@ -35,6 +40,7 @@ local ____utils = require("functions.utils")
|
|
|
35
40
|
local erange = ____utils.erange
|
|
36
41
|
local ____vector = require("functions.vector")
|
|
37
42
|
local isVector = ____vector.isVector
|
|
43
|
+
local vectorEquals = ____vector.vectorEquals
|
|
38
44
|
--- Helper function to get every legal grid index for the current room.
|
|
39
45
|
--
|
|
40
46
|
-- Under the hood, this uses the `Room.GetGridSize` method.
|
|
@@ -113,6 +119,9 @@ end
|
|
|
113
119
|
--- Helper function to remove a grid entity by providing the grid entity object or the grid index
|
|
114
120
|
-- inside of the room.
|
|
115
121
|
--
|
|
122
|
+
-- If removing a Devil Statue or an Angel Statue, this will also remove the associated effect
|
|
123
|
+
-- (`EffectVariant.DEVIL` (6) or `EffectVariant.ANGEL` (9), respectively.)
|
|
124
|
+
--
|
|
116
125
|
-- @param gridEntityOrGridIndex The grid entity or grid index to remove.
|
|
117
126
|
-- @param updateRoom Whether or not to update the room after the grid entity is removed. This is
|
|
118
127
|
-- generally a good idea because if the room is not updated, you will be unable to
|
|
@@ -121,11 +130,33 @@ end
|
|
|
121
130
|
-- so set this to false if you need to run this function multiple times.
|
|
122
131
|
function ____exports.removeGridEntity(self, gridEntityOrGridIndex, updateRoom)
|
|
123
132
|
local room = game:GetRoom()
|
|
133
|
+
local ____isNumber_result_0
|
|
134
|
+
if isNumber(nil, gridEntityOrGridIndex) then
|
|
135
|
+
____isNumber_result_0 = room:GetGridEntity(gridEntityOrGridIndex)
|
|
136
|
+
else
|
|
137
|
+
____isNumber_result_0 = gridEntityOrGridIndex
|
|
138
|
+
end
|
|
139
|
+
local gridEntity = ____isNumber_result_0
|
|
140
|
+
if gridEntity == nil then
|
|
141
|
+
return
|
|
142
|
+
end
|
|
143
|
+
local gridEntityType = gridEntity:GetType()
|
|
144
|
+
local variant = gridEntity:GetVariant()
|
|
145
|
+
local position = gridEntity.Position
|
|
124
146
|
local gridIndex = isNumber(nil, gridEntityOrGridIndex) and gridEntityOrGridIndex or gridEntityOrGridIndex:GetGridIndex()
|
|
125
147
|
room:RemoveGridEntity(gridIndex, 0, false)
|
|
126
148
|
if updateRoom then
|
|
127
149
|
roomUpdateSafe(nil)
|
|
128
150
|
end
|
|
151
|
+
if gridEntityType == GridEntityType.STATUE then
|
|
152
|
+
local effectVariant = variant == asNumber(nil, StatueVariant.DEVIL) and EffectVariant.DEVIL or EffectVariant.ANGEL
|
|
153
|
+
local effects = getEffects(nil, effectVariant)
|
|
154
|
+
local effectsOnTile = __TS__ArrayFilter(
|
|
155
|
+
effects,
|
|
156
|
+
function(____, effect) return vectorEquals(nil, effect.Position, position) end
|
|
157
|
+
)
|
|
158
|
+
removeEntities(nil, effectsOnTile)
|
|
159
|
+
end
|
|
129
160
|
end
|
|
130
161
|
--- Helper function to spawn a grid entity with a specific variant.
|
|
131
162
|
--
|
|
@@ -135,13 +166,13 @@ end
|
|
|
135
166
|
-- - allows you to specify the grid index or the position
|
|
136
167
|
function ____exports.spawnGridEntityWithVariant(self, gridEntityType, variant, gridIndexOrPosition)
|
|
137
168
|
local room = game:GetRoom()
|
|
138
|
-
local
|
|
169
|
+
local ____isVector_result_1
|
|
139
170
|
if isVector(nil, gridIndexOrPosition) then
|
|
140
|
-
|
|
171
|
+
____isVector_result_1 = room:GetGridEntityFromPos(gridIndexOrPosition)
|
|
141
172
|
else
|
|
142
|
-
|
|
173
|
+
____isVector_result_1 = room:GetGridEntity(gridIndexOrPosition)
|
|
143
174
|
end
|
|
144
|
-
local existingGridEntity =
|
|
175
|
+
local existingGridEntity = ____isVector_result_1
|
|
145
176
|
if existingGridEntity ~= nil then
|
|
146
177
|
____exports.removeGridEntity(nil, existingGridEntity, true)
|
|
147
178
|
end
|