isaacscript-common 51.11.2 → 52.0.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 +17 -2
- package/dist/isaacscript-common.lua +278 -9
- package/dist/src/enums/ModCallbackCustom.d.ts +2 -2
- package/dist/src/functions/gridEntities.d.ts +12 -0
- package/dist/src/functions/gridEntities.d.ts.map +1 -1
- package/dist/src/functions/gridEntities.lua +279 -5
- package/dist/src/objects/backdropTypeToRockAltType.lua +1 -1
- package/dist/src/objects/gridEntityTypeToANM2Path.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/enums/ModCallbackCustom.ts +2 -2
- package/src/functions/gridEntities.ts +292 -5
- package/src/objects/backdropTypeToRockAltType.ts +1 -1
- package/src/objects/gridEntityTypeToANM2Path.ts +1 -15
package/dist/index.rollup.d.ts
CHANGED
|
@@ -5742,6 +5742,15 @@ export declare function getGridEntitiesInRadius(targetPosition: Vector, radius:
|
|
|
5742
5742
|
*/
|
|
5743
5743
|
export declare function getGridEntitiesMap(...gridEntityTypes: GridEntityType[]): Map<int, GridEntity>;
|
|
5744
5744
|
|
|
5745
|
+
/** Helper function to get the ANM2 path for a grid entity type. */
|
|
5746
|
+
export declare function getGridEntityANM2Path(gridEntityType: GridEntityType): string | undefined;
|
|
5747
|
+
|
|
5748
|
+
/**
|
|
5749
|
+
* Helper function to get the ANM2 path for a decoration. This depends on the current room's
|
|
5750
|
+
* backdrop. The values are taken from the "backdrops.xml" file.
|
|
5751
|
+
*/
|
|
5752
|
+
export declare function getGridEntityANM2PathDecoration(): string;
|
|
5753
|
+
|
|
5745
5754
|
/** Helper function to get the top left and bottom right corners of a given grid entity. */
|
|
5746
5755
|
export declare function getGridEntityCollisionPoints(gridEntity: GridEntity): {
|
|
5747
5756
|
topLeft: Vector;
|
|
@@ -6939,6 +6948,12 @@ export declare function getReversedMap<K, V>(map: ReadonlyMap<K, V>): ReadonlyMa
|
|
|
6939
6948
|
*/
|
|
6940
6949
|
export declare function getRockAltType(): RockAltType;
|
|
6941
6950
|
|
|
6951
|
+
/**
|
|
6952
|
+
* Helper function to get the PNG path for a rock. This depends on the current room's backdrop. The
|
|
6953
|
+
* values are taken from the "backdrops.xml" file.
|
|
6954
|
+
*/
|
|
6955
|
+
export declare function getRockPNGPath(): string;
|
|
6956
|
+
|
|
6942
6957
|
/**
|
|
6943
6958
|
* Helper function to get all of the `GridEntityRock` in the room.
|
|
6944
6959
|
*
|
|
@@ -12854,7 +12869,7 @@ export declare enum ModCallbackCustom {
|
|
|
12854
12869
|
* velocity: Vector,
|
|
12855
12870
|
* spawner: Entity | undefined,
|
|
12856
12871
|
* initSeed: Seed,
|
|
12857
|
-
* ): [EntityType, int, int, int] | undefined {}
|
|
12872
|
+
* ): [entityType: EntityType, variant: int, subType: int, seed: int] | undefined {}
|
|
12858
12873
|
* ```
|
|
12859
12874
|
*/
|
|
12860
12875
|
PRE_ENTITY_SPAWN_FILTER = 130,
|
|
@@ -13029,7 +13044,7 @@ export declare enum ModCallbackCustom {
|
|
|
13029
13044
|
* subType: int,
|
|
13030
13045
|
* gridIndex: int,
|
|
13031
13046
|
* seed: Seed,
|
|
13032
|
-
* ): [EntityType | GridEntityXMLType, int, int] | undefined {}
|
|
13047
|
+
* ): [type: EntityType | GridEntityXMLType, variant: int, subType: int] | undefined {}
|
|
13033
13048
|
* ```
|
|
13034
13049
|
*/
|
|
13035
13050
|
PRE_ROOM_ENTITY_SPAWN_FILTER = 139,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 52.0.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -15448,8 +15448,8 @@ ____exports.BackdropType.BASEMENT = 1
|
|
|
15448
15448
|
____exports.BackdropType[____exports.BackdropType.BASEMENT] = "BASEMENT"
|
|
15449
15449
|
____exports.BackdropType.CELLAR = 2
|
|
15450
15450
|
____exports.BackdropType[____exports.BackdropType.CELLAR] = "CELLAR"
|
|
15451
|
-
____exports.BackdropType.
|
|
15452
|
-
____exports.BackdropType[____exports.BackdropType.
|
|
15451
|
+
____exports.BackdropType.BURNING_BASEMENT = 3
|
|
15452
|
+
____exports.BackdropType[____exports.BackdropType.BURNING_BASEMENT] = "BURNING_BASEMENT"
|
|
15453
15453
|
____exports.BackdropType.CAVES = 4
|
|
15454
15454
|
____exports.BackdropType[____exports.BackdropType.CAVES] = "CAVES"
|
|
15455
15455
|
____exports.BackdropType.CATACOMBS = 5
|
|
@@ -28437,6 +28437,7 @@ local Map = ____lualib.Map
|
|
|
28437
28437
|
local ____exports = {}
|
|
28438
28438
|
local getAllGridEntities
|
|
28439
28439
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
28440
|
+
local BackdropType = ____isaac_2Dtypescript_2Ddefinitions.BackdropType
|
|
28440
28441
|
local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
|
|
28441
28442
|
local GridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.GridCollisionClass
|
|
28442
28443
|
local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
|
|
@@ -28497,6 +28498,102 @@ function getAllGridEntities(self)
|
|
|
28497
28498
|
end
|
|
28498
28499
|
return gridEntities
|
|
28499
28500
|
end
|
|
28501
|
+
function ____exports.getGridEntityANM2PathDecoration(self)
|
|
28502
|
+
local room = game:GetRoom()
|
|
28503
|
+
local backdropType = room:GetBackdropType()
|
|
28504
|
+
repeat
|
|
28505
|
+
local ____switch36 = backdropType
|
|
28506
|
+
local ____cond36 = ____switch36 == BackdropType.BASEMENT or ____switch36 == BackdropType.CELLAR or ____switch36 == BackdropType.BURNING_BASEMENT or ____switch36 == BackdropType.DOWNPOUR_ENTRANCE or ____switch36 == BackdropType.ISAACS_BEDROOM or ____switch36 == BackdropType.CLOSET
|
|
28507
|
+
if ____cond36 then
|
|
28508
|
+
do
|
|
28509
|
+
return "gfx/grid/Props_01_Basement.anm2"
|
|
28510
|
+
end
|
|
28511
|
+
end
|
|
28512
|
+
____cond36 = ____cond36 or (____switch36 == BackdropType.CAVES or ____switch36 == BackdropType.CATACOMBS or ____switch36 == BackdropType.FLOODED_CAVES or ____switch36 == BackdropType.MINES_ENTRANCE)
|
|
28513
|
+
if ____cond36 then
|
|
28514
|
+
do
|
|
28515
|
+
return "gfx/grid/Props_03_Caves.anm2"
|
|
28516
|
+
end
|
|
28517
|
+
end
|
|
28518
|
+
____cond36 = ____cond36 or (____switch36 == BackdropType.DEPTHS or ____switch36 == BackdropType.NECROPOLIS or ____switch36 == BackdropType.DANK_DEPTHS or ____switch36 == BackdropType.SACRIFICE or ____switch36 == BackdropType.MAUSOLEUM or ____switch36 == BackdropType.MAUSOLEUM_ENTRANCE or ____switch36 == BackdropType.CORPSE_ENTRANCE or ____switch36 == BackdropType.MAUSOLEUM_2 or ____switch36 == BackdropType.MAUSOLEUM_3 or ____switch36 == BackdropType.MAUSOLEUM_4 or ____switch36 == BackdropType.CLOSET_B or ____switch36 == BackdropType.DARK_CLOSET)
|
|
28519
|
+
if ____cond36 then
|
|
28520
|
+
do
|
|
28521
|
+
return "gfx/grid/Props_05_Depths.anm2"
|
|
28522
|
+
end
|
|
28523
|
+
end
|
|
28524
|
+
____cond36 = ____cond36 or (____switch36 == BackdropType.WOMB or ____switch36 == BackdropType.SCARRED_WOMB)
|
|
28525
|
+
if ____cond36 then
|
|
28526
|
+
do
|
|
28527
|
+
return "gfx/grid/Props_07_The Womb.anm2"
|
|
28528
|
+
end
|
|
28529
|
+
end
|
|
28530
|
+
____cond36 = ____cond36 or ____switch36 == BackdropType.UTERO
|
|
28531
|
+
if ____cond36 then
|
|
28532
|
+
do
|
|
28533
|
+
return "gfx/grid/Props_07_Utero.anm2"
|
|
28534
|
+
end
|
|
28535
|
+
end
|
|
28536
|
+
____cond36 = ____cond36 or (____switch36 == BackdropType.BLUE_WOMB or ____switch36 == BackdropType.BLUE_WOMB_PASS)
|
|
28537
|
+
if ____cond36 then
|
|
28538
|
+
do
|
|
28539
|
+
return "gfx/grid/Props_07_The Womb_blue.anm2"
|
|
28540
|
+
end
|
|
28541
|
+
end
|
|
28542
|
+
____cond36 = ____cond36 or (____switch36 == BackdropType.SHEOL or ____switch36 == BackdropType.GEHENNA)
|
|
28543
|
+
if ____cond36 then
|
|
28544
|
+
do
|
|
28545
|
+
return "gfx/grid/Props_09_Sheol.anm2"
|
|
28546
|
+
end
|
|
28547
|
+
end
|
|
28548
|
+
____cond36 = ____cond36 or ____switch36 == BackdropType.CATHEDRAL
|
|
28549
|
+
if ____cond36 then
|
|
28550
|
+
do
|
|
28551
|
+
return "gfx/grid/Props_10_Cathedral.anm2"
|
|
28552
|
+
end
|
|
28553
|
+
end
|
|
28554
|
+
____cond36 = ____cond36 or ____switch36 == BackdropType.CHEST
|
|
28555
|
+
if ____cond36 then
|
|
28556
|
+
do
|
|
28557
|
+
return "gfx/grid/Props_11_The Chest.anm2"
|
|
28558
|
+
end
|
|
28559
|
+
end
|
|
28560
|
+
____cond36 = ____cond36 or ____switch36 == BackdropType.GREED_SHOP
|
|
28561
|
+
if ____cond36 then
|
|
28562
|
+
do
|
|
28563
|
+
return "gfx/grid/Props_12_Greed.anm2"
|
|
28564
|
+
end
|
|
28565
|
+
end
|
|
28566
|
+
____cond36 = ____cond36 or ____switch36 == BackdropType.DOWNPOUR
|
|
28567
|
+
if ____cond36 then
|
|
28568
|
+
do
|
|
28569
|
+
return "gfx/grid/props_01x_downpour.anm2"
|
|
28570
|
+
end
|
|
28571
|
+
end
|
|
28572
|
+
____cond36 = ____cond36 or (____switch36 == BackdropType.MINES or ____switch36 == BackdropType.ASHPIT or ____switch36 == BackdropType.MINES_SHAFT or ____switch36 == BackdropType.ASHPIT_SHAFT)
|
|
28573
|
+
if ____cond36 then
|
|
28574
|
+
do
|
|
28575
|
+
return "gfx/grid/props_03x_mines.anm2"
|
|
28576
|
+
end
|
|
28577
|
+
end
|
|
28578
|
+
____cond36 = ____cond36 or (____switch36 == BackdropType.CORPSE or ____switch36 == BackdropType.CORPSE_2 or ____switch36 == BackdropType.CORPSE_3 or ____switch36 == BackdropType.MORTIS)
|
|
28579
|
+
if ____cond36 then
|
|
28580
|
+
do
|
|
28581
|
+
return "gfx/grid/props_07_the corpse.anm2"
|
|
28582
|
+
end
|
|
28583
|
+
end
|
|
28584
|
+
____cond36 = ____cond36 or ____switch36 == BackdropType.DROSS
|
|
28585
|
+
if ____cond36 then
|
|
28586
|
+
do
|
|
28587
|
+
return "gfx/grid/props_02x_dross.anm2"
|
|
28588
|
+
end
|
|
28589
|
+
end
|
|
28590
|
+
do
|
|
28591
|
+
do
|
|
28592
|
+
return "gfx/grid/Props_01_Basement.anm2"
|
|
28593
|
+
end
|
|
28594
|
+
end
|
|
28595
|
+
until true
|
|
28596
|
+
end
|
|
28500
28597
|
function ____exports.getGridEntityCollisionPoints(self, gridEntity)
|
|
28501
28598
|
local topLeft = Vector(gridEntity.Position.X - DISTANCE_OF_GRID_TILE / 2, gridEntity.Position.Y - DISTANCE_OF_GRID_TILE / 2)
|
|
28502
28599
|
local bottomRight = Vector(gridEntity.Position.X + DISTANCE_OF_GRID_TILE / 2, gridEntity.Position.Y + DISTANCE_OF_GRID_TILE / 2)
|
|
@@ -28727,6 +28824,22 @@ function ____exports.getGridEntitiesMap(self, ...)
|
|
|
28727
28824
|
end
|
|
28728
28825
|
return gridEntityMap
|
|
28729
28826
|
end
|
|
28827
|
+
function ____exports.getGridEntityANM2Path(self, gridEntityType)
|
|
28828
|
+
repeat
|
|
28829
|
+
local ____switch32 = gridEntityType
|
|
28830
|
+
local ____cond32 = ____switch32 == GridEntityType.DECORATION
|
|
28831
|
+
if ____cond32 then
|
|
28832
|
+
do
|
|
28833
|
+
return ____exports.getGridEntityANM2PathDecoration(nil)
|
|
28834
|
+
end
|
|
28835
|
+
end
|
|
28836
|
+
do
|
|
28837
|
+
do
|
|
28838
|
+
return GRID_ENTITY_TYPE_TO_ANM2_PATH[gridEntityType]
|
|
28839
|
+
end
|
|
28840
|
+
end
|
|
28841
|
+
until true
|
|
28842
|
+
end
|
|
28730
28843
|
function ____exports.getGridEntityID(self, gridEntity)
|
|
28731
28844
|
local gridEntityType = gridEntity:GetType()
|
|
28732
28845
|
local variant = gridEntity:GetVariant()
|
|
@@ -28742,6 +28855,156 @@ function ____exports.getMatchingGridEntities(self, gridEntityType, variant)
|
|
|
28742
28855
|
function(____, gridEntity) return gridEntity:GetVariant() == variant end
|
|
28743
28856
|
)
|
|
28744
28857
|
end
|
|
28858
|
+
function ____exports.getRockPNGPath(self)
|
|
28859
|
+
local room = game:GetRoom()
|
|
28860
|
+
local backdropType = room:GetBackdropType()
|
|
28861
|
+
repeat
|
|
28862
|
+
local ____switch58 = backdropType
|
|
28863
|
+
local ____cond58 = ____switch58 == BackdropType.BASEMENT or ____switch58 == BackdropType.CHEST
|
|
28864
|
+
if ____cond58 then
|
|
28865
|
+
do
|
|
28866
|
+
return "rocks_basement.png"
|
|
28867
|
+
end
|
|
28868
|
+
end
|
|
28869
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.CELLAR
|
|
28870
|
+
if ____cond58 then
|
|
28871
|
+
do
|
|
28872
|
+
return "rocks_cellar.png"
|
|
28873
|
+
end
|
|
28874
|
+
end
|
|
28875
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.BURNING_BASEMENT
|
|
28876
|
+
if ____cond58 then
|
|
28877
|
+
do
|
|
28878
|
+
return "rocks_burningbasement.png"
|
|
28879
|
+
end
|
|
28880
|
+
end
|
|
28881
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.CAVES
|
|
28882
|
+
if ____cond58 then
|
|
28883
|
+
do
|
|
28884
|
+
return "rocks_caves.png"
|
|
28885
|
+
end
|
|
28886
|
+
end
|
|
28887
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.CATACOMBS
|
|
28888
|
+
if ____cond58 then
|
|
28889
|
+
do
|
|
28890
|
+
return "rocks_catacombs.png"
|
|
28891
|
+
end
|
|
28892
|
+
end
|
|
28893
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.FLOODED_CAVES
|
|
28894
|
+
if ____cond58 then
|
|
28895
|
+
do
|
|
28896
|
+
return "rocks_drownedcaves.png"
|
|
28897
|
+
end
|
|
28898
|
+
end
|
|
28899
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.DEPTHS or ____switch58 == BackdropType.NECROPOLIS or ____switch58 == BackdropType.DANK_DEPTHS or ____switch58 == BackdropType.SACRIFICE or ____switch58 == BackdropType.DARK_CLOSET)
|
|
28900
|
+
if ____cond58 then
|
|
28901
|
+
do
|
|
28902
|
+
return "rocks_depths.png"
|
|
28903
|
+
end
|
|
28904
|
+
end
|
|
28905
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.WOMB
|
|
28906
|
+
if ____cond58 then
|
|
28907
|
+
do
|
|
28908
|
+
return "rocks_womb.png"
|
|
28909
|
+
end
|
|
28910
|
+
end
|
|
28911
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.UTERO
|
|
28912
|
+
if ____cond58 then
|
|
28913
|
+
do
|
|
28914
|
+
return "rocks_utero.png"
|
|
28915
|
+
end
|
|
28916
|
+
end
|
|
28917
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.SCARRED_WOMB
|
|
28918
|
+
if ____cond58 then
|
|
28919
|
+
do
|
|
28920
|
+
return "rocks_scarredwomb.png"
|
|
28921
|
+
end
|
|
28922
|
+
end
|
|
28923
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.BLUE_WOMB or ____switch58 == BackdropType.BLUE_WOMB_PASS)
|
|
28924
|
+
if ____cond58 then
|
|
28925
|
+
do
|
|
28926
|
+
return "rocks_bluewomb.png"
|
|
28927
|
+
end
|
|
28928
|
+
end
|
|
28929
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.SHEOL or ____switch58 == BackdropType.DARK_ROOM)
|
|
28930
|
+
if ____cond58 then
|
|
28931
|
+
do
|
|
28932
|
+
return "rocks_sheol.png"
|
|
28933
|
+
end
|
|
28934
|
+
end
|
|
28935
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.CATHEDRAL or ____switch58 == BackdropType.PLANETARIUM)
|
|
28936
|
+
if ____cond58 then
|
|
28937
|
+
do
|
|
28938
|
+
return "rocks_cathedral.png"
|
|
28939
|
+
end
|
|
28940
|
+
end
|
|
28941
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.SECRET or ____switch58 == BackdropType.MINES or ____switch58 == BackdropType.MINES_ENTRANCE or ____switch58 == BackdropType.MINES_SHAFT)
|
|
28942
|
+
if ____cond58 then
|
|
28943
|
+
do
|
|
28944
|
+
return "rocks_secretroom.png"
|
|
28945
|
+
end
|
|
28946
|
+
end
|
|
28947
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.DOWNPOUR or ____switch58 == BackdropType.DOWNPOUR_ENTRANCE)
|
|
28948
|
+
if ____cond58 then
|
|
28949
|
+
do
|
|
28950
|
+
return "rocks_downpour.png"
|
|
28951
|
+
end
|
|
28952
|
+
end
|
|
28953
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.MAUSOLEUM or ____switch58 == BackdropType.MAUSOLEUM_ENTRANCE or ____switch58 == BackdropType.MAUSOLEUM_2 or ____switch58 == BackdropType.MAUSOLEUM_3 or ____switch58 == BackdropType.MAUSOLEUM_4)
|
|
28954
|
+
if ____cond58 then
|
|
28955
|
+
do
|
|
28956
|
+
return "rocks_mausoleum.png"
|
|
28957
|
+
end
|
|
28958
|
+
end
|
|
28959
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.CORPSE or ____switch58 == BackdropType.MORTIS)
|
|
28960
|
+
if ____cond58 then
|
|
28961
|
+
do
|
|
28962
|
+
return "rocks_corpse.png"
|
|
28963
|
+
end
|
|
28964
|
+
end
|
|
28965
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.CORPSE_ENTRANCE
|
|
28966
|
+
if ____cond58 then
|
|
28967
|
+
do
|
|
28968
|
+
return "rocks_corpseentrance.png"
|
|
28969
|
+
end
|
|
28970
|
+
end
|
|
28971
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.CORPSE_2
|
|
28972
|
+
if ____cond58 then
|
|
28973
|
+
do
|
|
28974
|
+
return "rocks_corpse2.png"
|
|
28975
|
+
end
|
|
28976
|
+
end
|
|
28977
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.CORPSE_3
|
|
28978
|
+
if ____cond58 then
|
|
28979
|
+
do
|
|
28980
|
+
return "rocks_corpse3.png"
|
|
28981
|
+
end
|
|
28982
|
+
end
|
|
28983
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.DROSS
|
|
28984
|
+
if ____cond58 then
|
|
28985
|
+
do
|
|
28986
|
+
return "rocks_dross.png"
|
|
28987
|
+
end
|
|
28988
|
+
end
|
|
28989
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.ASHPIT or ____switch58 == BackdropType.ASHPIT_SHAFT)
|
|
28990
|
+
if ____cond58 then
|
|
28991
|
+
do
|
|
28992
|
+
return "rocks_ashpit.png"
|
|
28993
|
+
end
|
|
28994
|
+
end
|
|
28995
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.GEHENNA
|
|
28996
|
+
if ____cond58 then
|
|
28997
|
+
do
|
|
28998
|
+
return "rocks_gehenna.png"
|
|
28999
|
+
end
|
|
29000
|
+
end
|
|
29001
|
+
do
|
|
29002
|
+
do
|
|
29003
|
+
return "rocks_basement.png"
|
|
29004
|
+
end
|
|
29005
|
+
end
|
|
29006
|
+
until true
|
|
29007
|
+
end
|
|
28745
29008
|
function ____exports.getSurroundingGridEntities(self, gridEntity)
|
|
28746
29009
|
local room = game:GetRoom()
|
|
28747
29010
|
local gridWidth = room:GetGridWidth()
|
|
@@ -28850,12 +29113,18 @@ end
|
|
|
28850
29113
|
function ____exports.setGridEntityType(self, gridEntity, gridEntityType)
|
|
28851
29114
|
gridEntity:SetType(gridEntityType)
|
|
28852
29115
|
local sprite = gridEntity:GetSprite()
|
|
28853
|
-
local anm2Path =
|
|
28854
|
-
if anm2Path
|
|
28855
|
-
|
|
28856
|
-
local defaultAnimation = sprite:GetDefaultAnimation()
|
|
28857
|
-
sprite:Play(defaultAnimation, true)
|
|
29116
|
+
local anm2Path = ____exports.getGridEntityANM2Path(nil, gridEntityType)
|
|
29117
|
+
if anm2Path == nil then
|
|
29118
|
+
return
|
|
28858
29119
|
end
|
|
29120
|
+
sprite:Load(anm2Path, false)
|
|
29121
|
+
if gridEntityType == GridEntityType.ROCK then
|
|
29122
|
+
local pngPath = ____exports.getRockPNGPath(nil)
|
|
29123
|
+
sprite:ReplaceSpritesheet(0, pngPath)
|
|
29124
|
+
end
|
|
29125
|
+
sprite:LoadGraphics()
|
|
29126
|
+
local defaultAnimation = sprite:GetDefaultAnimation()
|
|
29127
|
+
sprite:Play(defaultAnimation, true)
|
|
28859
29128
|
end
|
|
28860
29129
|
function ____exports.spawnGiantPoop(self, topLeftGridIndex)
|
|
28861
29130
|
local room = game:GetRoom()
|
|
@@ -41241,7 +41510,7 @@ local RockAltType = ____RockAltType.RockAltType
|
|
|
41241
41510
|
____exports.BACKDROP_TYPE_TO_ROCK_ALT_TYPE = {
|
|
41242
41511
|
[BackdropType.BASEMENT] = RockAltType.URN,
|
|
41243
41512
|
[BackdropType.CELLAR] = RockAltType.URN,
|
|
41244
|
-
[BackdropType.
|
|
41513
|
+
[BackdropType.BURNING_BASEMENT] = RockAltType.URN,
|
|
41245
41514
|
[BackdropType.CAVES] = RockAltType.MUSHROOM,
|
|
41246
41515
|
[BackdropType.CATACOMBS] = RockAltType.MUSHROOM,
|
|
41247
41516
|
[BackdropType.FLOODED_CAVES] = RockAltType.MUSHROOM,
|
|
@@ -2272,7 +2272,7 @@ export declare enum ModCallbackCustom {
|
|
|
2272
2272
|
* velocity: Vector,
|
|
2273
2273
|
* spawner: Entity | undefined,
|
|
2274
2274
|
* initSeed: Seed,
|
|
2275
|
-
* ): [EntityType, int, int, int] | undefined {}
|
|
2275
|
+
* ): [entityType: EntityType, variant: int, subType: int, seed: int] | undefined {}
|
|
2276
2276
|
* ```
|
|
2277
2277
|
*/
|
|
2278
2278
|
PRE_ENTITY_SPAWN_FILTER = 130,
|
|
@@ -2447,7 +2447,7 @@ export declare enum ModCallbackCustom {
|
|
|
2447
2447
|
* subType: int,
|
|
2448
2448
|
* gridIndex: int,
|
|
2449
2449
|
* seed: Seed,
|
|
2450
|
-
* ): [EntityType | GridEntityXMLType, int, int] | undefined {}
|
|
2450
|
+
* ): [type: EntityType | GridEntityXMLType, variant: int, subType: int] | undefined {}
|
|
2451
2451
|
* ```
|
|
2452
2452
|
*/
|
|
2453
2453
|
PRE_ROOM_ENTITY_SPAWN_FILTER = 139,
|
|
@@ -81,6 +81,13 @@ export declare function getGridEntitiesInRadius(targetPosition: Vector, radius:
|
|
|
81
81
|
* @allowEmptyVariadic
|
|
82
82
|
*/
|
|
83
83
|
export declare function getGridEntitiesMap(...gridEntityTypes: GridEntityType[]): Map<int, GridEntity>;
|
|
84
|
+
/** Helper function to get the ANM2 path for a grid entity type. */
|
|
85
|
+
export declare function getGridEntityANM2Path(gridEntityType: GridEntityType): string | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Helper function to get the ANM2 path for a decoration. This depends on the current room's
|
|
88
|
+
* backdrop. The values are taken from the "backdrops.xml" file.
|
|
89
|
+
*/
|
|
90
|
+
export declare function getGridEntityANM2PathDecoration(): string;
|
|
84
91
|
/** Helper function to get the top left and bottom right corners of a given grid entity. */
|
|
85
92
|
export declare function getGridEntityCollisionPoints(gridEntity: GridEntity): {
|
|
86
93
|
topLeft: Vector;
|
|
@@ -100,6 +107,11 @@ export declare function getGridEntityIDFromConstituents(gridEntityType: GridEnti
|
|
|
100
107
|
* If you want to match every variant, use the `getGridEntities` function instead.
|
|
101
108
|
*/
|
|
102
109
|
export declare function getMatchingGridEntities(gridEntityType: GridEntityType, variant: int): GridEntity[];
|
|
110
|
+
/**
|
|
111
|
+
* Helper function to get the PNG path for a rock. This depends on the current room's backdrop. The
|
|
112
|
+
* values are taken from the "backdrops.xml" file.
|
|
113
|
+
*/
|
|
114
|
+
export declare function getRockPNGPath(): string;
|
|
103
115
|
/**
|
|
104
116
|
* Helper function to get the grid entities on the surrounding tiles from the provided grid entity.
|
|
105
117
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridEntities.d.ts","sourceRoot":"","sources":["../../../src/functions/gridEntities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,
|
|
1
|
+
{"version":3,"file":"gridEntities.d.ts","sourceRoot":"","sources":["../../../src/functions/gridEntities.ts"],"names":[],"mappings":"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"}
|
|
@@ -8,6 +8,7 @@ local Map = ____lualib.Map
|
|
|
8
8
|
local ____exports = {}
|
|
9
9
|
local getAllGridEntities
|
|
10
10
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
11
|
+
local BackdropType = ____isaac_2Dtypescript_2Ddefinitions.BackdropType
|
|
11
12
|
local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
|
|
12
13
|
local GridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.GridCollisionClass
|
|
13
14
|
local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
|
|
@@ -71,6 +72,104 @@ function getAllGridEntities(self)
|
|
|
71
72
|
end
|
|
72
73
|
return gridEntities
|
|
73
74
|
end
|
|
75
|
+
--- Helper function to get the ANM2 path for a decoration. This depends on the current room's
|
|
76
|
+
-- backdrop. The values are taken from the "backdrops.xml" file.
|
|
77
|
+
function ____exports.getGridEntityANM2PathDecoration(self)
|
|
78
|
+
local room = game:GetRoom()
|
|
79
|
+
local backdropType = room:GetBackdropType()
|
|
80
|
+
repeat
|
|
81
|
+
local ____switch36 = backdropType
|
|
82
|
+
local ____cond36 = ____switch36 == BackdropType.BASEMENT or ____switch36 == BackdropType.CELLAR or ____switch36 == BackdropType.BURNING_BASEMENT or ____switch36 == BackdropType.DOWNPOUR_ENTRANCE or ____switch36 == BackdropType.ISAACS_BEDROOM or ____switch36 == BackdropType.CLOSET
|
|
83
|
+
if ____cond36 then
|
|
84
|
+
do
|
|
85
|
+
return "gfx/grid/Props_01_Basement.anm2"
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
____cond36 = ____cond36 or (____switch36 == BackdropType.CAVES or ____switch36 == BackdropType.CATACOMBS or ____switch36 == BackdropType.FLOODED_CAVES or ____switch36 == BackdropType.MINES_ENTRANCE)
|
|
89
|
+
if ____cond36 then
|
|
90
|
+
do
|
|
91
|
+
return "gfx/grid/Props_03_Caves.anm2"
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
____cond36 = ____cond36 or (____switch36 == BackdropType.DEPTHS or ____switch36 == BackdropType.NECROPOLIS or ____switch36 == BackdropType.DANK_DEPTHS or ____switch36 == BackdropType.SACRIFICE or ____switch36 == BackdropType.MAUSOLEUM or ____switch36 == BackdropType.MAUSOLEUM_ENTRANCE or ____switch36 == BackdropType.CORPSE_ENTRANCE or ____switch36 == BackdropType.MAUSOLEUM_2 or ____switch36 == BackdropType.MAUSOLEUM_3 or ____switch36 == BackdropType.MAUSOLEUM_4 or ____switch36 == BackdropType.CLOSET_B or ____switch36 == BackdropType.DARK_CLOSET)
|
|
95
|
+
if ____cond36 then
|
|
96
|
+
do
|
|
97
|
+
return "gfx/grid/Props_05_Depths.anm2"
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
____cond36 = ____cond36 or (____switch36 == BackdropType.WOMB or ____switch36 == BackdropType.SCARRED_WOMB)
|
|
101
|
+
if ____cond36 then
|
|
102
|
+
do
|
|
103
|
+
return "gfx/grid/Props_07_The Womb.anm2"
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
____cond36 = ____cond36 or ____switch36 == BackdropType.UTERO
|
|
107
|
+
if ____cond36 then
|
|
108
|
+
do
|
|
109
|
+
return "gfx/grid/Props_07_Utero.anm2"
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
____cond36 = ____cond36 or (____switch36 == BackdropType.BLUE_WOMB or ____switch36 == BackdropType.BLUE_WOMB_PASS)
|
|
113
|
+
if ____cond36 then
|
|
114
|
+
do
|
|
115
|
+
return "gfx/grid/Props_07_The Womb_blue.anm2"
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
____cond36 = ____cond36 or (____switch36 == BackdropType.SHEOL or ____switch36 == BackdropType.GEHENNA)
|
|
119
|
+
if ____cond36 then
|
|
120
|
+
do
|
|
121
|
+
return "gfx/grid/Props_09_Sheol.anm2"
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
____cond36 = ____cond36 or ____switch36 == BackdropType.CATHEDRAL
|
|
125
|
+
if ____cond36 then
|
|
126
|
+
do
|
|
127
|
+
return "gfx/grid/Props_10_Cathedral.anm2"
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
____cond36 = ____cond36 or ____switch36 == BackdropType.CHEST
|
|
131
|
+
if ____cond36 then
|
|
132
|
+
do
|
|
133
|
+
return "gfx/grid/Props_11_The Chest.anm2"
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
____cond36 = ____cond36 or ____switch36 == BackdropType.GREED_SHOP
|
|
137
|
+
if ____cond36 then
|
|
138
|
+
do
|
|
139
|
+
return "gfx/grid/Props_12_Greed.anm2"
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
____cond36 = ____cond36 or ____switch36 == BackdropType.DOWNPOUR
|
|
143
|
+
if ____cond36 then
|
|
144
|
+
do
|
|
145
|
+
return "gfx/grid/props_01x_downpour.anm2"
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
____cond36 = ____cond36 or (____switch36 == BackdropType.MINES or ____switch36 == BackdropType.ASHPIT or ____switch36 == BackdropType.MINES_SHAFT or ____switch36 == BackdropType.ASHPIT_SHAFT)
|
|
149
|
+
if ____cond36 then
|
|
150
|
+
do
|
|
151
|
+
return "gfx/grid/props_03x_mines.anm2"
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
____cond36 = ____cond36 or (____switch36 == BackdropType.CORPSE or ____switch36 == BackdropType.CORPSE_2 or ____switch36 == BackdropType.CORPSE_3 or ____switch36 == BackdropType.MORTIS)
|
|
155
|
+
if ____cond36 then
|
|
156
|
+
do
|
|
157
|
+
return "gfx/grid/props_07_the corpse.anm2"
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
____cond36 = ____cond36 or ____switch36 == BackdropType.DROSS
|
|
161
|
+
if ____cond36 then
|
|
162
|
+
do
|
|
163
|
+
return "gfx/grid/props_02x_dross.anm2"
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
do
|
|
167
|
+
do
|
|
168
|
+
return "gfx/grid/Props_01_Basement.anm2"
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
until true
|
|
172
|
+
end
|
|
74
173
|
--- Helper function to get the top left and bottom right corners of a given grid entity.
|
|
75
174
|
function ____exports.getGridEntityCollisionPoints(self, gridEntity)
|
|
76
175
|
local topLeft = Vector(gridEntity.Position.X - DISTANCE_OF_GRID_TILE / 2, gridEntity.Position.Y - DISTANCE_OF_GRID_TILE / 2)
|
|
@@ -379,6 +478,23 @@ function ____exports.getGridEntitiesMap(self, ...)
|
|
|
379
478
|
end
|
|
380
479
|
return gridEntityMap
|
|
381
480
|
end
|
|
481
|
+
--- Helper function to get the ANM2 path for a grid entity type.
|
|
482
|
+
function ____exports.getGridEntityANM2Path(self, gridEntityType)
|
|
483
|
+
repeat
|
|
484
|
+
local ____switch32 = gridEntityType
|
|
485
|
+
local ____cond32 = ____switch32 == GridEntityType.DECORATION
|
|
486
|
+
if ____cond32 then
|
|
487
|
+
do
|
|
488
|
+
return ____exports.getGridEntityANM2PathDecoration(nil)
|
|
489
|
+
end
|
|
490
|
+
end
|
|
491
|
+
do
|
|
492
|
+
do
|
|
493
|
+
return GRID_ENTITY_TYPE_TO_ANM2_PATH[gridEntityType]
|
|
494
|
+
end
|
|
495
|
+
end
|
|
496
|
+
until true
|
|
497
|
+
end
|
|
382
498
|
--- Helper function to get a string containing the grid entity's type and variant.
|
|
383
499
|
function ____exports.getGridEntityID(self, gridEntity)
|
|
384
500
|
local gridEntityType = gridEntity:GetType()
|
|
@@ -401,6 +517,158 @@ function ____exports.getMatchingGridEntities(self, gridEntityType, variant)
|
|
|
401
517
|
function(____, gridEntity) return gridEntity:GetVariant() == variant end
|
|
402
518
|
)
|
|
403
519
|
end
|
|
520
|
+
--- Helper function to get the PNG path for a rock. This depends on the current room's backdrop. The
|
|
521
|
+
-- values are taken from the "backdrops.xml" file.
|
|
522
|
+
function ____exports.getRockPNGPath(self)
|
|
523
|
+
local room = game:GetRoom()
|
|
524
|
+
local backdropType = room:GetBackdropType()
|
|
525
|
+
repeat
|
|
526
|
+
local ____switch58 = backdropType
|
|
527
|
+
local ____cond58 = ____switch58 == BackdropType.BASEMENT or ____switch58 == BackdropType.CHEST
|
|
528
|
+
if ____cond58 then
|
|
529
|
+
do
|
|
530
|
+
return "rocks_basement.png"
|
|
531
|
+
end
|
|
532
|
+
end
|
|
533
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.CELLAR
|
|
534
|
+
if ____cond58 then
|
|
535
|
+
do
|
|
536
|
+
return "rocks_cellar.png"
|
|
537
|
+
end
|
|
538
|
+
end
|
|
539
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.BURNING_BASEMENT
|
|
540
|
+
if ____cond58 then
|
|
541
|
+
do
|
|
542
|
+
return "rocks_burningbasement.png"
|
|
543
|
+
end
|
|
544
|
+
end
|
|
545
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.CAVES
|
|
546
|
+
if ____cond58 then
|
|
547
|
+
do
|
|
548
|
+
return "rocks_caves.png"
|
|
549
|
+
end
|
|
550
|
+
end
|
|
551
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.CATACOMBS
|
|
552
|
+
if ____cond58 then
|
|
553
|
+
do
|
|
554
|
+
return "rocks_catacombs.png"
|
|
555
|
+
end
|
|
556
|
+
end
|
|
557
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.FLOODED_CAVES
|
|
558
|
+
if ____cond58 then
|
|
559
|
+
do
|
|
560
|
+
return "rocks_drownedcaves.png"
|
|
561
|
+
end
|
|
562
|
+
end
|
|
563
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.DEPTHS or ____switch58 == BackdropType.NECROPOLIS or ____switch58 == BackdropType.DANK_DEPTHS or ____switch58 == BackdropType.SACRIFICE or ____switch58 == BackdropType.DARK_CLOSET)
|
|
564
|
+
if ____cond58 then
|
|
565
|
+
do
|
|
566
|
+
return "rocks_depths.png"
|
|
567
|
+
end
|
|
568
|
+
end
|
|
569
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.WOMB
|
|
570
|
+
if ____cond58 then
|
|
571
|
+
do
|
|
572
|
+
return "rocks_womb.png"
|
|
573
|
+
end
|
|
574
|
+
end
|
|
575
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.UTERO
|
|
576
|
+
if ____cond58 then
|
|
577
|
+
do
|
|
578
|
+
return "rocks_utero.png"
|
|
579
|
+
end
|
|
580
|
+
end
|
|
581
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.SCARRED_WOMB
|
|
582
|
+
if ____cond58 then
|
|
583
|
+
do
|
|
584
|
+
return "rocks_scarredwomb.png"
|
|
585
|
+
end
|
|
586
|
+
end
|
|
587
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.BLUE_WOMB or ____switch58 == BackdropType.BLUE_WOMB_PASS)
|
|
588
|
+
if ____cond58 then
|
|
589
|
+
do
|
|
590
|
+
return "rocks_bluewomb.png"
|
|
591
|
+
end
|
|
592
|
+
end
|
|
593
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.SHEOL or ____switch58 == BackdropType.DARK_ROOM)
|
|
594
|
+
if ____cond58 then
|
|
595
|
+
do
|
|
596
|
+
return "rocks_sheol.png"
|
|
597
|
+
end
|
|
598
|
+
end
|
|
599
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.CATHEDRAL or ____switch58 == BackdropType.PLANETARIUM)
|
|
600
|
+
if ____cond58 then
|
|
601
|
+
do
|
|
602
|
+
return "rocks_cathedral.png"
|
|
603
|
+
end
|
|
604
|
+
end
|
|
605
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.SECRET or ____switch58 == BackdropType.MINES or ____switch58 == BackdropType.MINES_ENTRANCE or ____switch58 == BackdropType.MINES_SHAFT)
|
|
606
|
+
if ____cond58 then
|
|
607
|
+
do
|
|
608
|
+
return "rocks_secretroom.png"
|
|
609
|
+
end
|
|
610
|
+
end
|
|
611
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.DOWNPOUR or ____switch58 == BackdropType.DOWNPOUR_ENTRANCE)
|
|
612
|
+
if ____cond58 then
|
|
613
|
+
do
|
|
614
|
+
return "rocks_downpour.png"
|
|
615
|
+
end
|
|
616
|
+
end
|
|
617
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.MAUSOLEUM or ____switch58 == BackdropType.MAUSOLEUM_ENTRANCE or ____switch58 == BackdropType.MAUSOLEUM_2 or ____switch58 == BackdropType.MAUSOLEUM_3 or ____switch58 == BackdropType.MAUSOLEUM_4)
|
|
618
|
+
if ____cond58 then
|
|
619
|
+
do
|
|
620
|
+
return "rocks_mausoleum.png"
|
|
621
|
+
end
|
|
622
|
+
end
|
|
623
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.CORPSE or ____switch58 == BackdropType.MORTIS)
|
|
624
|
+
if ____cond58 then
|
|
625
|
+
do
|
|
626
|
+
return "rocks_corpse.png"
|
|
627
|
+
end
|
|
628
|
+
end
|
|
629
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.CORPSE_ENTRANCE
|
|
630
|
+
if ____cond58 then
|
|
631
|
+
do
|
|
632
|
+
return "rocks_corpseentrance.png"
|
|
633
|
+
end
|
|
634
|
+
end
|
|
635
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.CORPSE_2
|
|
636
|
+
if ____cond58 then
|
|
637
|
+
do
|
|
638
|
+
return "rocks_corpse2.png"
|
|
639
|
+
end
|
|
640
|
+
end
|
|
641
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.CORPSE_3
|
|
642
|
+
if ____cond58 then
|
|
643
|
+
do
|
|
644
|
+
return "rocks_corpse3.png"
|
|
645
|
+
end
|
|
646
|
+
end
|
|
647
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.DROSS
|
|
648
|
+
if ____cond58 then
|
|
649
|
+
do
|
|
650
|
+
return "rocks_dross.png"
|
|
651
|
+
end
|
|
652
|
+
end
|
|
653
|
+
____cond58 = ____cond58 or (____switch58 == BackdropType.ASHPIT or ____switch58 == BackdropType.ASHPIT_SHAFT)
|
|
654
|
+
if ____cond58 then
|
|
655
|
+
do
|
|
656
|
+
return "rocks_ashpit.png"
|
|
657
|
+
end
|
|
658
|
+
end
|
|
659
|
+
____cond58 = ____cond58 or ____switch58 == BackdropType.GEHENNA
|
|
660
|
+
if ____cond58 then
|
|
661
|
+
do
|
|
662
|
+
return "rocks_gehenna.png"
|
|
663
|
+
end
|
|
664
|
+
end
|
|
665
|
+
do
|
|
666
|
+
do
|
|
667
|
+
return "rocks_basement.png"
|
|
668
|
+
end
|
|
669
|
+
end
|
|
670
|
+
until true
|
|
671
|
+
end
|
|
404
672
|
--- Helper function to get the grid entities on the surrounding tiles from the provided grid entity.
|
|
405
673
|
--
|
|
406
674
|
-- For example, if a rock was surrounded by rocks on all sides, this would return an array of 8
|
|
@@ -592,12 +860,18 @@ end
|
|
|
592
860
|
function ____exports.setGridEntityType(self, gridEntity, gridEntityType)
|
|
593
861
|
gridEntity:SetType(gridEntityType)
|
|
594
862
|
local sprite = gridEntity:GetSprite()
|
|
595
|
-
local anm2Path =
|
|
596
|
-
if anm2Path
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
863
|
+
local anm2Path = ____exports.getGridEntityANM2Path(nil, gridEntityType)
|
|
864
|
+
if anm2Path == nil then
|
|
865
|
+
return
|
|
866
|
+
end
|
|
867
|
+
sprite:Load(anm2Path, false)
|
|
868
|
+
if gridEntityType == GridEntityType.ROCK then
|
|
869
|
+
local pngPath = ____exports.getRockPNGPath(nil)
|
|
870
|
+
sprite:ReplaceSpritesheet(0, pngPath)
|
|
600
871
|
end
|
|
872
|
+
sprite:LoadGraphics()
|
|
873
|
+
local defaultAnimation = sprite:GetDefaultAnimation()
|
|
874
|
+
sprite:Play(defaultAnimation, true)
|
|
601
875
|
end
|
|
602
876
|
--- Helper function to spawn a giant poop. This is performed by spawning each of the four quadrant
|
|
603
877
|
-- grid entities in the appropriate positions.
|
|
@@ -7,7 +7,7 @@ local RockAltType = ____RockAltType.RockAltType
|
|
|
7
7
|
____exports.BACKDROP_TYPE_TO_ROCK_ALT_TYPE = {
|
|
8
8
|
[BackdropType.BASEMENT] = RockAltType.URN,
|
|
9
9
|
[BackdropType.CELLAR] = RockAltType.URN,
|
|
10
|
-
[BackdropType.
|
|
10
|
+
[BackdropType.BURNING_BASEMENT] = RockAltType.URN,
|
|
11
11
|
[BackdropType.CAVES] = RockAltType.MUSHROOM,
|
|
12
12
|
[BackdropType.CATACOMBS] = RockAltType.MUSHROOM,
|
|
13
13
|
[BackdropType.FLOODED_CAVES] = RockAltType.MUSHROOM,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridEntityTypeToANM2Path.d.ts","sourceRoot":"","sources":["../../../src/objects/gridEntityTypeToANM2Path.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"gridEntityTypeToANM2Path.d.ts","sourceRoot":"","sources":["../../../src/objects/gridEntityTypeToANM2Path.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "52.0.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": "^
|
|
28
|
+
"isaac-typescript-definitions": "^22.0.0"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -2402,7 +2402,7 @@ export enum ModCallbackCustom {
|
|
|
2402
2402
|
* velocity: Vector,
|
|
2403
2403
|
* spawner: Entity | undefined,
|
|
2404
2404
|
* initSeed: Seed,
|
|
2405
|
-
* ): [EntityType, int, int, int] | undefined {}
|
|
2405
|
+
* ): [entityType: EntityType, variant: int, subType: int, seed: int] | undefined {}
|
|
2406
2406
|
* ```
|
|
2407
2407
|
*/
|
|
2408
2408
|
PRE_ENTITY_SPAWN_FILTER,
|
|
@@ -2586,7 +2586,7 @@ export enum ModCallbackCustom {
|
|
|
2586
2586
|
* subType: int,
|
|
2587
2587
|
* gridIndex: int,
|
|
2588
2588
|
* seed: Seed,
|
|
2589
|
-
* ): [EntityType | GridEntityXMLType, int, int] | undefined {}
|
|
2589
|
+
* ): [type: EntityType | GridEntityXMLType, variant: int, subType: int] | undefined {}
|
|
2590
2590
|
* ```
|
|
2591
2591
|
*/
|
|
2592
2592
|
PRE_ROOM_ENTITY_SPAWN_FILTER,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { GridEntityXMLType } from "isaac-typescript-definitions";
|
|
2
2
|
import {
|
|
3
|
+
BackdropType,
|
|
3
4
|
EffectVariant,
|
|
4
5
|
GridCollisionClass,
|
|
5
6
|
GridEntityType,
|
|
@@ -337,6 +338,135 @@ export function getGridEntitiesMap(
|
|
|
337
338
|
return gridEntityMap;
|
|
338
339
|
}
|
|
339
340
|
|
|
341
|
+
/** Helper function to get the ANM2 path for a grid entity type. */
|
|
342
|
+
export function getGridEntityANM2Path(
|
|
343
|
+
gridEntityType: GridEntityType,
|
|
344
|
+
): string | undefined {
|
|
345
|
+
switch (gridEntityType) {
|
|
346
|
+
// 1
|
|
347
|
+
case GridEntityType.DECORATION: {
|
|
348
|
+
return getGridEntityANM2PathDecoration();
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
default: {
|
|
352
|
+
return GRID_ENTITY_TYPE_TO_ANM2_PATH[gridEntityType];
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Helper function to get the ANM2 path for a decoration. This depends on the current room's
|
|
359
|
+
* backdrop. The values are taken from the "backdrops.xml" file.
|
|
360
|
+
*/
|
|
361
|
+
export function getGridEntityANM2PathDecoration(): string {
|
|
362
|
+
const room = game.GetRoom();
|
|
363
|
+
const backdropType = room.GetBackdropType();
|
|
364
|
+
|
|
365
|
+
switch (backdropType) {
|
|
366
|
+
// 1, 2, 3, 36, 49, 52
|
|
367
|
+
case BackdropType.BASEMENT:
|
|
368
|
+
case BackdropType.CELLAR:
|
|
369
|
+
case BackdropType.BURNING_BASEMENT:
|
|
370
|
+
case BackdropType.DOWNPOUR_ENTRANCE:
|
|
371
|
+
case BackdropType.ISAACS_BEDROOM:
|
|
372
|
+
case BackdropType.CLOSET: {
|
|
373
|
+
return "gfx/grid/Props_01_Basement.anm2";
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// 4, 5, 6, 37
|
|
377
|
+
case BackdropType.CAVES:
|
|
378
|
+
case BackdropType.CATACOMBS:
|
|
379
|
+
case BackdropType.FLOODED_CAVES:
|
|
380
|
+
case BackdropType.MINES_ENTRANCE: {
|
|
381
|
+
return "gfx/grid/Props_03_Caves.anm2";
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// 7, 8, 9, 30, 33, 38, 39, 40, 41, 42, 53, 60
|
|
385
|
+
case BackdropType.DEPTHS:
|
|
386
|
+
case BackdropType.NECROPOLIS:
|
|
387
|
+
case BackdropType.DANK_DEPTHS:
|
|
388
|
+
case BackdropType.SACRIFICE:
|
|
389
|
+
case BackdropType.MAUSOLEUM:
|
|
390
|
+
case BackdropType.MAUSOLEUM_ENTRANCE:
|
|
391
|
+
case BackdropType.CORPSE_ENTRANCE:
|
|
392
|
+
case BackdropType.MAUSOLEUM_2:
|
|
393
|
+
case BackdropType.MAUSOLEUM_3:
|
|
394
|
+
case BackdropType.MAUSOLEUM_4:
|
|
395
|
+
case BackdropType.CLOSET_B:
|
|
396
|
+
case BackdropType.DARK_CLOSET: {
|
|
397
|
+
return "gfx/grid/Props_05_Depths.anm2";
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// 10, 12
|
|
401
|
+
case BackdropType.WOMB:
|
|
402
|
+
case BackdropType.SCARRED_WOMB: {
|
|
403
|
+
return "gfx/grid/Props_07_The Womb.anm2";
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// 11
|
|
407
|
+
case BackdropType.UTERO: {
|
|
408
|
+
return "gfx/grid/Props_07_Utero.anm2";
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// 13, 27
|
|
412
|
+
case BackdropType.BLUE_WOMB:
|
|
413
|
+
case BackdropType.BLUE_WOMB_PASS: {
|
|
414
|
+
return "gfx/grid/Props_07_The Womb_blue.anm2";
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// 14, 47
|
|
418
|
+
case BackdropType.SHEOL:
|
|
419
|
+
case BackdropType.GEHENNA: {
|
|
420
|
+
return "gfx/grid/Props_09_Sheol.anm2";
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// 15
|
|
424
|
+
case BackdropType.CATHEDRAL: {
|
|
425
|
+
return "gfx/grid/Props_10_Cathedral.anm2";
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// 17
|
|
429
|
+
case BackdropType.CHEST: {
|
|
430
|
+
return "gfx/grid/Props_11_The Chest.anm2";
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// 28
|
|
434
|
+
case BackdropType.GREED_SHOP: {
|
|
435
|
+
return "gfx/grid/Props_12_Greed.anm2";
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// 31
|
|
439
|
+
case BackdropType.DOWNPOUR: {
|
|
440
|
+
return "gfx/grid/props_01x_downpour.anm2";
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// 32, 46, 58, 59
|
|
444
|
+
case BackdropType.MINES:
|
|
445
|
+
case BackdropType.ASHPIT:
|
|
446
|
+
case BackdropType.MINES_SHAFT:
|
|
447
|
+
case BackdropType.ASHPIT_SHAFT: {
|
|
448
|
+
return "gfx/grid/props_03x_mines.anm2";
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// 34, 43, 44, 48
|
|
452
|
+
case BackdropType.CORPSE:
|
|
453
|
+
case BackdropType.CORPSE_2:
|
|
454
|
+
case BackdropType.CORPSE_3:
|
|
455
|
+
case BackdropType.MORTIS: {
|
|
456
|
+
return "gfx/grid/props_07_the corpse.anm2";
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// 45
|
|
460
|
+
case BackdropType.DROSS: {
|
|
461
|
+
return "gfx/grid/props_02x_dross.anm2";
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
default: {
|
|
465
|
+
return "gfx/grid/Props_01_Basement.anm2";
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
340
470
|
/** Helper function to get the top left and bottom right corners of a given grid entity. */
|
|
341
471
|
export function getGridEntityCollisionPoints(gridEntity: GridEntity): {
|
|
342
472
|
topLeft: Vector;
|
|
@@ -388,6 +518,154 @@ export function getMatchingGridEntities(
|
|
|
388
518
|
);
|
|
389
519
|
}
|
|
390
520
|
|
|
521
|
+
/**
|
|
522
|
+
* Helper function to get the PNG path for a rock. This depends on the current room's backdrop. The
|
|
523
|
+
* values are taken from the "backdrops.xml" file.
|
|
524
|
+
*/
|
|
525
|
+
export function getRockPNGPath(): string {
|
|
526
|
+
const room = game.GetRoom();
|
|
527
|
+
const backdropType = room.GetBackdropType();
|
|
528
|
+
|
|
529
|
+
switch (backdropType) {
|
|
530
|
+
// 1, 17
|
|
531
|
+
case BackdropType.BASEMENT:
|
|
532
|
+
case BackdropType.CHEST: {
|
|
533
|
+
return "rocks_basement.png";
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// 2
|
|
537
|
+
case BackdropType.CELLAR: {
|
|
538
|
+
return "rocks_cellar.png";
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// 3
|
|
542
|
+
case BackdropType.BURNING_BASEMENT: {
|
|
543
|
+
return "rocks_burningbasement.png"; // cspell:ignore burningbasement
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// 4
|
|
547
|
+
case BackdropType.CAVES: {
|
|
548
|
+
return "rocks_caves.png";
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
// 5
|
|
552
|
+
case BackdropType.CATACOMBS: {
|
|
553
|
+
return "rocks_catacombs.png";
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
// 6
|
|
557
|
+
case BackdropType.FLOODED_CAVES: {
|
|
558
|
+
return "rocks_drownedcaves.png"; // cspell:ignore drownedcaves
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
// 7, 8, 9, 30, 60
|
|
562
|
+
case BackdropType.DEPTHS:
|
|
563
|
+
case BackdropType.NECROPOLIS:
|
|
564
|
+
case BackdropType.DANK_DEPTHS:
|
|
565
|
+
case BackdropType.SACRIFICE:
|
|
566
|
+
case BackdropType.DARK_CLOSET: {
|
|
567
|
+
return "rocks_depths.png";
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// 10
|
|
571
|
+
case BackdropType.WOMB: {
|
|
572
|
+
return "rocks_womb.png";
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
// 11
|
|
576
|
+
case BackdropType.UTERO: {
|
|
577
|
+
return "rocks_utero.png";
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// 12
|
|
581
|
+
case BackdropType.SCARRED_WOMB: {
|
|
582
|
+
return "rocks_scarredwomb.png"; // cspell:ignore scarredwomb
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
// 13, 27
|
|
586
|
+
case BackdropType.BLUE_WOMB:
|
|
587
|
+
case BackdropType.BLUE_WOMB_PASS: {
|
|
588
|
+
return "rocks_bluewomb.png"; // cspell:ignore bluewomb
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
// 14, 16
|
|
592
|
+
case BackdropType.SHEOL:
|
|
593
|
+
case BackdropType.DARK_ROOM: {
|
|
594
|
+
return "rocks_sheol.png";
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
// 15, 35
|
|
598
|
+
case BackdropType.CATHEDRAL:
|
|
599
|
+
case BackdropType.PLANETARIUM: {
|
|
600
|
+
return "rocks_cathedral.png";
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
// 23, 32, 37, 58
|
|
604
|
+
case BackdropType.SECRET:
|
|
605
|
+
case BackdropType.MINES:
|
|
606
|
+
case BackdropType.MINES_ENTRANCE:
|
|
607
|
+
case BackdropType.MINES_SHAFT: {
|
|
608
|
+
return "rocks_secretroom.png"; // cspell:ignore secretroom
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
// 31, 36
|
|
612
|
+
case BackdropType.DOWNPOUR:
|
|
613
|
+
case BackdropType.DOWNPOUR_ENTRANCE: {
|
|
614
|
+
return "rocks_downpour.png";
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
// 33, 38, 40, 41, 42
|
|
618
|
+
case BackdropType.MAUSOLEUM:
|
|
619
|
+
case BackdropType.MAUSOLEUM_ENTRANCE:
|
|
620
|
+
case BackdropType.MAUSOLEUM_2:
|
|
621
|
+
case BackdropType.MAUSOLEUM_3:
|
|
622
|
+
case BackdropType.MAUSOLEUM_4: {
|
|
623
|
+
return "rocks_mausoleum.png";
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
// 34, 48
|
|
627
|
+
case BackdropType.CORPSE:
|
|
628
|
+
case BackdropType.MORTIS: {
|
|
629
|
+
return "rocks_corpse.png";
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// 39
|
|
633
|
+
case BackdropType.CORPSE_ENTRANCE: {
|
|
634
|
+
return "rocks_corpseentrance.png"; // cspell:ignore corpseentrance
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
// 43
|
|
638
|
+
case BackdropType.CORPSE_2: {
|
|
639
|
+
return "rocks_corpse2.png";
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
// 44
|
|
643
|
+
case BackdropType.CORPSE_3: {
|
|
644
|
+
return "rocks_corpse3.png";
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
// 45
|
|
648
|
+
case BackdropType.DROSS: {
|
|
649
|
+
return "rocks_dross.png";
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
// 46, 59
|
|
653
|
+
case BackdropType.ASHPIT:
|
|
654
|
+
case BackdropType.ASHPIT_SHAFT: {
|
|
655
|
+
return "rocks_ashpit.png";
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
// 47
|
|
659
|
+
case BackdropType.GEHENNA: {
|
|
660
|
+
return "rocks_gehenna.png";
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
default: {
|
|
664
|
+
return "rocks_basement.png";
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
391
669
|
/**
|
|
392
670
|
* Helper function to get the grid entities on the surrounding tiles from the provided grid entity.
|
|
393
671
|
*
|
|
@@ -731,12 +1009,21 @@ export function setGridEntityType(
|
|
|
731
1009
|
gridEntity.SetType(gridEntityType);
|
|
732
1010
|
|
|
733
1011
|
const sprite = gridEntity.GetSprite();
|
|
734
|
-
const anm2Path =
|
|
735
|
-
if (anm2Path
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
1012
|
+
const anm2Path = getGridEntityANM2Path(gridEntityType);
|
|
1013
|
+
if (anm2Path === undefined) {
|
|
1014
|
+
return;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
sprite.Load(anm2Path, false);
|
|
1018
|
+
|
|
1019
|
+
if (gridEntityType === GridEntityType.ROCK) {
|
|
1020
|
+
const pngPath = getRockPNGPath();
|
|
1021
|
+
sprite.ReplaceSpritesheet(0, pngPath);
|
|
739
1022
|
}
|
|
1023
|
+
|
|
1024
|
+
sprite.LoadGraphics();
|
|
1025
|
+
const defaultAnimation = sprite.GetDefaultAnimation();
|
|
1026
|
+
sprite.Play(defaultAnimation, true);
|
|
740
1027
|
}
|
|
741
1028
|
|
|
742
1029
|
/**
|
|
@@ -5,7 +5,7 @@ import { RockAltType } from "../enums/RockAltType";
|
|
|
5
5
|
export const BACKDROP_TYPE_TO_ROCK_ALT_TYPE = {
|
|
6
6
|
[BackdropType.BASEMENT]: RockAltType.URN, // 1
|
|
7
7
|
[BackdropType.CELLAR]: RockAltType.URN, // 2
|
|
8
|
-
[BackdropType.
|
|
8
|
+
[BackdropType.BURNING_BASEMENT]: RockAltType.URN, // 3
|
|
9
9
|
[BackdropType.CAVES]: RockAltType.MUSHROOM, // 4
|
|
10
10
|
[BackdropType.CATACOMBS]: RockAltType.MUSHROOM, // 5
|
|
11
11
|
[BackdropType.FLOODED_CAVES]: RockAltType.MUSHROOM, // 6
|
|
@@ -4,22 +4,8 @@ import { GridEntityType } from "isaac-typescript-definitions";
|
|
|
4
4
|
|
|
5
5
|
export const GRID_ENTITY_TYPE_TO_ANM2_PATH = {
|
|
6
6
|
[GridEntityType.NULL]: undefined, // 0
|
|
7
|
+
// There are more decoration ANM2 files; see the `getGridEntityANM2Path` function.
|
|
7
8
|
[GridEntityType.DECORATION]: "gfx/grid/Props_01_Basement.anm2", // 1
|
|
8
|
-
// Also there is:
|
|
9
|
-
// - props_03_caves.anm2
|
|
10
|
-
// - props_05_depths.anm2
|
|
11
|
-
// - props_07_the womb.anm2
|
|
12
|
-
// - props_07_utero.anm2
|
|
13
|
-
// - props_07_the womb_blue.anm2
|
|
14
|
-
// - props_09_sheol.anm2
|
|
15
|
-
// - props_10_cathedral.anm2
|
|
16
|
-
// - props_11_the chest.anm2
|
|
17
|
-
// - props_12_greed.anm2
|
|
18
|
-
// - props_01x_downpour.anm2
|
|
19
|
-
// - props_02x_dross.anm2
|
|
20
|
-
// - props_03x_mines.anm2
|
|
21
|
-
// - props_07_the corpse.anm2
|
|
22
|
-
// - props_0ex_isaacs_bedroom.anm2
|
|
23
9
|
[GridEntityType.ROCK]: "gfx/grid/grid_rock.anm2", // 2
|
|
24
10
|
[GridEntityType.BLOCK]: "gfx/grid/grid_rock.anm2", // 3
|
|
25
11
|
[GridEntityType.ROCK_TINTED]: "gfx/grid/grid_rock.anm2", // 4
|