isaacscript-common 1.0.500 → 1.0.501

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.
Files changed (45) hide show
  1. package/dist/callbacks/postBombInitLate.d.ts +2 -2
  2. package/dist/callbacks/postBombInitLate.lua +11 -16
  3. package/dist/callbacks/postEffectInitLate.d.ts +2 -2
  4. package/dist/callbacks/postEffectInitLate.lua +11 -16
  5. package/dist/callbacks/postFamiliarInitLate.d.ts +2 -2
  6. package/dist/callbacks/postFamiliarInitLate.lua +11 -16
  7. package/dist/callbacks/postKnifeInitLate.d.ts +2 -2
  8. package/dist/callbacks/postKnifeInitLate.lua +11 -16
  9. package/dist/callbacks/postLaserInitLate.d.ts +2 -2
  10. package/dist/callbacks/postLaserInitLate.lua +11 -16
  11. package/dist/callbacks/postNPCInitLate.d.ts +2 -2
  12. package/dist/callbacks/postNPCInitLate.lua +11 -16
  13. package/dist/callbacks/postNewRoomEarly.d.ts +2 -0
  14. package/dist/callbacks/postNewRoomEarly.lua +46 -0
  15. package/dist/callbacks/postPickupInitLate.d.ts +2 -2
  16. package/dist/callbacks/postPickupInitLate.lua +11 -16
  17. package/dist/callbacks/postProjectileInitLate.d.ts +2 -2
  18. package/dist/callbacks/postProjectileInitLate.lua +11 -16
  19. package/dist/callbacks/postTearInitLate.d.ts +2 -2
  20. package/dist/callbacks/postTearInitLate.lua +11 -16
  21. package/dist/callbacks/subscriptions/postNewRoomEarly.d.ts +4 -0
  22. package/dist/callbacks/subscriptions/postNewRoomEarly.lua +18 -0
  23. package/dist/features/deployJSONRoom.lua +16 -16
  24. package/dist/features/getCollectibleItemPoolType.lua +1 -6
  25. package/dist/functions/collectibles.d.ts +3 -3
  26. package/dist/functions/flag.d.ts +1 -1
  27. package/dist/functions/gridEntity.d.ts +8 -2
  28. package/dist/functions/gridEntity.lua +16 -0
  29. package/dist/functions/input.d.ts +3 -5
  30. package/dist/functions/player.d.ts +5 -5
  31. package/dist/functions/revive.d.ts +2 -2
  32. package/dist/functions/rooms.d.ts +39 -18
  33. package/dist/functions/rooms.lua +60 -47
  34. package/dist/functions/util.d.ts +2 -2
  35. package/dist/functions/util.lua +2 -2
  36. package/dist/index.d.ts +1 -0
  37. package/dist/index.lua +8 -0
  38. package/dist/maps/roomShapeToTopLeftWallGridIndexMap.d.ts +3 -0
  39. package/dist/maps/roomShapeToTopLeftWallGridIndexMap.lua +12 -0
  40. package/dist/types/CallbackParametersCustom.d.ts +4 -0
  41. package/dist/types/ModCallbacksCustom.d.ts +34 -33
  42. package/dist/types/ModCallbacksCustom.lua +35 -33
  43. package/dist/types/ModUpgraded.lua +178 -321
  44. package/dist/upgradeMod.lua +3 -0
  45. package/package.json +2 -2
@@ -1,2 +1,2 @@
1
- /// <reference types="isaac-typescript-definitions" />
2
- export declare function postBombInitLateCallbackInit(mod: Mod): void;
1
+ import { ModUpgraded } from "../types/ModUpgraded";
2
+ export declare function postBombInitLateCallbackInit(mod: ModUpgraded): void;
@@ -1,12 +1,11 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postBombUpdate, v
4
+ local hasSubscriptions, postBombUpdate, postNewRoomEarly, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____rooms = require("functions.rooms")
8
- local getRoomIndex = ____rooms.getRoomIndex
9
- local getRoomVisitedCount = ____rooms.getRoomVisitedCount
7
+ local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
+ local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
10
9
  local ____postBombInitLate = require("callbacks.subscriptions.postBombInitLate")
11
10
  local postBombInitLateFire = ____postBombInitLate.postBombInitLateFire
12
11
  local postBombInitLateHasSubscriptions = ____postBombInitLate.postBombInitLateHasSubscriptions
@@ -17,26 +16,22 @@ function postBombUpdate(self, bomb)
17
16
  if not hasSubscriptions(nil) then
18
17
  return
19
18
  end
20
- local roomIndex = getRoomIndex(nil)
21
- local roomVisitedCount = getRoomVisitedCount(nil)
22
- if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
23
- v.run.currentRoomIndex = roomIndex
24
- v.run.currentRoomVisitedCount = roomVisitedCount
25
- v.run.firedSet:clear()
26
- end
27
19
  local index = GetPtrHash(bomb)
28
20
  if not v.run.firedSet:has(index) then
29
21
  v.run.firedSet:add(index)
30
22
  postBombInitLateFire(nil, bomb)
31
23
  end
32
24
  end
33
- v = {run = {
34
- firedSet = __TS__New(Set),
35
- currentRoomIndex = nil,
36
- currentRoomVisitedCount = nil
37
- }}
25
+ function postNewRoomEarly(self)
26
+ if not hasSubscriptions(nil) then
27
+ return
28
+ end
29
+ v.run.firedSet:clear()
30
+ end
31
+ v = {run = {firedSet = __TS__New(Set)}}
38
32
  function ____exports.postBombInitLateCallbackInit(self, mod)
39
33
  saveDataManager(nil, "postBombInitLate", v, hasSubscriptions)
40
34
  mod:AddCallback(ModCallbacks.MC_POST_BOMB_UPDATE, postBombUpdate)
35
+ mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
41
36
  end
42
37
  return ____exports
@@ -1,2 +1,2 @@
1
- /// <reference types="isaac-typescript-definitions" />
2
- export declare function postEffectInitLateCallbackInit(mod: Mod): void;
1
+ import { ModUpgraded } from "../types/ModUpgraded";
2
+ export declare function postEffectInitLateCallbackInit(mod: ModUpgraded): void;
@@ -1,12 +1,11 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postEffectUpdate, v
4
+ local hasSubscriptions, postEffectUpdate, postNewRoomEarly, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____rooms = require("functions.rooms")
8
- local getRoomIndex = ____rooms.getRoomIndex
9
- local getRoomVisitedCount = ____rooms.getRoomVisitedCount
7
+ local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
+ local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
10
9
  local ____postEffectInitLate = require("callbacks.subscriptions.postEffectInitLate")
11
10
  local postEffectInitLateFire = ____postEffectInitLate.postEffectInitLateFire
12
11
  local postEffectInitLateHasSubscriptions = ____postEffectInitLate.postEffectInitLateHasSubscriptions
@@ -17,26 +16,22 @@ function postEffectUpdate(self, effect)
17
16
  if not hasSubscriptions(nil) then
18
17
  return
19
18
  end
20
- local roomIndex = getRoomIndex(nil)
21
- local roomVisitedCount = getRoomVisitedCount(nil)
22
- if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
23
- v.run.currentRoomIndex = roomIndex
24
- v.run.currentRoomVisitedCount = roomVisitedCount
25
- v.run.firedSet:clear()
26
- end
27
19
  local index = GetPtrHash(effect)
28
20
  if not v.run.firedSet:has(index) then
29
21
  v.run.firedSet:add(index)
30
22
  postEffectInitLateFire(nil, effect)
31
23
  end
32
24
  end
33
- v = {run = {
34
- firedSet = __TS__New(Set),
35
- currentRoomIndex = nil,
36
- currentRoomVisitedCount = nil
37
- }}
25
+ function postNewRoomEarly(self)
26
+ if not hasSubscriptions(nil) then
27
+ return
28
+ end
29
+ v.run.firedSet:clear()
30
+ end
31
+ v = {run = {firedSet = __TS__New(Set)}}
38
32
  function ____exports.postEffectInitLateCallbackInit(self, mod)
39
33
  saveDataManager(nil, "postEffectInitLate", v, hasSubscriptions)
40
34
  mod:AddCallback(ModCallbacks.MC_POST_EFFECT_UPDATE, postEffectUpdate)
35
+ mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
41
36
  end
42
37
  return ____exports
@@ -1,2 +1,2 @@
1
- /// <reference types="isaac-typescript-definitions" />
2
- export declare function postFamiliarInitLateCallbackInit(mod: Mod): void;
1
+ import { ModUpgraded } from "../types/ModUpgraded";
2
+ export declare function postFamiliarInitLateCallbackInit(mod: ModUpgraded): void;
@@ -1,12 +1,11 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postFamiliarUpdate, v
4
+ local hasSubscriptions, postFamiliarUpdate, postNewRoomEarly, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____rooms = require("functions.rooms")
8
- local getRoomIndex = ____rooms.getRoomIndex
9
- local getRoomVisitedCount = ____rooms.getRoomVisitedCount
7
+ local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
+ local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
10
9
  local ____postFamiliarInitLate = require("callbacks.subscriptions.postFamiliarInitLate")
11
10
  local postFamiliarInitLateFire = ____postFamiliarInitLate.postFamiliarInitLateFire
12
11
  local postFamiliarInitLateHasSubscriptions = ____postFamiliarInitLate.postFamiliarInitLateHasSubscriptions
@@ -17,26 +16,22 @@ function postFamiliarUpdate(self, familiar)
17
16
  if not hasSubscriptions(nil) then
18
17
  return
19
18
  end
20
- local roomIndex = getRoomIndex(nil)
21
- local roomVisitedCount = getRoomVisitedCount(nil)
22
- if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
23
- v.run.currentRoomIndex = roomIndex
24
- v.run.currentRoomVisitedCount = roomVisitedCount
25
- v.run.firedSet:clear()
26
- end
27
19
  local index = GetPtrHash(familiar)
28
20
  if not v.run.firedSet:has(index) then
29
21
  v.run.firedSet:add(index)
30
22
  postFamiliarInitLateFire(nil, familiar)
31
23
  end
32
24
  end
33
- v = {run = {
34
- firedSet = __TS__New(Set),
35
- currentRoomIndex = nil,
36
- currentRoomVisitedCount = nil
37
- }}
25
+ function postNewRoomEarly(self)
26
+ if not hasSubscriptions(nil) then
27
+ return
28
+ end
29
+ v.run.firedSet:clear()
30
+ end
31
+ v = {run = {firedSet = __TS__New(Set)}}
38
32
  function ____exports.postFamiliarInitLateCallbackInit(self, mod)
39
33
  saveDataManager(nil, "postFamiliarInitLate", v, hasSubscriptions)
40
34
  mod:AddCallback(ModCallbacks.MC_FAMILIAR_UPDATE, postFamiliarUpdate)
35
+ mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
41
36
  end
42
37
  return ____exports
@@ -1,2 +1,2 @@
1
- /// <reference types="isaac-typescript-definitions" />
2
- export declare function postKnifeInitLateCallbackInit(mod: Mod): void;
1
+ import { ModUpgraded } from "../types/ModUpgraded";
2
+ export declare function postKnifeInitLateCallbackInit(mod: ModUpgraded): void;
@@ -1,12 +1,11 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postKnifeUpdate, v
4
+ local hasSubscriptions, postKnifeUpdate, postNewRoomEarly, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____rooms = require("functions.rooms")
8
- local getRoomIndex = ____rooms.getRoomIndex
9
- local getRoomVisitedCount = ____rooms.getRoomVisitedCount
7
+ local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
+ local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
10
9
  local ____postKnifeInitLate = require("callbacks.subscriptions.postKnifeInitLate")
11
10
  local postKnifeInitLateFire = ____postKnifeInitLate.postKnifeInitLateFire
12
11
  local postKnifeInitLateHasSubscriptions = ____postKnifeInitLate.postKnifeInitLateHasSubscriptions
@@ -17,26 +16,22 @@ function postKnifeUpdate(self, knife)
17
16
  if not hasSubscriptions(nil) then
18
17
  return
19
18
  end
20
- local roomIndex = getRoomIndex(nil)
21
- local roomVisitedCount = getRoomVisitedCount(nil)
22
- if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
23
- v.run.currentRoomIndex = roomIndex
24
- v.run.currentRoomVisitedCount = roomVisitedCount
25
- v.run.firedSet:clear()
26
- end
27
19
  local index = GetPtrHash(knife)
28
20
  if not v.run.firedSet:has(index) then
29
21
  v.run.firedSet:add(index)
30
22
  postKnifeInitLateFire(nil, knife)
31
23
  end
32
24
  end
33
- v = {run = {
34
- firedSet = __TS__New(Set),
35
- currentRoomIndex = nil,
36
- currentRoomVisitedCount = nil
37
- }}
25
+ function postNewRoomEarly(self)
26
+ if not hasSubscriptions(nil) then
27
+ return
28
+ end
29
+ v.run.firedSet:clear()
30
+ end
31
+ v = {run = {firedSet = __TS__New(Set)}}
38
32
  function ____exports.postKnifeInitLateCallbackInit(self, mod)
39
33
  saveDataManager(nil, "postKnifeInitLate", v, hasSubscriptions)
40
34
  mod:AddCallback(ModCallbacks.MC_POST_KNIFE_UPDATE, postKnifeUpdate)
35
+ mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
41
36
  end
42
37
  return ____exports
@@ -1,2 +1,2 @@
1
- /// <reference types="isaac-typescript-definitions" />
2
- export declare function postLaserInitLateCallbackInit(mod: Mod): void;
1
+ import { ModUpgraded } from "../types/ModUpgraded";
2
+ export declare function postLaserInitLateCallbackInit(mod: ModUpgraded): void;
@@ -1,12 +1,11 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postLaserUpdate, v
4
+ local hasSubscriptions, postLaserUpdate, postNewRoomEarly, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____rooms = require("functions.rooms")
8
- local getRoomIndex = ____rooms.getRoomIndex
9
- local getRoomVisitedCount = ____rooms.getRoomVisitedCount
7
+ local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
+ local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
10
9
  local ____postLaserInitLate = require("callbacks.subscriptions.postLaserInitLate")
11
10
  local postLaserInitLateFire = ____postLaserInitLate.postLaserInitLateFire
12
11
  local postLaserInitLateHasSubscriptions = ____postLaserInitLate.postLaserInitLateHasSubscriptions
@@ -17,26 +16,22 @@ function postLaserUpdate(self, laser)
17
16
  if not hasSubscriptions(nil) then
18
17
  return
19
18
  end
20
- local roomIndex = getRoomIndex(nil)
21
- local roomVisitedCount = getRoomVisitedCount(nil)
22
- if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
23
- v.run.currentRoomIndex = roomIndex
24
- v.run.currentRoomVisitedCount = roomVisitedCount
25
- v.run.firedSet:clear()
26
- end
27
19
  local index = GetPtrHash(laser)
28
20
  if not v.run.firedSet:has(index) then
29
21
  v.run.firedSet:add(index)
30
22
  postLaserInitLateFire(nil, laser)
31
23
  end
32
24
  end
33
- v = {run = {
34
- firedSet = __TS__New(Set),
35
- currentRoomIndex = nil,
36
- currentRoomVisitedCount = nil
37
- }}
25
+ function postNewRoomEarly(self)
26
+ if not hasSubscriptions(nil) then
27
+ return
28
+ end
29
+ v.run.firedSet:clear()
30
+ end
31
+ v = {run = {firedSet = __TS__New(Set)}}
38
32
  function ____exports.postLaserInitLateCallbackInit(self, mod)
39
33
  saveDataManager(nil, "postLaserInitLate", v, hasSubscriptions)
40
34
  mod:AddCallback(ModCallbacks.MC_POST_LASER_UPDATE, postLaserUpdate)
35
+ mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
41
36
  end
42
37
  return ____exports
@@ -1,2 +1,2 @@
1
- /// <reference types="isaac-typescript-definitions" />
2
- export declare function postNPCInitLateCallbackInit(mod: Mod): void;
1
+ import { ModUpgraded } from "../types/ModUpgraded";
2
+ export declare function postNPCInitLateCallbackInit(mod: ModUpgraded): void;
@@ -1,12 +1,11 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postNPCUpdate, v
4
+ local hasSubscriptions, postNPCUpdate, postNewRoomEarly, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____rooms = require("functions.rooms")
8
- local getRoomIndex = ____rooms.getRoomIndex
9
- local getRoomVisitedCount = ____rooms.getRoomVisitedCount
7
+ local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
+ local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
10
9
  local ____postNPCInitLate = require("callbacks.subscriptions.postNPCInitLate")
11
10
  local postNPCInitLateFire = ____postNPCInitLate.postNPCInitLateFire
12
11
  local postNPCInitLateHasSubscriptions = ____postNPCInitLate.postNPCInitLateHasSubscriptions
@@ -17,26 +16,22 @@ function postNPCUpdate(self, npc)
17
16
  if not hasSubscriptions(nil) then
18
17
  return
19
18
  end
20
- local roomIndex = getRoomIndex(nil)
21
- local roomVisitedCount = getRoomVisitedCount(nil)
22
- if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
23
- v.run.currentRoomIndex = roomIndex
24
- v.run.currentRoomVisitedCount = roomVisitedCount
25
- v.run.firedSet:clear()
26
- end
27
19
  local index = GetPtrHash(npc)
28
20
  if not v.run.firedSet:has(index) then
29
21
  v.run.firedSet:add(index)
30
22
  postNPCInitLateFire(nil, npc)
31
23
  end
32
24
  end
33
- v = {run = {
34
- firedSet = __TS__New(Set),
35
- currentRoomIndex = nil,
36
- currentRoomVisitedCount = nil
37
- }}
25
+ function postNewRoomEarly(self)
26
+ if not hasSubscriptions(nil) then
27
+ return
28
+ end
29
+ v.run.firedSet:clear()
30
+ end
31
+ v = {run = {firedSet = __TS__New(Set)}}
38
32
  function ____exports.postNPCInitLateCallbackInit(self, mod)
39
33
  saveDataManager(nil, "postNPCInitLate", v, hasSubscriptions)
40
34
  mod:AddCallback(ModCallbacks.MC_NPC_UPDATE, postNPCUpdate)
35
+ mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
41
36
  end
42
37
  return ____exports
@@ -0,0 +1,2 @@
1
+ import { ModUpgraded } from "../types/ModUpgraded";
2
+ export declare function postNewRoomEarlyCallbackInit(mod: ModUpgraded): void;
@@ -0,0 +1,46 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____exports = {}
3
+ local hasSubscriptions, postNewRoom, preEntitySpawn, checkRoomChanged, v
4
+ local ____exports = require("features.saveDataManager.exports")
5
+ local saveDataManager = ____exports.saveDataManager
6
+ local ____gridEntity = require("functions.gridEntity")
7
+ local getTopLeftWall = ____gridEntity.getTopLeftWall
8
+ local ____postNewRoomEarly = require("callbacks.subscriptions.postNewRoomEarly")
9
+ local postNewRoomEarlyFire = ____postNewRoomEarly.postNewRoomEarlyFire
10
+ local postNewRoomEarlyHasSubscriptions = ____postNewRoomEarly.postNewRoomEarlyHasSubscriptions
11
+ function hasSubscriptions(self)
12
+ return postNewRoomEarlyHasSubscriptions(nil)
13
+ end
14
+ function postNewRoom(self)
15
+ if not hasSubscriptions(nil) then
16
+ return
17
+ end
18
+ checkRoomChanged(nil)
19
+ end
20
+ function preEntitySpawn(self)
21
+ if not hasSubscriptions(nil) then
22
+ return
23
+ end
24
+ checkRoomChanged(nil)
25
+ end
26
+ function checkRoomChanged(self)
27
+ local topLeftWall = getTopLeftWall(nil)
28
+ local ____temp_0
29
+ if topLeftWall == nil then
30
+ ____temp_0 = nil
31
+ else
32
+ ____temp_0 = GetPtrHash(topLeftWall)
33
+ end
34
+ local topLeftWallPtrHash = ____temp_0
35
+ if topLeftWallPtrHash ~= v.run.topLeftWallPtrHash then
36
+ v.run.topLeftWallPtrHash = topLeftWallPtrHash
37
+ postNewRoomEarlyFire(nil)
38
+ end
39
+ end
40
+ v = {run = {topLeftWallPtrHash = nil}}
41
+ function ____exports.postNewRoomEarlyCallbackInit(self, mod)
42
+ saveDataManager(nil, "postNewRoomEarlyCallback", v, hasSubscriptions)
43
+ mod:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, postNewRoom)
44
+ mod:AddCallback(ModCallbacks.MC_PRE_ENTITY_SPAWN, preEntitySpawn)
45
+ end
46
+ return ____exports
@@ -1,2 +1,2 @@
1
- /// <reference types="isaac-typescript-definitions" />
2
- export declare function postPickupInitLateCallbackInit(mod: Mod): void;
1
+ import { ModUpgraded } from "../types/ModUpgraded";
2
+ export declare function postPickupInitLateCallbackInit(mod: ModUpgraded): void;
@@ -1,12 +1,11 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postPickupUpdate, v
4
+ local hasSubscriptions, postPickupUpdate, postNewRoomEarly, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____rooms = require("functions.rooms")
8
- local getRoomIndex = ____rooms.getRoomIndex
9
- local getRoomVisitedCount = ____rooms.getRoomVisitedCount
7
+ local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
+ local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
10
9
  local ____postPickupInitLate = require("callbacks.subscriptions.postPickupInitLate")
11
10
  local postPickupInitLateFire = ____postPickupInitLate.postPickupInitLateFire
12
11
  local postPickupInitLateHasSubscriptions = ____postPickupInitLate.postPickupInitLateHasSubscriptions
@@ -17,26 +16,22 @@ function postPickupUpdate(self, pickup)
17
16
  if not hasSubscriptions(nil) then
18
17
  return
19
18
  end
20
- local roomIndex = getRoomIndex(nil)
21
- local roomVisitedCount = getRoomVisitedCount(nil)
22
- if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
23
- v.run.currentRoomIndex = roomIndex
24
- v.run.currentRoomVisitedCount = roomVisitedCount
25
- v.run.firedSet:clear()
26
- end
27
19
  local index = GetPtrHash(pickup)
28
20
  if not v.run.firedSet:has(index) then
29
21
  v.run.firedSet:add(index)
30
22
  postPickupInitLateFire(nil, pickup)
31
23
  end
32
24
  end
33
- v = {run = {
34
- firedSet = __TS__New(Set),
35
- currentRoomIndex = nil,
36
- currentRoomVisitedCount = nil
37
- }}
25
+ function postNewRoomEarly(self)
26
+ if not hasSubscriptions(nil) then
27
+ return
28
+ end
29
+ v.run.firedSet:clear()
30
+ end
31
+ v = {run = {firedSet = __TS__New(Set)}}
38
32
  function ____exports.postPickupInitLateCallbackInit(self, mod)
39
33
  saveDataManager(nil, "postPickupInitLate", v, hasSubscriptions)
40
34
  mod:AddCallback(ModCallbacks.MC_POST_PICKUP_UPDATE, postPickupUpdate)
35
+ mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
41
36
  end
42
37
  return ____exports
@@ -1,2 +1,2 @@
1
- /// <reference types="isaac-typescript-definitions" />
2
- export declare function postProjectileInitLateCallbackInit(mod: Mod): void;
1
+ import { ModUpgraded } from "../types/ModUpgraded";
2
+ export declare function postProjectileInitLateCallbackInit(mod: ModUpgraded): void;
@@ -1,12 +1,11 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postProjectileUpdate, v
4
+ local hasSubscriptions, postProjectileUpdate, postNewRoomEarly, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____rooms = require("functions.rooms")
8
- local getRoomIndex = ____rooms.getRoomIndex
9
- local getRoomVisitedCount = ____rooms.getRoomVisitedCount
7
+ local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
+ local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
10
9
  local ____postProjectileInitLate = require("callbacks.subscriptions.postProjectileInitLate")
11
10
  local postProjectileInitLateFire = ____postProjectileInitLate.postProjectileInitLateFire
12
11
  local postProjectileInitLateHasSubscriptions = ____postProjectileInitLate.postProjectileInitLateHasSubscriptions
@@ -17,26 +16,22 @@ function postProjectileUpdate(self, projectile)
17
16
  if not hasSubscriptions(nil) then
18
17
  return
19
18
  end
20
- local roomIndex = getRoomIndex(nil)
21
- local roomVisitedCount = getRoomVisitedCount(nil)
22
- if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
23
- v.run.currentRoomIndex = roomIndex
24
- v.run.currentRoomVisitedCount = roomVisitedCount
25
- v.run.firedSet:clear()
26
- end
27
19
  local index = GetPtrHash(projectile)
28
20
  if not v.run.firedSet:has(index) then
29
21
  v.run.firedSet:add(index)
30
22
  postProjectileInitLateFire(nil, projectile)
31
23
  end
32
24
  end
33
- v = {run = {
34
- firedSet = __TS__New(Set),
35
- currentRoomIndex = nil,
36
- currentRoomVisitedCount = nil
37
- }}
25
+ function postNewRoomEarly(self)
26
+ if not hasSubscriptions(nil) then
27
+ return
28
+ end
29
+ v.run.firedSet:clear()
30
+ end
31
+ v = {run = {firedSet = __TS__New(Set)}}
38
32
  function ____exports.postProjectileInitLateCallbackInit(self, mod)
39
33
  saveDataManager(nil, "postProjectileInitLate", v, hasSubscriptions)
40
34
  mod:AddCallback(ModCallbacks.MC_POST_PROJECTILE_UPDATE, postProjectileUpdate)
35
+ mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
41
36
  end
42
37
  return ____exports
@@ -1,2 +1,2 @@
1
- /// <reference types="isaac-typescript-definitions" />
2
- export declare function postTearInitLateCallbackInit(mod: Mod): void;
1
+ import { ModUpgraded } from "../types/ModUpgraded";
2
+ export declare function postTearInitLateCallbackInit(mod: ModUpgraded): void;
@@ -1,12 +1,11 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postTearUpdate, v
4
+ local hasSubscriptions, postTearUpdate, postNewRoomEarly, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____rooms = require("functions.rooms")
8
- local getRoomIndex = ____rooms.getRoomIndex
9
- local getRoomVisitedCount = ____rooms.getRoomVisitedCount
7
+ local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
+ local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
10
9
  local ____postTearInitLate = require("callbacks.subscriptions.postTearInitLate")
11
10
  local postTearInitLateFire = ____postTearInitLate.postTearInitLateFire
12
11
  local postTearInitLateHasSubscriptions = ____postTearInitLate.postTearInitLateHasSubscriptions
@@ -17,26 +16,22 @@ function postTearUpdate(self, tear)
17
16
  if not hasSubscriptions(nil) then
18
17
  return
19
18
  end
20
- local roomIndex = getRoomIndex(nil)
21
- local roomVisitedCount = getRoomVisitedCount(nil)
22
- if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
23
- v.run.currentRoomIndex = roomIndex
24
- v.run.currentRoomVisitedCount = roomVisitedCount
25
- v.run.firedSet:clear()
26
- end
27
19
  local index = GetPtrHash(tear)
28
20
  if not v.run.firedSet:has(index) then
29
21
  v.run.firedSet:add(index)
30
22
  postTearInitLateFire(nil, tear)
31
23
  end
32
24
  end
33
- v = {run = {
34
- firedSet = __TS__New(Set),
35
- currentRoomIndex = nil,
36
- currentRoomVisitedCount = nil
37
- }}
25
+ function postNewRoomEarly(self)
26
+ if not hasSubscriptions(nil) then
27
+ return
28
+ end
29
+ v.run.firedSet:clear()
30
+ end
31
+ v = {run = {firedSet = __TS__New(Set)}}
38
32
  function ____exports.postTearInitLateCallbackInit(self, mod)
39
33
  saveDataManager(nil, "postTearInitLate", v, hasSubscriptions)
40
34
  mod:AddCallback(ModCallbacks.MC_POST_TEAR_UPDATE, postTearUpdate)
35
+ mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
41
36
  end
42
37
  return ____exports
@@ -0,0 +1,4 @@
1
+ export declare type PostNewRoomEarlyCallbackType = () => void;
2
+ export declare function postNewRoomEarlyHasSubscriptions(): boolean;
3
+ export declare function postNewRoomEarlyRegister(callback: PostNewRoomEarlyCallbackType): void;
4
+ export declare function postNewRoomEarlyFire(): void;
@@ -0,0 +1,18 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ require("lualib_bundle");
3
+ local ____exports = {}
4
+ local subscriptions = {}
5
+ function ____exports.postNewRoomEarlyHasSubscriptions(self)
6
+ return #subscriptions > 0
7
+ end
8
+ function ____exports.postNewRoomEarlyRegister(self, callback)
9
+ __TS__ArrayPush(subscriptions, {callback})
10
+ end
11
+ function ____exports.postNewRoomEarlyFire(self)
12
+ local callback
13
+ for ____, ____value in ipairs(subscriptions) do
14
+ callback = ____value[1]
15
+ callback(nil)
16
+ end
17
+ end
18
+ return ____exports