isaacscript-common 1.0.499 → 1.0.503
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/callbacks/postBombInitLate.lua +3 -17
- package/dist/callbacks/postEffectInitLate.lua +3 -17
- package/dist/callbacks/postFamiliarInitLate.lua +1 -15
- package/dist/callbacks/postKnifeInitLate.lua +3 -17
- package/dist/callbacks/postLaserInitLate.lua +3 -17
- package/dist/callbacks/postNPCInitLate.lua +3 -17
- package/dist/callbacks/postNewRoomEarly.d.ts +2 -0
- package/dist/callbacks/postNewRoomEarly.lua +50 -0
- package/dist/callbacks/postPickupInitLate.lua +3 -17
- package/dist/callbacks/postProjectileInitLate.lua +3 -17
- package/dist/callbacks/postTearInitLate.lua +3 -17
- package/dist/callbacks/subscriptions/postNewRoomEarly.d.ts +4 -0
- package/dist/callbacks/subscriptions/postNewRoomEarly.lua +18 -0
- package/dist/features/deployJSONRoom.lua +16 -16
- package/dist/features/getCollectibleItemPoolType.lua +1 -6
- package/dist/features/saveDataManager/main.lua +5 -3
- package/dist/functions/collectibles.d.ts +5 -5
- package/dist/functions/collectibles.lua +4 -0
- package/dist/functions/flag.d.ts +1 -1
- package/dist/functions/gridEntity.d.ts +8 -2
- package/dist/functions/gridEntity.lua +16 -0
- package/dist/functions/input.d.ts +3 -5
- package/dist/functions/player.d.ts +5 -5
- package/dist/functions/revive.d.ts +2 -2
- package/dist/functions/rooms.d.ts +39 -18
- package/dist/functions/rooms.lua +60 -47
- package/dist/functions/util.d.ts +2 -2
- package/dist/functions/util.lua +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.lua +8 -0
- package/dist/maps/roomShapeToTopLeftWallGridIndexMap.d.ts +3 -0
- package/dist/maps/roomShapeToTopLeftWallGridIndexMap.lua +12 -0
- package/dist/types/CallbackParametersCustom.d.ts +4 -0
- package/dist/types/ModCallbacksCustom.d.ts +34 -33
- package/dist/types/ModCallbacksCustom.lua +35 -33
- package/dist/types/ModUpgraded.lua +178 -321
- package/dist/upgradeMod.d.ts +2 -2
- package/dist/upgradeMod.lua +9 -6
- package/package.json +2 -2
|
@@ -5,8 +5,18 @@ local ____constants = require("constants")
|
|
|
5
5
|
local EMPTY_PNG_PATH = ____constants.EMPTY_PNG_PATH
|
|
6
6
|
local ____gridEntityXMLMap = require("maps.gridEntityXMLMap")
|
|
7
7
|
local GRID_ENTITY_XML_MAP = ____gridEntityXMLMap.GRID_ENTITY_XML_MAP
|
|
8
|
+
local ____roomShapeToTopLeftWallGridIndexMap = require("maps.roomShapeToTopLeftWallGridIndexMap")
|
|
9
|
+
local DEFAULT_TOP_LEFT_WALL_GRID_INDEX = ____roomShapeToTopLeftWallGridIndexMap.DEFAULT_TOP_LEFT_WALL_GRID_INDEX
|
|
10
|
+
local ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP = ____roomShapeToTopLeftWallGridIndexMap.ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP
|
|
8
11
|
local ____rooms = require("functions.rooms")
|
|
9
12
|
local roomUpdateSafe = ____rooms.roomUpdateSafe
|
|
13
|
+
function ____exports.getTopLeftWallGridIndex(self)
|
|
14
|
+
local game = Game()
|
|
15
|
+
local room = game:GetRoom()
|
|
16
|
+
local roomShape = room:GetRoomShape()
|
|
17
|
+
local topLeftWallGridIndex = ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP:get(roomShape)
|
|
18
|
+
return topLeftWallGridIndex == nil and DEFAULT_TOP_LEFT_WALL_GRID_INDEX or topLeftWallGridIndex
|
|
19
|
+
end
|
|
10
20
|
function ____exports.removeGridEntity(self, gridEntity, updateRoom)
|
|
11
21
|
if updateRoom == nil then
|
|
12
22
|
updateRoom = true
|
|
@@ -77,6 +87,12 @@ function ____exports.getGridEntities(self, ...)
|
|
|
77
87
|
end
|
|
78
88
|
return gridEntities
|
|
79
89
|
end
|
|
90
|
+
function ____exports.getTopLeftWall(self)
|
|
91
|
+
local game = Game()
|
|
92
|
+
local room = game:GetRoom()
|
|
93
|
+
local topLeftWallGridIndex = ____exports.getTopLeftWallGridIndex(nil)
|
|
94
|
+
return room:GetGridEntity(topLeftWallGridIndex)
|
|
95
|
+
end
|
|
80
96
|
function ____exports.getSurroundingGridEntities(self, gridEntity)
|
|
81
97
|
local game = Game()
|
|
82
98
|
local room = game:GetRoom()
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
/** Helper function to get the enum name for the specified `Controller` value. */
|
|
3
3
|
export declare function controllerToString(controller: Controller): string;
|
|
4
|
-
/**
|
|
5
|
-
* Iterates over all 4 inputs to see if a particular button is pressed (i.e. held down).
|
|
6
|
-
*/
|
|
4
|
+
/** Iterates over all 4 inputs to determine if a particular button is pressed (i.e. held down). */
|
|
7
5
|
export declare function isActionPressedOnAnyInput(buttonAction: ButtonAction): boolean;
|
|
8
6
|
/**
|
|
9
|
-
* Iterates over all 4 inputs to
|
|
10
|
-
*
|
|
7
|
+
* Iterates over all 4 inputs to determine if a particular button is triggered (i.e. held down and
|
|
8
|
+
* then released).
|
|
11
9
|
*/
|
|
12
10
|
export declare function isActionTriggeredOnAnyInput(buttonAction: ButtonAction): boolean;
|
|
13
11
|
export declare function isKeyboardPressed(key: Keyboard): boolean;
|
|
@@ -21,14 +21,14 @@ export declare function anyPlayerHasCollectible(collectibleType: CollectibleType
|
|
|
21
21
|
export declare function anyPlayerHasTrinket(trinketType: TrinketType | int): boolean;
|
|
22
22
|
export declare function anyPlayerIs(matchingCharacter: PlayerType): boolean;
|
|
23
23
|
/**
|
|
24
|
-
* Helper function to
|
|
25
|
-
* characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper,
|
|
26
|
-
* though coin containers are not technically the same as red heart containers. Returns false
|
|
27
|
-
* characters like Blue Baby. Returns false for The Lost and Tainted Lost.
|
|
24
|
+
* Helper function to determine if the provided character can have red heart containers. Returns
|
|
25
|
+
* true for characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper,
|
|
26
|
+
* even though coin containers are not technically the same as red heart containers. Returns false
|
|
27
|
+
* for characters like Blue Baby. Returns false for The Lost and Tainted Lost.
|
|
28
28
|
*/
|
|
29
29
|
export declare function characterCanHaveRedHearts(character: PlayerType): boolean;
|
|
30
30
|
/**
|
|
31
|
-
* Helper function to
|
|
31
|
+
* Helper function to determine if the provided character can have soul hearts. Returns true for
|
|
32
32
|
* characters like Isaac, Magdalene, or Cain. Returns false for characters like Bethany. Returns
|
|
33
33
|
* false for The Lost and Tainted Lost.
|
|
34
34
|
*/
|
|
@@ -14,7 +14,7 @@ export declare function willPlayerRevive(player: EntityPlayer): boolean;
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function willMysteriousPaperRevive(player: EntityPlayer): boolean;
|
|
16
16
|
/**
|
|
17
|
-
* Helper function to
|
|
18
|
-
*
|
|
17
|
+
* Helper function to determine if the Spirit Shackles item is in an enabled state. (It can be
|
|
18
|
+
* either enabled or disabled.)
|
|
19
19
|
*/
|
|
20
20
|
export declare function willReviveFromSpiritShackles(player: EntityPlayer): boolean;
|
|
@@ -4,13 +4,7 @@
|
|
|
4
4
|
* Always use this helper function over invoking `Game().ChangeRoom()` directly to ensure that you
|
|
5
5
|
* do not forget to set the LeaveDoor property.
|
|
6
6
|
*/
|
|
7
|
-
export declare function changeRoom(
|
|
8
|
-
/**
|
|
9
|
-
* This function will not work properly for the Death Certificate dimension. When in the Death
|
|
10
|
-
* Certificate dimension, this function will randomly return either `Dimension.SECONDARY` or
|
|
11
|
-
* `Dimension.DEATH_CERTIFICATE`. Use the `inDeathCertificateArea` function instead for that
|
|
12
|
-
* purpose.
|
|
13
|
-
*/
|
|
7
|
+
export declare function changeRoom(roomGridIndex: int): void;
|
|
14
8
|
export declare function getCurrentDimension(): Dimension;
|
|
15
9
|
export declare function getRoomData(): RoomConfig | undefined;
|
|
16
10
|
/**
|
|
@@ -23,19 +17,35 @@ export declare function getRoomData(): RoomConfig | undefined;
|
|
|
23
17
|
*/
|
|
24
18
|
export declare function getRoomDataType(): int;
|
|
25
19
|
/**
|
|
26
|
-
* Helper function to get the
|
|
27
|
-
* `Level.
|
|
28
|
-
*
|
|
29
|
-
*
|
|
20
|
+
* Helper function to get the list grid index of the current room, which is equal to the index in
|
|
21
|
+
* the `Level.GetRooms().Get()` method. In other words, this is equal to the order that the room was
|
|
22
|
+
* created by the floor generation algorithm.
|
|
23
|
+
*
|
|
24
|
+
* Use this as an index for data structures that store data per room, since it is unique across
|
|
25
|
+
* different dimensions.
|
|
30
26
|
*/
|
|
31
|
-
export declare function
|
|
27
|
+
export declare function getRoomListIndex(): int;
|
|
28
|
+
/**
|
|
29
|
+
* Helper function to get the safe grid index of the current room. The safe grid index is defined as
|
|
30
|
+
* the top-left 1x1 section that the room overlaps with (or the top-right 1x1 section of a
|
|
31
|
+
* `RoomType.ROOMSHAPE_LTL` room).
|
|
32
|
+
*
|
|
33
|
+
* In most situations, using the safe grid index is more reliable than using the `GridIndex` or the
|
|
34
|
+
* `Level.GetCurrentRoomIndex()` method directly. `GridIndex` can return quadrants that are not on
|
|
35
|
+
* the map, and `Level.GetCurrentRoomIndex()` returns the specific 1x1 quadrant that the player
|
|
36
|
+
* entered the room at.
|
|
37
|
+
*
|
|
38
|
+
* Data structures that store data per room should use the room's `ListIndex` instead of
|
|
39
|
+
* `SafeGridIndex`, since the former is unique across different dimensions.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getRoomSafeGridIndex(): int;
|
|
32
42
|
/**
|
|
33
43
|
* Helper function to get an array of all of the safe grid indexes for rooms that match the
|
|
34
44
|
* specified room type.
|
|
35
45
|
*
|
|
36
46
|
* This function only searches through rooms in the current dimension.
|
|
37
47
|
*/
|
|
38
|
-
export declare function
|
|
48
|
+
export declare function getRoomGridIndexesForType(roomType: RoomType): Set<int>;
|
|
39
49
|
/**
|
|
40
50
|
* Helper function to get the item pool type for the current room. For example, this returns
|
|
41
51
|
* `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
|
|
@@ -72,6 +82,11 @@ export declare function getRoomSubType(): int;
|
|
|
72
82
|
* @returns The room variant. Returns -1 if the variant was not found.
|
|
73
83
|
*/
|
|
74
84
|
export declare function getRoomVariant(): int;
|
|
85
|
+
/**
|
|
86
|
+
* The room visited count will be inaccurate during the period before the PostNewRoom callback has
|
|
87
|
+
* fired (i.e. when entities are initializing and performing their first update). This is because
|
|
88
|
+
* the variable is only incremented immediately before the PostNewRoom callback fires.
|
|
89
|
+
*/
|
|
75
90
|
export declare function getRoomVisitedCount(): int;
|
|
76
91
|
/**
|
|
77
92
|
* Converts a room X and Y coordinate to a position. For example, the coordinates of 0, 0 are
|
|
@@ -79,7 +94,7 @@ export declare function getRoomVisitedCount(): int;
|
|
|
79
94
|
*/
|
|
80
95
|
export declare function gridToPos(x: int, y: int): Vector;
|
|
81
96
|
/**
|
|
82
|
-
* Helper function to
|
|
97
|
+
* Helper function to determine if the current room shape is equal to `RoomShape.ROOMSHAPE_1x2` or
|
|
83
98
|
* `RoomShape.ROOMSHAPE_2x1`.
|
|
84
99
|
*/
|
|
85
100
|
export declare function in2x1Room(): boolean;
|
|
@@ -97,16 +112,22 @@ export declare function inBossRoomOf(bossID: BossID): boolean;
|
|
|
97
112
|
*/
|
|
98
113
|
export declare function inCrawlspace(): boolean;
|
|
99
114
|
/**
|
|
100
|
-
* We cannot use the `inDimension` function for this since it is bugged
|
|
101
|
-
* area.
|
|
115
|
+
* We cannot use the standard code in the `inDimension` function for this purpose since it is bugged
|
|
116
|
+
* with the Death Certificate area.
|
|
102
117
|
*/
|
|
103
118
|
export declare function inDeathCertificateArea(): boolean;
|
|
104
|
-
export declare function
|
|
119
|
+
export declare function inDevilsCrownTreasureRoom(): boolean;
|
|
105
120
|
export declare function inDimension(dimension: Dimension): boolean;
|
|
106
|
-
/** Helper function to
|
|
121
|
+
/** Helper function to determine if the current room shape is one of the four L room shapes. */
|
|
107
122
|
export declare function inLRoom(): boolean;
|
|
108
123
|
export declare function inGenesisRoom(): boolean;
|
|
124
|
+
/** Helper function to determine whether or not the current room is the starting room of a floor. */
|
|
109
125
|
export declare function inStartingRoom(): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Helper function to determine whether or not the current room is part of the floor layout. For
|
|
128
|
+
* example, Devil Rooms and the Mega Satan room are not considered to be inside the map.
|
|
129
|
+
*/
|
|
130
|
+
export declare function isRoomInsideMap(): boolean;
|
|
110
131
|
/**
|
|
111
132
|
* If `Room.Update()` is called in a PostNewRoom callback, then some entities will slide around
|
|
112
133
|
* (such as the player). Since those entity velocities are already at zero, setting them to zero
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -17,28 +17,57 @@ local setEntityPositions = ____entity.setEntityPositions
|
|
|
17
17
|
local setEntityVelocities = ____entity.setEntityVelocities
|
|
18
18
|
local ____flag = require("functions.flag")
|
|
19
19
|
local hasFlag = ____flag.hasFlag
|
|
20
|
-
function ____exports.
|
|
20
|
+
function ____exports.getRoomData(self)
|
|
21
|
+
local game = Game()
|
|
22
|
+
local level = game:GetLevel()
|
|
23
|
+
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
24
|
+
local roomDesc = level:GetRoomByIdx(roomSafeGridIndex)
|
|
25
|
+
return roomDesc.Data
|
|
26
|
+
end
|
|
27
|
+
function ____exports.getRoomSafeGridIndex(self)
|
|
21
28
|
local game = Game()
|
|
22
29
|
local level = game:GetLevel()
|
|
23
30
|
local roomDesc = level:GetCurrentRoomDesc()
|
|
24
31
|
return roomDesc.SafeGridIndex
|
|
25
32
|
end
|
|
26
|
-
function ____exports.
|
|
33
|
+
function ____exports.getRoomStageID(self)
|
|
34
|
+
local roomData = ____exports.getRoomData(nil)
|
|
35
|
+
if roomData == nil then
|
|
36
|
+
return -1
|
|
37
|
+
end
|
|
38
|
+
return roomData.StageID
|
|
39
|
+
end
|
|
40
|
+
function ____exports.getRoomSubType(self)
|
|
41
|
+
local roomData = ____exports.getRoomData(nil)
|
|
42
|
+
if roomData == nil then
|
|
43
|
+
return -1
|
|
44
|
+
end
|
|
45
|
+
return roomData.Subtype
|
|
46
|
+
end
|
|
47
|
+
function ____exports.inDeathCertificateArea(self)
|
|
48
|
+
local roomStageID = ____exports.getRoomStageID(nil)
|
|
49
|
+
local roomSubType = ____exports.getRoomSubType(nil)
|
|
50
|
+
return roomStageID == 35 and (roomSubType == 33 or roomSubType == 33)
|
|
51
|
+
end
|
|
52
|
+
function ____exports.changeRoom(self, roomGridIndex)
|
|
27
53
|
local game = Game()
|
|
28
54
|
local level = game:GetLevel()
|
|
29
55
|
level.LeaveDoor = -1
|
|
30
|
-
game:ChangeRoom(
|
|
56
|
+
game:ChangeRoom(roomGridIndex)
|
|
31
57
|
end
|
|
32
58
|
function ____exports.getCurrentDimension(self)
|
|
33
59
|
local game = Game()
|
|
34
60
|
local level = game:GetLevel()
|
|
35
|
-
|
|
36
|
-
|
|
61
|
+
if ____exports.inDeathCertificateArea(nil) then
|
|
62
|
+
return 2
|
|
63
|
+
end
|
|
64
|
+
local startingRoomGridIndex = level:GetStartingRoomIndex()
|
|
65
|
+
local startingRoomDesc = level:GetRoomByIdx(startingRoomGridIndex, -1)
|
|
37
66
|
local startingRoomHash = GetPtrHash(startingRoomDesc)
|
|
38
67
|
do
|
|
39
68
|
local dimension = 0
|
|
40
69
|
while dimension <= 2 do
|
|
41
|
-
local dimensionRoomDesc = level:GetRoomByIdx(
|
|
70
|
+
local dimensionRoomDesc = level:GetRoomByIdx(startingRoomGridIndex, dimension)
|
|
42
71
|
local dimensionRoomHash = GetPtrHash(dimensionRoomDesc)
|
|
43
72
|
if dimensionRoomHash == startingRoomHash then
|
|
44
73
|
return dimension
|
|
@@ -46,16 +75,9 @@ function ____exports.getCurrentDimension(self)
|
|
|
46
75
|
dimension = dimension + 1
|
|
47
76
|
end
|
|
48
77
|
end
|
|
49
|
-
error("Failed to get the current dimension using the starting room index of: " .. tostring(
|
|
78
|
+
error("Failed to get the current dimension using the starting room index of: " .. tostring(startingRoomGridIndex))
|
|
50
79
|
return 0
|
|
51
80
|
end
|
|
52
|
-
function ____exports.getRoomData(self)
|
|
53
|
-
local game = Game()
|
|
54
|
-
local level = game:GetLevel()
|
|
55
|
-
local roomIndex = ____exports.getRoomIndex(nil)
|
|
56
|
-
local roomDesc = level:GetRoomByIdx(roomIndex)
|
|
57
|
-
return roomDesc.Data
|
|
58
|
-
end
|
|
59
81
|
function ____exports.getRoomDataType(self)
|
|
60
82
|
local roomData = ____exports.getRoomData(nil)
|
|
61
83
|
if roomData == nil then
|
|
@@ -63,21 +85,27 @@ function ____exports.getRoomDataType(self)
|
|
|
63
85
|
end
|
|
64
86
|
return roomData.Type
|
|
65
87
|
end
|
|
66
|
-
function ____exports.
|
|
88
|
+
function ____exports.getRoomListIndex(self)
|
|
89
|
+
local game = Game()
|
|
90
|
+
local level = game:GetLevel()
|
|
91
|
+
local roomDesc = level:GetCurrentRoomDesc()
|
|
92
|
+
return roomDesc.ListIndex
|
|
93
|
+
end
|
|
94
|
+
function ____exports.getRoomGridIndexesForType(self, roomType)
|
|
67
95
|
local game = Game()
|
|
68
96
|
local level = game:GetLevel()
|
|
69
|
-
local
|
|
97
|
+
local roomGridIndexes = __TS__New(Set)
|
|
70
98
|
do
|
|
71
99
|
local i = 0
|
|
72
100
|
while i <= MAX_ROOM_INDEX do
|
|
73
101
|
local room = level:GetRoomByIdx(i)
|
|
74
102
|
if room ~= nil and room.Data ~= nil and room.Data.Type == roomType then
|
|
75
|
-
|
|
103
|
+
roomGridIndexes:add(room.SafeGridIndex)
|
|
76
104
|
end
|
|
77
105
|
i = i + 1
|
|
78
106
|
end
|
|
79
107
|
end
|
|
80
|
-
return
|
|
108
|
+
return roomGridIndexes
|
|
81
109
|
end
|
|
82
110
|
function ____exports.getRoomItemPoolType(self)
|
|
83
111
|
local game = Game()
|
|
@@ -94,20 +122,6 @@ function ____exports.getRoomName(self)
|
|
|
94
122
|
end
|
|
95
123
|
return roomData.Name
|
|
96
124
|
end
|
|
97
|
-
function ____exports.getRoomStageID(self)
|
|
98
|
-
local roomData = ____exports.getRoomData(nil)
|
|
99
|
-
if roomData == nil then
|
|
100
|
-
return -1
|
|
101
|
-
end
|
|
102
|
-
return roomData.StageID
|
|
103
|
-
end
|
|
104
|
-
function ____exports.getRoomSubType(self)
|
|
105
|
-
local roomData = ____exports.getRoomData(nil)
|
|
106
|
-
if roomData == nil then
|
|
107
|
-
return -1
|
|
108
|
-
end
|
|
109
|
-
return roomData.Subtype
|
|
110
|
-
end
|
|
111
125
|
function ____exports.getRoomVariant(self)
|
|
112
126
|
local roomData = ____exports.getRoomData(nil)
|
|
113
127
|
if roomData == nil then
|
|
@@ -143,9 +157,9 @@ function ____exports.inAngelShop(self)
|
|
|
143
157
|
return roomType == RoomType.ROOM_ANGEL and roomSubType == 1
|
|
144
158
|
end
|
|
145
159
|
function ____exports.inBeastRoom(self)
|
|
146
|
-
local
|
|
160
|
+
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
147
161
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
148
|
-
return
|
|
162
|
+
return roomSafeGridIndex == GridRooms.ROOM_DUNGEON_IDX and roomSubType == 4
|
|
149
163
|
end
|
|
150
164
|
function ____exports.inBossRoomOf(self, bossID)
|
|
151
165
|
local game = Game()
|
|
@@ -156,16 +170,11 @@ function ____exports.inBossRoomOf(self, bossID)
|
|
|
156
170
|
return roomType == RoomType.ROOM_BOSS and roomStageID == 0 and roomSubType == bossID
|
|
157
171
|
end
|
|
158
172
|
function ____exports.inCrawlspace(self)
|
|
159
|
-
local
|
|
173
|
+
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
160
174
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
161
|
-
return
|
|
175
|
+
return roomSafeGridIndex == GridRooms.ROOM_DUNGEON_IDX and roomSubType ~= 4
|
|
162
176
|
end
|
|
163
|
-
function ____exports.
|
|
164
|
-
local roomStageID = ____exports.getRoomStageID(nil)
|
|
165
|
-
local roomSubType = ____exports.getRoomSubType(nil)
|
|
166
|
-
return roomStageID == 35 and (roomSubType == 33 or roomSubType == 33)
|
|
167
|
-
end
|
|
168
|
-
function ____exports.isDevilsCrownTreasureRoom(self)
|
|
177
|
+
function ____exports.inDevilsCrownTreasureRoom(self)
|
|
169
178
|
local game = Game()
|
|
170
179
|
local level = game:GetLevel()
|
|
171
180
|
local roomDesc = level:GetCurrentRoomDesc()
|
|
@@ -191,9 +200,13 @@ end
|
|
|
191
200
|
function ____exports.inStartingRoom(self)
|
|
192
201
|
local game = Game()
|
|
193
202
|
local level = game:GetLevel()
|
|
194
|
-
local
|
|
195
|
-
local
|
|
196
|
-
return
|
|
203
|
+
local startingRoomGridIndex = level:GetStartingRoomIndex()
|
|
204
|
+
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
205
|
+
return roomSafeGridIndex == startingRoomGridIndex
|
|
206
|
+
end
|
|
207
|
+
function ____exports.isRoomInsideMap(self)
|
|
208
|
+
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
209
|
+
return roomSafeGridIndex >= 0
|
|
197
210
|
end
|
|
198
211
|
function ____exports.roomUpdateSafe(self)
|
|
199
212
|
local game = Game()
|
|
@@ -217,14 +230,14 @@ function ____exports.setRoomCleared(self)
|
|
|
217
230
|
for ____, door in ipairs(getDoors(nil)) do
|
|
218
231
|
do
|
|
219
232
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
220
|
-
goto
|
|
233
|
+
goto __continue41
|
|
221
234
|
end
|
|
222
235
|
door.State = DoorState.STATE_OPEN
|
|
223
236
|
local sprite = door:GetSprite()
|
|
224
237
|
sprite:Play("Opened", true)
|
|
225
238
|
door.ExtraVisible = false
|
|
226
239
|
end
|
|
227
|
-
::
|
|
240
|
+
::__continue41::
|
|
228
241
|
end
|
|
229
242
|
sfx:Stop(SoundEffect.SOUND_DOOR_HEAVY_OPEN)
|
|
230
243
|
game:ShakeScreen(0)
|
package/dist/functions/util.d.ts
CHANGED
|
@@ -80,8 +80,8 @@ export declare function tableClear(table: LuaTable): void;
|
|
|
80
80
|
* arguments. Use this function instead of invoking `Game.StartRoomTransition()` directly so that
|
|
81
81
|
* you don't forget to set `Level.LeaveDoor` property.
|
|
82
82
|
*
|
|
83
|
-
* @param
|
|
83
|
+
* @param roomGridIndex The room grid index of the destination room.
|
|
84
84
|
* @param direction Optional. Default is `Direction.NO_DIRECTION`.
|
|
85
85
|
* @param roomTransitionAnim Optional. Default is `RoomTransitionAnim.TELEPORT`.
|
|
86
86
|
*/
|
|
87
|
-
export declare function teleport(
|
|
87
|
+
export declare function teleport(roomGridIndex: int, direction?: Direction, roomTransitionAnim?: RoomTransitionAnim): void;
|
package/dist/functions/util.lua
CHANGED
|
@@ -62,7 +62,7 @@ function ____exports.tableClear(self, ____table)
|
|
|
62
62
|
____table[key] = nil
|
|
63
63
|
end
|
|
64
64
|
end
|
|
65
|
-
function ____exports.teleport(self,
|
|
65
|
+
function ____exports.teleport(self, roomGridIndex, direction, roomTransitionAnim)
|
|
66
66
|
if direction == nil then
|
|
67
67
|
direction = Direction.NO_DIRECTION
|
|
68
68
|
end
|
|
@@ -72,6 +72,6 @@ function ____exports.teleport(self, roomIndex, direction, roomTransitionAnim)
|
|
|
72
72
|
local game = Game()
|
|
73
73
|
local level = game:GetLevel()
|
|
74
74
|
level.LeaveDoor = -1
|
|
75
|
-
game:StartRoomTransition(
|
|
75
|
+
game:StartRoomTransition(roomGridIndex, direction, roomTransitionAnim)
|
|
76
76
|
end
|
|
77
77
|
return ____exports
|
package/dist/index.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export * from "./maps/cardNameMap";
|
|
|
52
52
|
export * from "./maps/collectibleNameMap";
|
|
53
53
|
export * from "./maps/gridEntityXMLMap";
|
|
54
54
|
export * from "./maps/pillEffectNameMap";
|
|
55
|
+
export * from "./maps/roomShapeToTopLeftWallGridIndexMap";
|
|
55
56
|
export * from "./maps/transformationMap";
|
|
56
57
|
export * from "./maps/trinketNameMap";
|
|
57
58
|
export * from "./sets/cards";
|
package/dist/index.lua
CHANGED
|
@@ -422,6 +422,14 @@ do
|
|
|
422
422
|
end
|
|
423
423
|
end
|
|
424
424
|
end
|
|
425
|
+
do
|
|
426
|
+
local ____export = require("maps.roomShapeToTopLeftWallGridIndexMap")
|
|
427
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
428
|
+
if ____exportKey ~= "default" then
|
|
429
|
+
____exports[____exportKey] = ____exportValue
|
|
430
|
+
end
|
|
431
|
+
end
|
|
432
|
+
end
|
|
425
433
|
do
|
|
426
434
|
local ____export = require("maps.transformationMap")
|
|
427
435
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
require("lualib_bundle");
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
____exports.ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP = __TS__New(Map, {
|
|
5
|
+
{RoomShape.ROOMSHAPE_IH, 30},
|
|
6
|
+
{RoomShape.ROOMSHAPE_IV, 4},
|
|
7
|
+
{RoomShape.ROOMSHAPE_IIV, 4},
|
|
8
|
+
{RoomShape.ROOMSHAPE_IIH, 56},
|
|
9
|
+
{RoomShape.ROOMSHAPE_LTL, 13}
|
|
10
|
+
})
|
|
11
|
+
____exports.DEFAULT_TOP_LEFT_WALL_GRID_INDEX = 0
|
|
12
|
+
return ____exports
|
|
@@ -16,6 +16,7 @@ import { PostItemPickupCallbackType } from "../callbacks/subscriptions/postItemP
|
|
|
16
16
|
import { PostKnifeInitLateCallbackType } from "../callbacks/subscriptions/postKnifeInitLate";
|
|
17
17
|
import { PostLaserInitLateCallbackType } from "../callbacks/subscriptions/postLaserInitLate";
|
|
18
18
|
import { PostNewLevelReorderedCallbackType } from "../callbacks/subscriptions/postNewLevelReordered";
|
|
19
|
+
import { PostNewRoomEarlyCallbackType } from "../callbacks/subscriptions/postNewRoomEarly";
|
|
19
20
|
import { PostNewRoomReorderedCallbackType } from "../callbacks/subscriptions/postNewRoomReordered";
|
|
20
21
|
import { PostNPCInitLateCallbackType } from "../callbacks/subscriptions/postNPCInitLate";
|
|
21
22
|
import { PostPickupCollectCallbackType } from "../callbacks/subscriptions/postPickupCollect";
|
|
@@ -61,6 +62,9 @@ export interface CallbackParametersCustom {
|
|
|
61
62
|
callback: PostPlayerRenderReorderedCallbackType,
|
|
62
63
|
playerVariant?: PlayerVariant
|
|
63
64
|
];
|
|
65
|
+
[ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY]: [
|
|
66
|
+
callback: PostNewRoomEarlyCallbackType
|
|
67
|
+
];
|
|
64
68
|
[ModCallbacksCustom.MC_POST_PLAYER_INIT_LATE]: [
|
|
65
69
|
callback: PostPlayerInitLateCallbackType,
|
|
66
70
|
playerVariant?: PlayerVariant
|
|
@@ -14,37 +14,38 @@ export declare enum ModCallbacksCustom {
|
|
|
14
14
|
MC_POST_PLAYER_INIT_REORDERED = 3,
|
|
15
15
|
MC_POST_PLAYER_UPDATE_REORDERED = 4,
|
|
16
16
|
MC_POST_PLAYER_RENDER_REORDERED = 5,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
17
|
+
MC_POST_NEW_ROOM_EARLY = 6,
|
|
18
|
+
MC_POST_PLAYER_INIT_LATE = 7,
|
|
19
|
+
MC_POST_TEAR_INIT_LATE = 8,
|
|
20
|
+
MC_POST_FAMILIAR_INIT_LATE = 9,
|
|
21
|
+
MC_POST_BOMB_INIT_LATE = 10,
|
|
22
|
+
MC_POST_PICKUP_INIT_LATE = 11,
|
|
23
|
+
MC_POST_LASER_INIT_LATE = 12,
|
|
24
|
+
MC_POST_KNIFE_INIT_LATE = 13,
|
|
25
|
+
MC_POST_PROJECTILE_INIT_LATE = 14,
|
|
26
|
+
MC_POST_NPC_INIT_LATE = 15,
|
|
27
|
+
MC_POST_EFFECT_INIT_LATE = 16,
|
|
28
|
+
MC_POST_PICKUP_COLLECT = 17,
|
|
29
|
+
MC_PRE_ITEM_PICKUP = 18,
|
|
30
|
+
MC_POST_ITEM_PICKUP = 19,
|
|
31
|
+
MC_POST_PLAYER_CHANGE_TYPE = 20,
|
|
32
|
+
MC_POST_PLAYER_CHANGE_HEALTH = 21,
|
|
33
|
+
MC_POST_PLAYER_FATAL_DAMAGE = 22,
|
|
34
|
+
MC_PRE_CUSTOM_REVIVE = 23,
|
|
35
|
+
MC_POST_CUSTOM_REVIVE = 24,
|
|
36
|
+
MC_POST_FLIP = 25,
|
|
37
|
+
MC_POST_FIRST_FLIP = 26,
|
|
38
|
+
MC_POST_ESAU_JR = 27,
|
|
39
|
+
MC_POST_FIRST_ESAU_JR = 28,
|
|
40
|
+
MC_POST_TRANSFORMATION = 29,
|
|
41
|
+
MC_POST_PURCHASE = 30,
|
|
42
|
+
MC_POST_SACRIFICE = 31,
|
|
43
|
+
MC_POST_CURSED_TELEPORT = 32,
|
|
44
|
+
MC_POST_SLOT_INIT = 33,
|
|
45
|
+
MC_POST_SLOT_UPDATE = 34,
|
|
46
|
+
MC_POST_SLOT_RENDER = 35,
|
|
47
|
+
MC_POST_SLOT_DESTROYED = 36,
|
|
48
|
+
MC_POST_GRID_ENTITY_INIT = 37,
|
|
49
|
+
MC_POST_GRID_ENTITY_UPDATE = 38,
|
|
50
|
+
MC_POST_GRID_ENTITY_REMOVE = 39
|
|
50
51
|
}
|