isaacscript-common 1.0.501 → 1.0.505

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.
@@ -1,2 +1,2 @@
1
- import { ModUpgraded } from "../types/ModUpgraded";
2
- export declare function postBombInitLateCallbackInit(mod: ModUpgraded): void;
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare function postBombInitLateCallbackInit(mod: Mod): void;
@@ -1,11 +1,9 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postBombUpdate, postNewRoomEarly, v
4
+ local hasSubscriptions, postBombUpdate, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
- local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
9
7
  local ____postBombInitLate = require("callbacks.subscriptions.postBombInitLate")
10
8
  local postBombInitLateFire = ____postBombInitLate.postBombInitLateFire
11
9
  local postBombInitLateHasSubscriptions = ____postBombInitLate.postBombInitLateHasSubscriptions
@@ -17,21 +15,14 @@ function postBombUpdate(self, bomb)
17
15
  return
18
16
  end
19
17
  local index = GetPtrHash(bomb)
20
- if not v.run.firedSet:has(index) then
21
- v.run.firedSet:add(index)
18
+ if not v.room.firedSet:has(index) then
19
+ v.room.firedSet:add(index)
22
20
  postBombInitLateFire(nil, bomb)
23
21
  end
24
22
  end
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)}}
23
+ v = {room = {firedSet = __TS__New(Set)}}
32
24
  function ____exports.postBombInitLateCallbackInit(self, mod)
33
25
  saveDataManager(nil, "postBombInitLate", v, hasSubscriptions)
34
26
  mod:AddCallback(ModCallbacks.MC_POST_BOMB_UPDATE, postBombUpdate)
35
- mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
36
27
  end
37
28
  return ____exports
@@ -1,2 +1,2 @@
1
- import { ModUpgraded } from "../types/ModUpgraded";
2
- export declare function postEffectInitLateCallbackInit(mod: ModUpgraded): void;
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare function postEffectInitLateCallbackInit(mod: Mod): void;
@@ -1,11 +1,9 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postEffectUpdate, postNewRoomEarly, v
4
+ local hasSubscriptions, postEffectUpdate, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
- local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
9
7
  local ____postEffectInitLate = require("callbacks.subscriptions.postEffectInitLate")
10
8
  local postEffectInitLateFire = ____postEffectInitLate.postEffectInitLateFire
11
9
  local postEffectInitLateHasSubscriptions = ____postEffectInitLate.postEffectInitLateHasSubscriptions
@@ -17,21 +15,14 @@ function postEffectUpdate(self, effect)
17
15
  return
18
16
  end
19
17
  local index = GetPtrHash(effect)
20
- if not v.run.firedSet:has(index) then
21
- v.run.firedSet:add(index)
18
+ if not v.room.firedSet:has(index) then
19
+ v.room.firedSet:add(index)
22
20
  postEffectInitLateFire(nil, effect)
23
21
  end
24
22
  end
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)}}
23
+ v = {room = {firedSet = __TS__New(Set)}}
32
24
  function ____exports.postEffectInitLateCallbackInit(self, mod)
33
25
  saveDataManager(nil, "postEffectInitLate", v, hasSubscriptions)
34
26
  mod:AddCallback(ModCallbacks.MC_POST_EFFECT_UPDATE, postEffectUpdate)
35
- mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
36
27
  end
37
28
  return ____exports
@@ -1,2 +1,2 @@
1
- import { ModUpgraded } from "../types/ModUpgraded";
2
- export declare function postFamiliarInitLateCallbackInit(mod: ModUpgraded): void;
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare function postFamiliarInitLateCallbackInit(mod: Mod): void;
@@ -1,11 +1,9 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postFamiliarUpdate, postNewRoomEarly, v
4
+ local hasSubscriptions, postFamiliarUpdate, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
- local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
9
7
  local ____postFamiliarInitLate = require("callbacks.subscriptions.postFamiliarInitLate")
10
8
  local postFamiliarInitLateFire = ____postFamiliarInitLate.postFamiliarInitLateFire
11
9
  local postFamiliarInitLateHasSubscriptions = ____postFamiliarInitLate.postFamiliarInitLateHasSubscriptions
@@ -22,16 +20,9 @@ function postFamiliarUpdate(self, familiar)
22
20
  postFamiliarInitLateFire(nil, familiar)
23
21
  end
24
22
  end
25
- function postNewRoomEarly(self)
26
- if not hasSubscriptions(nil) then
27
- return
28
- end
29
- v.run.firedSet:clear()
30
- end
31
23
  v = {run = {firedSet = __TS__New(Set)}}
32
24
  function ____exports.postFamiliarInitLateCallbackInit(self, mod)
33
25
  saveDataManager(nil, "postFamiliarInitLate", v, hasSubscriptions)
34
26
  mod:AddCallback(ModCallbacks.MC_FAMILIAR_UPDATE, postFamiliarUpdate)
35
- mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
36
27
  end
37
28
  return ____exports
@@ -1,2 +1,2 @@
1
- import { ModUpgraded } from "../types/ModUpgraded";
2
- export declare function postKnifeInitLateCallbackInit(mod: ModUpgraded): void;
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare function postKnifeInitLateCallbackInit(mod: Mod): void;
@@ -1,11 +1,9 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postKnifeUpdate, postNewRoomEarly, v
4
+ local hasSubscriptions, postKnifeUpdate, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
- local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
9
7
  local ____postKnifeInitLate = require("callbacks.subscriptions.postKnifeInitLate")
10
8
  local postKnifeInitLateFire = ____postKnifeInitLate.postKnifeInitLateFire
11
9
  local postKnifeInitLateHasSubscriptions = ____postKnifeInitLate.postKnifeInitLateHasSubscriptions
@@ -17,21 +15,14 @@ function postKnifeUpdate(self, knife)
17
15
  return
18
16
  end
19
17
  local index = GetPtrHash(knife)
20
- if not v.run.firedSet:has(index) then
21
- v.run.firedSet:add(index)
18
+ if not v.room.firedSet:has(index) then
19
+ v.room.firedSet:add(index)
22
20
  postKnifeInitLateFire(nil, knife)
23
21
  end
24
22
  end
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)}}
23
+ v = {room = {firedSet = __TS__New(Set)}}
32
24
  function ____exports.postKnifeInitLateCallbackInit(self, mod)
33
25
  saveDataManager(nil, "postKnifeInitLate", v, hasSubscriptions)
34
26
  mod:AddCallback(ModCallbacks.MC_POST_KNIFE_UPDATE, postKnifeUpdate)
35
- mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
36
27
  end
37
28
  return ____exports
@@ -1,2 +1,2 @@
1
- import { ModUpgraded } from "../types/ModUpgraded";
2
- export declare function postLaserInitLateCallbackInit(mod: ModUpgraded): void;
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare function postLaserInitLateCallbackInit(mod: Mod): void;
@@ -1,11 +1,9 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postLaserUpdate, postNewRoomEarly, v
4
+ local hasSubscriptions, postLaserUpdate, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
- local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
9
7
  local ____postLaserInitLate = require("callbacks.subscriptions.postLaserInitLate")
10
8
  local postLaserInitLateFire = ____postLaserInitLate.postLaserInitLateFire
11
9
  local postLaserInitLateHasSubscriptions = ____postLaserInitLate.postLaserInitLateHasSubscriptions
@@ -17,21 +15,14 @@ function postLaserUpdate(self, laser)
17
15
  return
18
16
  end
19
17
  local index = GetPtrHash(laser)
20
- if not v.run.firedSet:has(index) then
21
- v.run.firedSet:add(index)
18
+ if not v.room.firedSet:has(index) then
19
+ v.room.firedSet:add(index)
22
20
  postLaserInitLateFire(nil, laser)
23
21
  end
24
22
  end
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)}}
23
+ v = {room = {firedSet = __TS__New(Set)}}
32
24
  function ____exports.postLaserInitLateCallbackInit(self, mod)
33
25
  saveDataManager(nil, "postLaserInitLate", v, hasSubscriptions)
34
26
  mod:AddCallback(ModCallbacks.MC_POST_LASER_UPDATE, postLaserUpdate)
35
- mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
36
27
  end
37
28
  return ____exports
@@ -1,2 +1,2 @@
1
- import { ModUpgraded } from "../types/ModUpgraded";
2
- export declare function postNPCInitLateCallbackInit(mod: ModUpgraded): void;
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare function postNPCInitLateCallbackInit(mod: Mod): void;
@@ -1,11 +1,9 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postNPCUpdate, postNewRoomEarly, v
4
+ local hasSubscriptions, postNPCUpdate, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
- local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
9
7
  local ____postNPCInitLate = require("callbacks.subscriptions.postNPCInitLate")
10
8
  local postNPCInitLateFire = ____postNPCInitLate.postNPCInitLateFire
11
9
  local postNPCInitLateHasSubscriptions = ____postNPCInitLate.postNPCInitLateHasSubscriptions
@@ -17,21 +15,14 @@ function postNPCUpdate(self, npc)
17
15
  return
18
16
  end
19
17
  local index = GetPtrHash(npc)
20
- if not v.run.firedSet:has(index) then
21
- v.run.firedSet:add(index)
18
+ if not v.room.firedSet:has(index) then
19
+ v.room.firedSet:add(index)
22
20
  postNPCInitLateFire(nil, npc)
23
21
  end
24
22
  end
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)}}
23
+ v = {room = {firedSet = __TS__New(Set)}}
32
24
  function ____exports.postNPCInitLateCallbackInit(self, mod)
33
25
  saveDataManager(nil, "postNPCInitLate", v, hasSubscriptions)
34
26
  mod:AddCallback(ModCallbacks.MC_NPC_UPDATE, postNPCUpdate)
35
- mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
36
27
  end
37
28
  return ____exports
@@ -1,10 +1,9 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____exports = {}
3
- local hasSubscriptions, postNewRoom, preEntitySpawn, checkRoomChanged, v
4
- local ____exports = require("features.saveDataManager.exports")
5
- local saveDataManager = ____exports.saveDataManager
3
+ local hasSubscriptions, postNewRoom, preEntitySpawn, checkRoomChanged, currentRoomTopLeftWallPtrHash
6
4
  local ____gridEntity = require("functions.gridEntity")
7
- local getTopLeftWall = ____gridEntity.getTopLeftWall
5
+ local getTopLeftWallGridIndex = ____gridEntity.getTopLeftWallGridIndex
6
+ local spawnGridEntity = ____gridEntity.spawnGridEntity
8
7
  local ____postNewRoomEarly = require("callbacks.subscriptions.postNewRoomEarly")
9
8
  local postNewRoomEarlyFire = ____postNewRoomEarly.postNewRoomEarlyFire
10
9
  local postNewRoomEarlyHasSubscriptions = ____postNewRoomEarly.postNewRoomEarlyHasSubscriptions
@@ -24,22 +23,21 @@ function preEntitySpawn(self)
24
23
  checkRoomChanged(nil)
25
24
  end
26
25
  function checkRoomChanged(self)
27
- local topLeftWall = getTopLeftWall(nil)
28
- local ____temp_0
26
+ local game = Game()
27
+ local room = game:GetRoom()
28
+ local topLeftWallGridIndex = getTopLeftWallGridIndex(nil)
29
+ local topLeftWall = room:GetGridEntity(topLeftWallGridIndex)
29
30
  if topLeftWall == nil then
30
- ____temp_0 = nil
31
- else
32
- ____temp_0 = GetPtrHash(topLeftWall)
31
+ topLeftWall = spawnGridEntity(nil, GridEntityType.GRID_WALL, topLeftWallGridIndex)
33
32
  end
34
- local topLeftWallPtrHash = ____temp_0
35
- if topLeftWallPtrHash ~= v.run.topLeftWallPtrHash then
36
- v.run.topLeftWallPtrHash = topLeftWallPtrHash
33
+ local topLeftWallPtrHash = GetPtrHash(topLeftWall)
34
+ if topLeftWallPtrHash ~= currentRoomTopLeftWallPtrHash then
35
+ currentRoomTopLeftWallPtrHash = topLeftWallPtrHash
37
36
  postNewRoomEarlyFire(nil)
38
37
  end
39
38
  end
40
- v = {run = {topLeftWallPtrHash = nil}}
39
+ currentRoomTopLeftWallPtrHash = nil
41
40
  function ____exports.postNewRoomEarlyCallbackInit(self, mod)
42
- saveDataManager(nil, "postNewRoomEarlyCallback", v, hasSubscriptions)
43
41
  mod:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, postNewRoom)
44
42
  mod:AddCallback(ModCallbacks.MC_PRE_ENTITY_SPAWN, preEntitySpawn)
45
43
  end
@@ -1,2 +1,2 @@
1
- import { ModUpgraded } from "../types/ModUpgraded";
2
- export declare function postPickupInitLateCallbackInit(mod: ModUpgraded): void;
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare function postPickupInitLateCallbackInit(mod: Mod): void;
@@ -1,11 +1,9 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postPickupUpdate, postNewRoomEarly, v
4
+ local hasSubscriptions, postPickupUpdate, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
- local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
9
7
  local ____postPickupInitLate = require("callbacks.subscriptions.postPickupInitLate")
10
8
  local postPickupInitLateFire = ____postPickupInitLate.postPickupInitLateFire
11
9
  local postPickupInitLateHasSubscriptions = ____postPickupInitLate.postPickupInitLateHasSubscriptions
@@ -17,21 +15,14 @@ function postPickupUpdate(self, pickup)
17
15
  return
18
16
  end
19
17
  local index = GetPtrHash(pickup)
20
- if not v.run.firedSet:has(index) then
21
- v.run.firedSet:add(index)
18
+ if not v.room.firedSet:has(index) then
19
+ v.room.firedSet:add(index)
22
20
  postPickupInitLateFire(nil, pickup)
23
21
  end
24
22
  end
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)}}
23
+ v = {room = {firedSet = __TS__New(Set)}}
32
24
  function ____exports.postPickupInitLateCallbackInit(self, mod)
33
25
  saveDataManager(nil, "postPickupInitLate", v, hasSubscriptions)
34
26
  mod:AddCallback(ModCallbacks.MC_POST_PICKUP_UPDATE, postPickupUpdate)
35
- mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
36
27
  end
37
28
  return ____exports
@@ -1,2 +1,2 @@
1
- import { ModUpgraded } from "../types/ModUpgraded";
2
- export declare function postProjectileInitLateCallbackInit(mod: ModUpgraded): void;
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare function postProjectileInitLateCallbackInit(mod: Mod): void;
@@ -1,11 +1,9 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postProjectileUpdate, postNewRoomEarly, v
4
+ local hasSubscriptions, postProjectileUpdate, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
- local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
9
7
  local ____postProjectileInitLate = require("callbacks.subscriptions.postProjectileInitLate")
10
8
  local postProjectileInitLateFire = ____postProjectileInitLate.postProjectileInitLateFire
11
9
  local postProjectileInitLateHasSubscriptions = ____postProjectileInitLate.postProjectileInitLateHasSubscriptions
@@ -17,21 +15,14 @@ function postProjectileUpdate(self, projectile)
17
15
  return
18
16
  end
19
17
  local index = GetPtrHash(projectile)
20
- if not v.run.firedSet:has(index) then
21
- v.run.firedSet:add(index)
18
+ if not v.room.firedSet:has(index) then
19
+ v.room.firedSet:add(index)
22
20
  postProjectileInitLateFire(nil, projectile)
23
21
  end
24
22
  end
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)}}
23
+ v = {room = {firedSet = __TS__New(Set)}}
32
24
  function ____exports.postProjectileInitLateCallbackInit(self, mod)
33
25
  saveDataManager(nil, "postProjectileInitLate", v, hasSubscriptions)
34
26
  mod:AddCallback(ModCallbacks.MC_POST_PROJECTILE_UPDATE, postProjectileUpdate)
35
- mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
36
27
  end
37
28
  return ____exports
@@ -1,2 +1,2 @@
1
- import { ModUpgraded } from "../types/ModUpgraded";
2
- export declare function postTearInitLateCallbackInit(mod: ModUpgraded): void;
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare function postTearInitLateCallbackInit(mod: Mod): void;
@@ -1,11 +1,9 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
- local hasSubscriptions, postTearUpdate, postNewRoomEarly, v
4
+ local hasSubscriptions, postTearUpdate, v
5
5
  local ____exports = require("features.saveDataManager.exports")
6
6
  local saveDataManager = ____exports.saveDataManager
7
- local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
8
- local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
9
7
  local ____postTearInitLate = require("callbacks.subscriptions.postTearInitLate")
10
8
  local postTearInitLateFire = ____postTearInitLate.postTearInitLateFire
11
9
  local postTearInitLateHasSubscriptions = ____postTearInitLate.postTearInitLateHasSubscriptions
@@ -17,21 +15,14 @@ function postTearUpdate(self, tear)
17
15
  return
18
16
  end
19
17
  local index = GetPtrHash(tear)
20
- if not v.run.firedSet:has(index) then
21
- v.run.firedSet:add(index)
18
+ if not v.room.firedSet:has(index) then
19
+ v.room.firedSet:add(index)
22
20
  postTearInitLateFire(nil, tear)
23
21
  end
24
22
  end
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)}}
23
+ v = {room = {firedSet = __TS__New(Set)}}
32
24
  function ____exports.postTearInitLateCallbackInit(self, mod)
33
25
  saveDataManager(nil, "postTearInitLate", v, hasSubscriptions)
34
26
  mod:AddCallback(ModCallbacks.MC_POST_TEAR_UPDATE, postTearUpdate)
35
- mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
36
27
  end
37
28
  return ____exports
@@ -1,6 +1,6 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____exports = {}
3
- local postPlayerInit, preGameExit, postNewLevel, postNewRoom, restoreDefaultsAll, restoreDefaults, clearAndCopyAllElements, mod, loadedDataOnThisRun
3
+ local postPlayerInit, preGameExit, postNewLevel, postNewRoomEarly, restoreDefaultsAll, restoreDefaults, clearAndCopyAllElements, mod, loadedDataOnThisRun
4
4
  local ____errors = require("errors")
5
5
  local getUpgradeErrorMsg = ____errors.getUpgradeErrorMsg
6
6
  local ____deepCopy = require("functions.deepCopy")
@@ -8,6 +8,8 @@ local deepCopy = ____deepCopy.deepCopy
8
8
  local SerializationType = ____deepCopy.SerializationType
9
9
  local ____util = require("functions.util")
10
10
  local tableClear = ____util.tableClear
11
+ local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
12
+ local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
11
13
  local ____SaveData = require("types.SaveData")
12
14
  local SaveDataKeys = ____SaveData.SaveDataKeys
13
15
  local ____load = require("features.saveDataManager.load")
@@ -47,7 +49,7 @@ end
47
49
  function postNewLevel(self)
48
50
  restoreDefaults(nil, SaveDataKeys.Level)
49
51
  end
50
- function postNewRoom(self)
52
+ function postNewRoomEarly(self)
51
53
  restoreDefaults(nil, SaveDataKeys.Room)
52
54
  end
53
55
  function restoreDefaultsAll(self)
@@ -94,7 +96,7 @@ function ____exports.saveDataManagerInit(self, incomingMod)
94
96
  mod:AddCallback(ModCallbacks.MC_POST_PLAYER_INIT, postPlayerInit)
95
97
  mod:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, preGameExit)
96
98
  mod:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, postNewLevel)
97
- mod:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, postNewRoom)
99
+ mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY, postNewRoomEarly)
98
100
  end
99
101
  function ____exports.isSaveDataManagerInitialized(self)
100
102
  return mod ~= nil
@@ -44,6 +44,12 @@ export declare function isDoorToMines(door: GridEntityDoor): boolean;
44
44
  export declare function isDoorToMomsHeart(door: GridEntityDoor): boolean;
45
45
  export declare function isRepentanceDoor(door: GridEntityDoor): boolean;
46
46
  export declare function isSecretRoomDoor(door: GridEntityDoor): boolean;
47
+ /**
48
+ * Helper function to reset an unlocked door back to a locked state. Doing this is non-trivial
49
+ * because you must also set the variant and close the door in addition to calling the `SetLocked()`
50
+ * method.
51
+ */
52
+ export declare function lockDoor(door: GridEntityDoor): void;
47
53
  /**
48
54
  * For the purposes of this function, doors to Secret Rooms or Super Secret Rooms that have not been
49
55
  * discovered yet will not be opened.
@@ -125,6 +125,11 @@ function ____exports.isDoorToMomsHeart(self, door)
125
125
  local filename = sprite:GetFilename()
126
126
  return filename == "gfx/grid/Door_MomsHeart.anm2"
127
127
  end
128
+ function ____exports.lockDoor(self, door)
129
+ door:SetVariant(DoorVariant.DOOR_LOCKED)
130
+ door:SetLocked(true)
131
+ door:Close(true)
132
+ end
128
133
  function ____exports.openAllDoors(self)
129
134
  for ____, door in ipairs(____exports.getDoors(nil)) do
130
135
  door:Open()
@@ -18,10 +18,10 @@ import { ModUpgraded } from "./types/ModUpgraded";
18
18
  * For a list of all custom callbacks, check out the
19
19
  * [Function Signatures](https://isaacscript.github.io/docs/function-signatures#custom-callbacks).
20
20
  *
21
- * @param mod The mod object returned by the `RegisterMod()` function.
21
+ * @param modVanilla The mod object returned by the `RegisterMod()` function.
22
22
  * @param verbose Enables verbose logging for the purposes of crash troubleshooting.
23
23
  * Defaults to false.
24
24
  * @returns The upgraded mod object.
25
25
  * @category Custom Callbacks
26
26
  */
27
- export declare function upgradeMod(mod: Mod, verbose?: boolean): ModUpgraded;
27
+ export declare function upgradeMod(modVanilla: Mod, verbose?: boolean): ModUpgraded;
@@ -82,7 +82,6 @@ local ModUpgraded = ____ModUpgraded.ModUpgraded
82
82
  function initCustomCallbacks(self, mod)
83
83
  reorderedCallbacksInit(nil, mod)
84
84
  postPlayerReorderedCallbacksInit(nil, mod)
85
- postNewRoomEarlyCallbackInit(nil, mod)
86
85
  postPlayerInitLateCallbackInit(nil, mod)
87
86
  postTearInitLateCallbackInit(nil, mod)
88
87
  postFamiliarInitLateCallbackInit(nil, mod)
@@ -118,17 +117,18 @@ function initFeatures(self, mod)
118
117
  runInNFramesInit(nil, mod)
119
118
  sirenHelpersInit(nil, mod)
120
119
  end
121
- function ____exports.upgradeMod(self, mod, verbose)
120
+ function ____exports.upgradeMod(self, modVanilla, verbose)
122
121
  if verbose == nil then
123
122
  verbose = false
124
123
  end
125
- local modUpgraded = __TS__New(ModUpgraded, mod, verbose)
124
+ local mod = __TS__New(ModUpgraded, modVanilla, verbose)
126
125
  if not areFeaturesInitialized(nil) then
127
126
  setFeaturesInitialized(nil)
128
- saveDataManagerInit(nil, modUpgraded)
129
- initCustomCallbacks(nil, modUpgraded)
130
- initFeatures(nil, modUpgraded)
127
+ postNewRoomEarlyCallbackInit(nil, mod)
128
+ saveDataManagerInit(nil, mod)
129
+ initCustomCallbacks(nil, mod)
130
+ initFeatures(nil, mod)
131
131
  end
132
- return modUpgraded
132
+ return mod
133
133
  end
134
134
  return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.501",
3
+ "version": "1.0.505",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",