isaacscript-common 30.4.1 → 30.4.2
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 +31 -21
- package/dist/isaacscript-common.lua +56 -51
- package/dist/lualib_bundle.lua +15 -0
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts +4 -4
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.lua +1 -1
- package/dist/src/classes/features/other/PressInput.d.ts.map +1 -1
- package/dist/src/classes/features/other/PressInput.lua +7 -8
- package/dist/src/classes/features/other/StageHistory.d.ts +2 -4
- package/dist/src/classes/features/other/StageHistory.d.ts.map +1 -1
- package/dist/src/classes/features/other/StageHistory.lua +3 -13
- package/dist/src/functions/levelGrid.d.ts +20 -13
- package/dist/src/functions/levelGrid.d.ts.map +1 -1
- package/dist/src/functions/levelGrid.lua +7 -5
- package/dist/src/functions/playerHealth.d.ts.map +1 -1
- package/dist/src/functions/playerHealth.lua +18 -23
- package/dist/src/interfaces/StageHistoryEntry.d.ts +7 -0
- package/dist/src/interfaces/StageHistoryEntry.d.ts.map +1 -0
- package/dist/src/interfaces/StageHistoryEntry.lua +2 -0
- package/package.json +1 -1
- package/src/classes/features/callbackLogic/CustomGridEntities.ts +9 -5
- package/src/classes/features/other/PressInput.ts +10 -8
- package/src/classes/features/other/StageHistory.ts +8 -8
- package/src/functions/levelGrid.ts +45 -20
- package/src/functions/playerHealth.ts +23 -16
- package/src/interfaces/StageHistoryEntry.ts +7 -0
package/dist/index.rollup.d.ts
CHANGED
|
@@ -1844,10 +1844,10 @@ declare class CustomGridEntities extends Feature {
|
|
|
1844
1844
|
* In order to use this function, you must upgrade your mod with
|
|
1845
1845
|
* `ISCFeature.CUSTOM_GRID_ENTITIES`.
|
|
1846
1846
|
*/
|
|
1847
|
-
getCustomGridEntities(): Array<
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1847
|
+
getCustomGridEntities(): Array<{
|
|
1848
|
+
gridEntity: GridEntity;
|
|
1849
|
+
data: GridEntityCustomData;
|
|
1850
|
+
}>;
|
|
1851
1851
|
/**
|
|
1852
1852
|
* Helper function to get the custom `GridEntityType` from a `GridEntity` or grid index. Returns
|
|
1853
1853
|
* undefined if the provided `GridEntity` is not a custom grid entity, or if there was not a grid
|
|
@@ -4279,7 +4279,7 @@ export declare function getActivePocketItemSlot(player: EntityPlayer): PocketIte
|
|
|
4279
4279
|
* This is just a filtering of the results of the `getAdjacentExistingRoomGridIndexes` function. See
|
|
4280
4280
|
* that function for more information.
|
|
4281
4281
|
*/
|
|
4282
|
-
export declare function getAdjacentExistingRoomGridIndexes(roomGridIndex?: int): int[];
|
|
4282
|
+
export declare function getAdjacentExistingRoomGridIndexes(roomGridIndex?: int): readonly int[];
|
|
4283
4283
|
|
|
4284
4284
|
/**
|
|
4285
4285
|
* Helper function to get only the adjacent room grid indexes that do not exist (i.e. do not have
|
|
@@ -4288,7 +4288,7 @@ export declare function getAdjacentExistingRoomGridIndexes(roomGridIndex?: int):
|
|
|
4288
4288
|
* This is just a filtering of the results of the `getAdjacentExistingRoomGridIndexes` function. See
|
|
4289
4289
|
* that function for more information.
|
|
4290
4290
|
*/
|
|
4291
|
-
export declare function getAdjacentNonExistingRoomGridIndexes(roomGridIndex?: int): int[];
|
|
4291
|
+
export declare function getAdjacentNonExistingRoomGridIndexes(roomGridIndex?: int): readonly int[];
|
|
4292
4292
|
|
|
4293
4293
|
/**
|
|
4294
4294
|
* Helper function to get all of the room grid indexes that are adjacent to a given room grid index
|
|
@@ -4305,7 +4305,7 @@ export declare function getAdjacentNonExistingRoomGridIndexes(roomGridIndex?: in
|
|
|
4305
4305
|
*
|
|
4306
4306
|
* @param roomGridIndex Optional. Default is the current room index.
|
|
4307
4307
|
*/
|
|
4308
|
-
export declare function getAdjacentRoomGridIndexes(roomGridIndex?: int): int[];
|
|
4308
|
+
export declare function getAdjacentRoomGridIndexes(roomGridIndex?: int): readonly int[];
|
|
4309
4309
|
|
|
4310
4310
|
/**
|
|
4311
4311
|
* Helper function to get all of the non-dead bosses in the room.
|
|
@@ -4382,7 +4382,7 @@ export declare function getAllPillColors(): PillColor[];
|
|
|
4382
4382
|
export declare function getAllPlayers(): EntityPlayer[];
|
|
4383
4383
|
|
|
4384
4384
|
/** Helper function to get the room safe grid index for every room on the entire floor. */
|
|
4385
|
-
export declare function getAllRoomGridIndexes(): int[];
|
|
4385
|
+
export declare function getAllRoomGridIndexes(): readonly int[];
|
|
4386
4386
|
|
|
4387
4387
|
/**
|
|
4388
4388
|
* Helper function to get the corresponding ambush type for the current room. Returns undefined if
|
|
@@ -5488,7 +5488,11 @@ export declare function getNewGlobals(): ReadonlyArray<[AnyNotNil, unknown]>;
|
|
|
5488
5488
|
* @returns Either a tuple of adjacent room grid index, `DoorSlot`, and new room grid index, or
|
|
5489
5489
|
* undefined.
|
|
5490
5490
|
*/
|
|
5491
|
-
export declare function getNewRoomCandidate(seedOrRNG?: Seed | RNG):
|
|
5491
|
+
export declare function getNewRoomCandidate(seedOrRNG?: Seed | RNG): {
|
|
5492
|
+
readonly adjacentRoomGridIndex: int;
|
|
5493
|
+
readonly doorSlot: DoorSlot;
|
|
5494
|
+
readonly newRoomGridIndex: int;
|
|
5495
|
+
} | undefined;
|
|
5492
5496
|
|
|
5493
5497
|
/**
|
|
5494
5498
|
* Helper function to iterate through the possible doors for a room and see if any of them would be
|
|
@@ -5498,7 +5502,10 @@ export declare function getNewRoomCandidate(seedOrRNG?: Seed | RNG): [adjacentRo
|
|
|
5498
5502
|
* @param roomGridIndex Optional. Default is the current room index.
|
|
5499
5503
|
* @returns A array of tuples of `DoorSlot` and room grid index.
|
|
5500
5504
|
*/
|
|
5501
|
-
export declare function getNewRoomCandidatesBesideRoom(roomGridIndex?: int):
|
|
5505
|
+
export declare function getNewRoomCandidatesBesideRoom(roomGridIndex?: int): ReadonlyArray<{
|
|
5506
|
+
readonly doorSlot: DoorSlot;
|
|
5507
|
+
readonly roomGridIndex: int;
|
|
5508
|
+
}>;
|
|
5502
5509
|
|
|
5503
5510
|
/**
|
|
5504
5511
|
* Helper function to search through all of the rooms on the floor for a spot to insert a brand new
|
|
@@ -5507,11 +5514,11 @@ export declare function getNewRoomCandidatesBesideRoom(roomGridIndex?: int): Arr
|
|
|
5507
5514
|
* @returns A array of tuples containing the adjacent room grid index, the `DoorSlot`, and the new
|
|
5508
5515
|
* room grid index.
|
|
5509
5516
|
*/
|
|
5510
|
-
export declare function getNewRoomCandidatesForLevel():
|
|
5511
|
-
adjacentRoomGridIndex: int
|
|
5512
|
-
doorSlot: DoorSlot
|
|
5513
|
-
newRoomGridIndex: int
|
|
5514
|
-
|
|
5517
|
+
export declare function getNewRoomCandidatesForLevel(): ReadonlyArray<{
|
|
5518
|
+
readonly adjacentRoomGridIndex: int;
|
|
5519
|
+
readonly doorSlot: DoorSlot;
|
|
5520
|
+
readonly newRoomGridIndex: int;
|
|
5521
|
+
}>;
|
|
5515
5522
|
|
|
5516
5523
|
/**
|
|
5517
5524
|
* Helper function to get the stage that a trapdoor or heaven door would take the player to, based
|
|
@@ -6356,7 +6363,7 @@ export declare function getRoomGridIndex(): int;
|
|
|
6356
6363
|
* This function is variadic, meaning that you can specify N arguments to get the combined grid
|
|
6357
6364
|
* indexes for N room types.
|
|
6358
6365
|
*/
|
|
6359
|
-
export declare function getRoomGridIndexesForType(...roomTypes: RoomType[]): int[];
|
|
6366
|
+
export declare function getRoomGridIndexesForType(...roomTypes: RoomType[]): readonly int[];
|
|
6360
6367
|
|
|
6361
6368
|
/**
|
|
6362
6369
|
* Helper function to get the item pool type for the current room. For example, this returns
|
|
@@ -14483,7 +14490,7 @@ export declare function roomExists(roomGridIndex: int): boolean;
|
|
|
14483
14490
|
* - The bottom-left grid index of 156 is equal to coordinates of: (0, 12)
|
|
14484
14491
|
* - The bottom-right grid index of 168 is equal to coordinates of: (12, 12)
|
|
14485
14492
|
*/
|
|
14486
|
-
export declare function roomGridIndexToVector(roomGridIndex: int): Vector
|
|
14493
|
+
export declare function roomGridIndexToVector(roomGridIndex: int): Readonly<Vector>;
|
|
14487
14494
|
|
|
14488
14495
|
declare class RoomHistory extends Feature {
|
|
14489
14496
|
private postNewRoomEarly;
|
|
@@ -16200,10 +16207,7 @@ declare class StageHistory extends Feature {
|
|
|
16200
16207
|
*
|
|
16201
16208
|
* In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`.
|
|
16202
16209
|
*/
|
|
16203
|
-
getStageHistory():
|
|
16204
|
-
stage: LevelStage,
|
|
16205
|
-
stageType: StageType
|
|
16206
|
-
]>;
|
|
16210
|
+
getStageHistory(): readonly StageHistoryEntry[];
|
|
16207
16211
|
/**
|
|
16208
16212
|
* Helper function to check if a player has previous visited a particular stage (or stage + stage
|
|
16209
16213
|
* type combination) on this run.
|
|
@@ -16217,6 +16221,12 @@ declare class StageHistory extends Feature {
|
|
|
16217
16221
|
hasVisitedStage(stage: LevelStage, stageType?: StageType): boolean;
|
|
16218
16222
|
}
|
|
16219
16223
|
|
|
16224
|
+
/** This is used by the `StageHistory` feature. */
|
|
16225
|
+
declare interface StageHistoryEntry {
|
|
16226
|
+
readonly stage: LevelStage;
|
|
16227
|
+
readonly stageType: StageType;
|
|
16228
|
+
}
|
|
16229
|
+
|
|
16220
16230
|
/**
|
|
16221
16231
|
* Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
|
|
16222
16232
|
* console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 30.4.
|
|
3
|
+
isaacscript-common 30.4.2
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -1491,6 +1491,20 @@ do
|
|
|
1491
1491
|
end
|
|
1492
1492
|
end
|
|
1493
1493
|
|
|
1494
|
+
local function __TS__NumberToFixed(self, fractionDigits)
|
|
1495
|
+
if math.abs(self) >= 1e+21 or self ~= self then
|
|
1496
|
+
return tostring(self)
|
|
1497
|
+
end
|
|
1498
|
+
local f = math.floor(fractionDigits or 0)
|
|
1499
|
+
if f < 0 or f > 99 then
|
|
1500
|
+
error("toFixed() digits argument must be between 0 and 99", 0)
|
|
1501
|
+
end
|
|
1502
|
+
return string.format(
|
|
1503
|
+
("%." .. tostring(f)) .. "f",
|
|
1504
|
+
self
|
|
1505
|
+
)
|
|
1506
|
+
end
|
|
1507
|
+
|
|
1494
1508
|
local function __TS__ObjectDefineProperty(target, key, desc)
|
|
1495
1509
|
local luaKey = type(key) == "number" and key + 1 or key
|
|
1496
1510
|
local value = rawget(target, luaKey)
|
|
@@ -2463,6 +2477,7 @@ return {
|
|
|
2463
2477
|
__TS__NumberIsFinite = __TS__NumberIsFinite,
|
|
2464
2478
|
__TS__NumberIsNaN = __TS__NumberIsNaN,
|
|
2465
2479
|
__TS__NumberToString = __TS__NumberToString,
|
|
2480
|
+
__TS__NumberToFixed = __TS__NumberToFixed,
|
|
2466
2481
|
__TS__ObjectAssign = __TS__ObjectAssign,
|
|
2467
2482
|
__TS__ObjectDefineProperty = __TS__ObjectDefineProperty,
|
|
2468
2483
|
__TS__ObjectEntries = __TS__ObjectEntries,
|
|
@@ -27924,8 +27939,6 @@ local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
|
27924
27939
|
local HeartSubType = ____isaac_2Dtypescript_2Ddefinitions.HeartSubType
|
|
27925
27940
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
27926
27941
|
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
27927
|
-
local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
|
|
27928
|
-
local ACTIVE_SLOT_VALUES = ____cachedEnumValues.ACTIVE_SLOT_VALUES
|
|
27929
27942
|
local ____constants = require("src.core.constants")
|
|
27930
27943
|
local MAX_PLAYER_HEART_CONTAINERS = ____constants.MAX_PLAYER_HEART_CONTAINERS
|
|
27931
27944
|
local ____HealthType = require("src.enums.HealthType")
|
|
@@ -27939,6 +27952,7 @@ local getCharacterMaxHeartContainers = ____characters.getCharacterMaxHeartContai
|
|
|
27939
27952
|
local ____charge = require("src.functions.charge")
|
|
27940
27953
|
local getTotalCharge = ____charge.getTotalCharge
|
|
27941
27954
|
local ____players = require("src.functions.players")
|
|
27955
|
+
local getActiveItemSlots = ____players.getActiveItemSlots
|
|
27942
27956
|
local isCharacter = ____players.isCharacter
|
|
27943
27957
|
local isKeeper = ____players.isKeeper
|
|
27944
27958
|
local setActiveItem = ____players.setActiveItem
|
|
@@ -27997,18 +28011,14 @@ end
|
|
|
27997
28011
|
function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
27998
28012
|
local character = player:GetPlayerType()
|
|
27999
28013
|
local subPlayer = player:GetSubPlayer()
|
|
28000
|
-
|
|
28001
|
-
local
|
|
28002
|
-
|
|
28003
|
-
|
|
28004
|
-
|
|
28005
|
-
|
|
28006
|
-
local totalCharge = getTotalCharge(nil, player, activeSlot)
|
|
28007
|
-
setActiveItem(nil, player, CollectibleType.NULL, activeSlot)
|
|
28008
|
-
alabasterBoxes[#alabasterBoxes + 1] = {activeSlot, totalCharge}
|
|
28009
|
-
end
|
|
28010
|
-
end
|
|
28014
|
+
local alabasterBoxDescriptions = {}
|
|
28015
|
+
local alabasterBoxActiveSlots = getActiveItemSlots(nil, player, CollectibleType.ALABASTER_BOX)
|
|
28016
|
+
for ____, activeSlot in ipairs(alabasterBoxActiveSlots) do
|
|
28017
|
+
local totalCharge = getTotalCharge(nil, player, activeSlot)
|
|
28018
|
+
setActiveItem(nil, player, CollectibleType.NULL, activeSlot)
|
|
28019
|
+
alabasterBoxDescriptions[#alabasterBoxDescriptions + 1] = {activeSlot = activeSlot, totalCharge = totalCharge}
|
|
28011
28020
|
end
|
|
28021
|
+
____exports.removeAllPlayerHealth(nil, player)
|
|
28012
28022
|
if character == PlayerType.SOUL and subPlayer ~= nil then
|
|
28013
28023
|
subPlayer:AddMaxHearts(playerHealth.maxHearts, false)
|
|
28014
28024
|
else
|
|
@@ -28025,25 +28035,25 @@ function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
|
28025
28035
|
addAmount = 1
|
|
28026
28036
|
end
|
|
28027
28037
|
repeat
|
|
28028
|
-
local
|
|
28029
|
-
local
|
|
28030
|
-
if
|
|
28038
|
+
local ____switch70 = soulHeartType
|
|
28039
|
+
local ____cond70 = ____switch70 == HeartSubType.SOUL
|
|
28040
|
+
if ____cond70 then
|
|
28031
28041
|
do
|
|
28032
28042
|
player:AddSoulHearts(addAmount)
|
|
28033
28043
|
soulHeartsRemaining = soulHeartsRemaining - addAmount
|
|
28034
28044
|
break
|
|
28035
28045
|
end
|
|
28036
28046
|
end
|
|
28037
|
-
|
|
28038
|
-
if
|
|
28047
|
+
____cond70 = ____cond70 or ____switch70 == HeartSubType.BLACK
|
|
28048
|
+
if ____cond70 then
|
|
28039
28049
|
do
|
|
28040
28050
|
player:AddBlackHearts(addAmount)
|
|
28041
28051
|
soulHeartsRemaining = soulHeartsRemaining - addAmount
|
|
28042
28052
|
break
|
|
28043
28053
|
end
|
|
28044
28054
|
end
|
|
28045
|
-
|
|
28046
|
-
if
|
|
28055
|
+
____cond70 = ____cond70 or ____switch70 == HeartSubType.BONE
|
|
28056
|
+
if ____cond70 then
|
|
28047
28057
|
do
|
|
28048
28058
|
player:AddBoneHearts(addAmount)
|
|
28049
28059
|
break
|
|
@@ -28081,9 +28091,9 @@ function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
|
28081
28091
|
elseif character == PlayerType.BETHANY_B then
|
|
28082
28092
|
player:SetBloodCharge(playerHealth.bloodCharges)
|
|
28083
28093
|
end
|
|
28084
|
-
for ____, ____value in ipairs(
|
|
28085
|
-
local activeSlot = ____value
|
|
28086
|
-
local totalCharge = ____value
|
|
28094
|
+
for ____, ____value in ipairs(alabasterBoxDescriptions) do
|
|
28095
|
+
local activeSlot = ____value.activeSlot
|
|
28096
|
+
local totalCharge = ____value.totalCharge
|
|
28087
28097
|
setActiveItem(
|
|
28088
28098
|
nil,
|
|
28089
28099
|
player,
|
|
@@ -34182,7 +34192,7 @@ function CustomGridEntities.prototype.getCustomGridEntities(self)
|
|
|
34182
34192
|
local data = ____value[2]
|
|
34183
34193
|
local gridEntity = room:GetGridEntity(gridIndex)
|
|
34184
34194
|
if gridEntity ~= nil then
|
|
34185
|
-
customGridEntities[#customGridEntities + 1] = {gridEntity, data}
|
|
34195
|
+
customGridEntities[#customGridEntities + 1] = {gridEntity = gridEntity, data = data}
|
|
34186
34196
|
end
|
|
34187
34197
|
end
|
|
34188
34198
|
return customGridEntities
|
|
@@ -41062,6 +41072,10 @@ function ____exports.getNextStageType(self, upwards)
|
|
|
41062
41072
|
end
|
|
41063
41073
|
return calculateStageType(nil, nextStage)
|
|
41064
41074
|
end
|
|
41075
|
+
return ____exports
|
|
41076
|
+
end,
|
|
41077
|
+
["src.interfaces.StageHistoryEntry"] = function(...)
|
|
41078
|
+
local ____exports = {}
|
|
41065
41079
|
return ____exports
|
|
41066
41080
|
end,
|
|
41067
41081
|
["src.classes.features.other.StageHistory"] = function(...)
|
|
@@ -41104,7 +41118,7 @@ function StageHistory.prototype.____constructor(self)
|
|
|
41104
41118
|
local stage = level:GetStage()
|
|
41105
41119
|
local stageType = level:GetStageType()
|
|
41106
41120
|
local ____v_run_stageHistory_0 = v.run.stageHistory
|
|
41107
|
-
____v_run_stageHistory_0[#____v_run_stageHistory_0 + 1] = {stage, stageType}
|
|
41121
|
+
____v_run_stageHistory_0[#____v_run_stageHistory_0 + 1] = {stage = stage, stageType = stageType}
|
|
41108
41122
|
end
|
|
41109
41123
|
self.customCallbacksUsed = {{ModCallbackCustom.POST_NEW_LEVEL_REORDERED, self.postNewLevelReordered}}
|
|
41110
41124
|
end
|
|
@@ -41243,22 +41257,12 @@ function StageHistory.prototype.hasVisitedStage(self, stage, stageType)
|
|
|
41243
41257
|
if stageType == nil then
|
|
41244
41258
|
return __TS__ArraySome(
|
|
41245
41259
|
v.run.stageHistory,
|
|
41246
|
-
function(____,
|
|
41247
|
-
local previousStage
|
|
41248
|
-
previousStage = ____bindingPattern0[1]
|
|
41249
|
-
return previousStage == stage
|
|
41250
|
-
end
|
|
41260
|
+
function(____, stageHistoryEntry) return stageHistoryEntry.stage == stage end
|
|
41251
41261
|
)
|
|
41252
41262
|
end
|
|
41253
41263
|
return __TS__ArraySome(
|
|
41254
41264
|
v.run.stageHistory,
|
|
41255
|
-
function(____,
|
|
41256
|
-
local previousStageType
|
|
41257
|
-
local previousStage
|
|
41258
|
-
previousStage = ____bindingPattern0[1]
|
|
41259
|
-
previousStageType = ____bindingPattern0[2]
|
|
41260
|
-
return previousStage == stage and previousStageType == stageType
|
|
41261
|
-
end
|
|
41265
|
+
function(____, stageHistoryEntry) return stageHistoryEntry.stage == stage and stageHistoryEntry.stageType == stageType end
|
|
41262
41266
|
)
|
|
41263
41267
|
end
|
|
41264
41268
|
__TS__Decorate({Exported}, StageHistory.prototype, "getNextStageTypeWithHistory", true)
|
|
@@ -47236,7 +47240,7 @@ function ____exports.getNewRoomCandidatesBesideRoom(self, roomGridIndex)
|
|
|
47236
47240
|
if not ____exports.isDeadEnd(nil, adjacentRoomGridIndex) then
|
|
47237
47241
|
goto __continue17
|
|
47238
47242
|
end
|
|
47239
|
-
roomCandidates[#roomCandidates + 1] = {doorSlot, adjacentRoomGridIndex}
|
|
47243
|
+
roomCandidates[#roomCandidates + 1] = {doorSlot = doorSlot, roomGridIndex = adjacentRoomGridIndex}
|
|
47240
47244
|
end
|
|
47241
47245
|
::__continue17::
|
|
47242
47246
|
end
|
|
@@ -47252,9 +47256,9 @@ function ____exports.getNewRoomCandidatesForLevel(self)
|
|
|
47252
47256
|
for ____, room in ipairs(normalRooms) do
|
|
47253
47257
|
local newRoomCandidatesBesideRoom = ____exports.getNewRoomCandidatesBesideRoom(nil, room.SafeGridIndex)
|
|
47254
47258
|
for ____, ____value in ipairs(newRoomCandidatesBesideRoom) do
|
|
47255
|
-
local doorSlot = ____value
|
|
47256
|
-
local
|
|
47257
|
-
newRoomCandidates[#newRoomCandidates + 1] = {room.SafeGridIndex, doorSlot, newRoomGridIndex}
|
|
47259
|
+
local doorSlot = ____value.doorSlot
|
|
47260
|
+
local roomGridIndex = ____value.roomGridIndex
|
|
47261
|
+
newRoomCandidates[#newRoomCandidates + 1] = {adjacentRoomGridIndex = room.SafeGridIndex, doorSlot = doorSlot, newRoomGridIndex = roomGridIndex}
|
|
47258
47262
|
end
|
|
47259
47263
|
end
|
|
47260
47264
|
return newRoomCandidates
|
|
@@ -47408,7 +47412,9 @@ function ____exports.newRoom(self, seedOrRNG)
|
|
|
47408
47412
|
if newRoomCandidate == nil then
|
|
47409
47413
|
return nil
|
|
47410
47414
|
end
|
|
47411
|
-
local adjacentRoomGridIndex
|
|
47415
|
+
local adjacentRoomGridIndex = newRoomCandidate.adjacentRoomGridIndex
|
|
47416
|
+
local doorSlot = newRoomCandidate.doorSlot
|
|
47417
|
+
local newRoomGridIndex = newRoomCandidate.newRoomGridIndex
|
|
47412
47418
|
level:MakeRedRoomDoor(adjacentRoomGridIndex, doorSlot)
|
|
47413
47419
|
local roomDescriptor = getRoomDescriptor(nil, newRoomGridIndex)
|
|
47414
47420
|
roomDescriptor.Flags = removeFlag(nil, roomDescriptor.Flags, RoomDescriptorFlag.RED_ROOM)
|
|
@@ -50369,7 +50375,7 @@ local ____playerIndex = require("src.functions.playerIndex")
|
|
|
50369
50375
|
local getPlayerIndex = ____playerIndex.getPlayerIndex
|
|
50370
50376
|
local ____Feature = require("src.classes.private.Feature")
|
|
50371
50377
|
local Feature = ____Feature.Feature
|
|
50372
|
-
local v = {run = {
|
|
50378
|
+
local v = {run = {buttonActionPairs = {}}}
|
|
50373
50379
|
____exports.PressInput = __TS__Class()
|
|
50374
50380
|
local PressInput = ____exports.PressInput
|
|
50375
50381
|
PressInput.name = "PressInput"
|
|
@@ -50387,12 +50393,11 @@ function PressInput.prototype.____constructor(self)
|
|
|
50387
50393
|
end
|
|
50388
50394
|
local playerIndex = getPlayerIndex(nil, player)
|
|
50389
50395
|
do
|
|
50390
|
-
local i = #v.run.
|
|
50396
|
+
local i = #v.run.buttonActionPairs - 1
|
|
50391
50397
|
while i >= 0 do
|
|
50392
|
-
local
|
|
50393
|
-
|
|
50394
|
-
|
|
50395
|
-
__TS__ArraySplice(v.run.buttonActionTuples, i)
|
|
50398
|
+
local pair = v.run.buttonActionPairs[i + 1]
|
|
50399
|
+
if pair.playerIndex == playerIndex and pair.buttonAction == buttonAction then
|
|
50400
|
+
__TS__ArraySplice(v.run.buttonActionPairs, i)
|
|
50396
50401
|
return true
|
|
50397
50402
|
end
|
|
50398
50403
|
i = i - 1
|
|
@@ -50404,8 +50409,8 @@ function PressInput.prototype.____constructor(self)
|
|
|
50404
50409
|
end
|
|
50405
50410
|
function PressInput.prototype.pressInput(self, player, buttonAction)
|
|
50406
50411
|
local playerIndex = getPlayerIndex(nil, player)
|
|
50407
|
-
local
|
|
50408
|
-
|
|
50412
|
+
local ____v_run_buttonActionPairs_0 = v.run.buttonActionPairs
|
|
50413
|
+
____v_run_buttonActionPairs_0[#____v_run_buttonActionPairs_0 + 1] = {playerIndex = playerIndex, buttonAction = buttonAction}
|
|
50409
50414
|
end
|
|
50410
50415
|
__TS__Decorate({Exported}, PressInput.prototype, "pressInput", true)
|
|
50411
50416
|
return ____exports
|
package/dist/lualib_bundle.lua
CHANGED
|
@@ -1440,6 +1440,20 @@ do
|
|
|
1440
1440
|
end
|
|
1441
1441
|
end
|
|
1442
1442
|
|
|
1443
|
+
local function __TS__NumberToFixed(self, fractionDigits)
|
|
1444
|
+
if math.abs(self) >= 1e+21 or self ~= self then
|
|
1445
|
+
return tostring(self)
|
|
1446
|
+
end
|
|
1447
|
+
local f = math.floor(fractionDigits or 0)
|
|
1448
|
+
if f < 0 or f > 99 then
|
|
1449
|
+
error("toFixed() digits argument must be between 0 and 99", 0)
|
|
1450
|
+
end
|
|
1451
|
+
return string.format(
|
|
1452
|
+
("%." .. tostring(f)) .. "f",
|
|
1453
|
+
self
|
|
1454
|
+
)
|
|
1455
|
+
end
|
|
1456
|
+
|
|
1443
1457
|
local function __TS__ObjectDefineProperty(target, key, desc)
|
|
1444
1458
|
local luaKey = type(key) == "number" and key + 1 or key
|
|
1445
1459
|
local value = rawget(target, luaKey)
|
|
@@ -2412,6 +2426,7 @@ return {
|
|
|
2412
2426
|
__TS__NumberIsFinite = __TS__NumberIsFinite,
|
|
2413
2427
|
__TS__NumberIsNaN = __TS__NumberIsNaN,
|
|
2414
2428
|
__TS__NumberToString = __TS__NumberToString,
|
|
2429
|
+
__TS__NumberToFixed = __TS__NumberToFixed,
|
|
2415
2430
|
__TS__ObjectAssign = __TS__ObjectAssign,
|
|
2416
2431
|
__TS__ObjectDefineProperty = __TS__ObjectDefineProperty,
|
|
2417
2432
|
__TS__ObjectEntries = __TS__ObjectEntries,
|
|
@@ -112,10 +112,10 @@ export declare class CustomGridEntities extends Feature {
|
|
|
112
112
|
* In order to use this function, you must upgrade your mod with
|
|
113
113
|
* `ISCFeature.CUSTOM_GRID_ENTITIES`.
|
|
114
114
|
*/
|
|
115
|
-
getCustomGridEntities(): Array<
|
|
116
|
-
gridEntity: GridEntity
|
|
117
|
-
data: GridEntityCustomData
|
|
118
|
-
|
|
115
|
+
getCustomGridEntities(): Array<{
|
|
116
|
+
gridEntity: GridEntity;
|
|
117
|
+
data: GridEntityCustomData;
|
|
118
|
+
}>;
|
|
119
119
|
/**
|
|
120
120
|
* Helper function to get the custom `GridEntityType` from a `GridEntity` or grid index. Returns
|
|
121
121
|
* undefined if the provided `GridEntity` is not a custom grid entity, or if there was not a grid
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomGridEntities.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/CustomGridEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAClB,cAAc,EAGf,MAAM,8BAA8B,CAAC;AAatC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAiBhD,qBAAa,kBAAmB,SAAQ,OAAO;IAI7C,OAAO,CAAC,YAAY,CAAe;IA0BnC,OAAO,CAAC,0BAA0B,CA+ChC;IAGF,OAAO,CAAC,oBAAoB,CA4B1B;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+EG;IAEI,qBAAqB,CAC1B,oBAAoB,EAAE,cAAc,EACpC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,kBAAkB,CAAC,EAAE,kBAAkB,EACvC,QAAQ,CAAC,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,MAAM,EACzB,kBAAkB,iBAA4B,EAC9C,qBAAqB,SAAI,GACxB,UAAU;IA8Cb;;;;;;;;;;;;;;;;;OAiBG;IAEI,sBAAsB,CAC3B,+BAA+B,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,EAC1D,UAAU,UAAO,GAChB,UAAU,GAAG,SAAS;IAuCzB;;;;;;OAMG;IAEI,qBAAqB,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"CustomGridEntities.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/CustomGridEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAClB,cAAc,EAGf,MAAM,8BAA8B,CAAC;AAatC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAiBhD,qBAAa,kBAAmB,SAAQ,OAAO;IAI7C,OAAO,CAAC,YAAY,CAAe;IA0BnC,OAAO,CAAC,0BAA0B,CA+ChC;IAGF,OAAO,CAAC,oBAAoB,CA4B1B;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+EG;IAEI,qBAAqB,CAC1B,oBAAoB,EAAE,cAAc,EACpC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,kBAAkB,CAAC,EAAE,kBAAkB,EACvC,QAAQ,CAAC,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,MAAM,EACzB,kBAAkB,iBAA4B,EAC9C,qBAAqB,SAAI,GACxB,UAAU;IA8Cb;;;;;;;;;;;;;;;;;OAiBG;IAEI,sBAAsB,CAC3B,+BAA+B,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,EAC1D,UAAU,UAAO,GAChB,UAAU,GAAG,SAAS;IAuCzB;;;;;;OAMG;IAEI,qBAAqB,IAAI,KAAK,CAAC;QACpC,UAAU,EAAE,UAAU,CAAC;QACvB,IAAI,EAAE,oBAAoB,CAAC;KAC5B,CAAC;IAuBF;;;;;;;OAOG;IAEI,uBAAuB,CAC5B,qBAAqB,EAAE,UAAU,GAAG,GAAG,GACtC,cAAc,GAAG,SAAS;IAyB7B;;;;;;OAMG;IAEI,kBAAkB,CAAC,qBAAqB,EAAE,UAAU,GAAG,GAAG,GAAG,OAAO;CAM5E"}
|
|
@@ -193,7 +193,7 @@ function CustomGridEntities.prototype.getCustomGridEntities(self)
|
|
|
193
193
|
local data = ____value[2]
|
|
194
194
|
local gridEntity = room:GetGridEntity(gridIndex)
|
|
195
195
|
if gridEntity ~= nil then
|
|
196
|
-
customGridEntities[#customGridEntities + 1] = {gridEntity, data}
|
|
196
|
+
customGridEntities[#customGridEntities + 1] = {gridEntity = gridEntity, data = data}
|
|
197
197
|
end
|
|
198
198
|
end
|
|
199
199
|
return customGridEntities
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PressInput.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PressInput.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"PressInput.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PressInput.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAWhD,qBAAa,UAAW,SAAQ,OAAO;IAoBrC,OAAO,CAAC,iBAAiB,CA8BvB;IAEF;;;;;;OAMG;IAEI,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI;CAI1E"}
|
|
@@ -13,7 +13,7 @@ local ____playerIndex = require("src.functions.playerIndex")
|
|
|
13
13
|
local getPlayerIndex = ____playerIndex.getPlayerIndex
|
|
14
14
|
local ____Feature = require("src.classes.private.Feature")
|
|
15
15
|
local Feature = ____Feature.Feature
|
|
16
|
-
local v = {run = {
|
|
16
|
+
local v = {run = {buttonActionPairs = {}}}
|
|
17
17
|
____exports.PressInput = __TS__Class()
|
|
18
18
|
local PressInput = ____exports.PressInput
|
|
19
19
|
PressInput.name = "PressInput"
|
|
@@ -31,12 +31,11 @@ function PressInput.prototype.____constructor(self)
|
|
|
31
31
|
end
|
|
32
32
|
local playerIndex = getPlayerIndex(nil, player)
|
|
33
33
|
do
|
|
34
|
-
local i = #v.run.
|
|
34
|
+
local i = #v.run.buttonActionPairs - 1
|
|
35
35
|
while i >= 0 do
|
|
36
|
-
local
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
__TS__ArraySplice(v.run.buttonActionTuples, i)
|
|
36
|
+
local pair = v.run.buttonActionPairs[i + 1]
|
|
37
|
+
if pair.playerIndex == playerIndex and pair.buttonAction == buttonAction then
|
|
38
|
+
__TS__ArraySplice(v.run.buttonActionPairs, i)
|
|
40
39
|
return true
|
|
41
40
|
end
|
|
42
41
|
i = i - 1
|
|
@@ -48,8 +47,8 @@ function PressInput.prototype.____constructor(self)
|
|
|
48
47
|
end
|
|
49
48
|
function PressInput.prototype.pressInput(self, player, buttonAction)
|
|
50
49
|
local playerIndex = getPlayerIndex(nil, player)
|
|
51
|
-
local
|
|
52
|
-
|
|
50
|
+
local ____v_run_buttonActionPairs_0 = v.run.buttonActionPairs
|
|
51
|
+
____v_run_buttonActionPairs_0[#____v_run_buttonActionPairs_0 + 1] = {playerIndex = playerIndex, buttonAction = buttonAction}
|
|
53
52
|
end
|
|
54
53
|
__TS__Decorate({Exported}, PressInput.prototype, "pressInput", true)
|
|
55
54
|
return ____exports
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LevelStage, StageType } from "isaac-typescript-definitions";
|
|
2
|
+
import { StageHistoryEntry } from "../../../interfaces/StageHistoryEntry";
|
|
2
3
|
import { Feature } from "../../private/Feature";
|
|
3
4
|
export declare class StageHistory extends Feature {
|
|
4
5
|
private postNewLevelReordered;
|
|
@@ -32,10 +33,7 @@ export declare class StageHistory extends Feature {
|
|
|
32
33
|
*
|
|
33
34
|
* In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`.
|
|
34
35
|
*/
|
|
35
|
-
getStageHistory():
|
|
36
|
-
stage: LevelStage,
|
|
37
|
-
stageType: StageType
|
|
38
|
-
]>;
|
|
36
|
+
getStageHistory(): readonly StageHistoryEntry[];
|
|
39
37
|
/**
|
|
40
38
|
* Helper function to check if a player has previous visited a particular stage (or stage + stage
|
|
41
39
|
* type combination) on this run.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageHistory.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/StageHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAUtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,qBAAa,YAAa,SAAQ,OAAO;IAcvC,OAAO,CAAC,qBAAqB,CAM3B;IAEF;;;;;;;;;;;;OAYG;IAEI,2BAA2B,CAAC,OAAO,UAAQ,GAAG,SAAS;IAiG9D;;;;;;;;;OASG;IAEI,uBAAuB,IAAI,UAAU;IA8H5C;;;;OAIG;IAEI,eAAe,IAAI,
|
|
1
|
+
{"version":3,"file":"StageHistory.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/StageHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAUtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,qBAAa,YAAa,SAAQ,OAAO;IAcvC,OAAO,CAAC,qBAAqB,CAM3B;IAEF;;;;;;;;;;;;OAYG;IAEI,2BAA2B,CAAC,OAAO,UAAQ,GAAG,SAAS;IAiG9D;;;;;;;;;OASG;IAEI,uBAAuB,IAAI,UAAU;IA8H5C;;;;OAIG;IAEI,eAAe,IAAI,SAAS,iBAAiB,EAAE;IAItD;;;;;;;;;OASG;IAEI,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO;CAa1E"}
|
|
@@ -37,7 +37,7 @@ function StageHistory.prototype.____constructor(self)
|
|
|
37
37
|
local stage = level:GetStage()
|
|
38
38
|
local stageType = level:GetStageType()
|
|
39
39
|
local ____v_run_stageHistory_0 = v.run.stageHistory
|
|
40
|
-
____v_run_stageHistory_0[#____v_run_stageHistory_0 + 1] = {stage, stageType}
|
|
40
|
+
____v_run_stageHistory_0[#____v_run_stageHistory_0 + 1] = {stage = stage, stageType = stageType}
|
|
41
41
|
end
|
|
42
42
|
self.customCallbacksUsed = {{ModCallbackCustom.POST_NEW_LEVEL_REORDERED, self.postNewLevelReordered}}
|
|
43
43
|
end
|
|
@@ -176,22 +176,12 @@ function StageHistory.prototype.hasVisitedStage(self, stage, stageType)
|
|
|
176
176
|
if stageType == nil then
|
|
177
177
|
return __TS__ArraySome(
|
|
178
178
|
v.run.stageHistory,
|
|
179
|
-
function(____,
|
|
180
|
-
local previousStage
|
|
181
|
-
previousStage = ____bindingPattern0[1]
|
|
182
|
-
return previousStage == stage
|
|
183
|
-
end
|
|
179
|
+
function(____, stageHistoryEntry) return stageHistoryEntry.stage == stage end
|
|
184
180
|
)
|
|
185
181
|
end
|
|
186
182
|
return __TS__ArraySome(
|
|
187
183
|
v.run.stageHistory,
|
|
188
|
-
function(____,
|
|
189
|
-
local previousStageType
|
|
190
|
-
local previousStage
|
|
191
|
-
previousStage = ____bindingPattern0[1]
|
|
192
|
-
previousStageType = ____bindingPattern0[2]
|
|
193
|
-
return previousStage == stage and previousStageType == stageType
|
|
194
|
-
end
|
|
184
|
+
function(____, stageHistoryEntry) return stageHistoryEntry.stage == stage and stageHistoryEntry.stageType == stageType end
|
|
195
185
|
)
|
|
196
186
|
end
|
|
197
187
|
__TS__Decorate({Exported}, StageHistory.prototype, "getNextStageTypeWithHistory", true)
|
|
@@ -13,7 +13,7 @@ import { DoorSlot, RoomShape, RoomType } from "isaac-typescript-definitions";
|
|
|
13
13
|
* This is just a filtering of the results of the `getAdjacentExistingRoomGridIndexes` function. See
|
|
14
14
|
* that function for more information.
|
|
15
15
|
*/
|
|
16
|
-
export declare function getAdjacentExistingRoomGridIndexes(roomGridIndex?: int): int[];
|
|
16
|
+
export declare function getAdjacentExistingRoomGridIndexes(roomGridIndex?: int): readonly int[];
|
|
17
17
|
/**
|
|
18
18
|
* Helper function to get only the adjacent room grid indexes that do not exist (i.e. do not have
|
|
19
19
|
* room data).
|
|
@@ -21,7 +21,7 @@ export declare function getAdjacentExistingRoomGridIndexes(roomGridIndex?: int):
|
|
|
21
21
|
* This is just a filtering of the results of the `getAdjacentExistingRoomGridIndexes` function. See
|
|
22
22
|
* that function for more information.
|
|
23
23
|
*/
|
|
24
|
-
export declare function getAdjacentNonExistingRoomGridIndexes(roomGridIndex?: int): int[];
|
|
24
|
+
export declare function getAdjacentNonExistingRoomGridIndexes(roomGridIndex?: int): readonly int[];
|
|
25
25
|
/**
|
|
26
26
|
* Helper function to get all of the room grid indexes that are adjacent to a given room grid index
|
|
27
27
|
* (even if those room grid indexes do not have any rooms in them).
|
|
@@ -37,9 +37,9 @@ export declare function getAdjacentNonExistingRoomGridIndexes(roomGridIndex?: in
|
|
|
37
37
|
*
|
|
38
38
|
* @param roomGridIndex Optional. Default is the current room index.
|
|
39
39
|
*/
|
|
40
|
-
export declare function getAdjacentRoomGridIndexes(roomGridIndex?: int): int[];
|
|
40
|
+
export declare function getAdjacentRoomGridIndexes(roomGridIndex?: int): readonly int[];
|
|
41
41
|
/** Helper function to get the room safe grid index for every room on the entire floor. */
|
|
42
|
-
export declare function getAllRoomGridIndexes(): int[];
|
|
42
|
+
export declare function getAllRoomGridIndexes(): readonly int[];
|
|
43
43
|
/**
|
|
44
44
|
* Helper function to pick a random valid spot on the floor to insert a brand new room. Note that
|
|
45
45
|
* some floors will not have any valid spots. If this is the case, this function will return
|
|
@@ -50,7 +50,11 @@ export declare function getAllRoomGridIndexes(): int[];
|
|
|
50
50
|
* @returns Either a tuple of adjacent room grid index, `DoorSlot`, and new room grid index, or
|
|
51
51
|
* undefined.
|
|
52
52
|
*/
|
|
53
|
-
export declare function getNewRoomCandidate(seedOrRNG?: Seed | RNG):
|
|
53
|
+
export declare function getNewRoomCandidate(seedOrRNG?: Seed | RNG): {
|
|
54
|
+
readonly adjacentRoomGridIndex: int;
|
|
55
|
+
readonly doorSlot: DoorSlot;
|
|
56
|
+
readonly newRoomGridIndex: int;
|
|
57
|
+
} | undefined;
|
|
54
58
|
/**
|
|
55
59
|
* Helper function to iterate through the possible doors for a room and see if any of them would be
|
|
56
60
|
* a valid spot to insert a brand new room on the floor. (Any potential new rooms cannot be
|
|
@@ -59,7 +63,10 @@ export declare function getNewRoomCandidate(seedOrRNG?: Seed | RNG): [adjacentRo
|
|
|
59
63
|
* @param roomGridIndex Optional. Default is the current room index.
|
|
60
64
|
* @returns A array of tuples of `DoorSlot` and room grid index.
|
|
61
65
|
*/
|
|
62
|
-
export declare function getNewRoomCandidatesBesideRoom(roomGridIndex?: int):
|
|
66
|
+
export declare function getNewRoomCandidatesBesideRoom(roomGridIndex?: int): ReadonlyArray<{
|
|
67
|
+
readonly doorSlot: DoorSlot;
|
|
68
|
+
readonly roomGridIndex: int;
|
|
69
|
+
}>;
|
|
63
70
|
/**
|
|
64
71
|
* Helper function to search through all of the rooms on the floor for a spot to insert a brand new
|
|
65
72
|
* room.
|
|
@@ -67,11 +74,11 @@ export declare function getNewRoomCandidatesBesideRoom(roomGridIndex?: int): Arr
|
|
|
67
74
|
* @returns A array of tuples containing the adjacent room grid index, the `DoorSlot`, and the new
|
|
68
75
|
* room grid index.
|
|
69
76
|
*/
|
|
70
|
-
export declare function getNewRoomCandidatesForLevel():
|
|
71
|
-
adjacentRoomGridIndex: int
|
|
72
|
-
doorSlot: DoorSlot
|
|
73
|
-
newRoomGridIndex: int
|
|
74
|
-
|
|
77
|
+
export declare function getNewRoomCandidatesForLevel(): ReadonlyArray<{
|
|
78
|
+
readonly adjacentRoomGridIndex: int;
|
|
79
|
+
readonly doorSlot: DoorSlot;
|
|
80
|
+
readonly newRoomGridIndex: int;
|
|
81
|
+
}>;
|
|
75
82
|
/**
|
|
76
83
|
* Helper function to get the grid indexes of all the rooms connected to the given room index,
|
|
77
84
|
* taking the shape of the room into account. (This will only include rooms with valid data.)
|
|
@@ -102,7 +109,7 @@ export declare function getRoomDescriptorsForType(...roomTypes: RoomType[]): Roo
|
|
|
102
109
|
* This function is variadic, meaning that you can specify N arguments to get the combined grid
|
|
103
110
|
* indexes for N room types.
|
|
104
111
|
*/
|
|
105
|
-
export declare function getRoomGridIndexesForType(...roomTypes: RoomType[]): int[];
|
|
112
|
+
export declare function getRoomGridIndexesForType(...roomTypes: RoomType[]): readonly int[];
|
|
106
113
|
/**
|
|
107
114
|
* Helper function to get only the adjacent room grid indexes for a room shape that exist (i.e. have
|
|
108
115
|
* room data).
|
|
@@ -199,7 +206,7 @@ export declare function roomExists(roomGridIndex: int): boolean;
|
|
|
199
206
|
* - The bottom-left grid index of 156 is equal to coordinates of: (0, 12)
|
|
200
207
|
* - The bottom-right grid index of 168 is equal to coordinates of: (12, 12)
|
|
201
208
|
*/
|
|
202
|
-
export declare function roomGridIndexToVector(roomGridIndex: int): Vector
|
|
209
|
+
export declare function roomGridIndexToVector(roomGridIndex: int): Readonly<Vector>;
|
|
203
210
|
/**
|
|
204
211
|
* Helper function to convert a room grid index expressed as a vector back into an integer.
|
|
205
212
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"levelGrid.d.ts","sourceRoot":"","sources":["../../../src/functions/levelGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,QAAQ,EAKR,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AA+BtC;;;;;GAKG;AACH,wBAAgB,kCAAkC,
|
|
1
|
+
{"version":3,"file":"levelGrid.d.ts","sourceRoot":"","sources":["../../../src/functions/levelGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,QAAQ,EAKR,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AA+BtC;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAChD,aAAa,CAAC,EAAE,GAAG,GAClB,SAAS,GAAG,EAAE,CAKhB;AAED;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,aAAa,CAAC,EAAE,GAAG,GAClB,SAAS,GAAG,EAAE,CAKhB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,CAAC,EAAE,GAAG,GAClB,SAAS,GAAG,EAAE,CAehB;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,IAAI,SAAS,GAAG,EAAE,CAGtD;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,GAAE,IAAI,GAAG,GAAqB,GACvE;IACE,QAAQ,CAAC,qBAAqB,EAAE,GAAG,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC;CAChC,GACD,SAAS,CAOZ;AAED;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,aAAa,CAAC,EAAE,GAAG,GAClB,aAAa,CAAC;IAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,aAAa,EAAE,GAAG,CAAA;CAAE,CAAC,CAiD7E;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,IAAI,aAAa,CAAC;IAC5D,QAAQ,CAAC,qBAAqB,EAAE,GAAG,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC;CAChC,CAAC,CAmCD;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,CAAC,EAAE,GAAG,GAClB,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAgB5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,SAAS,EAAE,QAAQ,EAAE,GACvB,cAAc,EAAE,CASlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,SAAS,EAAE,QAAQ,EAAE,GACvB,SAAS,GAAG,EAAE,CAGhB;AAED;;;;;;GAMG;AACH,wBAAgB,uCAAuC,CACrD,iBAAiB,EAAE,GAAG,EACtB,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAa5B;AAED;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CACjD,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAE5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAC7C,iBAAiB,EAAE,GAAG,EACtB,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAa5B;AAED;;;;;;GAMG;AACH,wBAAgB,0CAA0C,CACxD,iBAAiB,EAAE,GAAG,EACtB,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAa5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAKtD;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,GAAG,GACjB,OAAO,CAGT;AAED,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,GAAG,GACjB,OAAO,CAqBT;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAGzD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAM7D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,SAAS,CAmD/D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAGtD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAK1E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAE7D"}
|
|
@@ -116,7 +116,7 @@ function ____exports.getNewRoomCandidatesBesideRoom(self, roomGridIndex)
|
|
|
116
116
|
if not ____exports.isDeadEnd(nil, adjacentRoomGridIndex) then
|
|
117
117
|
goto __continue17
|
|
118
118
|
end
|
|
119
|
-
roomCandidates[#roomCandidates + 1] = {doorSlot, adjacentRoomGridIndex}
|
|
119
|
+
roomCandidates[#roomCandidates + 1] = {doorSlot = doorSlot, roomGridIndex = adjacentRoomGridIndex}
|
|
120
120
|
end
|
|
121
121
|
::__continue17::
|
|
122
122
|
end
|
|
@@ -137,9 +137,9 @@ function ____exports.getNewRoomCandidatesForLevel(self)
|
|
|
137
137
|
for ____, room in ipairs(normalRooms) do
|
|
138
138
|
local newRoomCandidatesBesideRoom = ____exports.getNewRoomCandidatesBesideRoom(nil, room.SafeGridIndex)
|
|
139
139
|
for ____, ____value in ipairs(newRoomCandidatesBesideRoom) do
|
|
140
|
-
local doorSlot = ____value
|
|
141
|
-
local
|
|
142
|
-
newRoomCandidates[#newRoomCandidates + 1] = {room.SafeGridIndex, doorSlot, newRoomGridIndex}
|
|
140
|
+
local doorSlot = ____value.doorSlot
|
|
141
|
+
local roomGridIndex = ____value.roomGridIndex
|
|
142
|
+
newRoomCandidates[#newRoomCandidates + 1] = {adjacentRoomGridIndex = room.SafeGridIndex, doorSlot = doorSlot, newRoomGridIndex = roomGridIndex}
|
|
143
143
|
end
|
|
144
144
|
end
|
|
145
145
|
return newRoomCandidates
|
|
@@ -385,7 +385,9 @@ function ____exports.newRoom(self, seedOrRNG)
|
|
|
385
385
|
if newRoomCandidate == nil then
|
|
386
386
|
return nil
|
|
387
387
|
end
|
|
388
|
-
local adjacentRoomGridIndex
|
|
388
|
+
local adjacentRoomGridIndex = newRoomCandidate.adjacentRoomGridIndex
|
|
389
|
+
local doorSlot = newRoomCandidate.doorSlot
|
|
390
|
+
local newRoomGridIndex = newRoomCandidate.newRoomGridIndex
|
|
389
391
|
level:MakeRedRoomDoor(adjacentRoomGridIndex, doorSlot)
|
|
390
392
|
local roomDescriptor = getRoomDescriptor(nil, newRoomGridIndex)
|
|
391
393
|
roomDescriptor.Flags = removeFlag(nil, roomDescriptor.Flags, RoomDescriptorFlag.RED_ROOM)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerHealth.d.ts","sourceRoot":"","sources":["../../../src/functions/playerHealth.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"playerHealth.d.ts","sourceRoot":"","sources":["../../../src/functions/playerHealth.ts"],"names":[],"mappings":";;AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAiB,MAAM,4BAA4B,CAAC;AAYzE,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,GAAG,GACb,IAAI,CA+CN;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAMlE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAK1E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAKzE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAYtE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAK9D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CA2ElE;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,GACrB,GAAG,CAmDL;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAKzD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CAoDnE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAqCrE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAK7D;AAED;;;;;;;;;GASG;AACH,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,YAAY,GACnB,GAAG,CAML;AAED,sDAAsD;AACtD,wBAAgB,eAAe,IAAI,YAAY,CAc9C;AAED,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,YAAY,GACnB,IAAI,CAQN;AAED,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,YAAY,GACnB,IAAI,CAQN;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAMjE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAwBhE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,YAAY,GACzB,IAAI,CAyHN;AAED;;;;;;;;;GASG;AACH,wBAAgB,sDAAsD,CACpE,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,KAAK,GAClB,OAAO,CAyBT"}
|
|
@@ -7,8 +7,6 @@ local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
|
7
7
|
local HeartSubType = ____isaac_2Dtypescript_2Ddefinitions.HeartSubType
|
|
8
8
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
9
9
|
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
10
|
-
local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
|
|
11
|
-
local ACTIVE_SLOT_VALUES = ____cachedEnumValues.ACTIVE_SLOT_VALUES
|
|
12
10
|
local ____constants = require("src.core.constants")
|
|
13
11
|
local MAX_PLAYER_HEART_CONTAINERS = ____constants.MAX_PLAYER_HEART_CONTAINERS
|
|
14
12
|
local ____HealthType = require("src.enums.HealthType")
|
|
@@ -22,6 +20,7 @@ local getCharacterMaxHeartContainers = ____characters.getCharacterMaxHeartContai
|
|
|
22
20
|
local ____charge = require("src.functions.charge")
|
|
23
21
|
local getTotalCharge = ____charge.getTotalCharge
|
|
24
22
|
local ____players = require("src.functions.players")
|
|
23
|
+
local getActiveItemSlots = ____players.getActiveItemSlots
|
|
25
24
|
local isCharacter = ____players.isCharacter
|
|
26
25
|
local isKeeper = ____players.isKeeper
|
|
27
26
|
local setActiveItem = ____players.setActiveItem
|
|
@@ -106,18 +105,14 @@ end
|
|
|
106
105
|
function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
107
106
|
local character = player:GetPlayerType()
|
|
108
107
|
local subPlayer = player:GetSubPlayer()
|
|
109
|
-
|
|
110
|
-
local
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
local totalCharge = getTotalCharge(nil, player, activeSlot)
|
|
116
|
-
setActiveItem(nil, player, CollectibleType.NULL, activeSlot)
|
|
117
|
-
alabasterBoxes[#alabasterBoxes + 1] = {activeSlot, totalCharge}
|
|
118
|
-
end
|
|
119
|
-
end
|
|
108
|
+
local alabasterBoxDescriptions = {}
|
|
109
|
+
local alabasterBoxActiveSlots = getActiveItemSlots(nil, player, CollectibleType.ALABASTER_BOX)
|
|
110
|
+
for ____, activeSlot in ipairs(alabasterBoxActiveSlots) do
|
|
111
|
+
local totalCharge = getTotalCharge(nil, player, activeSlot)
|
|
112
|
+
setActiveItem(nil, player, CollectibleType.NULL, activeSlot)
|
|
113
|
+
alabasterBoxDescriptions[#alabasterBoxDescriptions + 1] = {activeSlot = activeSlot, totalCharge = totalCharge}
|
|
120
114
|
end
|
|
115
|
+
____exports.removeAllPlayerHealth(nil, player)
|
|
121
116
|
if character == PlayerType.SOUL and subPlayer ~= nil then
|
|
122
117
|
subPlayer:AddMaxHearts(playerHealth.maxHearts, false)
|
|
123
118
|
else
|
|
@@ -134,25 +129,25 @@ function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
|
134
129
|
addAmount = 1
|
|
135
130
|
end
|
|
136
131
|
repeat
|
|
137
|
-
local
|
|
138
|
-
local
|
|
139
|
-
if
|
|
132
|
+
local ____switch70 = soulHeartType
|
|
133
|
+
local ____cond70 = ____switch70 == HeartSubType.SOUL
|
|
134
|
+
if ____cond70 then
|
|
140
135
|
do
|
|
141
136
|
player:AddSoulHearts(addAmount)
|
|
142
137
|
soulHeartsRemaining = soulHeartsRemaining - addAmount
|
|
143
138
|
break
|
|
144
139
|
end
|
|
145
140
|
end
|
|
146
|
-
|
|
147
|
-
if
|
|
141
|
+
____cond70 = ____cond70 or ____switch70 == HeartSubType.BLACK
|
|
142
|
+
if ____cond70 then
|
|
148
143
|
do
|
|
149
144
|
player:AddBlackHearts(addAmount)
|
|
150
145
|
soulHeartsRemaining = soulHeartsRemaining - addAmount
|
|
151
146
|
break
|
|
152
147
|
end
|
|
153
148
|
end
|
|
154
|
-
|
|
155
|
-
if
|
|
149
|
+
____cond70 = ____cond70 or ____switch70 == HeartSubType.BONE
|
|
150
|
+
if ____cond70 then
|
|
156
151
|
do
|
|
157
152
|
player:AddBoneHearts(addAmount)
|
|
158
153
|
break
|
|
@@ -190,9 +185,9 @@ function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
|
190
185
|
elseif character == PlayerType.BETHANY_B then
|
|
191
186
|
player:SetBloodCharge(playerHealth.bloodCharges)
|
|
192
187
|
end
|
|
193
|
-
for ____, ____value in ipairs(
|
|
194
|
-
local activeSlot = ____value
|
|
195
|
-
local totalCharge = ____value
|
|
188
|
+
for ____, ____value in ipairs(alabasterBoxDescriptions) do
|
|
189
|
+
local activeSlot = ____value.activeSlot
|
|
190
|
+
local totalCharge = ____value.totalCharge
|
|
196
191
|
setActiveItem(
|
|
197
192
|
nil,
|
|
198
193
|
player,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LevelStage, StageType } from "isaac-typescript-definitions";
|
|
2
|
+
/** This is used by the `StageHistory` feature. */
|
|
3
|
+
export interface StageHistoryEntry {
|
|
4
|
+
readonly stage: LevelStage;
|
|
5
|
+
readonly stageType: StageType;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=StageHistoryEntry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StageHistoryEntry.d.ts","sourceRoot":"","sources":["../../../src/interfaces/StageHistoryEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAErE,kDAAkD;AAClD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;CAC/B"}
|
package/package.json
CHANGED
|
@@ -351,9 +351,10 @@ export class CustomGridEntities extends Feature {
|
|
|
351
351
|
* `ISCFeature.CUSTOM_GRID_ENTITIES`.
|
|
352
352
|
*/
|
|
353
353
|
@Exported
|
|
354
|
-
public getCustomGridEntities(): Array<
|
|
355
|
-
|
|
356
|
-
|
|
354
|
+
public getCustomGridEntities(): Array<{
|
|
355
|
+
gridEntity: GridEntity;
|
|
356
|
+
data: GridEntityCustomData;
|
|
357
|
+
}> {
|
|
357
358
|
const roomListIndex = getRoomListIndex();
|
|
358
359
|
const roomCustomGridEntities =
|
|
359
360
|
v.level.customGridEntities.get(roomListIndex);
|
|
@@ -362,11 +363,14 @@ export class CustomGridEntities extends Feature {
|
|
|
362
363
|
}
|
|
363
364
|
|
|
364
365
|
const room = game.GetRoom();
|
|
365
|
-
const customGridEntities: Array<
|
|
366
|
+
const customGridEntities: Array<{
|
|
367
|
+
gridEntity: GridEntity;
|
|
368
|
+
data: GridEntityCustomData;
|
|
369
|
+
}> = [];
|
|
366
370
|
for (const [gridIndex, data] of roomCustomGridEntities) {
|
|
367
371
|
const gridEntity = room.GetGridEntity(gridIndex);
|
|
368
372
|
if (gridEntity !== undefined) {
|
|
369
|
-
customGridEntities.push(
|
|
373
|
+
customGridEntities.push({ gridEntity, data });
|
|
370
374
|
}
|
|
371
375
|
}
|
|
372
376
|
|
|
@@ -10,7 +10,10 @@ import { Feature } from "../../private/Feature";
|
|
|
10
10
|
|
|
11
11
|
const v = {
|
|
12
12
|
run: {
|
|
13
|
-
|
|
13
|
+
buttonActionPairs: [] as Array<{
|
|
14
|
+
playerIndex: PlayerIndex;
|
|
15
|
+
buttonAction: ButtonAction;
|
|
16
|
+
}>,
|
|
14
17
|
},
|
|
15
18
|
};
|
|
16
19
|
|
|
@@ -50,16 +53,15 @@ export class PressInput extends Feature {
|
|
|
50
53
|
|
|
51
54
|
const playerIndex = getPlayerIndex(player);
|
|
52
55
|
|
|
53
|
-
for (let i = v.run.
|
|
56
|
+
for (let i = v.run.buttonActionPairs.length - 1; i >= 0; i--) {
|
|
54
57
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
55
|
-
const
|
|
56
|
-
const [tuplePlayerIndex, tupleButtonAction] = tuple;
|
|
58
|
+
const pair = v.run.buttonActionPairs[i]!;
|
|
57
59
|
|
|
58
60
|
if (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
pair.playerIndex === playerIndex &&
|
|
62
|
+
pair.buttonAction === buttonAction
|
|
61
63
|
) {
|
|
62
|
-
v.run.
|
|
64
|
+
v.run.buttonActionPairs.splice(i);
|
|
63
65
|
return true;
|
|
64
66
|
}
|
|
65
67
|
}
|
|
@@ -77,6 +79,6 @@ export class PressInput extends Feature {
|
|
|
77
79
|
@Exported
|
|
78
80
|
public pressInput(player: EntityPlayer, buttonAction: ButtonAction): void {
|
|
79
81
|
const playerIndex = getPlayerIndex(player);
|
|
80
|
-
v.run.
|
|
82
|
+
v.run.buttonActionPairs.push({ playerIndex, buttonAction });
|
|
81
83
|
}
|
|
82
84
|
}
|
|
@@ -12,11 +12,12 @@ import {
|
|
|
12
12
|
onRepentanceStage,
|
|
13
13
|
} from "../../../functions/stage";
|
|
14
14
|
import { asNumber } from "../../../functions/types";
|
|
15
|
+
import { StageHistoryEntry } from "../../../interfaces/StageHistoryEntry";
|
|
15
16
|
import { Feature } from "../../private/Feature";
|
|
16
17
|
|
|
17
18
|
const v = {
|
|
18
19
|
run: {
|
|
19
|
-
stageHistory: [] as
|
|
20
|
+
stageHistory: [] as StageHistoryEntry[],
|
|
20
21
|
},
|
|
21
22
|
};
|
|
22
23
|
|
|
@@ -39,7 +40,7 @@ export class StageHistory extends Feature {
|
|
|
39
40
|
const stage = level.GetStage();
|
|
40
41
|
const stageType = level.GetStageType();
|
|
41
42
|
|
|
42
|
-
v.run.stageHistory.push(
|
|
43
|
+
v.run.stageHistory.push({ stage, stageType });
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
/**
|
|
@@ -296,9 +297,7 @@ export class StageHistory extends Feature {
|
|
|
296
297
|
* In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`.
|
|
297
298
|
*/
|
|
298
299
|
@Exported
|
|
299
|
-
public getStageHistory():
|
|
300
|
-
[stage: LevelStage, stageType: StageType]
|
|
301
|
-
> {
|
|
300
|
+
public getStageHistory(): readonly StageHistoryEntry[] {
|
|
302
301
|
return v.run.stageHistory;
|
|
303
302
|
}
|
|
304
303
|
|
|
@@ -316,13 +315,14 @@ export class StageHistory extends Feature {
|
|
|
316
315
|
public hasVisitedStage(stage: LevelStage, stageType?: StageType): boolean {
|
|
317
316
|
if (stageType === undefined) {
|
|
318
317
|
return v.run.stageHistory.some(
|
|
319
|
-
(
|
|
318
|
+
(stageHistoryEntry) => stageHistoryEntry.stage === stage,
|
|
320
319
|
);
|
|
321
320
|
}
|
|
322
321
|
|
|
323
322
|
return v.run.stageHistory.some(
|
|
324
|
-
(
|
|
325
|
-
|
|
323
|
+
(stageHistoryEntry) =>
|
|
324
|
+
stageHistoryEntry.stage === stage &&
|
|
325
|
+
stageHistoryEntry.stageType === stageType,
|
|
326
326
|
);
|
|
327
327
|
}
|
|
328
328
|
}
|
|
@@ -53,7 +53,9 @@ const ADJACENT_ROOM_GRID_INDEX_DELTAS = [LEFT, UP, RIGHT, DOWN] as const;
|
|
|
53
53
|
* This is just a filtering of the results of the `getAdjacentExistingRoomGridIndexes` function. See
|
|
54
54
|
* that function for more information.
|
|
55
55
|
*/
|
|
56
|
-
export function getAdjacentExistingRoomGridIndexes(
|
|
56
|
+
export function getAdjacentExistingRoomGridIndexes(
|
|
57
|
+
roomGridIndex?: int,
|
|
58
|
+
): readonly int[] {
|
|
57
59
|
const adjacentRoomGridIndexes = getAdjacentRoomGridIndexes(roomGridIndex);
|
|
58
60
|
return adjacentRoomGridIndexes.filter(
|
|
59
61
|
(adjacentRoomGridIndex) => getRoomData(adjacentRoomGridIndex) !== undefined,
|
|
@@ -69,7 +71,7 @@ export function getAdjacentExistingRoomGridIndexes(roomGridIndex?: int): int[] {
|
|
|
69
71
|
*/
|
|
70
72
|
export function getAdjacentNonExistingRoomGridIndexes(
|
|
71
73
|
roomGridIndex?: int,
|
|
72
|
-
): int[] {
|
|
74
|
+
): readonly int[] {
|
|
73
75
|
const adjacentRoomGridIndexes = getAdjacentRoomGridIndexes(roomGridIndex);
|
|
74
76
|
return adjacentRoomGridIndexes.filter(
|
|
75
77
|
(adjacentRoomGridIndex) => getRoomData(adjacentRoomGridIndex) === undefined,
|
|
@@ -91,7 +93,9 @@ export function getAdjacentNonExistingRoomGridIndexes(
|
|
|
91
93
|
*
|
|
92
94
|
* @param roomGridIndex Optional. Default is the current room index.
|
|
93
95
|
*/
|
|
94
|
-
export function getAdjacentRoomGridIndexes(
|
|
96
|
+
export function getAdjacentRoomGridIndexes(
|
|
97
|
+
roomGridIndex?: int,
|
|
98
|
+
): readonly int[] {
|
|
95
99
|
const roomGridIndexToUse =
|
|
96
100
|
roomGridIndex === undefined ? getRoomGridIndex() : roomGridIndex;
|
|
97
101
|
|
|
@@ -109,7 +113,7 @@ export function getAdjacentRoomGridIndexes(roomGridIndex?: int): int[] {
|
|
|
109
113
|
}
|
|
110
114
|
|
|
111
115
|
/** Helper function to get the room safe grid index for every room on the entire floor. */
|
|
112
|
-
export function getAllRoomGridIndexes(): int[] {
|
|
116
|
+
export function getAllRoomGridIndexes(): readonly int[] {
|
|
113
117
|
const rooms = getRooms();
|
|
114
118
|
return rooms.map((roomDescriptor) => roomDescriptor.SafeGridIndex);
|
|
115
119
|
}
|
|
@@ -124,10 +128,12 @@ export function getAllRoomGridIndexes(): int[] {
|
|
|
124
128
|
* @returns Either a tuple of adjacent room grid index, `DoorSlot`, and new room grid index, or
|
|
125
129
|
* undefined.
|
|
126
130
|
*/
|
|
127
|
-
export function getNewRoomCandidate(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
export function getNewRoomCandidate(seedOrRNG: Seed | RNG = getRandomSeed()):
|
|
132
|
+
| {
|
|
133
|
+
readonly adjacentRoomGridIndex: int;
|
|
134
|
+
readonly doorSlot: DoorSlot;
|
|
135
|
+
readonly newRoomGridIndex: int;
|
|
136
|
+
}
|
|
131
137
|
| undefined {
|
|
132
138
|
const newRoomCandidatesForLevel = getNewRoomCandidatesForLevel();
|
|
133
139
|
if (newRoomCandidatesForLevel.length === 0) {
|
|
@@ -147,7 +153,7 @@ export function getNewRoomCandidate(
|
|
|
147
153
|
*/
|
|
148
154
|
export function getNewRoomCandidatesBesideRoom(
|
|
149
155
|
roomGridIndex?: int,
|
|
150
|
-
):
|
|
156
|
+
): ReadonlyArray<{ readonly doorSlot: DoorSlot; readonly roomGridIndex: int }> {
|
|
151
157
|
const roomDescriptor = getRoomDescriptor(roomGridIndex);
|
|
152
158
|
|
|
153
159
|
// First, handle the case of rooms outside of the grid, which obviously cannot have any possible
|
|
@@ -168,7 +174,10 @@ export function getNewRoomCandidatesBesideRoom(
|
|
|
168
174
|
roomData.Shape,
|
|
169
175
|
);
|
|
170
176
|
|
|
171
|
-
const roomCandidates: Array<
|
|
177
|
+
const roomCandidates: Array<{
|
|
178
|
+
readonly doorSlot: DoorSlot;
|
|
179
|
+
readonly roomGridIndex: int;
|
|
180
|
+
}> = [];
|
|
172
181
|
|
|
173
182
|
for (const [doorSlot, adjacentRoomGridIndex] of doorSlotToRoomGridIndexes) {
|
|
174
183
|
// The "getRoomShapeAdjacentNonExistingGridIndexes" returns grid indexes for every possible
|
|
@@ -186,7 +195,10 @@ export function getNewRoomCandidatesBesideRoom(
|
|
|
186
195
|
continue;
|
|
187
196
|
}
|
|
188
197
|
|
|
189
|
-
roomCandidates.push(
|
|
198
|
+
roomCandidates.push({
|
|
199
|
+
doorSlot,
|
|
200
|
+
roomGridIndex: adjacentRoomGridIndex,
|
|
201
|
+
});
|
|
190
202
|
}
|
|
191
203
|
|
|
192
204
|
return roomCandidates;
|
|
@@ -199,9 +211,11 @@ export function getNewRoomCandidatesBesideRoom(
|
|
|
199
211
|
* @returns A array of tuples containing the adjacent room grid index, the `DoorSlot`, and the new
|
|
200
212
|
* room grid index.
|
|
201
213
|
*/
|
|
202
|
-
export function getNewRoomCandidatesForLevel():
|
|
203
|
-
|
|
204
|
-
|
|
214
|
+
export function getNewRoomCandidatesForLevel(): ReadonlyArray<{
|
|
215
|
+
readonly adjacentRoomGridIndex: int;
|
|
216
|
+
readonly doorSlot: DoorSlot;
|
|
217
|
+
readonly newRoomGridIndex: int;
|
|
218
|
+
}> {
|
|
205
219
|
// We want to iterate over every room on the floor and search for potential new room spots.
|
|
206
220
|
const rooms = getRoomsInsideGrid();
|
|
207
221
|
|
|
@@ -216,14 +230,22 @@ export function getNewRoomCandidatesForLevel(): Array<
|
|
|
216
230
|
room.Data.Subtype !== asNumber(MinesRoomSubType.MINESHAFT_ENTRANCE),
|
|
217
231
|
);
|
|
218
232
|
|
|
219
|
-
const newRoomCandidates: Array<
|
|
233
|
+
const newRoomCandidates: Array<{
|
|
234
|
+
readonly adjacentRoomGridIndex: int;
|
|
235
|
+
readonly doorSlot: DoorSlot;
|
|
236
|
+
readonly newRoomGridIndex: int;
|
|
237
|
+
}> = [];
|
|
220
238
|
|
|
221
239
|
for (const room of normalRooms) {
|
|
222
240
|
const newRoomCandidatesBesideRoom = getNewRoomCandidatesBesideRoom(
|
|
223
241
|
room.SafeGridIndex,
|
|
224
242
|
);
|
|
225
|
-
for (const
|
|
226
|
-
newRoomCandidates.push(
|
|
243
|
+
for (const { doorSlot, roomGridIndex } of newRoomCandidatesBesideRoom) {
|
|
244
|
+
newRoomCandidates.push({
|
|
245
|
+
adjacentRoomGridIndex: room.SafeGridIndex,
|
|
246
|
+
doorSlot,
|
|
247
|
+
newRoomGridIndex: roomGridIndex,
|
|
248
|
+
});
|
|
227
249
|
}
|
|
228
250
|
}
|
|
229
251
|
|
|
@@ -291,7 +313,9 @@ export function getRoomDescriptorsForType(
|
|
|
291
313
|
* This function is variadic, meaning that you can specify N arguments to get the combined grid
|
|
292
314
|
* indexes for N room types.
|
|
293
315
|
*/
|
|
294
|
-
export function getRoomGridIndexesForType(
|
|
316
|
+
export function getRoomGridIndexesForType(
|
|
317
|
+
...roomTypes: RoomType[]
|
|
318
|
+
): readonly int[] {
|
|
295
319
|
const roomDescriptors = getRoomDescriptorsForType(...roomTypes);
|
|
296
320
|
return roomDescriptors.map((roomDescriptor) => roomDescriptor.SafeGridIndex);
|
|
297
321
|
}
|
|
@@ -492,7 +516,8 @@ export function newRoom(seedOrRNG?: Seed | RNG): int | undefined {
|
|
|
492
516
|
if (newRoomCandidate === undefined) {
|
|
493
517
|
return undefined;
|
|
494
518
|
}
|
|
495
|
-
const
|
|
519
|
+
const { adjacentRoomGridIndex, doorSlot, newRoomGridIndex } =
|
|
520
|
+
newRoomCandidate;
|
|
496
521
|
|
|
497
522
|
level.MakeRedRoomDoor(adjacentRoomGridIndex, doorSlot);
|
|
498
523
|
|
|
@@ -552,7 +577,7 @@ export function roomExists(roomGridIndex: int): boolean {
|
|
|
552
577
|
* - The bottom-left grid index of 156 is equal to coordinates of: (0, 12)
|
|
553
578
|
* - The bottom-right grid index of 168 is equal to coordinates of: (12, 12)
|
|
554
579
|
*/
|
|
555
|
-
export function roomGridIndexToVector(roomGridIndex: int): Vector {
|
|
580
|
+
export function roomGridIndexToVector(roomGridIndex: int): Readonly<Vector> {
|
|
556
581
|
const x = roomGridIndex % LEVEL_GRID_ROW_WIDTH;
|
|
557
582
|
const y = Math.floor(roomGridIndex / LEVEL_GRID_ROW_WIDTH);
|
|
558
583
|
|
|
@@ -5,14 +5,18 @@ import {
|
|
|
5
5
|
PlayerType,
|
|
6
6
|
TrinketType,
|
|
7
7
|
} from "isaac-typescript-definitions";
|
|
8
|
-
import { ACTIVE_SLOT_VALUES } from "../arrays/cachedEnumValues";
|
|
9
8
|
import { MAX_PLAYER_HEART_CONTAINERS } from "../core/constants";
|
|
10
9
|
import { HealthType } from "../enums/HealthType";
|
|
11
10
|
import { PlayerHealth, SoulHeartType } from "../interfaces/PlayerHealth";
|
|
12
11
|
import { countSetBits, getKBitOfN, getNumBitsOfN } from "./bitwise";
|
|
13
12
|
import { getCharacterMaxHeartContainers } from "./characters";
|
|
14
13
|
import { getTotalCharge } from "./charge";
|
|
15
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
getActiveItemSlots,
|
|
16
|
+
isCharacter,
|
|
17
|
+
isKeeper,
|
|
18
|
+
setActiveItem,
|
|
19
|
+
} from "./players";
|
|
16
20
|
import { repeat } from "./utils";
|
|
17
21
|
|
|
18
22
|
export function addPlayerHealthType(
|
|
@@ -543,21 +547,24 @@ export function setPlayerHealth(
|
|
|
543
547
|
const character = player.GetPlayerType();
|
|
544
548
|
const subPlayer = player.GetSubPlayer();
|
|
545
549
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
550
|
+
// Before we add or remove any health, we have to take away Alabaster Box, if present. (Removing
|
|
551
|
+
// soul hearts from the player will remove Alabaster Box charges.)
|
|
552
|
+
const alabasterBoxDescriptions: Array<{
|
|
553
|
+
activeSlot: ActiveSlot;
|
|
554
|
+
totalCharge: int;
|
|
555
|
+
}> = [];
|
|
556
|
+
const alabasterBoxActiveSlots = getActiveItemSlots(
|
|
557
|
+
player,
|
|
558
|
+
CollectibleType.ALABASTER_BOX,
|
|
559
|
+
);
|
|
560
|
+
for (const activeSlot of alabasterBoxActiveSlots) {
|
|
561
|
+
const totalCharge = getTotalCharge(player, activeSlot);
|
|
562
|
+
setActiveItem(player, CollectibleType.NULL, activeSlot);
|
|
563
|
+
alabasterBoxDescriptions.push({ activeSlot, totalCharge });
|
|
559
564
|
}
|
|
560
565
|
|
|
566
|
+
removeAllPlayerHealth(player);
|
|
567
|
+
|
|
561
568
|
// Add the red heart containers.
|
|
562
569
|
if (character === PlayerType.SOUL && subPlayer !== undefined) {
|
|
563
570
|
// Adding health to The Soul is a special case.
|
|
@@ -649,7 +656,7 @@ export function setPlayerHealth(
|
|
|
649
656
|
}
|
|
650
657
|
|
|
651
658
|
// Re-add the Alabaster Box, if present.
|
|
652
|
-
for (const
|
|
659
|
+
for (const { activeSlot, totalCharge } of alabasterBoxDescriptions) {
|
|
653
660
|
setActiveItem(
|
|
654
661
|
player,
|
|
655
662
|
CollectibleType.ALABASTER_BOX,
|