isaacscript-common 6.3.0 → 6.5.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/cachedClasses.d.ts +15 -0
- package/cachedClasses.lua +20 -0
- package/constants.d.ts +17 -4
- package/constants.lua +13 -4
- package/enums/DecorationVariant.d.ts +9 -0
- package/enums/DecorationVariant.lua +7 -0
- package/enums/RockAltType.d.ts +7 -0
- package/enums/RockAltType.lua +13 -0
- package/features/customGridEntity.d.ts +2 -2
- package/features/customGridEntity.lua +7 -5
- package/features/customStage/backdrop.lua +11 -18
- package/features/customStage/customStageConstants.d.ts +1 -0
- package/features/customStage/customStageConstants.lua +3 -0
- package/features/customStage/exports.d.ts +27 -0
- package/features/customStage/exports.lua +33 -3
- package/features/customStage/gridEntities.d.ts +18 -0
- package/features/customStage/gridEntities.lua +215 -0
- package/features/customStage/init.lua +57 -8
- package/features/customStage/shadows.d.ts +3 -0
- package/features/customStage/shadows.lua +58 -0
- package/features/customStage/streakText.d.ts +3 -0
- package/features/customStage/streakText.lua +29 -0
- package/features/customStage/v.d.ts +6 -0
- package/features/customStage/v.lua +3 -1
- package/features/customStage/versusScreen.d.ts +3 -0
- package/features/customStage/versusScreen.lua +201 -0
- package/features/deployJSONRoom.lua +6 -2
- package/features/extraConsoleCommands/init.lua +2 -0
- package/features/extraConsoleCommands/listCommands.d.ts +9 -2
- package/features/extraConsoleCommands/listCommands.lua +20 -4
- package/features/saveDataManager/exports.lua +2 -2
- package/features/saveDataManager/load.lua +3 -3
- package/features/saveDataManager/main.lua +3 -3
- package/features/saveDataManager/merge.lua +2 -2
- package/features/saveDataManager/save.lua +3 -3
- package/features/saveDataManager/{constants.d.ts → saveDataManagerConstants.d.ts} +0 -0
- package/features/saveDataManager/{constants.lua → saveDataManagerConstants.lua} +0 -0
- package/functions/color.d.ts +0 -2
- package/functions/color.lua +0 -4
- package/functions/deepCopy.lua +2 -2
- package/functions/doors.d.ts +10 -5
- package/functions/doors.lua +20 -17
- package/functions/entity.d.ts +5 -0
- package/functions/entity.lua +13 -0
- package/functions/gridEntity.d.ts +39 -0
- package/functions/gridEntity.lua +83 -2
- package/functions/kColor.d.ts +0 -2
- package/functions/kColor.lua +0 -4
- package/functions/log.lua +2 -1
- package/functions/pickups.d.ts +9 -9
- package/functions/run.d.ts +7 -0
- package/functions/run.lua +16 -4
- package/functions/ui.d.ts +2 -0
- package/functions/ui.lua +8 -0
- package/functions/utils.d.ts +6 -4
- package/functions/utils.lua +6 -4
- package/interfaces/CustomStageLua.d.ts +271 -63
- package/objects/backdropTypeToRockAltType.d.ts +6 -0
- package/objects/backdropTypeToRockAltType.lua +69 -0
- package/objects/bossNamePNGFileNames.d.ts +5 -0
- package/objects/bossNamePNGFileNames.lua +108 -0
- package/objects/bossPortraitPNGFileNames.d.ts +5 -0
- package/objects/bossPortraitPNGFileNames.lua +108 -0
- package/objects/colors.d.ts +15 -8
- package/objects/colors.lua +9 -2
- package/objects/playerNamePNGFileNames.d.ts +5 -0
- package/objects/playerNamePNGFileNames.lua +49 -0
- package/objects/playerPortraitPNGFileNames.d.ts +5 -0
- package/objects/playerPortraitPNGFileNames.lua +49 -0
- package/objects/versusScreenBackgroundColors.d.ts +5 -0
- package/objects/versusScreenBackgroundColors.lua +38 -0
- package/objects/versusScreenDirtSpotColors.d.ts +5 -0
- package/objects/versusScreenDirtSpotColors.lua +38 -0
- package/package.json +2 -2
- package/features/customStage/boss.d.ts +0 -2
- package/features/customStage/boss.lua +0 -74
- package/features/customStage/stageAPIBoss.d.ts +0 -29
- package/features/customStage/stageAPIBoss.lua +0 -9
package/cachedClasses.d.ts
CHANGED
|
@@ -38,3 +38,18 @@ export declare const musicManager: MusicManager;
|
|
|
38
38
|
* `Room`) is not safe and can lead to the game crashing in certain situations.
|
|
39
39
|
*/
|
|
40
40
|
export declare const sfxManager: SFXManager;
|
|
41
|
+
/**
|
|
42
|
+
* An object containing all 7 vanilla fonts that are pre-loaded and ready to use.
|
|
43
|
+
*
|
|
44
|
+
* For more information on the vanilla fonts and to see what they look like, see:
|
|
45
|
+
* https://wofsauge.github.io/IsaacDocs/rep/tutorials/Tutorial-Rendertext.html
|
|
46
|
+
*/
|
|
47
|
+
export declare const fonts: {
|
|
48
|
+
readonly droid: Font;
|
|
49
|
+
readonly pfTempestaSevenCondensed: Font;
|
|
50
|
+
readonly teamMeatFont10: Font;
|
|
51
|
+
readonly teamMeatFont12: Font;
|
|
52
|
+
readonly teamMeatFont16Bold: Font;
|
|
53
|
+
readonly terminus: Font;
|
|
54
|
+
readonly upheaval: Font;
|
|
55
|
+
};
|
package/cachedClasses.lua
CHANGED
|
@@ -27,4 +27,24 @@ ____exports.musicManager = MusicManager()
|
|
|
27
27
|
-- Caching the results of this constructor is safe, but caching other classes (like `Level` or
|
|
28
28
|
-- `Room`) is not safe and can lead to the game crashing in certain situations.
|
|
29
29
|
____exports.sfxManager = SFXManager()
|
|
30
|
+
--- An object containing all 7 vanilla fonts that are pre-loaded and ready to use.
|
|
31
|
+
--
|
|
32
|
+
-- For more information on the vanilla fonts and to see what they look like, see:
|
|
33
|
+
-- https://wofsauge.github.io/IsaacDocs/rep/tutorials/Tutorial-Rendertext.html
|
|
34
|
+
____exports.fonts = {
|
|
35
|
+
droid = Font(),
|
|
36
|
+
pfTempestaSevenCondensed = Font(),
|
|
37
|
+
teamMeatFont10 = Font(),
|
|
38
|
+
teamMeatFont12 = Font(),
|
|
39
|
+
teamMeatFont16Bold = Font(),
|
|
40
|
+
terminus = Font(),
|
|
41
|
+
upheaval = Font()
|
|
42
|
+
}
|
|
43
|
+
____exports.fonts.droid:Load("font/droid.fnt")
|
|
44
|
+
____exports.fonts.pfTempestaSevenCondensed:Load("font/pftempestasevencondensed.fnt")
|
|
45
|
+
____exports.fonts.teamMeatFont10:Load("font/teammeatfont10.fnt")
|
|
46
|
+
____exports.fonts.teamMeatFont12:Load("font/teammeatfont12.fnt")
|
|
47
|
+
____exports.fonts.teamMeatFont16Bold:Load("font/teammeatfont16bold.fnt")
|
|
48
|
+
____exports.fonts.terminus:Load("font/terminus.fnt")
|
|
49
|
+
____exports.fonts.upheaval:Load("font/upheaval.fnt")
|
|
30
50
|
return ____exports
|
package/constants.d.ts
CHANGED
|
@@ -115,12 +115,25 @@ export declare const TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE = 10000;
|
|
|
115
115
|
*/
|
|
116
116
|
export declare const UI_HEART_WIDTH = 12;
|
|
117
117
|
/**
|
|
118
|
-
* This is a safer version of the `Vector.One` constant. (Other mods can mutate
|
|
119
|
-
*
|
|
118
|
+
* This is a safer version of the `Vector.One` constant. (Other mods can mutate `Vector.One`, so it
|
|
119
|
+
* is not safe to use.)
|
|
120
120
|
*/
|
|
121
121
|
export declare const VectorOne: Readonly<Vector>;
|
|
122
122
|
/**
|
|
123
|
-
* This is a safer version of the `Vector.Zero` constant. (Other mods can mutate `Vector.Zero
|
|
124
|
-
*
|
|
123
|
+
* This is a safer version of the `Vector.Zero` constant. (Other mods can mutate `Vector.Zero`, so
|
|
124
|
+
* it is not safe to use.)
|
|
125
125
|
*/
|
|
126
126
|
export declare const VectorZero: Readonly<Vector>;
|
|
127
|
+
/**
|
|
128
|
+
* This is a safer version of the `Color.Default` constant. (Other mods can mutate `Color.Default`,
|
|
129
|
+
* so it is not safe to use.)
|
|
130
|
+
*
|
|
131
|
+
* If you need to mutate this, make a copy first with the `copyColor` helper function.
|
|
132
|
+
*/
|
|
133
|
+
export declare const ColorDefault: Readonly<Color>;
|
|
134
|
+
/**
|
|
135
|
+
* Equal to `KColor(1, 1, 1, 1)`.
|
|
136
|
+
*
|
|
137
|
+
* If you need to mutate this, make a copy first with the `copyKColor` helper function.
|
|
138
|
+
*/
|
|
139
|
+
export declare const KColorDefault: Readonly<KColor>;
|
package/constants.lua
CHANGED
|
@@ -97,10 +97,19 @@ ____exports.TAINTED_SAMSON_BERSERK_CHARGE_FROM_TAKING_DAMAGE = 10000
|
|
|
97
97
|
--- This is the number of draw coordinates that each heart spans on the UI in the upper left hand
|
|
98
98
|
-- corner.
|
|
99
99
|
____exports.UI_HEART_WIDTH = 12
|
|
100
|
-
--- This is a safer version of the `Vector.One` constant. (Other mods can mutate
|
|
101
|
-
--
|
|
100
|
+
--- This is a safer version of the `Vector.One` constant. (Other mods can mutate `Vector.One`, so it
|
|
101
|
+
-- is not safe to use.)
|
|
102
102
|
____exports.VectorOne = Vector(1, 1)
|
|
103
|
-
--- This is a safer version of the `Vector.Zero` constant. (Other mods can mutate `Vector.Zero
|
|
104
|
-
--
|
|
103
|
+
--- This is a safer version of the `Vector.Zero` constant. (Other mods can mutate `Vector.Zero`, so
|
|
104
|
+
-- it is not safe to use.)
|
|
105
105
|
____exports.VectorZero = Vector(0, 0)
|
|
106
|
+
--- This is a safer version of the `Color.Default` constant. (Other mods can mutate `Color.Default`,
|
|
107
|
+
-- so it is not safe to use.)
|
|
108
|
+
--
|
|
109
|
+
-- If you need to mutate this, make a copy first with the `copyColor` helper function.
|
|
110
|
+
____exports.ColorDefault = Color(1, 1, 1)
|
|
111
|
+
--- Equal to `KColor(1, 1, 1, 1)`.
|
|
112
|
+
--
|
|
113
|
+
-- If you need to mutate this, make a copy first with the `copyKColor` helper function.
|
|
114
|
+
____exports.KColorDefault = KColor(1, 1, 1, 1)
|
|
106
115
|
return ____exports
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare enum DecorationVariant {
|
|
2
|
+
VANILLA_DECORATION = 0,
|
|
3
|
+
/**
|
|
4
|
+
* The vanilla game does not support any custom grid entities. Under the hood, IsaacScript allows
|
|
5
|
+
* for custom grid entities by using decorations with this variant to represent custom grid
|
|
6
|
+
* entities.
|
|
7
|
+
*/
|
|
8
|
+
CUSTOM_GRID_ENTITY = 1
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
____exports.DecorationVariant = {}
|
|
3
|
+
____exports.DecorationVariant.VANILLA_DECORATION = 0
|
|
4
|
+
____exports.DecorationVariant[____exports.DecorationVariant.VANILLA_DECORATION] = "VANILLA_DECORATION"
|
|
5
|
+
____exports.DecorationVariant.CUSTOM_GRID_ENTITY = 1
|
|
6
|
+
____exports.DecorationVariant[____exports.DecorationVariant.CUSTOM_GRID_ENTITY] = "CUSTOM_GRID_ENTITY"
|
|
7
|
+
return ____exports
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
____exports.RockAltType = {}
|
|
3
|
+
____exports.RockAltType.URN = 0
|
|
4
|
+
____exports.RockAltType[____exports.RockAltType.URN] = "URN"
|
|
5
|
+
____exports.RockAltType.MUSHROOM = 1
|
|
6
|
+
____exports.RockAltType[____exports.RockAltType.MUSHROOM] = "MUSHROOM"
|
|
7
|
+
____exports.RockAltType.SKULL = 2
|
|
8
|
+
____exports.RockAltType[____exports.RockAltType.SKULL] = "SKULL"
|
|
9
|
+
____exports.RockAltType.POLYP = 3
|
|
10
|
+
____exports.RockAltType[____exports.RockAltType.POLYP] = "POLYP"
|
|
11
|
+
____exports.RockAltType.BUCKET = 4
|
|
12
|
+
____exports.RockAltType[____exports.RockAltType.BUCKET] = "BUCKET"
|
|
13
|
+
return ____exports
|
|
@@ -3,8 +3,8 @@ import { GridCollisionClass, GridEntityType } from "isaac-typescript-definitions
|
|
|
3
3
|
* Helper function to spawn a custom grid entity.
|
|
4
4
|
*
|
|
5
5
|
* This is an IsaacScript feature because the vanilla game does not support any custom grid
|
|
6
|
-
* entities. Under the hood, IsaacScript accomplishes this by using decorations
|
|
7
|
-
* grid entities.
|
|
6
|
+
* entities. Under the hood, IsaacScript accomplishes this by using decorations with an arbitrary
|
|
7
|
+
* non-zero variant to represent custom grid entities.
|
|
8
8
|
*
|
|
9
9
|
* Once a custom grid entity is spawned, you can take advantage of the custom grid callbacks such as
|
|
10
10
|
* `POST_GRID_ENTITY_CUSTOM_UPDATE`.
|
|
@@ -10,13 +10,15 @@ local ____cachedClasses = require("cachedClasses")
|
|
|
10
10
|
local game = ____cachedClasses.game
|
|
11
11
|
local ____DefaultMap = require("classes.DefaultMap")
|
|
12
12
|
local DefaultMap = ____DefaultMap.DefaultMap
|
|
13
|
+
local ____DecorationVariant = require("enums.DecorationVariant")
|
|
14
|
+
local DecorationVariant = ____DecorationVariant.DecorationVariant
|
|
13
15
|
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
|
|
14
16
|
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
15
17
|
local ____featuresInitialized = require("featuresInitialized")
|
|
16
18
|
local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
|
|
17
19
|
local ____gridEntity = require("functions.gridEntity")
|
|
18
20
|
local removeGrid = ____gridEntity.removeGrid
|
|
19
|
-
local
|
|
21
|
+
local spawnGridWithVariant = ____gridEntity.spawnGridWithVariant
|
|
20
22
|
local ____roomData = require("functions.roomData")
|
|
21
23
|
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
22
24
|
local ____vector = require("functions.vector")
|
|
@@ -60,8 +62,8 @@ end
|
|
|
60
62
|
--- Helper function to spawn a custom grid entity.
|
|
61
63
|
--
|
|
62
64
|
-- This is an IsaacScript feature because the vanilla game does not support any custom grid
|
|
63
|
-
-- entities. Under the hood, IsaacScript accomplishes this by using decorations
|
|
64
|
-
-- grid entities.
|
|
65
|
+
-- entities. Under the hood, IsaacScript accomplishes this by using decorations with an arbitrary
|
|
66
|
+
-- non-zero variant to represent custom grid entities.
|
|
65
67
|
--
|
|
66
68
|
-- Once a custom grid entity is spawned, you can take advantage of the custom grid callbacks such as
|
|
67
69
|
-- `POST_GRID_ENTITY_CUSTOM_UPDATE`.
|
|
@@ -84,8 +86,8 @@ function ____exports.spawnCustomGrid(self, gridEntityTypeCustom, gridIndexOrPosi
|
|
|
84
86
|
local roomListIndex = getRoomListIndex(nil)
|
|
85
87
|
local gridIndex = isVector(nil, gridIndexOrPosition) and room:GetGridIndex(gridIndexOrPosition) or gridIndexOrPosition
|
|
86
88
|
local existingGridEntity = room:GetGridEntity(gridIndex)
|
|
87
|
-
local isExistingDecoration = existingGridEntity ~= nil and existingGridEntity:GetType() == GridEntityType.DECORATION
|
|
88
|
-
local decoration = isExistingDecoration and existingGridEntity or
|
|
89
|
+
local isExistingDecoration = existingGridEntity ~= nil and existingGridEntity:GetType() == GridEntityType.DECORATION and existingGridEntity:GetVariant() == DecorationVariant.CUSTOM_GRID_ENTITY
|
|
90
|
+
local decoration = isExistingDecoration and existingGridEntity or spawnGridWithVariant(nil, GridEntityType.DECORATION, DecorationVariant.CUSTOM_GRID_ENTITY, gridIndexOrPosition)
|
|
89
91
|
if decoration == nil then
|
|
90
92
|
error("Failed to spawn a decoration for a custom grid entity.")
|
|
91
93
|
end
|
|
@@ -2,7 +2,7 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local Set = ____lualib.Set
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
4
|
local ____exports = {}
|
|
5
|
-
local getBackdropPNGPath, spawnWallEntity, spawnSecondWallEntity, spawnFloorEntity, getNumFloorLayers, BackdropKind,
|
|
5
|
+
local getBackdropPNGPath, spawnWallEntity, spawnSecondWallEntity, spawnFloorEntity, getNumFloorLayers, BackdropKind, DEFAULT_BACKDROP, ROOM_SHAPE_WALL_ANM2_LAYERS, ROOM_SHAPE_WALL_EXTRA_ANM2_LAYERS, WALL_OFFSET, BACKDROP_EFFECT_VARIANT
|
|
6
6
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
7
|
local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
|
|
8
8
|
local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
|
|
@@ -26,25 +26,26 @@ local trimPrefix = ____string.trimPrefix
|
|
|
26
26
|
local ____utils = require("functions.utils")
|
|
27
27
|
local erange = ____utils.erange
|
|
28
28
|
local irange = ____utils.irange
|
|
29
|
+
local ____customStageConstants = require("features.customStage.customStageConstants")
|
|
30
|
+
local ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH = ____customStageConstants.ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH
|
|
29
31
|
function getBackdropPNGPath(self, customStage, backdropKind, rng)
|
|
30
|
-
local
|
|
31
|
-
local
|
|
32
|
-
return (
|
|
32
|
+
local backdrop = customStage.backdropPNGPaths == nil and DEFAULT_BACKDROP or customStage.backdropPNGPaths
|
|
33
|
+
local pathArray = backdrop[backdropKind]
|
|
34
|
+
return getRandomArrayElement(nil, pathArray, rng)
|
|
33
35
|
end
|
|
34
36
|
function spawnWallEntity(self, customStage, rng, isExtraWall)
|
|
35
37
|
local room = game:GetRoom()
|
|
36
38
|
local roomShape = room:GetRoomShape()
|
|
37
|
-
local subType = isExtraWall and BackdropEntitySubType.WALL_EXTRA or BackdropEntitySubType.WALL
|
|
38
39
|
local wallEffect = spawnEffectWithSeed(
|
|
39
40
|
nil,
|
|
40
41
|
BACKDROP_EFFECT_VARIANT,
|
|
41
|
-
|
|
42
|
+
0,
|
|
42
43
|
VectorZero,
|
|
43
44
|
1
|
|
44
45
|
)
|
|
45
46
|
wallEffect:AddEntityFlags(EntityFlag.RENDER_WALL)
|
|
46
47
|
local sprite = wallEffect:GetSprite()
|
|
47
|
-
sprite:Load("
|
|
48
|
+
sprite:Load(ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH .. "/wall-backdrop.anm2", false)
|
|
48
49
|
local wallLayersArray = isExtraWall and ROOM_SHAPE_WALL_EXTRA_ANM2_LAYERS or ROOM_SHAPE_WALL_ANM2_LAYERS
|
|
49
50
|
local numWallLayers = wallLayersArray[roomShape]
|
|
50
51
|
if numWallLayers == nil then
|
|
@@ -83,13 +84,13 @@ function spawnFloorEntity(self, customStage, rng)
|
|
|
83
84
|
local floorEffect = spawnEffectWithSeed(
|
|
84
85
|
nil,
|
|
85
86
|
BACKDROP_EFFECT_VARIANT,
|
|
86
|
-
|
|
87
|
+
0,
|
|
87
88
|
VectorZero,
|
|
88
89
|
1
|
|
89
90
|
)
|
|
90
91
|
floorEffect:AddEntityFlags(EntityFlag.RENDER_FLOOR)
|
|
91
92
|
local sprite = floorEffect:GetSprite()
|
|
92
|
-
sprite:Load("
|
|
93
|
+
sprite:Load(ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH .. "/floor-backdrop.anm2", false)
|
|
93
94
|
local numFloorLayers = getNumFloorLayers(nil, roomShape)
|
|
94
95
|
if numFloorLayers ~= nil then
|
|
95
96
|
for ____, layerID in ipairs(erange(nil, 0, numFloorLayers)) do
|
|
@@ -151,15 +152,7 @@ BackdropKind.N_FLOOR = "nFloors"
|
|
|
151
152
|
BackdropKind.L_FLOOR = "lFloors"
|
|
152
153
|
BackdropKind.WALL = "walls"
|
|
153
154
|
BackdropKind.CORNER = "corners"
|
|
154
|
-
|
|
155
|
-
BackdropEntitySubType.VANILLA_LADDER = 0
|
|
156
|
-
BackdropEntitySubType[BackdropEntitySubType.VANILLA_LADDER] = "VANILLA_LADDER"
|
|
157
|
-
BackdropEntitySubType.WALL = 1
|
|
158
|
-
BackdropEntitySubType[BackdropEntitySubType.WALL] = "WALL"
|
|
159
|
-
BackdropEntitySubType.WALL_EXTRA = 2
|
|
160
|
-
BackdropEntitySubType[BackdropEntitySubType.WALL_EXTRA] = "WALL_EXTRA"
|
|
161
|
-
BackdropEntitySubType.FLOOR = 3
|
|
162
|
-
BackdropEntitySubType[BackdropEntitySubType.FLOOR] = "FLOOR"
|
|
155
|
+
DEFAULT_BACKDROP = {nFloors = {ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH .. "/backdrop/nfloor.png"}, lFloors = {ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH .. "/backdrop/lfloor.png"}, walls = {ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH .. "/backdrop/wall.png"}, corners = {ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH .. "/backdrop/corner.png"}}
|
|
163
156
|
ROOM_SHAPE_WALL_ANM2_LAYERS = {
|
|
164
157
|
[RoomShape.SHAPE_1x1] = 44,
|
|
165
158
|
[RoomShape.IH] = 36,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH = "gfx/isaacscript-custom-stage";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EntityType } from "isaac-typescript-definitions";
|
|
1
2
|
/**
|
|
2
3
|
* Helper function to warp to a custom stage/level.
|
|
3
4
|
*
|
|
@@ -6,3 +7,29 @@
|
|
|
6
7
|
*/
|
|
7
8
|
export declare function setCustomStage(name: string, verbose?: boolean): void;
|
|
8
9
|
export declare function setCustomStageDebug(): void;
|
|
10
|
+
/**
|
|
11
|
+
* By default, unknown bosses will be drawn on the boss "versus" screen as "???". If your custom
|
|
12
|
+
* stage has custom bosses, you can use this function to register the corresponding graphic file
|
|
13
|
+
* files for them.
|
|
14
|
+
*
|
|
15
|
+
* For reference:
|
|
16
|
+
* - The vanilla name sprite for Monstro is located at "C:\Program Files
|
|
17
|
+
* (x86)\Steam\steamapps\common\The Binding of Isaac
|
|
18
|
+
* Rebirth\resources\gfx\ui\boss\bossname_20.0_monstro.png".
|
|
19
|
+
* - The vanilla portrait sprite for Monstro is located at "C:\Program Files
|
|
20
|
+
* (x86)\Steam\steamapps\common\The Binding of Isaac
|
|
21
|
+
* Rebirth\resources\gfx\ui\boss\portrait_20.0_monstro.png".
|
|
22
|
+
*
|
|
23
|
+
* (Note that boss metadata like this cannot be specified with the rest of the custom stage metadata
|
|
24
|
+
* in the "tsconfig.json" file because there is not a way to retrieve the name of an entity at
|
|
25
|
+
* run-time.)
|
|
26
|
+
*
|
|
27
|
+
* @param entityType The entity type of the custom boss.
|
|
28
|
+
* @param variant The variant of the custom boss.
|
|
29
|
+
* @param subType The sub-type of the custom boss.
|
|
30
|
+
* @param namePNGPath The full path to the PNG file that contains the name of the boss that will be
|
|
31
|
+
* displayed on the top of the boss "versus" screen.
|
|
32
|
+
* @param portraitPNGPath The full path to the PNG file that contains the portrait of the boss that
|
|
33
|
+
* will be displayed on the right side of the boss "versus" screen.
|
|
34
|
+
*/
|
|
35
|
+
export declare function registerCustomBoss(entityType: EntityType, variant: int, subType: int, namePNGPath: string, portraitPNGPath: string): void;
|
|
@@ -13,6 +13,8 @@ local ____cachedClasses = require("cachedClasses")
|
|
|
13
13
|
local game = ____cachedClasses.game
|
|
14
14
|
local ____reorderedCallbacks = require("callbacks.reorderedCallbacks")
|
|
15
15
|
local reorderedCallbacksSetStage = ____reorderedCallbacks.reorderedCallbacksSetStage
|
|
16
|
+
local ____entity = require("functions.entity")
|
|
17
|
+
local getEntityIDFromConstituents = ____entity.getEntityIDFromConstituents
|
|
16
18
|
local ____log = require("functions.log")
|
|
17
19
|
local log = ____log.log
|
|
18
20
|
local logError = ____log.logError
|
|
@@ -29,14 +31,15 @@ local getGotoCommand = ____stage.getGotoCommand
|
|
|
29
31
|
local setStage = ____stage.setStage
|
|
30
32
|
local ____runNextRoom = require("features.runNextRoom")
|
|
31
33
|
local runNextRoom = ____runNextRoom.runNextRoom
|
|
32
|
-
local ____boss = require("features.customStage.boss")
|
|
33
|
-
local playBossRoomAnimation = ____boss.playBossRoomAnimation
|
|
34
34
|
local ____util = require("features.customStage.util")
|
|
35
35
|
local getRandomCustomStageRoom = ____util.getRandomCustomStageRoom
|
|
36
36
|
local ____v = require("features.customStage.v")
|
|
37
37
|
local v = ____v.default
|
|
38
|
+
local customBossPNGPaths = ____v.customBossPNGPaths
|
|
38
39
|
local customStageCachedRoomData = ____v.customStageCachedRoomData
|
|
39
40
|
local customStagesMap = ____v.customStagesMap
|
|
41
|
+
local ____versusScreen = require("features.customStage.versusScreen")
|
|
42
|
+
local playVersusScreenAnimation = ____versusScreen.playVersusScreenAnimation
|
|
40
43
|
function postRoomTransition(self)
|
|
41
44
|
movePlayersToCenter(nil)
|
|
42
45
|
end
|
|
@@ -116,6 +119,33 @@ function ____exports.setCustomStageDebug(self)
|
|
|
116
119
|
log("No custom stage is currently loaded.")
|
|
117
120
|
return
|
|
118
121
|
end
|
|
119
|
-
|
|
122
|
+
playVersusScreenAnimation(nil, customStage, true)
|
|
123
|
+
end
|
|
124
|
+
--- By default, unknown bosses will be drawn on the boss "versus" screen as "???". If your custom
|
|
125
|
+
-- stage has custom bosses, you can use this function to register the corresponding graphic file
|
|
126
|
+
-- files for them.
|
|
127
|
+
--
|
|
128
|
+
-- For reference:
|
|
129
|
+
-- - The vanilla name sprite for Monstro is located at "C:\Program Files
|
|
130
|
+
-- (x86)\Steam\steamapps\common\The Binding of Isaac
|
|
131
|
+
-- Rebirth\resources\gfx\ui\boss\bossname_20.0_monstro.png".
|
|
132
|
+
-- - The vanilla portrait sprite for Monstro is located at "C:\Program Files
|
|
133
|
+
-- (x86)\Steam\steamapps\common\The Binding of Isaac
|
|
134
|
+
-- Rebirth\resources\gfx\ui\boss\portrait_20.0_monstro.png".
|
|
135
|
+
--
|
|
136
|
+
-- (Note that boss metadata like this cannot be specified with the rest of the custom stage metadata
|
|
137
|
+
-- in the "tsconfig.json" file because there is not a way to retrieve the name of an entity at
|
|
138
|
+
-- run-time.)
|
|
139
|
+
--
|
|
140
|
+
-- @param entityType The entity type of the custom boss.
|
|
141
|
+
-- @param variant The variant of the custom boss.
|
|
142
|
+
-- @param subType The sub-type of the custom boss.
|
|
143
|
+
-- @param namePNGPath The full path to the PNG file that contains the name of the boss that will be
|
|
144
|
+
-- displayed on the top of the boss "versus" screen.
|
|
145
|
+
-- @param portraitPNGPath The full path to the PNG file that contains the portrait of the boss that
|
|
146
|
+
-- will be displayed on the right side of the boss "versus" screen.
|
|
147
|
+
function ____exports.registerCustomBoss(self, entityType, variant, subType, namePNGPath, portraitPNGPath)
|
|
148
|
+
local entityID = getEntityIDFromConstituents(nil, entityType, variant, subType)
|
|
149
|
+
customBossPNGPaths:set(entityID, {namePNGPath, portraitPNGPath})
|
|
120
150
|
end
|
|
121
151
|
return ____exports
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
import { CustomStage } from "../../interfaces/CustomStage";
|
|
3
|
+
/** For `GridEntityType.DECORATION` (1) */
|
|
4
|
+
export declare function setCustomDecorationGraphics(customStage: CustomStage, gridEntity: GridEntity): void;
|
|
5
|
+
/** For `GridEntityType.ROCK` (2) */
|
|
6
|
+
export declare function setCustomRockGraphics(customStage: CustomStage, gridEntity: GridEntity): void;
|
|
7
|
+
/** For `GridEntityType.PIT` (7) */
|
|
8
|
+
export declare function setCustomPitGraphics(customStage: CustomStage, gridEntity: GridEntity): void;
|
|
9
|
+
/** For GridEntityType.DOOR (16) */
|
|
10
|
+
export declare function setCustomDoorGraphics(customStage: CustomStage, gridEntity: GridEntity): void;
|
|
11
|
+
/**
|
|
12
|
+
* The rewards are based on the ones from the wiki:
|
|
13
|
+
* https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Urns
|
|
14
|
+
*
|
|
15
|
+
* On the bugged stage of -1, only urns will spawn, so we do not have to handle the case of mushroom
|
|
16
|
+
* rewards, skull rewards, and so on.
|
|
17
|
+
*/
|
|
18
|
+
export declare function removeUrnRewards(customStage: CustomStage, gridEntity: GridEntity): void;
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local getNewDoorPNGPath, removeEntitiesSpawnedFromGridEntity
|
|
5
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
6
|
+
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
7
|
+
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
8
|
+
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
9
|
+
local ____DecorationVariant = require("enums.DecorationVariant")
|
|
10
|
+
local DecorationVariant = ____DecorationVariant.DecorationVariant
|
|
11
|
+
local ____entity = require("functions.entity")
|
|
12
|
+
local removeEntities = ____entity.removeEntities
|
|
13
|
+
local ____entitySpecific = require("functions.entitySpecific")
|
|
14
|
+
local getNPCs = ____entitySpecific.getNPCs
|
|
15
|
+
local ____pickups = require("functions.pickups")
|
|
16
|
+
local getCoins = ____pickups.getCoins
|
|
17
|
+
local getCollectibles = ____pickups.getCollectibles
|
|
18
|
+
local getTrinkets = ____pickups.getTrinkets
|
|
19
|
+
local ____vector = require("functions.vector")
|
|
20
|
+
local vectorEquals = ____vector.vectorEquals
|
|
21
|
+
function getNewDoorPNGPath(self, customStage, fileName)
|
|
22
|
+
repeat
|
|
23
|
+
local ____switch16 = fileName
|
|
24
|
+
local ____cond16 = ____switch16 == "gfx/grid/door_01_normaldoor.anm2"
|
|
25
|
+
if ____cond16 then
|
|
26
|
+
do
|
|
27
|
+
local ____customStage_doorPNGPaths_normal_0 = customStage.doorPNGPaths
|
|
28
|
+
if ____customStage_doorPNGPaths_normal_0 ~= nil then
|
|
29
|
+
____customStage_doorPNGPaths_normal_0 = ____customStage_doorPNGPaths_normal_0.normal
|
|
30
|
+
end
|
|
31
|
+
return ____customStage_doorPNGPaths_normal_0
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_02_treasureroomdoor.anm2"
|
|
35
|
+
if ____cond16 then
|
|
36
|
+
do
|
|
37
|
+
local ____customStage_doorPNGPaths_treasureRoom_2 = customStage.doorPNGPaths
|
|
38
|
+
if ____customStage_doorPNGPaths_treasureRoom_2 ~= nil then
|
|
39
|
+
____customStage_doorPNGPaths_treasureRoom_2 = ____customStage_doorPNGPaths_treasureRoom_2.treasureRoom
|
|
40
|
+
end
|
|
41
|
+
return ____customStage_doorPNGPaths_treasureRoom_2
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_03_ambushroomdoor.anm2"
|
|
45
|
+
if ____cond16 then
|
|
46
|
+
do
|
|
47
|
+
local ____customStage_doorPNGPaths_normalChallengeRoom_4 = customStage.doorPNGPaths
|
|
48
|
+
if ____customStage_doorPNGPaths_normalChallengeRoom_4 ~= nil then
|
|
49
|
+
____customStage_doorPNGPaths_normalChallengeRoom_4 = ____customStage_doorPNGPaths_normalChallengeRoom_4.normalChallengeRoom
|
|
50
|
+
end
|
|
51
|
+
return ____customStage_doorPNGPaths_normalChallengeRoom_4
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_04_selfsacrificeroomdoor.anm2"
|
|
55
|
+
if ____cond16 then
|
|
56
|
+
do
|
|
57
|
+
local ____customStage_doorPNGPaths_curseRoom_6 = customStage.doorPNGPaths
|
|
58
|
+
if ____customStage_doorPNGPaths_curseRoom_6 ~= nil then
|
|
59
|
+
____customStage_doorPNGPaths_curseRoom_6 = ____customStage_doorPNGPaths_curseRoom_6.curseRoom
|
|
60
|
+
end
|
|
61
|
+
return ____customStage_doorPNGPaths_curseRoom_6
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_05_arcaderoomdoor.anm2"
|
|
65
|
+
if ____cond16 then
|
|
66
|
+
do
|
|
67
|
+
local ____customStage_doorPNGPaths_arcade_8 = customStage.doorPNGPaths
|
|
68
|
+
if ____customStage_doorPNGPaths_arcade_8 ~= nil then
|
|
69
|
+
____customStage_doorPNGPaths_arcade_8 = ____customStage_doorPNGPaths_arcade_8.arcade
|
|
70
|
+
end
|
|
71
|
+
return ____customStage_doorPNGPaths_arcade_8
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_07_devilroomdoor.anm2"
|
|
75
|
+
if ____cond16 then
|
|
76
|
+
do
|
|
77
|
+
local ____customStage_doorPNGPaths_devilRoom_10 = customStage.doorPNGPaths
|
|
78
|
+
if ____customStage_doorPNGPaths_devilRoom_10 ~= nil then
|
|
79
|
+
____customStage_doorPNGPaths_devilRoom_10 = ____customStage_doorPNGPaths_devilRoom_10.devilRoom
|
|
80
|
+
end
|
|
81
|
+
return ____customStage_doorPNGPaths_devilRoom_10
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_07_holyroomdoor.anm2"
|
|
85
|
+
if ____cond16 then
|
|
86
|
+
do
|
|
87
|
+
local ____customStage_doorPNGPaths_angelRoom_12 = customStage.doorPNGPaths
|
|
88
|
+
if ____customStage_doorPNGPaths_angelRoom_12 ~= nil then
|
|
89
|
+
____customStage_doorPNGPaths_angelRoom_12 = ____customStage_doorPNGPaths_angelRoom_12.angelRoom
|
|
90
|
+
end
|
|
91
|
+
return ____customStage_doorPNGPaths_angelRoom_12
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_08_holeinwall.anm2"
|
|
95
|
+
if ____cond16 then
|
|
96
|
+
do
|
|
97
|
+
local ____customStage_doorPNGPaths_secretRoom_14 = customStage.doorPNGPaths
|
|
98
|
+
if ____customStage_doorPNGPaths_secretRoom_14 ~= nil then
|
|
99
|
+
____customStage_doorPNGPaths_secretRoom_14 = ____customStage_doorPNGPaths_secretRoom_14.secretRoom
|
|
100
|
+
end
|
|
101
|
+
return ____customStage_doorPNGPaths_secretRoom_14
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_09_bossambushroomdoor.anm2"
|
|
105
|
+
if ____cond16 then
|
|
106
|
+
do
|
|
107
|
+
local ____customStage_doorPNGPaths_bossChallengeRoom_16 = customStage.doorPNGPaths
|
|
108
|
+
if ____customStage_doorPNGPaths_bossChallengeRoom_16 ~= nil then
|
|
109
|
+
____customStage_doorPNGPaths_bossChallengeRoom_16 = ____customStage_doorPNGPaths_bossChallengeRoom_16.bossChallengeRoom
|
|
110
|
+
end
|
|
111
|
+
return ____customStage_doorPNGPaths_bossChallengeRoom_16
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_10_bossroomdoor.anm2"
|
|
115
|
+
if ____cond16 then
|
|
116
|
+
do
|
|
117
|
+
local ____customStage_doorPNGPaths_bossRoom_18 = customStage.doorPNGPaths
|
|
118
|
+
if ____customStage_doorPNGPaths_bossRoom_18 ~= nil then
|
|
119
|
+
____customStage_doorPNGPaths_bossRoom_18 = ____customStage_doorPNGPaths_bossRoom_18.bossRoom
|
|
120
|
+
end
|
|
121
|
+
return ____customStage_doorPNGPaths_bossRoom_18
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
____cond16 = ____cond16 or ____switch16 == "gfx/grid/door_15_bossrushdoor.anm2"
|
|
125
|
+
if ____cond16 then
|
|
126
|
+
do
|
|
127
|
+
local ____customStage_doorPNGPaths_bossRush_20 = customStage.doorPNGPaths
|
|
128
|
+
if ____customStage_doorPNGPaths_bossRush_20 ~= nil then
|
|
129
|
+
____customStage_doorPNGPaths_bossRush_20 = ____customStage_doorPNGPaths_bossRush_20.bossRush
|
|
130
|
+
end
|
|
131
|
+
return ____customStage_doorPNGPaths_bossRush_20
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
until true
|
|
135
|
+
return nil
|
|
136
|
+
end
|
|
137
|
+
function removeEntitiesSpawnedFromGridEntity(self, entities, gridEntity)
|
|
138
|
+
local entitiesFromGridEntity = __TS__ArrayFilter(
|
|
139
|
+
entities,
|
|
140
|
+
function(____, entity) return entity.FrameCount == 0 and vectorEquals(nil, entity.Position, gridEntity.Position) end
|
|
141
|
+
)
|
|
142
|
+
removeEntities(nil, entitiesFromGridEntity)
|
|
143
|
+
end
|
|
144
|
+
--- For `GridEntityType.DECORATION` (1)
|
|
145
|
+
function ____exports.setCustomDecorationGraphics(self, customStage, gridEntity)
|
|
146
|
+
if customStage.decorationsPNGPath == nil then
|
|
147
|
+
return
|
|
148
|
+
end
|
|
149
|
+
local variant = gridEntity:GetVariant()
|
|
150
|
+
if variant ~= DecorationVariant.VANILLA_DECORATION then
|
|
151
|
+
return
|
|
152
|
+
end
|
|
153
|
+
local sprite = gridEntity:GetSprite()
|
|
154
|
+
local fileName = sprite:GetFilename()
|
|
155
|
+
if string.lower(fileName) == "gfx/grid/props_01_basement.anm2" then
|
|
156
|
+
sprite:ReplaceSpritesheet(0, customStage.decorationsPNGPath)
|
|
157
|
+
sprite:LoadGraphics()
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
--- For `GridEntityType.ROCK` (2)
|
|
161
|
+
function ____exports.setCustomRockGraphics(self, customStage, gridEntity)
|
|
162
|
+
if customStage.rocksPNGPath == nil then
|
|
163
|
+
return
|
|
164
|
+
end
|
|
165
|
+
local sprite = gridEntity:GetSprite()
|
|
166
|
+
local fileName = sprite:GetFilename()
|
|
167
|
+
if fileName == "gfx/grid/grid_rock.anm2" then
|
|
168
|
+
sprite:ReplaceSpritesheet(0, customStage.rocksPNGPath)
|
|
169
|
+
sprite:LoadGraphics()
|
|
170
|
+
elseif fileName == "gfx/grid/grid_pit.anm2" then
|
|
171
|
+
sprite:ReplaceSpritesheet(1, customStage.rocksPNGPath)
|
|
172
|
+
sprite:LoadGraphics()
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
--- For `GridEntityType.PIT` (7)
|
|
176
|
+
function ____exports.setCustomPitGraphics(self, customStage, gridEntity)
|
|
177
|
+
if customStage.pitsPNGPath == nil then
|
|
178
|
+
return
|
|
179
|
+
end
|
|
180
|
+
local sprite = gridEntity:GetSprite()
|
|
181
|
+
local fileName = sprite:GetFilename()
|
|
182
|
+
if fileName == "gfx/grid/grid_pit.anm2" then
|
|
183
|
+
sprite:ReplaceSpritesheet(0, customStage.pitsPNGPath)
|
|
184
|
+
sprite:LoadGraphics()
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
--- For GridEntityType.DOOR (16)
|
|
188
|
+
function ____exports.setCustomDoorGraphics(self, customStage, gridEntity)
|
|
189
|
+
local sprite = gridEntity:GetSprite()
|
|
190
|
+
local fileName = sprite:GetFilename()
|
|
191
|
+
local doorPNGPath = getNewDoorPNGPath(nil, customStage, fileName)
|
|
192
|
+
if doorPNGPath ~= nil then
|
|
193
|
+
sprite:ReplaceSpritesheet(0, doorPNGPath)
|
|
194
|
+
sprite:LoadGraphics()
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
--- The rewards are based on the ones from the wiki:
|
|
198
|
+
-- https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Urns
|
|
199
|
+
--
|
|
200
|
+
-- On the bugged stage of -1, only urns will spawn, so we do not have to handle the case of mushroom
|
|
201
|
+
-- rewards, skull rewards, and so on.
|
|
202
|
+
function ____exports.removeUrnRewards(self, customStage, gridEntity)
|
|
203
|
+
if customStage.rocksPNGPath == nil then
|
|
204
|
+
return
|
|
205
|
+
end
|
|
206
|
+
local spiders = getNPCs(nil, EntityType.SPIDER)
|
|
207
|
+
removeEntitiesSpawnedFromGridEntity(nil, spiders, gridEntity)
|
|
208
|
+
local coins = getCoins(nil)
|
|
209
|
+
removeEntitiesSpawnedFromGridEntity(nil, coins, gridEntity)
|
|
210
|
+
local quarters = getCollectibles(nil, CollectibleType.QUARTER)
|
|
211
|
+
removeEntitiesSpawnedFromGridEntity(nil, quarters, gridEntity)
|
|
212
|
+
local swallowedPennies = getTrinkets(nil, TrinketType.SWALLOWED_PENNY)
|
|
213
|
+
removeEntitiesSpawnedFromGridEntity(nil, swallowedPennies, gridEntity)
|
|
214
|
+
end
|
|
215
|
+
return ____exports
|