isaacscript-common 7.4.2 → 7.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/dist/callbacks/postGridEntity.d.ts.map +1 -1
- package/dist/callbacks/postGridEntity.lua +53 -6
- package/dist/callbacks/postPlayerChangeStat.d.ts.map +1 -1
- package/dist/callbacks/postPlayerChangeStat.lua +9 -2
- package/dist/callbacks/subscriptions/postGridEntityCustomBroken.d.ts +1 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomBroken.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postGridEntityCustomBroken.lua +5 -2
- package/dist/callbacks/subscriptions/postGridEntityCustomInit.d.ts +9 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomInit.d.ts.map +1 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomInit.lua +23 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomRemove.d.ts +9 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomRemove.d.ts.map +1 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomRemove.lua +23 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomStateChanged.d.ts +9 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomStateChanged.d.ts.map +1 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomStateChanged.lua +29 -0
- package/dist/callbacks/subscriptions/postPlayerChangeStat.d.ts +3 -2
- package/dist/callbacks/subscriptions/postPlayerChangeStat.d.ts.map +1 -1
- package/dist/classes/DefaultMap.d.ts +3 -2
- package/dist/classes/DefaultMap.d.ts.map +1 -1
- package/dist/classes/DefaultMap.lua +2 -1
- package/dist/enums/ModCallbackCustom.d.ts +131 -81
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/enums/ModCallbackCustom.lua +67 -61
- package/dist/enums/StatType.d.ts +3 -1
- package/dist/enums/StatType.d.ts.map +1 -1
- package/dist/enums/StatType.lua +2 -0
- package/dist/features/customGridEntity.d.ts +30 -13
- package/dist/features/customGridEntity.d.ts.map +1 -1
- package/dist/features/customGridEntity.lua +67 -48
- package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -1
- package/dist/features/customStage/customStageGridEntities.lua +37 -31
- package/dist/features/customStage/customStageUtils.d.ts +2 -1
- package/dist/features/customStage/customStageUtils.d.ts.map +1 -1
- package/dist/features/customStage/customStageUtils.lua +40 -1
- package/dist/features/customStage/exports.d.ts +1 -25
- package/dist/features/customStage/exports.d.ts.map +1 -1
- package/dist/features/customStage/exports.lua +28 -29
- package/dist/features/customStage/v.d.ts +0 -2
- package/dist/features/customStage/v.d.ts.map +1 -1
- package/dist/features/customStage/v.lua +0 -2
- package/dist/features/customStage/versusScreen.d.ts.map +1 -1
- package/dist/features/customStage/versusScreen.lua +74 -60
- package/dist/functions/dev.d.ts +20 -0
- package/dist/functions/dev.d.ts.map +1 -0
- package/dist/functions/dev.lua +34 -0
- package/dist/functions/doors.d.ts +6 -5
- package/dist/functions/doors.d.ts.map +1 -1
- package/dist/functions/doors.lua +25 -12
- package/dist/functions/enums.d.ts +3 -3
- package/dist/functions/enums.lua +3 -3
- 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/functions/playerStats.d.ts.map +1 -1
- package/dist/functions/playerStats.lua +2 -1
- package/dist/functions/players.d.ts.map +1 -1
- package/dist/functions/players.lua +3 -2
- package/dist/functions/rooms.d.ts +5 -0
- package/dist/functions/rooms.d.ts.map +1 -1
- package/dist/functions/rooms.lua +12 -2
- package/dist/index.d.ts +312 -198
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +1134 -8
- package/dist/interfaces/{CustomStageLua.d.ts → CustomStageTSConfig.d.ts} +86 -60
- package/dist/interfaces/CustomStageTSConfig.d.ts.map +1 -0
- package/dist/interfaces/{CustomStageLua.lua → CustomStageTSConfig.lua} +0 -0
- package/dist/interfaces/JSONRoomsFile.d.ts +6 -5
- package/dist/interfaces/JSONRoomsFile.d.ts.map +1 -1
- package/dist/interfaces/StatTypeType.d.ts +1 -0
- package/dist/interfaces/StatTypeType.d.ts.map +1 -1
- package/dist/interfaces/private/AddCallbackParameterCustom.d.ts +6 -0
- package/dist/interfaces/private/AddCallbackParameterCustom.d.ts.map +1 -1
- package/dist/interfaces/private/CustomStage.d.ts +1 -1
- package/dist/interfaces/private/CustomStage.d.ts.map +1 -1
- package/dist/objects/callbackRegisterFunctions.d.ts.map +1 -1
- package/dist/objects/callbackRegisterFunctions.lua +9 -0
- package/dist/types/PossibleStatType.d.ts +7 -0
- package/dist/types/PossibleStatType.d.ts.map +1 -0
- package/dist/{interfaces/index.lua → types/PossibleStatType.lua} +0 -0
- package/package.json +1 -1
- package/src/callbacks/postGridEntity.ts +75 -10
- package/src/callbacks/postPlayerChangeStat.ts +8 -4
- package/src/callbacks/subscriptions/postGridEntityCustomBroken.ts +4 -0
- package/src/callbacks/subscriptions/postGridEntityCustomInit.ts +38 -0
- package/src/callbacks/subscriptions/postGridEntityCustomRemove.ts +35 -0
- package/src/callbacks/subscriptions/postGridEntityCustomStateChanged.ts +42 -0
- package/src/callbacks/subscriptions/postPlayerChangeStat.ts +4 -7
- package/src/classes/DefaultMap.ts +3 -2
- package/src/enums/ModCallbackCustom.ts +73 -20
- package/src/enums/StatType.ts +3 -3
- package/src/features/customGridEntity.ts +87 -61
- package/src/features/customStage/customStageGridEntities.ts +16 -7
- package/src/features/customStage/customStageUtils.ts +52 -1
- package/src/features/customStage/exports.ts +33 -45
- package/src/features/customStage/init.ts +1 -1
- package/src/features/customStage/v.ts +0 -6
- package/src/features/customStage/versusScreen.ts +70 -55
- package/src/functions/dev.ts +31 -0
- package/src/functions/doors.ts +37 -21
- package/src/functions/enums.ts +3 -3
- package/src/functions/gridEntities.ts +33 -1
- package/src/functions/playerStats.ts +1 -0
- package/src/functions/players.ts +7 -3
- package/src/functions/rooms.ts +18 -0
- package/src/index.ts +208 -9
- package/src/interfaces/{CustomStageLua.ts → CustomStageTSConfig.ts} +107 -41
- package/src/interfaces/JSONRoomsFile.ts +6 -5
- package/src/interfaces/StatTypeType.ts +1 -0
- package/src/interfaces/private/AddCallbackParameterCustom.ts +6 -0
- package/src/interfaces/private/CustomStage.ts +4 -1
- package/src/objects/callbackRegisterFunctions.ts +9 -0
- package/src/types/PossibleStatType.ts +12 -0
- package/dist/classes/index.d.ts +0 -3
- package/dist/classes/index.d.ts.map +0 -1
- package/dist/classes/index.lua +0 -18
- package/dist/core/index.d.ts +0 -5
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.lua +0 -34
- package/dist/enums/DecorationVariant.d.ts +0 -10
- package/dist/enums/DecorationVariant.d.ts.map +0 -1
- package/dist/enums/DecorationVariant.lua +0 -7
- package/dist/enums/index.d.ts +0 -11
- package/dist/enums/index.d.ts.map +0 -1
- package/dist/enums/index.lua +0 -82
- package/dist/features/index.d.ts +0 -30
- package/dist/features/index.d.ts.map +0 -1
- package/dist/features/index.lua +0 -216
- package/dist/functions/index.d.ts +0 -100
- package/dist/functions/index.d.ts.map +0 -1
- package/dist/functions/index.lua +0 -794
- package/dist/interfaces/CustomStageLua.d.ts.map +0 -1
- package/dist/interfaces/index.d.ts +0 -12
- package/dist/interfaces/index.d.ts.map +0 -1
- package/dist/maps/index.d.ts +0 -5
- package/dist/maps/index.d.ts.map +0 -1
- package/dist/maps/index.lua +0 -34
- package/dist/objects/index.d.ts +0 -2
- package/dist/objects/index.d.ts.map +0 -1
- package/dist/objects/index.lua +0 -10
- package/dist/types/index.d.ts +0 -11
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.lua +0 -10
- package/src/classes/index.ts +0 -2
- package/src/classes/indexTypeDoc.ts +0 -2
- package/src/core/index.ts +0 -4
- package/src/core/indexTypeDoc.ts +0 -4
- package/src/enums/DecorationVariant.ts +0 -10
- package/src/enums/index.ts +0 -10
- package/src/enums/indexTypeDoc.ts +0 -10
- package/src/features/index.ts +0 -59
- package/src/features/indexTypeDoc.ts +0 -30
- package/src/functions/index.ts +0 -101
- package/src/functions/indexTypeDoc.ts +0 -101
- package/src/indexTypeDoc.ts +0 -13
- package/src/interfaces/index.ts +0 -11
- package/src/interfaces/indexTypeDoc.ts +0 -11
- package/src/maps/index.ts +0 -4
- package/src/maps/indexTypeDoc.ts +0 -4
- package/src/objects/index.ts +0 -1
- package/src/objects/indexTypeDoc.ts +0 -1
- package/src/types/index.ts +0 -10
- package/src/types/indexTypeDoc.ts +0 -10
|
@@ -7,8 +7,6 @@ local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
|
7
7
|
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
8
8
|
local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
|
|
9
9
|
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
10
|
-
local ____DecorationVariant = require("enums.DecorationVariant")
|
|
11
|
-
local DecorationVariant = ____DecorationVariant.DecorationVariant
|
|
12
10
|
local ____entities = require("functions.entities")
|
|
13
11
|
local removeEntities = ____entities.removeEntities
|
|
14
12
|
local ____entitiesSpecific = require("functions.entitiesSpecific")
|
|
@@ -21,10 +19,10 @@ local getCollectibles = ____pickupsSpecific.getCollectibles
|
|
|
21
19
|
local getTrinkets = ____pickupsSpecific.getTrinkets
|
|
22
20
|
local ____stage = require("functions.stage")
|
|
23
21
|
local calculateStageType = ____stage.calculateStageType
|
|
24
|
-
local ____types = require("functions.types")
|
|
25
|
-
local asNumber = ____types.asNumber
|
|
26
22
|
local ____vector = require("functions.vector")
|
|
27
23
|
local vectorEquals = ____vector.vectorEquals
|
|
24
|
+
local ____customGridEntity = require("features.customGridEntity")
|
|
25
|
+
local isCustomGridEntity = ____customGridEntity.isCustomGridEntity
|
|
28
26
|
local ____exports = require("features.customTrapdoor.exports")
|
|
29
27
|
local spawnCustomTrapdoor = ____exports.spawnCustomTrapdoor
|
|
30
28
|
local ____exports = require("features.customStage.exports")
|
|
@@ -33,9 +31,9 @@ local ____v = require("features.customStage.v")
|
|
|
33
31
|
local v = ____v.default
|
|
34
32
|
function getNewDoorPNGPath(self, customStage, fileName)
|
|
35
33
|
repeat
|
|
36
|
-
local
|
|
37
|
-
local
|
|
38
|
-
if
|
|
34
|
+
local ____switch24 = fileName
|
|
35
|
+
local ____cond24 = ____switch24 == "gfx/grid/door_01_normaldoor.anm2"
|
|
36
|
+
if ____cond24 then
|
|
39
37
|
do
|
|
40
38
|
local ____customStage_doorPNGPaths_normal_0 = customStage.doorPNGPaths
|
|
41
39
|
if ____customStage_doorPNGPaths_normal_0 ~= nil then
|
|
@@ -44,8 +42,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
|
|
|
44
42
|
return ____customStage_doorPNGPaths_normal_0
|
|
45
43
|
end
|
|
46
44
|
end
|
|
47
|
-
|
|
48
|
-
if
|
|
45
|
+
____cond24 = ____cond24 or ____switch24 == "gfx/grid/door_02_treasureroomdoor.anm2"
|
|
46
|
+
if ____cond24 then
|
|
49
47
|
do
|
|
50
48
|
local ____customStage_doorPNGPaths_treasureRoom_2 = customStage.doorPNGPaths
|
|
51
49
|
if ____customStage_doorPNGPaths_treasureRoom_2 ~= nil then
|
|
@@ -54,8 +52,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
|
|
|
54
52
|
return ____customStage_doorPNGPaths_treasureRoom_2
|
|
55
53
|
end
|
|
56
54
|
end
|
|
57
|
-
|
|
58
|
-
if
|
|
55
|
+
____cond24 = ____cond24 or ____switch24 == "gfx/grid/door_03_ambushroomdoor.anm2"
|
|
56
|
+
if ____cond24 then
|
|
59
57
|
do
|
|
60
58
|
local ____customStage_doorPNGPaths_normalChallengeRoom_4 = customStage.doorPNGPaths
|
|
61
59
|
if ____customStage_doorPNGPaths_normalChallengeRoom_4 ~= nil then
|
|
@@ -64,8 +62,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
|
|
|
64
62
|
return ____customStage_doorPNGPaths_normalChallengeRoom_4
|
|
65
63
|
end
|
|
66
64
|
end
|
|
67
|
-
|
|
68
|
-
if
|
|
65
|
+
____cond24 = ____cond24 or ____switch24 == "gfx/grid/door_04_selfsacrificeroomdoor.anm2"
|
|
66
|
+
if ____cond24 then
|
|
69
67
|
do
|
|
70
68
|
local ____customStage_doorPNGPaths_curseRoom_6 = customStage.doorPNGPaths
|
|
71
69
|
if ____customStage_doorPNGPaths_curseRoom_6 ~= nil then
|
|
@@ -74,8 +72,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
|
|
|
74
72
|
return ____customStage_doorPNGPaths_curseRoom_6
|
|
75
73
|
end
|
|
76
74
|
end
|
|
77
|
-
|
|
78
|
-
if
|
|
75
|
+
____cond24 = ____cond24 or ____switch24 == "gfx/grid/door_05_arcaderoomdoor.anm2"
|
|
76
|
+
if ____cond24 then
|
|
79
77
|
do
|
|
80
78
|
local ____customStage_doorPNGPaths_arcade_8 = customStage.doorPNGPaths
|
|
81
79
|
if ____customStage_doorPNGPaths_arcade_8 ~= nil then
|
|
@@ -84,8 +82,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
|
|
|
84
82
|
return ____customStage_doorPNGPaths_arcade_8
|
|
85
83
|
end
|
|
86
84
|
end
|
|
87
|
-
|
|
88
|
-
if
|
|
85
|
+
____cond24 = ____cond24 or ____switch24 == "gfx/grid/door_07_devilroomdoor.anm2"
|
|
86
|
+
if ____cond24 then
|
|
89
87
|
do
|
|
90
88
|
local ____customStage_doorPNGPaths_devilRoom_10 = customStage.doorPNGPaths
|
|
91
89
|
if ____customStage_doorPNGPaths_devilRoom_10 ~= nil then
|
|
@@ -94,8 +92,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
|
|
|
94
92
|
return ____customStage_doorPNGPaths_devilRoom_10
|
|
95
93
|
end
|
|
96
94
|
end
|
|
97
|
-
|
|
98
|
-
if
|
|
95
|
+
____cond24 = ____cond24 or ____switch24 == "gfx/grid/door_07_holyroomdoor.anm2"
|
|
96
|
+
if ____cond24 then
|
|
99
97
|
do
|
|
100
98
|
local ____customStage_doorPNGPaths_angelRoom_12 = customStage.doorPNGPaths
|
|
101
99
|
if ____customStage_doorPNGPaths_angelRoom_12 ~= nil then
|
|
@@ -104,8 +102,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
|
|
|
104
102
|
return ____customStage_doorPNGPaths_angelRoom_12
|
|
105
103
|
end
|
|
106
104
|
end
|
|
107
|
-
|
|
108
|
-
if
|
|
105
|
+
____cond24 = ____cond24 or ____switch24 == "gfx/grid/door_08_holeinwall.anm2"
|
|
106
|
+
if ____cond24 then
|
|
109
107
|
do
|
|
110
108
|
local ____customStage_doorPNGPaths_secretRoom_14 = customStage.doorPNGPaths
|
|
111
109
|
if ____customStage_doorPNGPaths_secretRoom_14 ~= nil then
|
|
@@ -114,8 +112,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
|
|
|
114
112
|
return ____customStage_doorPNGPaths_secretRoom_14
|
|
115
113
|
end
|
|
116
114
|
end
|
|
117
|
-
|
|
118
|
-
if
|
|
115
|
+
____cond24 = ____cond24 or ____switch24 == "gfx/grid/door_09_bossambushroomdoor.anm2"
|
|
116
|
+
if ____cond24 then
|
|
119
117
|
do
|
|
120
118
|
local ____customStage_doorPNGPaths_bossChallengeRoom_16 = customStage.doorPNGPaths
|
|
121
119
|
if ____customStage_doorPNGPaths_bossChallengeRoom_16 ~= nil then
|
|
@@ -124,8 +122,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
|
|
|
124
122
|
return ____customStage_doorPNGPaths_bossChallengeRoom_16
|
|
125
123
|
end
|
|
126
124
|
end
|
|
127
|
-
|
|
128
|
-
if
|
|
125
|
+
____cond24 = ____cond24 or ____switch24 == "gfx/grid/door_10_bossroomdoor.anm2"
|
|
126
|
+
if ____cond24 then
|
|
129
127
|
do
|
|
130
128
|
local ____customStage_doorPNGPaths_bossRoom_18 = customStage.doorPNGPaths
|
|
131
129
|
if ____customStage_doorPNGPaths_bossRoom_18 ~= nil then
|
|
@@ -134,8 +132,8 @@ function getNewDoorPNGPath(self, customStage, fileName)
|
|
|
134
132
|
return ____customStage_doorPNGPaths_bossRoom_18
|
|
135
133
|
end
|
|
136
134
|
end
|
|
137
|
-
|
|
138
|
-
if
|
|
135
|
+
____cond24 = ____cond24 or ____switch24 == "gfx/grid/door_15_bossrushdoor.anm2"
|
|
136
|
+
if ____cond24 then
|
|
139
137
|
do
|
|
140
138
|
local ____customStage_doorPNGPaths_bossRush_20 = customStage.doorPNGPaths
|
|
141
139
|
if ____customStage_doorPNGPaths_bossRush_20 ~= nil then
|
|
@@ -159,12 +157,11 @@ function ____exports.setCustomDecorationGraphics(self, customStage, gridEntity)
|
|
|
159
157
|
if customStage.decorationsPNGPath == nil then
|
|
160
158
|
return
|
|
161
159
|
end
|
|
162
|
-
|
|
163
|
-
if gridEntityType ~= GridEntityType.DECORATION then
|
|
160
|
+
if isCustomGridEntity(nil, gridEntity) then
|
|
164
161
|
return
|
|
165
162
|
end
|
|
166
|
-
local
|
|
167
|
-
if
|
|
163
|
+
local gridEntityType = gridEntity:GetType()
|
|
164
|
+
if gridEntityType ~= GridEntityType.DECORATION then
|
|
168
165
|
return
|
|
169
166
|
end
|
|
170
167
|
local sprite = gridEntity:GetSprite()
|
|
@@ -179,6 +176,9 @@ function ____exports.setCustomRockGraphics(self, customStage, gridEntity)
|
|
|
179
176
|
if customStage.rocksPNGPath == nil then
|
|
180
177
|
return
|
|
181
178
|
end
|
|
179
|
+
if isCustomGridEntity(nil, gridEntity) then
|
|
180
|
+
return
|
|
181
|
+
end
|
|
182
182
|
local gridEntityRock = gridEntity:ToRock()
|
|
183
183
|
if gridEntityRock == nil then
|
|
184
184
|
return
|
|
@@ -198,6 +198,9 @@ function ____exports.setCustomPitGraphics(self, customStage, gridEntity)
|
|
|
198
198
|
if customStage.pitsPNGPath == nil then
|
|
199
199
|
return
|
|
200
200
|
end
|
|
201
|
+
if isCustomGridEntity(nil, gridEntity) then
|
|
202
|
+
return
|
|
203
|
+
end
|
|
201
204
|
local gridEntityPit = gridEntity:ToPit()
|
|
202
205
|
if gridEntityPit == nil then
|
|
203
206
|
return
|
|
@@ -214,6 +217,9 @@ function ____exports.setCustomDoorGraphics(self, customStage, gridEntity)
|
|
|
214
217
|
if customStage.doorPNGPaths == nil then
|
|
215
218
|
return
|
|
216
219
|
end
|
|
220
|
+
if isCustomGridEntity(nil, gridEntity) then
|
|
221
|
+
return
|
|
222
|
+
end
|
|
217
223
|
local gridEntityDoor = gridEntity:ToDoor()
|
|
218
224
|
if gridEntityDoor == nil then
|
|
219
225
|
return
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/// <reference types="isaac-typescript-definitions" />
|
|
3
|
-
import { CustomStageRoomMetadata } from "../../interfaces/
|
|
3
|
+
import { CustomStageBossPoolEntry, CustomStageRoomMetadata } from "../../interfaces/CustomStageTSConfig";
|
|
4
4
|
/**
|
|
5
5
|
* Helper function to get a random custom stage room from an array of custom stage rooms.
|
|
6
6
|
*
|
|
@@ -9,4 +9,5 @@ import { CustomStageRoomMetadata } from "../../interfaces/CustomStageLua";
|
|
|
9
9
|
* https://stackoverflow.com/questions/1761626/weighted-random-numbers
|
|
10
10
|
*/
|
|
11
11
|
export declare function getRandomCustomStageRoom(roomsMetadata: readonly CustomStageRoomMetadata[], seedOrRNG?: Seed | RNG, verbose?: boolean): CustomStageRoomMetadata;
|
|
12
|
+
export declare function getRandomBossRoomFromPool(roomsMetadata: readonly CustomStageRoomMetadata[], bossPool: readonly CustomStageBossPoolEntry[], seedOrRNG?: Seed | RNG, verbose?: boolean): CustomStageRoomMetadata;
|
|
12
13
|
//# sourceMappingURL=customStageUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customStageUtils.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/customStageUtils.ts"],"names":[],"mappings":";;AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"customStageUtils.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/customStageUtils.ts"],"names":[],"mappings":";;AAIA,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,sCAAsC,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,SAAS,uBAAuB,EAAE,EACjD,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,uBAAuB,CAYzB;AA0BD,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,SAAS,uBAAuB,EAAE,EACjD,QAAQ,EAAE,SAAS,wBAAwB,EAAE,EAC7C,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,uBAAuB,CAiBzB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
3
|
+
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
3
4
|
local ____exports = {}
|
|
4
|
-
local getTotalWeightOfCustomStageRooms, getCustomStageRoomWithChosenWeight
|
|
5
|
+
local getTotalWeightOfCustomStageRooms, getCustomStageRoomWithChosenWeight, getTotalWeightOfBossPool, getBossEntryWithChosenWeight
|
|
5
6
|
local ____array = require("functions.array")
|
|
6
7
|
local sumArray = ____array.sumArray
|
|
7
8
|
local ____log = require("functions.log")
|
|
@@ -26,6 +27,22 @@ function getCustomStageRoomWithChosenWeight(self, roomsMetadata, chosenWeight)
|
|
|
26
27
|
end
|
|
27
28
|
error("Failed to get a custom stage room with chosen weight: " .. tostring(chosenWeight))
|
|
28
29
|
end
|
|
30
|
+
function getTotalWeightOfBossPool(self, bossPool)
|
|
31
|
+
local weights = __TS__ArrayMap(
|
|
32
|
+
bossPool,
|
|
33
|
+
function(____, bossEntry) return bossEntry.weight end
|
|
34
|
+
)
|
|
35
|
+
return sumArray(nil, weights)
|
|
36
|
+
end
|
|
37
|
+
function getBossEntryWithChosenWeight(self, bossPool, chosenWeight)
|
|
38
|
+
for ____, bossEntry in ipairs(bossPool) do
|
|
39
|
+
if chosenWeight < bossEntry.weight then
|
|
40
|
+
return bossEntry
|
|
41
|
+
end
|
|
42
|
+
chosenWeight = chosenWeight - bossEntry.weight
|
|
43
|
+
end
|
|
44
|
+
error("Failed to get a custom stage boss entry with chosen weight: " .. tostring(chosenWeight))
|
|
45
|
+
end
|
|
29
46
|
--- Helper function to get a random custom stage room from an array of custom stage rooms.
|
|
30
47
|
--
|
|
31
48
|
-- Note that this function does not simply choose a random element in the provided array; it will
|
|
@@ -48,4 +65,26 @@ function ____exports.getRandomCustomStageRoom(self, roomsMetadata, seedOrRNG, ve
|
|
|
48
65
|
end
|
|
49
66
|
return getCustomStageRoomWithChosenWeight(nil, roomsMetadata, chosenWeight)
|
|
50
67
|
end
|
|
68
|
+
function ____exports.getRandomBossRoomFromPool(self, roomsMetadata, bossPool, seedOrRNG, verbose)
|
|
69
|
+
if seedOrRNG == nil then
|
|
70
|
+
seedOrRNG = getRandomSeed(nil)
|
|
71
|
+
end
|
|
72
|
+
if verbose == nil then
|
|
73
|
+
verbose = false
|
|
74
|
+
end
|
|
75
|
+
local totalWeight = getTotalWeightOfBossPool(nil, bossPool)
|
|
76
|
+
if verbose then
|
|
77
|
+
log("Total weight of the custom stage boss pool provided: " .. tostring(totalWeight))
|
|
78
|
+
end
|
|
79
|
+
local chosenWeight = getRandomFloat(nil, 0, totalWeight, seedOrRNG)
|
|
80
|
+
if verbose then
|
|
81
|
+
log("Randomly chose weight for custom stage boss pool: " .. tostring(chosenWeight))
|
|
82
|
+
end
|
|
83
|
+
local bossEntry = getBossEntryWithChosenWeight(nil, bossPool, chosenWeight)
|
|
84
|
+
local roomsMetadataForBoss = __TS__ArrayFilter(
|
|
85
|
+
roomsMetadata,
|
|
86
|
+
function(____, roomMetadata) return roomMetadata.subType == bossEntry.subType end
|
|
87
|
+
)
|
|
88
|
+
return ____exports.getRandomCustomStageRoom(nil, roomsMetadataForBoss, seedOrRNG, verbose)
|
|
89
|
+
end
|
|
51
90
|
return ____exports
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { LevelStage, StageType } from "isaac-typescript-definitions";
|
|
9
9
|
export declare const DEFAULT_BASE_STAGE = LevelStage.BASEMENT_2;
|
|
10
10
|
export declare const DEFAULT_BASE_STAGE_TYPE = StageType.ORIGINAL;
|
|
11
11
|
export declare const INVALID_STAGE_VALUE: LevelStage;
|
|
@@ -23,30 +23,6 @@ export declare const INVALID_STAGE_VALUE: LevelStage;
|
|
|
23
23
|
* Default is false.
|
|
24
24
|
*/
|
|
25
25
|
export declare function setCustomStage(name: string, firstFloor?: boolean, verbose?: boolean): void;
|
|
26
|
-
/**
|
|
27
|
-
* By default, unknown bosses will be drawn on the boss "versus" screen as "???". If your custom
|
|
28
|
-
* stage has custom bosses, you can use this function to register the corresponding graphic file
|
|
29
|
-
* files for them.
|
|
30
|
-
*
|
|
31
|
-
* For reference:
|
|
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`
|
|
36
|
-
*
|
|
37
|
-
* (Note that boss metadata like this cannot be specified with the rest of the custom stage metadata
|
|
38
|
-
* in the "tsconfig.json" file because there is not a way to retrieve the name of an entity at
|
|
39
|
-
* run-time.)
|
|
40
|
-
*
|
|
41
|
-
* @param entityType The entity type of the custom boss.
|
|
42
|
-
* @param variant The variant of the custom boss.
|
|
43
|
-
* @param subType The sub-type of the custom boss.
|
|
44
|
-
* @param namePNGPath The full path to the PNG file that contains the name of the boss that will be
|
|
45
|
-
* displayed on the top of the boss "versus" screen.
|
|
46
|
-
* @param portraitPNGPath The full path to the PNG file that contains the portrait of the boss that
|
|
47
|
-
* will be displayed on the right side of the boss "versus" screen.
|
|
48
|
-
*/
|
|
49
|
-
export declare function registerCustomBoss(entityType: EntityType, variant: int, subType: int, namePNGPath: string, portraitPNGPath: string): void;
|
|
50
26
|
/**
|
|
51
27
|
* Helper function to disable the custom stage. This is typically called before taking the player to
|
|
52
28
|
* a vanilla floor.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/exports.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/exports.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,EAEL,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;AAkGD;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local Map = ____lualib.Map
|
|
3
|
+
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
3
4
|
local ____exports = {}
|
|
4
5
|
local setStageRoomsData
|
|
5
6
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
|
+
local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
|
|
6
8
|
local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
|
|
7
9
|
local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
|
|
8
10
|
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
@@ -11,8 +13,8 @@ local ____reorderedCallbacks = require("callbacks.reorderedCallbacks")
|
|
|
11
13
|
local reorderedCallbacksSetStageInternal = ____reorderedCallbacks.reorderedCallbacksSetStageInternal
|
|
12
14
|
local ____cachedClasses = require("core.cachedClasses")
|
|
13
15
|
local game = ____cachedClasses.game
|
|
14
|
-
local
|
|
15
|
-
local
|
|
16
|
+
local ____doors = require("functions.doors")
|
|
17
|
+
local doorSlotFlagsToDoorSlots = ____doors.doorSlotFlagsToDoorSlots
|
|
16
18
|
local ____log = require("functions.log")
|
|
17
19
|
local logError = ____log.logError
|
|
18
20
|
local ____rng = require("functions.rng")
|
|
@@ -25,10 +27,10 @@ local setStage = ____stage.setStage
|
|
|
25
27
|
local ____types = require("functions.types")
|
|
26
28
|
local asNumber = ____types.asNumber
|
|
27
29
|
local ____customStageUtils = require("features.customStage.customStageUtils")
|
|
30
|
+
local getRandomBossRoomFromPool = ____customStageUtils.getRandomBossRoomFromPool
|
|
28
31
|
local getRandomCustomStageRoom = ____customStageUtils.getRandomCustomStageRoom
|
|
29
32
|
local ____v = require("features.customStage.v")
|
|
30
33
|
local v = ____v.default
|
|
31
|
-
local customBossPNGPaths = ____v.customBossPNGPaths
|
|
32
34
|
local customStageCachedRoomData = ____v.customStageCachedRoomData
|
|
33
35
|
local customStagesMap = ____v.customStagesMap
|
|
34
36
|
function setStageRoomsData(self, customStage, rng, verbose)
|
|
@@ -60,9 +62,31 @@ function setStageRoomsData(self, customStage, rng, verbose)
|
|
|
60
62
|
local roomsMetadata = roomDoorSlotFlagMap:get(doorSlotFlags)
|
|
61
63
|
if roomsMetadata == nil then
|
|
62
64
|
logError((((((((((("Failed to find any custom rooms for RoomType." .. tostring(RoomType[roomType])) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. tostring(RoomShape[roomShape])) .. " (") .. tostring(roomShape)) .. ") + DoorSlotFlags ") .. tostring(doorSlotFlags)) .. " for custom stage: ") .. customStage.name)
|
|
65
|
+
local header = ("For reference, a DoorSlotFlags of " .. tostring(doorSlotFlags)) .. " is equal to the following doors being enabled:\n"
|
|
66
|
+
local doorSlots = doorSlotFlagsToDoorSlots(nil, doorSlotFlags)
|
|
67
|
+
local doorSlotLines = __TS__ArrayMap(
|
|
68
|
+
doorSlots,
|
|
69
|
+
function(____, doorSlot) return ((("- DoorSlot." .. tostring(DoorSlot[doorSlot])) .. " (") .. tostring(doorSlot)) .. ")" end
|
|
70
|
+
)
|
|
71
|
+
local explanation = header .. table.concat(doorSlotLines, "\n")
|
|
72
|
+
logError(explanation)
|
|
63
73
|
goto __continue7
|
|
64
74
|
end
|
|
65
|
-
local randomRoom
|
|
75
|
+
local randomRoom
|
|
76
|
+
if roomType == RoomType.BOSS then
|
|
77
|
+
if customStage.bossPool == nil then
|
|
78
|
+
goto __continue7
|
|
79
|
+
end
|
|
80
|
+
randomRoom = getRandomBossRoomFromPool(
|
|
81
|
+
nil,
|
|
82
|
+
roomsMetadata,
|
|
83
|
+
customStage.bossPool,
|
|
84
|
+
rng,
|
|
85
|
+
verbose
|
|
86
|
+
)
|
|
87
|
+
else
|
|
88
|
+
randomRoom = getRandomCustomStageRoom(nil, roomsMetadata, rng, verbose)
|
|
89
|
+
end
|
|
66
90
|
local newRoomData = customStageCachedRoomData:get(randomRoom.variant)
|
|
67
91
|
if newRoomData == nil then
|
|
68
92
|
newRoomData = getRoomDataForTypeVariant(nil, roomType, randomRoom.variant, false)
|
|
@@ -125,31 +149,6 @@ function ____exports.setCustomStage(self, name, firstFloor, verbose)
|
|
|
125
149
|
level:SetStage(targetStage, targetStageType)
|
|
126
150
|
reorderedCallbacksSetStageInternal(nil, targetStage, targetStageType)
|
|
127
151
|
end
|
|
128
|
-
--- By default, unknown bosses will be drawn on the boss "versus" screen as "???". If your custom
|
|
129
|
-
-- stage has custom bosses, you can use this function to register the corresponding graphic file
|
|
130
|
-
-- files for them.
|
|
131
|
-
--
|
|
132
|
-
-- For reference:
|
|
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`
|
|
137
|
-
--
|
|
138
|
-
-- (Note that boss metadata like this cannot be specified with the rest of the custom stage metadata
|
|
139
|
-
-- in the "tsconfig.json" file because there is not a way to retrieve the name of an entity at
|
|
140
|
-
-- run-time.)
|
|
141
|
-
--
|
|
142
|
-
-- @param entityType The entity type of the custom boss.
|
|
143
|
-
-- @param variant The variant of the custom boss.
|
|
144
|
-
-- @param subType The sub-type of the custom boss.
|
|
145
|
-
-- @param namePNGPath The full path to the PNG file that contains the name of the boss that will be
|
|
146
|
-
-- displayed on the top of the boss "versus" screen.
|
|
147
|
-
-- @param portraitPNGPath The full path to the PNG file that contains the portrait of the boss that
|
|
148
|
-
-- will be displayed on the right side of the boss "versus" screen.
|
|
149
|
-
function ____exports.registerCustomBoss(self, entityType, variant, subType, namePNGPath, portraitPNGPath)
|
|
150
|
-
local entityID = getEntityIDFromConstituents(nil, entityType, variant, subType)
|
|
151
|
-
customBossPNGPaths:set(entityID, {namePNGPath, portraitPNGPath})
|
|
152
|
-
end
|
|
153
152
|
--- Helper function to disable the custom stage. This is typically called before taking the player to
|
|
154
153
|
-- a vanilla floor.
|
|
155
154
|
function ____exports.disableCustomStage(self)
|
|
@@ -30,6 +30,4 @@ export default v;
|
|
|
30
30
|
export declare const customStagesMap: Map<string, CustomStage>;
|
|
31
31
|
/** Indexed by room variant. */
|
|
32
32
|
export declare const customStageCachedRoomData: Map<number, Readonly<RoomConfig>>;
|
|
33
|
-
/** Indexed by entity ID. */
|
|
34
|
-
export declare const customBossPNGPaths: Map<string, [namePNGPath: string, portraitPNGPath: string]>;
|
|
35
33
|
//# sourceMappingURL=v.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/v.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,QAAA,MAAM,CAAC;;;QAIH,iDAAiD;;;QAKjD,oFAAoF;;;;;;;;;;;;;;;;;CAqBvF,CAAC;AACF,eAAe,CAAC,CAAC;AAEjB,oCAAoC;AACpC,eAAO,MAAM,eAAe,0BAAiC,CAAC;AAE9D,+BAA+B;AAC/B,eAAO,MAAM,yBAAyB,mCAAuC,CAAC
|
|
1
|
+
{"version":3,"file":"v.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/v.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,QAAA,MAAM,CAAC;;;QAIH,iDAAiD;;;QAKjD,oFAAoF;;;;;;;;;;;;;;;;;CAqBvF,CAAC;AACF,eAAe,CAAC,CAAC;AAEjB,oCAAoC;AACpC,eAAO,MAAM,eAAe,0BAAiC,CAAC;AAE9D,+BAA+B;AAC/B,eAAO,MAAM,yBAAyB,mCAAuC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versusScreen.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/versusScreen.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AA2EnE;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAavC;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"versusScreen.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/versusScreen.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AA2EnE;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAavC;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CA2ExE;AAkGD,wBAAgB,sBAAsB,IAAI,IAAI,CAkC7C"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local Map = ____lualib.Map
|
|
3
2
|
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
3
|
+
local __TS__ArrayFind = ____lualib.__TS__ArrayFind
|
|
4
4
|
local ____exports = {}
|
|
5
|
-
local willVanillaVersusScreenPlay, getPlayerPNGPaths, getBossPNGPaths, DEFAULT_CHARACTER, PNG_PATH_PREFIX, PLAYER_PORTRAIT_PNG_PATH_PREFIX
|
|
5
|
+
local willVanillaVersusScreenPlay, getPlayerPNGPaths, getBossPNGPaths, getBossPNGPathsCustom, DEFAULT_CHARACTER, PNG_PATH_PREFIX, PLAYER_PORTRAIT_PNG_PATH_PREFIX
|
|
6
6
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
7
|
local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
|
|
8
8
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
@@ -17,8 +17,8 @@ local ____array = require("functions.array")
|
|
|
17
17
|
local arrayRemove = ____array.arrayRemove
|
|
18
18
|
local ____bosses = require("functions.bosses")
|
|
19
19
|
local getBosses = ____bosses.getBosses
|
|
20
|
-
local
|
|
21
|
-
local
|
|
20
|
+
local ____roomData = require("functions.roomData")
|
|
21
|
+
local getRoomSubType = ____roomData.getRoomSubType
|
|
22
22
|
local ____utils = require("functions.utils")
|
|
23
23
|
local erange = ____utils.erange
|
|
24
24
|
local ____bossNamePNGFileNames = require("objects.bossNamePNGFileNames")
|
|
@@ -46,7 +46,6 @@ local DEFAULT_BASE_STAGE_TYPE = ____exports.DEFAULT_BASE_STAGE_TYPE
|
|
|
46
46
|
local INVALID_STAGE_VALUE = ____exports.INVALID_STAGE_VALUE
|
|
47
47
|
local ____v = require("features.customStage.v")
|
|
48
48
|
local v = ____v.default
|
|
49
|
-
local customBossPNGPaths = ____v.customBossPNGPaths
|
|
50
49
|
function willVanillaVersusScreenPlay(self)
|
|
51
50
|
local bosses = getBosses(nil)
|
|
52
51
|
return __TS__ArraySome(
|
|
@@ -57,40 +56,51 @@ end
|
|
|
57
56
|
function getPlayerPNGPaths(self)
|
|
58
57
|
local player = Isaac.GetPlayer()
|
|
59
58
|
local character = player:GetPlayerType()
|
|
60
|
-
local
|
|
61
|
-
if
|
|
62
|
-
|
|
59
|
+
local namePNGFileName = PLAYER_NAME_PNG_FILE_NAMES[character]
|
|
60
|
+
if namePNGFileName == nil then
|
|
61
|
+
namePNGFileName = PLAYER_NAME_PNG_FILE_NAMES[DEFAULT_CHARACTER]
|
|
63
62
|
end
|
|
64
|
-
local
|
|
65
|
-
local
|
|
66
|
-
if
|
|
67
|
-
|
|
63
|
+
local namePNGPath = (PNG_PATH_PREFIX .. "/") .. tostring(namePNGFileName)
|
|
64
|
+
local portraitFileName = PLAYER_PORTRAIT_PNG_FILE_NAMES[character]
|
|
65
|
+
if namePNGFileName == nil then
|
|
66
|
+
portraitFileName = PLAYER_PORTRAIT_PNG_FILE_NAMES[DEFAULT_CHARACTER]
|
|
68
67
|
end
|
|
69
|
-
local
|
|
70
|
-
return {
|
|
68
|
+
local portraitPNGPath = (PLAYER_PORTRAIT_PNG_PATH_PREFIX .. "/") .. tostring(portraitFileName)
|
|
69
|
+
return {namePNGPath = namePNGPath, portraitPNGPath = portraitPNGPath}
|
|
71
70
|
end
|
|
72
|
-
function getBossPNGPaths(self)
|
|
71
|
+
function getBossPNGPaths(self, customStage)
|
|
72
|
+
local paths = getBossPNGPathsCustom(nil, customStage)
|
|
73
|
+
if paths ~= nil then
|
|
74
|
+
return paths
|
|
75
|
+
end
|
|
73
76
|
local bosses = getBosses(nil)
|
|
74
77
|
local firstBoss = bosses[1]
|
|
75
|
-
if firstBoss ~= nil then
|
|
76
|
-
local entityID = getEntityID(nil, firstBoss)
|
|
77
|
-
local pngPaths = customBossPNGPaths:get(entityID)
|
|
78
|
-
if pngPaths ~= nil then
|
|
79
|
-
return pngPaths
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
78
|
local bossID = firstBoss == nil and 0 or firstBoss:GetBossID()
|
|
83
79
|
if bossID == 0 then
|
|
84
80
|
local questionMarkSprite = (PNG_PATH_PREFIX .. "/") .. BOSS_NAME_PNG_FILE_NAMES[BossID.BLUE_BABY]
|
|
85
|
-
local
|
|
86
|
-
local
|
|
87
|
-
return {
|
|
88
|
-
end
|
|
89
|
-
local
|
|
90
|
-
local
|
|
91
|
-
local
|
|
92
|
-
local
|
|
93
|
-
return {
|
|
81
|
+
local namePNGPath = questionMarkSprite
|
|
82
|
+
local portraitPNGPath = questionMarkSprite
|
|
83
|
+
return {namePNGPath = namePNGPath, portraitPNGPath = portraitPNGPath}
|
|
84
|
+
end
|
|
85
|
+
local namePNGFileName = BOSS_NAME_PNG_FILE_NAMES[bossID]
|
|
86
|
+
local namePNGPath = (PNG_PATH_PREFIX .. "/") .. namePNGFileName
|
|
87
|
+
local portraitPNGFileName = BOSS_PORTRAIT_PNG_FILE_NAMES[bossID]
|
|
88
|
+
local portraitPNGPath = (PNG_PATH_PREFIX .. "/") .. portraitPNGFileName
|
|
89
|
+
return {namePNGPath = namePNGPath, portraitPNGPath = portraitPNGPath}
|
|
90
|
+
end
|
|
91
|
+
function getBossPNGPathsCustom(self, customStage)
|
|
92
|
+
if customStage.bossPool == nil then
|
|
93
|
+
return nil
|
|
94
|
+
end
|
|
95
|
+
local roomSubType = getRoomSubType(nil)
|
|
96
|
+
local matchingBossEntry = __TS__ArrayFind(
|
|
97
|
+
customStage.bossPool,
|
|
98
|
+
function(____, bossEntry) return bossEntry.subType == roomSubType end
|
|
99
|
+
)
|
|
100
|
+
if matchingBossEntry == nil then
|
|
101
|
+
return nil
|
|
102
|
+
end
|
|
103
|
+
return matchingBossEntry.versusScreen
|
|
94
104
|
end
|
|
95
105
|
DEFAULT_CHARACTER = PlayerType.ISAAC
|
|
96
106
|
local DEFAULT_STAGE_ID = StageID.BASEMENT
|
|
@@ -164,37 +174,45 @@ function ____exports.playVersusScreenAnimation(self, customStage)
|
|
|
164
174
|
v.run.showingBossVersusScreen = true
|
|
165
175
|
pause(nil)
|
|
166
176
|
hud:SetVisible(false)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
177
|
+
do
|
|
178
|
+
local ____getPlayerPNGPaths_result_0 = getPlayerPNGPaths(nil)
|
|
179
|
+
local namePNGPath = ____getPlayerPNGPaths_result_0.namePNGPath
|
|
180
|
+
local portraitPNGPath = ____getPlayerPNGPaths_result_0.portraitPNGPath
|
|
181
|
+
versusScreenSprite:ReplaceSpritesheet(PLAYER_NAME_ANM2_LAYER, namePNGPath)
|
|
182
|
+
versusScreenSprite:ReplaceSpritesheet(PLAYER_PORTRAIT_ANM2_LAYER, portraitPNGPath)
|
|
183
|
+
end
|
|
184
|
+
do
|
|
185
|
+
local ____getBossPNGPaths_result_1 = getBossPNGPaths(nil, customStage)
|
|
186
|
+
local namePNGPath = ____getBossPNGPaths_result_1.namePNGPath
|
|
187
|
+
local portraitPNGPath = ____getBossPNGPaths_result_1.portraitPNGPath
|
|
188
|
+
versusScreenSprite:ReplaceSpritesheet(BOSS_NAME_ANM2_LAYER, namePNGPath)
|
|
189
|
+
versusScreenSprite:ReplaceSpritesheet(BOSS_PORTRAIT_ANM2_LAYER, portraitPNGPath)
|
|
190
|
+
end
|
|
173
191
|
versusScreenSprite:LoadGraphics()
|
|
174
192
|
local backgroundColor = VERSUS_SCREEN_BACKGROUND_COLORS[DEFAULT_STAGE_ID]
|
|
175
|
-
local
|
|
176
|
-
if
|
|
177
|
-
|
|
178
|
-
end
|
|
179
|
-
if
|
|
180
|
-
local
|
|
181
|
-
local r =
|
|
182
|
-
local g =
|
|
183
|
-
local b =
|
|
184
|
-
local a =
|
|
193
|
+
local ____customStage_versusScreen_backgroundColor_2 = customStage.versusScreen
|
|
194
|
+
if ____customStage_versusScreen_backgroundColor_2 ~= nil then
|
|
195
|
+
____customStage_versusScreen_backgroundColor_2 = ____customStage_versusScreen_backgroundColor_2.backgroundColor
|
|
196
|
+
end
|
|
197
|
+
if ____customStage_versusScreen_backgroundColor_2 ~= nil then
|
|
198
|
+
local ____customStage_versusScreen_backgroundColor_4 = customStage.versusScreen.backgroundColor
|
|
199
|
+
local r = ____customStage_versusScreen_backgroundColor_4.r
|
|
200
|
+
local g = ____customStage_versusScreen_backgroundColor_4.g
|
|
201
|
+
local b = ____customStage_versusScreen_backgroundColor_4.b
|
|
202
|
+
local a = ____customStage_versusScreen_backgroundColor_4.a
|
|
185
203
|
backgroundColor = Color(r, g, b, a)
|
|
186
204
|
end
|
|
187
205
|
versusScreenBackgroundSprite.Color = backgroundColor
|
|
188
206
|
local dirtSpotColor = VERSUS_SCREEN_DIRT_SPOT_COLORS[DEFAULT_STAGE_ID]
|
|
189
|
-
local
|
|
190
|
-
if
|
|
191
|
-
|
|
192
|
-
end
|
|
193
|
-
if
|
|
194
|
-
local
|
|
195
|
-
local r =
|
|
196
|
-
local g =
|
|
197
|
-
local b =
|
|
207
|
+
local ____customStage_versusScreen_dirtSpotColor_5 = customStage.versusScreen
|
|
208
|
+
if ____customStage_versusScreen_dirtSpotColor_5 ~= nil then
|
|
209
|
+
____customStage_versusScreen_dirtSpotColor_5 = ____customStage_versusScreen_dirtSpotColor_5.dirtSpotColor
|
|
210
|
+
end
|
|
211
|
+
if ____customStage_versusScreen_dirtSpotColor_5 ~= nil then
|
|
212
|
+
local ____customStage_versusScreen_dirtSpotColor_7 = customStage.versusScreen.dirtSpotColor
|
|
213
|
+
local r = ____customStage_versusScreen_dirtSpotColor_7.r
|
|
214
|
+
local g = ____customStage_versusScreen_dirtSpotColor_7.g
|
|
215
|
+
local b = ____customStage_versusScreen_dirtSpotColor_7.b
|
|
198
216
|
dirtSpotColor = Color(r, g, b)
|
|
199
217
|
end
|
|
200
218
|
versusScreenDirtSpotSprite.Color = dirtSpotColor
|
|
@@ -214,10 +232,6 @@ function ____exports.versusScreenPostRender(self)
|
|
|
214
232
|
if not v.run.showingBossVersusScreen then
|
|
215
233
|
return
|
|
216
234
|
end
|
|
217
|
-
local isPaused = game:IsPaused()
|
|
218
|
-
if isPaused then
|
|
219
|
-
return
|
|
220
|
-
end
|
|
221
235
|
if versusScreenSprite:IsFinished(VERSUS_SCREEN_ANIMATION_NAME) then
|
|
222
236
|
finishVersusScreenAnimation(nil)
|
|
223
237
|
return
|