isaacscript-common 7.16.1 → 7.16.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.
@@ -22,13 +22,22 @@ export declare function getDevilRoomDoor(): GridEntityDoor | undefined;
22
22
  */
23
23
  export declare function getDevilRoomOrAngelRoomDoor(): GridEntityDoor | undefined;
24
24
  /**
25
- * Helper function to get the position that a player will enter a room at.
25
+ * Helper function to get the position that a player will enter a room at corresponding to a door.
26
26
  *
27
27
  * When players enter a room, they do not appear exactly on the location of the door, because then
28
28
  * they would immediately collide with the loading zone. Instead, they appear on the grid tile next
29
29
  * to the door.
30
30
  */
31
31
  export declare function getDoorEnterPosition(door: GridEntityDoor): Readonly<Vector>;
32
+ /**
33
+ * Helper function to get the position that a player will enter a room at corresponding to a door
34
+ * slot.
35
+ *
36
+ * When players enter a room, they do not appear exactly on the location of the door, because then
37
+ * they would immediately collide with the loading zone. Instead, they appear on the grid tile next
38
+ * to the door.
39
+ */
40
+ export declare function getDoorSlotEnterPosition(doorSlot: DoorSlot): Readonly<Vector>;
32
41
  /**
33
42
  * Helper function to get the offset from a door position that a player will enter a room at.
34
43
  *
@@ -1 +1 @@
1
- {"version":3,"file":"doors.d.ts","sourceRoot":"","sources":["../../src/functions/doors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,YAAY,EAIZ,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAmBtC,wBAAgB,aAAa,IAAI,IAAI,CAIpC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAKxD;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,GAAG,QAAQ,CAG3E;AAED,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,QAAQ,CAAC,YAAY,CAAC,GACpC,QAAQ,EAAE,CAWZ;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ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@ -70,13 +70,13 @@ function ____exports.getDoors(self, ...)
70
70
  do
71
71
  local door = room:GetDoor(doorSlot)
72
72
  if door == nil then
73
- goto __continue22
73
+ goto __continue23
74
74
  end
75
75
  if roomTypesSet.size == 0 or roomTypesSet:has(door.TargetRoomType) then
76
76
  doors[#doors + 1] = door
77
77
  end
78
78
  end
79
- ::__continue22::
79
+ ::__continue23::
80
80
  end
81
81
  return doors
82
82
  end
@@ -178,7 +178,7 @@ function ____exports.getDevilRoomOrAngelRoomDoor(self)
178
178
  end
179
179
  return ____temp_2
180
180
  end
181
- --- Helper function to get the position that a player will enter a room at.
181
+ --- Helper function to get the position that a player will enter a room at corresponding to a door.
182
182
  --
183
183
  -- When players enter a room, they do not appear exactly on the location of the door, because then
184
184
  -- they would immediately collide with the loading zone. Instead, they appear on the grid tile next
@@ -187,6 +187,18 @@ function ____exports.getDoorEnterPosition(self, door)
187
187
  local offset = ____exports.getDoorSlotEnterPositionOffset(nil, door.Slot)
188
188
  return door.Position + offset
189
189
  end
190
+ --- Helper function to get the position that a player will enter a room at corresponding to a door
191
+ -- slot.
192
+ --
193
+ -- When players enter a room, they do not appear exactly on the location of the door, because then
194
+ -- they would immediately collide with the loading zone. Instead, they appear on the grid tile next
195
+ -- to the door.
196
+ function ____exports.getDoorSlotEnterPosition(self, doorSlot)
197
+ local room = game:GetRoom()
198
+ local position = room:GetDoorSlotPosition(doorSlot)
199
+ local offset = ____exports.getDoorSlotEnterPositionOffset(nil, doorSlot)
200
+ return position + offset
201
+ end
190
202
  --- Helper function to get the possible door slots that can exist for a given room shape.
191
203
  function ____exports.getDoorSlotsForRoomShape(self, roomShape)
192
204
  return ROOM_SHAPE_TO_DOOR_SLOTS[roomShape]
package/dist/index.d.ts CHANGED
@@ -2839,7 +2839,7 @@ export declare function getDimension(): Dimension;
2839
2839
  export declare function getDirectionName(direction: Direction): string | undefined;
2840
2840
 
2841
2841
  /**
2842
- * Helper function to get the position that a player will enter a room at.
2842
+ * Helper function to get the position that a player will enter a room at corresponding to a door.
2843
2843
  *
2844
2844
  * When players enter a room, they do not appear exactly on the location of the door, because then
2845
2845
  * they would immediately collide with the loading zone. Instead, they appear on the grid tile next
@@ -2854,6 +2854,16 @@ export declare function getDoorEnterPosition(door: GridEntityDoor): Readonly<Vec
2854
2854
  */
2855
2855
  export declare function getDoors(...roomTypes: RoomType[]): GridEntityDoor[];
2856
2856
 
2857
+ /**
2858
+ * Helper function to get the position that a player will enter a room at corresponding to a door
2859
+ * slot.
2860
+ *
2861
+ * When players enter a room, they do not appear exactly on the location of the door, because then
2862
+ * they would immediately collide with the loading zone. Instead, they appear on the grid tile next
2863
+ * to the door.
2864
+ */
2865
+ export declare function getDoorSlotEnterPosition(doorSlot: DoorSlot): Readonly<Vector>;
2866
+
2857
2867
  /**
2858
2868
  * Helper function to get the offset from a door position that a player will enter a room at.
2859
2869
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "7.16.1",
3
+ "version": "7.16.2",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -114,7 +114,7 @@ export function getDevilRoomOrAngelRoomDoor(): GridEntityDoor | undefined {
114
114
  }
115
115
 
116
116
  /**
117
- * Helper function to get the position that a player will enter a room at.
117
+ * Helper function to get the position that a player will enter a room at corresponding to a door.
118
118
  *
119
119
  * When players enter a room, they do not appear exactly on the location of the door, because then
120
120
  * they would immediately collide with the loading zone. Instead, they appear on the grid tile next
@@ -125,6 +125,21 @@ export function getDoorEnterPosition(door: GridEntityDoor): Readonly<Vector> {
125
125
  return door.Position.add(offset);
126
126
  }
127
127
 
128
+ /**
129
+ * Helper function to get the position that a player will enter a room at corresponding to a door
130
+ * slot.
131
+ *
132
+ * When players enter a room, they do not appear exactly on the location of the door, because then
133
+ * they would immediately collide with the loading zone. Instead, they appear on the grid tile next
134
+ * to the door.
135
+ */
136
+ export function getDoorSlotEnterPosition(doorSlot: DoorSlot): Readonly<Vector> {
137
+ const room = game.GetRoom();
138
+ const position = room.GetDoorSlotPosition(doorSlot);
139
+ const offset = getDoorSlotEnterPositionOffset(doorSlot);
140
+ return position.add(offset);
141
+ }
142
+
128
143
  /**
129
144
  * Helper function to get the offset from a door position that a player will enter a room at.
130
145
  *