isaacscript-common 30.4.1 → 30.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.rollup.d.ts +35 -23
- package/dist/isaacscript-common.lua +57 -52
- 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/functions/spawnCollectible.d.ts +4 -2
- package/dist/src/functions/spawnCollectible.d.ts.map +1 -1
- package/dist/src/functions/spawnCollectible.lua +5 -3
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- 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/functions/spawnCollectible.ts +5 -3
- package/src/index.ts +1 -0
- package/src/interfaces/StageHistoryEntry.ts +7 -0
- package/dist/src/indexLua.d.ts +0 -185
- package/dist/src/indexLua.d.ts.map +0 -1
- package/dist/src/indexLua.lua +0 -1114
|
@@ -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+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AG,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;;;;;;;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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,
|
|
@@ -25,8 +25,10 @@ export declare function spawnCollectibleUnsafe(collectibleType: CollectibleType,
|
|
|
25
25
|
* with `CollectibleType.NULL` will result in spawning a collectible with a random type from the
|
|
26
26
|
* current room's item pool.
|
|
27
27
|
*
|
|
28
|
-
* Instead, this function arbitrarily spawns a collectible with `CollectibleType.
|
|
29
|
-
* then converts it to an empty pedestal afterward.
|
|
28
|
+
* Instead, this function arbitrarily spawns a collectible with `CollectibleType.BROKEN_SHOVEL_1`,
|
|
29
|
+
* and then converts it to an empty pedestal afterward. (Broken Shovel is used instead of e.g. Sad
|
|
30
|
+
* Onion because it is a quest collectible and quest collectibles will prevent Damocles from
|
|
31
|
+
* duplicating the pedestal.)
|
|
30
32
|
*
|
|
31
33
|
* @param positionOrGridIndex The position or grid index to spawn the empty collectible at.
|
|
32
34
|
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawnCollectible.d.ts","sourceRoot":"","sources":["../../../src/functions/spawnCollectible.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGhB,MAAM,8BAA8B,CAAC;AAQtC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,eAAe,EAChC,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,EACf,aAAa,UAAQ,EACrB,OAAO,CAAC,EAAE,MAAM,GACf,uBAAuB,CAiCzB;AAED
|
|
1
|
+
{"version":3,"file":"spawnCollectible.d.ts","sourceRoot":"","sources":["../../../src/functions/spawnCollectible.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGhB,MAAM,8BAA8B,CAAC;AAQtC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,eAAe,EAChC,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,EACf,aAAa,UAAQ,EACrB,OAAO,CAAC,EAAE,MAAM,GACf,uBAAuB,CAiCzB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,YAAY,CAWd"}
|
|
@@ -67,8 +67,10 @@ end
|
|
|
67
67
|
-- with `CollectibleType.NULL` will result in spawning a collectible with a random type from the
|
|
68
68
|
-- current room's item pool.
|
|
69
69
|
--
|
|
70
|
-
-- Instead, this function arbitrarily spawns a collectible with `CollectibleType.
|
|
71
|
-
-- then converts it to an empty pedestal afterward.
|
|
70
|
+
-- Instead, this function arbitrarily spawns a collectible with `CollectibleType.BROKEN_SHOVEL_1`,
|
|
71
|
+
-- and then converts it to an empty pedestal afterward. (Broken Shovel is used instead of e.g. Sad
|
|
72
|
+
-- Onion because it is a quest collectible and quest collectibles will prevent Damocles from
|
|
73
|
+
-- duplicating the pedestal.)
|
|
72
74
|
--
|
|
73
75
|
-- @param positionOrGridIndex The position or grid index to spawn the empty collectible at.
|
|
74
76
|
-- @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
|
|
@@ -79,7 +81,7 @@ function ____exports.spawnEmptyCollectible(self, positionOrGridIndex, seedOrRNG)
|
|
|
79
81
|
end
|
|
80
82
|
local collectible = ____exports.spawnCollectibleUnsafe(
|
|
81
83
|
nil,
|
|
82
|
-
CollectibleType.
|
|
84
|
+
CollectibleType.BROKEN_SHOVEL_1,
|
|
83
85
|
positionOrGridIndex,
|
|
84
86
|
seedOrRNG,
|
|
85
87
|
false,
|
package/dist/src/index.d.ts
CHANGED
|
@@ -135,6 +135,7 @@ export * from "./interfaces/PlayerHealth";
|
|
|
135
135
|
export * from "./interfaces/PocketItemDescription";
|
|
136
136
|
export * from "./interfaces/RoomDescription";
|
|
137
137
|
export * from "./interfaces/SaveData";
|
|
138
|
+
export * from "./interfaces/StageHistoryEntry";
|
|
138
139
|
export * from "./interfaces/StatTypeType";
|
|
139
140
|
export * from "./interfaces/TrinketSituation";
|
|
140
141
|
export * from "./interfaces/TSTLClassMetatable";
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,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AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yCAAyC,CAAC;AACxD,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC"}
|
|
@@ -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
|
|