isaacscript-common 6.0.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/functions/doors.d.ts +2 -2
- package/functions/doors.lua +5 -4
- package/package.json +1 -1
package/functions/doors.d.ts
CHANGED
|
@@ -24,13 +24,13 @@ export declare function getDevilRoomOrAngelRoomDoor(): GridEntityDoor | undefine
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function getDoorEnterPosition(door: GridEntityDoor): Vector;
|
|
26
26
|
/**
|
|
27
|
-
* Helper function to
|
|
27
|
+
* Helper function to get the offset from a door position that a player will enter a room at.
|
|
28
28
|
*
|
|
29
29
|
* When players enter a room, they do not appear exactly on the location of the door, because then
|
|
30
30
|
* they would immediately collide with the loading zone. Instead, they are offset by a certain
|
|
31
31
|
* amount of units.
|
|
32
32
|
*/
|
|
33
|
-
export declare function
|
|
33
|
+
export declare function getDoorSlotEnterPositionOffset(doorSlot: DoorSlot): Vector;
|
|
34
34
|
/**
|
|
35
35
|
* Helper function to convert an array of door slots or a set of door slots to the resulting bit
|
|
36
36
|
* flag number.
|
package/functions/doors.lua
CHANGED
|
@@ -39,15 +39,16 @@ local isTSTLSet = ____tstlClass.isTSTLSet
|
|
|
39
39
|
function ____exports.doorSlotToDirection(self, doorSlot)
|
|
40
40
|
return DOOR_SLOT_TO_DIRECTION[doorSlot]
|
|
41
41
|
end
|
|
42
|
-
--- Helper function to
|
|
42
|
+
--- Helper function to get the offset from a door position that a player will enter a room at.
|
|
43
43
|
--
|
|
44
44
|
-- When players enter a room, they do not appear exactly on the location of the door, because then
|
|
45
45
|
-- they would immediately collide with the loading zone. Instead, they are offset by a certain
|
|
46
46
|
-- amount of units.
|
|
47
|
-
function ____exports.
|
|
47
|
+
function ____exports.getDoorSlotEnterPositionOffset(self, doorSlot)
|
|
48
48
|
local direction = ____exports.doorSlotToDirection(nil, doorSlot)
|
|
49
49
|
local vector = directionToVector(nil, direction)
|
|
50
|
-
|
|
50
|
+
local oppositeVector = vector * -1
|
|
51
|
+
return oppositeVector * ROOM_ENTRY_OFFSET_FROM_DOOR
|
|
51
52
|
end
|
|
52
53
|
--- Helper function to get all of the doors in the room. By default, it will return every door. You
|
|
53
54
|
-- can optionally specify one or more room types to return only the doors that match the specified
|
|
@@ -152,7 +153,7 @@ end
|
|
|
152
153
|
-- they would immediately collide with the loading zone. Instead, they are offset by a certain
|
|
153
154
|
-- amount of units.
|
|
154
155
|
function ____exports.getDoorEnterPosition(self, door)
|
|
155
|
-
local offset = ____exports.
|
|
156
|
+
local offset = ____exports.getDoorSlotEnterPositionOffset(nil, door.Slot)
|
|
156
157
|
return door.Position + offset
|
|
157
158
|
end
|
|
158
159
|
--- Helper function to convert an array of door slots or a set of door slots to the resulting bit
|