isaacscript-common 1.0.456 → 1.0.460
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/constants.d.ts +3 -0
- package/dist/constants.lua +3 -0
- package/dist/features/disableInputs.d.ts +10 -5
- package/dist/features/forgottenSwitch.lua +1 -1
- package/dist/features/getCollectibleItemPoolType.d.ts +10 -0
- package/dist/features/getCollectibleItemPoolType.lua +64 -0
- package/dist/features/saveDataManager/exports.d.ts +2 -1
- package/dist/features/saveDataManager/main.d.ts +0 -4
- package/dist/functions/rooms.d.ts +16 -3
- package/dist/functions/rooms.lua +18 -17
- package/dist/index.d.ts +1 -0
- package/dist/index.lua +5 -0
- package/dist/upgradeMod.d.ts +3 -3
- package/dist/upgradeMod.lua +3 -0
- package/package.json +2 -2
package/dist/constants.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125;
|
|
|
8
8
|
export declare const BOMB_EXPLODE_FRAME = 45;
|
|
9
9
|
export declare const CHARACTERS_WITH_AN_ACTIVE_ITEM: Set<PlayerType>;
|
|
10
10
|
export declare const CHARACTERS_WITH_NO_RED_HEARTS: Set<PlayerType>;
|
|
11
|
+
export declare const DEFAULT_ITEM_POOL_TYPE = ItemPoolType.POOL_TREASURE;
|
|
11
12
|
/** This is also the distance that a player spawns from the door that they enter a room from. */
|
|
12
13
|
export declare const DISTANCE_OF_GRID_TILE = 40;
|
|
13
14
|
export declare const DOOR_HITBOX_DISTANCE = 11;
|
|
@@ -24,6 +25,7 @@ export declare const EGGY_STATE_FRAME_OF_FINAL_SPIDER = 45;
|
|
|
24
25
|
*/
|
|
25
26
|
export declare const FIRST_GLITCHED_COLLECTIBLE_TYPE: number;
|
|
26
27
|
export declare const GENESIS_ROOM_VARIANT = 1000;
|
|
28
|
+
export declare const GENESIS_ROOM_SUBTYPE = 99;
|
|
27
29
|
export declare const GOLDEN_TRINKET_SHIFT: number;
|
|
28
30
|
/**
|
|
29
31
|
* This maps the GridEntityXMLType (i.e. the type contained in the room XML/STB file) to the
|
|
@@ -63,6 +65,7 @@ export declare const MAX_ROOM_INDEX = 168;
|
|
|
63
65
|
export declare const MAX_VANILLA_COLLECTIBLE_TYPE = CollectibleType.COLLECTIBLE_MOMS_RING;
|
|
64
66
|
export declare const MOVEMENT_ACTIONS: Set<ButtonAction>;
|
|
65
67
|
export declare const ONE_BY_ONE_ROOM_GRID_SIZE = 135;
|
|
68
|
+
export declare const ROOM_TYPE_TO_ITEM_POOL_TYPE_MAP: Map<RoomType, ItemPoolType>;
|
|
66
69
|
export declare const SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES: Set<CollectibleType>;
|
|
67
70
|
export declare const SHOOTING_ACTIONS: Set<ButtonAction>;
|
|
68
71
|
/**
|
package/dist/constants.lua
CHANGED
|
@@ -5,11 +5,13 @@ ____exports.AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125
|
|
|
5
5
|
____exports.BOMB_EXPLODE_FRAME = 45
|
|
6
6
|
____exports.CHARACTERS_WITH_AN_ACTIVE_ITEM = __TS__New(Set, {PlayerType.PLAYER_ISAAC, PlayerType.PLAYER_MAGDALENE, PlayerType.PLAYER_JUDAS, PlayerType.PLAYER_BLUEBABY, PlayerType.PLAYER_EVE, PlayerType.PLAYER_EDEN, PlayerType.PLAYER_THELOST, PlayerType.PLAYER_LILITH, PlayerType.PLAYER_KEEPER, PlayerType.PLAYER_APOLLYON, PlayerType.PLAYER_EDEN_B})
|
|
7
7
|
____exports.CHARACTERS_WITH_NO_RED_HEARTS = __TS__New(Set, {PlayerType.PLAYER_BLUEBABY, PlayerType.PLAYER_BLACKJUDAS, PlayerType.PLAYER_JUDAS_B, PlayerType.PLAYER_BLUEBABY_B, PlayerType.PLAYER_THEFORGOTTEN_B, PlayerType.PLAYER_BETHANY_B})
|
|
8
|
+
____exports.DEFAULT_ITEM_POOL_TYPE = ItemPoolType.POOL_TREASURE
|
|
8
9
|
____exports.DISTANCE_OF_GRID_TILE = 40
|
|
9
10
|
____exports.DOOR_HITBOX_DISTANCE = 11
|
|
10
11
|
____exports.EGGY_STATE_FRAME_OF_FINAL_SPIDER = 45
|
|
11
12
|
____exports.FIRST_GLITCHED_COLLECTIBLE_TYPE = (1 << 32) - 1
|
|
12
13
|
____exports.GENESIS_ROOM_VARIANT = 1000
|
|
14
|
+
____exports.GENESIS_ROOM_SUBTYPE = 99
|
|
13
15
|
____exports.GOLDEN_TRINKET_SHIFT = 1 << 15
|
|
14
16
|
____exports.GRID_ENTITY_XML_MAP = __TS__New(Map, {{1000, {GridEntityType.GRID_ROCK, 0}}, {1001, {GridEntityType.GRID_ROCK_BOMB, 0}}, {1002, {GridEntityType.GRID_ROCK_ALT, 0}}, {1003, {GridEntityType.GRID_ROCKT, 0}}, {1008, {GridEntityType.GRID_ROCK_ALT2, 0}}, {1009, {GridEntityType.GRID_ROCK_ALT2, 1}}, {1010, {GridEntityType.GRID_ROCK_SPIKED, 0}}, {1011, {GridEntityType.GRID_ROCK_GOLD, 0}}, {1300, {GridEntityType.GRID_TNT, 0}}, {1490, {GridEntityType.GRID_POOP, 1}}, {1494, {GridEntityType.GRID_POOP, 4}}, {1495, {GridEntityType.GRID_POOP, 2}}, {1496, {GridEntityType.GRID_POOP, 3}}, {1497, {GridEntityType.GRID_POOP, 5}}, {1498, {GridEntityType.GRID_POOP, 6}}, {1500, {GridEntityType.GRID_POOP, 0}}, {1501, {GridEntityType.GRID_POOP, 11}}, {1900, {GridEntityType.GRID_ROCKB, 0}}, {1901, {GridEntityType.GRID_PILLAR, 0}}, {1930, {GridEntityType.GRID_SPIKES, 0}}, {1931, {GridEntityType.GRID_SPIKES_ONOFF, 0}}, {1940, {GridEntityType.GRID_SPIDERWEB, 0}}, {1999, {GridEntityType.GRID_WALL, 0}}, {3000, {GridEntityType.GRID_PIT, 0}}, {3001, {GridEntityType.GRID_PIT, 16}}, {3009, {GridEntityType.GRID_PIT, 0}}, {4000, {GridEntityType.GRID_LOCK, 0}}, {4500, {GridEntityType.GRID_PRESSURE_PLATE, 0}}, {5000, {GridEntityType.GRID_STATUE, 0}}, {5001, {GridEntityType.GRID_STATUE, 1}}, {6100, {GridEntityType.GRID_TELEPORTER, 0}}, {9000, {GridEntityType.GRID_TRAPDOOR, 0}}, {9100, {GridEntityType.GRID_STAIRS, 0}}, {10000, {GridEntityType.GRID_GRAVITY, 0}}})
|
|
15
17
|
____exports.GRID_INDEX_CENTER_OF_1X1_ROOM = 67
|
|
@@ -26,6 +28,7 @@ ____exports.MAX_ROOM_INDEX = 168
|
|
|
26
28
|
____exports.MAX_VANILLA_COLLECTIBLE_TYPE = CollectibleType.COLLECTIBLE_MOMS_RING
|
|
27
29
|
____exports.MOVEMENT_ACTIONS = __TS__New(Set, {ButtonAction.ACTION_LEFT, ButtonAction.ACTION_RIGHT, ButtonAction.ACTION_UP, ButtonAction.ACTION_DOWN})
|
|
28
30
|
____exports.ONE_BY_ONE_ROOM_GRID_SIZE = 135
|
|
31
|
+
____exports.ROOM_TYPE_TO_ITEM_POOL_TYPE_MAP = __TS__New(Map, {{RoomType.ROOM_SHOP, ItemPoolType.POOL_SHOP}, {RoomType.ROOM_TREASURE, ItemPoolType.POOL_TREASURE}, {RoomType.ROOM_BOSS, ItemPoolType.POOL_BOSS}, {RoomType.ROOM_SECRET, ItemPoolType.POOL_SECRET}, {RoomType.ROOM_CURSE, ItemPoolType.POOL_CURSE}, {RoomType.ROOM_CHALLENGE, ItemPoolType.POOL_BOSS}, {RoomType.ROOM_LIBRARY, ItemPoolType.POOL_LIBRARY}, {RoomType.ROOM_DEVIL, ItemPoolType.POOL_DEVIL}, {RoomType.ROOM_ANGEL, ItemPoolType.POOL_ANGEL}, {RoomType.ROOM_CHEST, ItemPoolType.POOL_GOLDEN_CHEST}, {RoomType.ROOM_BLACK_MARKET, ItemPoolType.POOL_SHOP}, {RoomType.ROOM_PLANETARIUM, ItemPoolType.POOL_PLANETARIUM}, {RoomType.ROOM_ULTRASECRET, ItemPoolType.POOL_ULTRA_SECRET}})
|
|
29
32
|
____exports.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES = __TS__New(Set, {CollectibleType.COLLECTIBLE_FORGET_ME_NOW, CollectibleType.COLLECTIBLE_EDENS_SOUL, CollectibleType.COLLECTIBLE_ALABASTER_BOX, CollectibleType.COLLECTIBLE_PLAN_C, CollectibleType.COLLECTIBLE_MAMA_MEGA, CollectibleType.COLLECTIBLE_SACRIFICIAL_ALTAR, CollectibleType.COLLECTIBLE_DEATH_CERTIFICATE, CollectibleType.COLLECTIBLE_R_KEY})
|
|
30
33
|
____exports.SHOOTING_ACTIONS = __TS__New(Set, {ButtonAction.ACTION_SHOOTLEFT, ButtonAction.ACTION_SHOOTRIGHT, ButtonAction.ACTION_SHOOTUP, ButtonAction.ACTION_SHOOTDOWN})
|
|
31
34
|
____exports.UI_HEART_WIDTH = 12
|
|
@@ -6,7 +6,8 @@ export declare function disableInputsInit(mod: ModUpgraded): void;
|
|
|
6
6
|
export declare function enableAllInputs(): void;
|
|
7
7
|
/**
|
|
8
8
|
* Helper function to disable all inputs.
|
|
9
|
-
* This is useful because `EntityPlayer.ControlsEnabled`
|
|
9
|
+
* This is useful because `EntityPlayer.ControlsEnabled` can be changed by the game under certain
|
|
10
|
+
* conditions.
|
|
10
11
|
*
|
|
11
12
|
* Call `enableAllInputs()` to set things back to normal.
|
|
12
13
|
*
|
|
@@ -16,7 +17,8 @@ export declare function enableAllInputs(): void;
|
|
|
16
17
|
export declare function disableAllInputs(): void;
|
|
17
18
|
/**
|
|
18
19
|
* Helper function to enable all inputs besides the ones provided.
|
|
19
|
-
* This is useful because `EntityPlayer.ControlsEnabled`
|
|
20
|
+
* This is useful because `EntityPlayer.ControlsEnabled` can be changed by the game under certain
|
|
21
|
+
* conditions.
|
|
20
22
|
*
|
|
21
23
|
* Call `enableAllInputs()` to set things back to normal.
|
|
22
24
|
*
|
|
@@ -26,7 +28,8 @@ export declare function disableAllInputs(): void;
|
|
|
26
28
|
export declare function enableAllInputsExceptFor(blacklist: Set<ButtonAction>): void;
|
|
27
29
|
/**
|
|
28
30
|
* Helper function to disable all inputs besides the ones provided.
|
|
29
|
-
* This is useful because `EntityPlayer.ControlsEnabled`
|
|
31
|
+
* This is useful because `EntityPlayer.ControlsEnabled` can be changed by the game under certain
|
|
32
|
+
* conditions.
|
|
30
33
|
*
|
|
31
34
|
* Call `enableAllInputs()` to set things back to normal.
|
|
32
35
|
*
|
|
@@ -37,7 +40,8 @@ export declare function disableAllInputsExceptFor(whitelist: Set<ButtonAction>):
|
|
|
37
40
|
/**
|
|
38
41
|
* Helper function to disable only the inputs used for moving the character (or moving the cursor in
|
|
39
42
|
* the UI).
|
|
40
|
-
* This is useful because `EntityPlayer.ControlsEnabled`
|
|
43
|
+
* This is useful because `EntityPlayer.ControlsEnabled` can be changed by the game under certain
|
|
44
|
+
* conditions.
|
|
41
45
|
*
|
|
42
46
|
* Call `enableInputs()` to set things back to normal.
|
|
43
47
|
*
|
|
@@ -47,7 +51,8 @@ export declare function disableAllInputsExceptFor(whitelist: Set<ButtonAction>):
|
|
|
47
51
|
export declare function disableMovementInputs(): void;
|
|
48
52
|
/**
|
|
49
53
|
* Helper function to disable only the inputs used for shooting tears.
|
|
50
|
-
* This is useful because `EntityPlayer.ControlsEnabled`
|
|
54
|
+
* This is useful because `EntityPlayer.ControlsEnabled` can be changed by the game under certain
|
|
55
|
+
* conditions.
|
|
51
56
|
*
|
|
52
57
|
* Call `enableInputs()` to set things back to normal.
|
|
53
58
|
*
|
|
@@ -12,7 +12,7 @@ function isActionTriggered(self, _entity, _inputHook, buttonAction)
|
|
|
12
12
|
end
|
|
13
13
|
return nil
|
|
14
14
|
end
|
|
15
|
-
local FEATURE_NAME = "
|
|
15
|
+
local FEATURE_NAME = "forgotten switcher"
|
|
16
16
|
local initialized = false
|
|
17
17
|
v = {run = {shouldSwitch = false}}
|
|
18
18
|
function ____exports.forgottenSwitchInit(self, mod)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
import { ModUpgraded } from "../types/ModUpgraded";
|
|
3
|
+
/** @hidden */
|
|
4
|
+
export declare function getCollectibleItemPoolTypeInit(mod: ModUpgraded): void;
|
|
5
|
+
/**
|
|
6
|
+
* Helper function to get the item pool type that a given collectible came from. Since there is no
|
|
7
|
+
* native method in the API to get this, IsaacScript listens in the PreGetCollectible callback for
|
|
8
|
+
* item pool types, and then assumes that the next spawned collectible will match.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getCollectibleItemPoolType(collectible: EntityPickup): ItemPoolType;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
require("lualib_bundle");
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local postPickupInitCollectible, preGetCollectible, v
|
|
5
|
+
local ____errors = require("errors")
|
|
6
|
+
local getUpgradeErrorMsg = ____errors.getUpgradeErrorMsg
|
|
7
|
+
local ____array = require("functions.array")
|
|
8
|
+
local arrayEmpty = ____array.arrayEmpty
|
|
9
|
+
local ____rooms = require("functions.rooms")
|
|
10
|
+
local getRoomIndex = ____rooms.getRoomIndex
|
|
11
|
+
local getRoomItemPoolType = ____rooms.getRoomItemPoolType
|
|
12
|
+
local getRoomVisitedCount = ____rooms.getRoomVisitedCount
|
|
13
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
14
|
+
local saveDataManager = ____exports.saveDataManager
|
|
15
|
+
function postPickupInitCollectible(self, pickup)
|
|
16
|
+
local itemPoolType = __TS__ArrayShift(v.run.collectibleQueue)
|
|
17
|
+
if itemPoolType == nil then
|
|
18
|
+
return
|
|
19
|
+
end
|
|
20
|
+
local ptrHash = GetPtrHash(pickup)
|
|
21
|
+
v.run.collectibleItemPoolTypeMap:set(ptrHash, itemPoolType)
|
|
22
|
+
end
|
|
23
|
+
function preGetCollectible(self, itemPoolType, _decrease, _seed)
|
|
24
|
+
local roomIndex = getRoomIndex(nil)
|
|
25
|
+
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
26
|
+
if (roomIndex ~= v.run.currentRoomIndex) or (roomVisitedCount ~= v.run.currentRoomVisitedCount) then
|
|
27
|
+
v.run.currentRoomIndex = roomIndex
|
|
28
|
+
v.run.currentRoomVisitedCount = roomVisitedCount
|
|
29
|
+
arrayEmpty(nil, v.run.collectibleQueue)
|
|
30
|
+
v.run.collectibleItemPoolTypeMap:clear()
|
|
31
|
+
end
|
|
32
|
+
__TS__ArrayPush(v.run.collectibleQueue, itemPoolType)
|
|
33
|
+
end
|
|
34
|
+
local FEATURE_NAME = "get collectible item pool type"
|
|
35
|
+
local initialized = false
|
|
36
|
+
v = {
|
|
37
|
+
run = {
|
|
38
|
+
collectibleQueue = {},
|
|
39
|
+
collectibleItemPoolTypeMap = __TS__New(Map),
|
|
40
|
+
currentRoomIndex = nil,
|
|
41
|
+
currentRoomVisitedCount = nil
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function ____exports.getCollectibleItemPoolTypeInit(self, mod)
|
|
45
|
+
initialized = true
|
|
46
|
+
saveDataManager(nil, "getCollectibleItemPoolType", v)
|
|
47
|
+
mod:AddCallback(ModCallbacks.MC_POST_PICKUP_INIT, postPickupInitCollectible, PickupVariant.PICKUP_COLLECTIBLE)
|
|
48
|
+
mod:AddCallback(ModCallbacks.MC_PRE_GET_COLLECTIBLE, preGetCollectible)
|
|
49
|
+
end
|
|
50
|
+
function ____exports.getCollectibleItemPoolType(self, collectible)
|
|
51
|
+
if not initialized then
|
|
52
|
+
local msg = getUpgradeErrorMsg(nil, FEATURE_NAME)
|
|
53
|
+
error(msg)
|
|
54
|
+
end
|
|
55
|
+
if (collectible.Type ~= EntityType.ENTITY_PICKUP) or (collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE) then
|
|
56
|
+
error(
|
|
57
|
+
(((("The \"getCollectibleItemPoolType()\" function was given a non-collectible: " .. tostring(collectible.Type)) .. ".") .. tostring(collectible.Variant)) .. ".") .. tostring(collectible.SubType)
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
local ptrHash = GetPtrHash(collectible)
|
|
61
|
+
local itemPoolType = v.run.collectibleItemPoolTypeMap:get(ptrHash)
|
|
62
|
+
return ((itemPoolType == nil) and getRoomItemPoolType(nil)) or itemPoolType
|
|
63
|
+
end
|
|
64
|
+
return ____exports
|
|
@@ -62,7 +62,8 @@ import { SaveData } from "../../types/SaveData";
|
|
|
62
62
|
*
|
|
63
63
|
* @param key The name of the file or feature that is submitting data to be managed by the save data
|
|
64
64
|
* manager. The save data manager will throw an error if the key is already registered.
|
|
65
|
-
* @param saveData An object that corresponds to the `SaveData` interface.
|
|
65
|
+
* @param saveData An object that corresponds to the `SaveData` interface. The object is
|
|
66
|
+
* conventionally called "v" for brevity (which is short for "local variables").
|
|
66
67
|
* @param conditionalFunc An optional function to run upon saving this key to disk. If the function
|
|
67
68
|
* is false, the key will not be written to disk. This allows mod features to avoid cluttering the
|
|
68
69
|
* "save#.dat" file with unnecessary keys.
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { ModUpgraded } from "../../types/ModUpgraded";
|
|
2
|
-
/** @hidden */
|
|
3
2
|
export declare const FEATURE_NAME = "save data manager";
|
|
4
|
-
/** @hidden */
|
|
5
3
|
export declare function saveDataManagerInit(incomingMod: ModUpgraded): void;
|
|
6
|
-
/** @hidden */
|
|
7
4
|
export declare function isSaveDataManagerInitialized(): boolean;
|
|
8
|
-
/** @hidden */
|
|
9
5
|
export declare function forceSaveDataManagerSave(): void;
|
|
@@ -36,6 +36,12 @@ export declare function getRoomIndex(): int;
|
|
|
36
36
|
* This function only searches through rooms in the current dimension.
|
|
37
37
|
*/
|
|
38
38
|
export declare function getRoomIndexesForType(roomType: RoomType): Set<int>;
|
|
39
|
+
/**
|
|
40
|
+
* Helper function to get the item pool type for the current room. For example, this returns
|
|
41
|
+
* `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room. Returns
|
|
42
|
+
* `DEFAULT_ITEM_POOL_TYPE` if there is no particular pool associated with the current room type.
|
|
43
|
+
*/
|
|
44
|
+
export declare function getRoomItemPoolType(): ItemPoolType;
|
|
39
45
|
/**
|
|
40
46
|
* Helper function to get the name of the room as it appears in the STB/XML data.
|
|
41
47
|
*
|
|
@@ -73,10 +79,18 @@ export declare function getRoomVisitedCount(): int;
|
|
|
73
79
|
* equal to `Vector(80, 160)`.
|
|
74
80
|
*/
|
|
75
81
|
export declare function gridToPos(x: int, y: int): Vector;
|
|
82
|
+
/**
|
|
83
|
+
* Helper function to see if the current room shape is equal to `RoomShape.ROOMSHAPE_1x2` or
|
|
84
|
+
* `RoomShape.ROOMSHAPE_2x1`.
|
|
85
|
+
*/
|
|
76
86
|
export declare function in2x1Room(): boolean;
|
|
77
87
|
export declare function inAngelShop(): boolean;
|
|
78
88
|
export declare function inBeastRoom(): boolean;
|
|
79
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Helper function to check if the current room is a boss room for a particular boss. This will only
|
|
91
|
+
* work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
92
|
+
*/
|
|
93
|
+
export declare function inBossRoomOf(bossID: BossID): boolean;
|
|
80
94
|
/**
|
|
81
95
|
* Helper function for determining whether the current room is a crawlspace. Use this function over
|
|
82
96
|
* comparing to `GridRooms.ROOM_DUNGEON_IDX` directly since there is a special case of the player
|
|
@@ -89,8 +103,7 @@ export declare function inCrawlspace(): boolean;
|
|
|
89
103
|
*/
|
|
90
104
|
export declare function inDeathCertificateArea(): boolean;
|
|
91
105
|
export declare function inDimension(dimension: Dimension): boolean;
|
|
106
|
+
/** Helper function to see if the current room shape is one of the four L room shapes. */
|
|
92
107
|
export declare function inLRoom(): boolean;
|
|
93
|
-
export declare function inLambRoom(): boolean;
|
|
94
108
|
export declare function inGenesisRoom(): boolean;
|
|
95
|
-
export declare function inItLivesRoom(): boolean;
|
|
96
109
|
export declare function inStartingRoom(): boolean;
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
require("lualib_bundle");
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local ____constants = require("constants")
|
|
5
|
+
local DEFAULT_ITEM_POOL_TYPE = ____constants.DEFAULT_ITEM_POOL_TYPE
|
|
6
|
+
local GENESIS_ROOM_SUBTYPE = ____constants.GENESIS_ROOM_SUBTYPE
|
|
5
7
|
local GENESIS_ROOM_VARIANT = ____constants.GENESIS_ROOM_VARIANT
|
|
6
8
|
local MAX_ROOM_INDEX = ____constants.MAX_ROOM_INDEX
|
|
9
|
+
local ROOM_TYPE_TO_ITEM_POOL_TYPE_MAP = ____constants.ROOM_TYPE_TO_ITEM_POOL_TYPE_MAP
|
|
7
10
|
function ____exports.getRoomIndex(self)
|
|
8
11
|
local game = Game()
|
|
9
12
|
local level = game:GetLevel()
|
|
@@ -14,9 +17,6 @@ function ____exports.getRoomIndex(self)
|
|
|
14
17
|
local roomDesc = level:GetCurrentRoomDesc()
|
|
15
18
|
return roomDesc.SafeGridIndex
|
|
16
19
|
end
|
|
17
|
-
local IT_LIVES_ROOM_VARIANTS = {1090, 1091, 1092, 1093, 1094}
|
|
18
|
-
local BLUE_BABY_ROOM_VARIANTS = {3390, 3391, 3392, 3393}
|
|
19
|
-
local LAMB_ROOM_VARIANTS = {5130}
|
|
20
20
|
function ____exports.changeRoom(self, roomIndex)
|
|
21
21
|
local game = Game()
|
|
22
22
|
local level = game:GetLevel()
|
|
@@ -75,6 +75,13 @@ function ____exports.getRoomIndexesForType(self, roomType)
|
|
|
75
75
|
end
|
|
76
76
|
return roomIndexes
|
|
77
77
|
end
|
|
78
|
+
function ____exports.getRoomItemPoolType(self)
|
|
79
|
+
local game = Game()
|
|
80
|
+
local room = game:GetRoom()
|
|
81
|
+
local roomType = room:GetType()
|
|
82
|
+
local itemPoolType = ROOM_TYPE_TO_ITEM_POOL_TYPE_MAP:get(roomType)
|
|
83
|
+
return ((itemPoolType == nil) and DEFAULT_ITEM_POOL_TYPE) or itemPoolType
|
|
84
|
+
end
|
|
78
85
|
function ____exports.getRoomName(self)
|
|
79
86
|
local roomData = ____exports.getRoomData(nil)
|
|
80
87
|
if roomData == nil then
|
|
@@ -135,10 +142,13 @@ function ____exports.inBeastRoom(self)
|
|
|
135
142
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
136
143
|
return (roomIndex == GridRooms.ROOM_DUNGEON_IDX) and (roomSubType == 4)
|
|
137
144
|
end
|
|
138
|
-
function ____exports.
|
|
145
|
+
function ____exports.inBossRoomOf(self, bossID)
|
|
146
|
+
local game = Game()
|
|
147
|
+
local room = game:GetRoom()
|
|
148
|
+
local roomType = room:GetType()
|
|
139
149
|
local roomStageID = ____exports.getRoomStageID(nil)
|
|
140
|
-
local
|
|
141
|
-
return (roomStageID == 0) and
|
|
150
|
+
local roomSubType = ____exports.getRoomSubType(nil)
|
|
151
|
+
return ((roomType == RoomType.ROOM_BOSS) and (roomStageID == 0)) and (roomSubType == bossID)
|
|
142
152
|
end
|
|
143
153
|
function ____exports.inCrawlspace(self)
|
|
144
154
|
local roomIndex = ____exports.getRoomIndex(nil)
|
|
@@ -159,22 +169,13 @@ function ____exports.inLRoom(self)
|
|
|
159
169
|
local roomShape = room:GetRoomShape()
|
|
160
170
|
return (((roomShape == RoomShape.ROOMSHAPE_LTL) or (roomShape == RoomShape.ROOMSHAPE_LTR)) or (roomShape == RoomShape.ROOMSHAPE_LBL)) or (roomShape == RoomShape.ROOMSHAPE_LBR)
|
|
161
171
|
end
|
|
162
|
-
function ____exports.inLambRoom(self)
|
|
163
|
-
local roomStageID = ____exports.getRoomStageID(nil)
|
|
164
|
-
local roomVariant = ____exports.getRoomVariant(nil)
|
|
165
|
-
return (roomStageID == 0) and __TS__ArrayIncludes(LAMB_ROOM_VARIANTS, roomVariant)
|
|
166
|
-
end
|
|
167
172
|
function ____exports.inGenesisRoom(self)
|
|
168
173
|
local game = Game()
|
|
169
174
|
local room = game:GetRoom()
|
|
170
175
|
local roomType = room:GetType()
|
|
171
176
|
local roomVariant = ____exports.getRoomVariant(nil)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
function ____exports.inItLivesRoom(self)
|
|
175
|
-
local roomStageID = ____exports.getRoomStageID(nil)
|
|
176
|
-
local roomVariant = ____exports.getRoomVariant(nil)
|
|
177
|
-
return (roomStageID == 0) and __TS__ArrayIncludes(IT_LIVES_ROOM_VARIANTS, roomVariant)
|
|
177
|
+
local roomSubType = ____exports.getRoomSubType(nil)
|
|
178
|
+
return ((roomType == RoomType.ROOM_ISAACS) and (roomVariant == GENESIS_ROOM_VARIANT)) and (roomSubType == GENESIS_ROOM_SUBTYPE)
|
|
178
179
|
end
|
|
179
180
|
function ____exports.inStartingRoom(self)
|
|
180
181
|
local game = Game()
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./collectibleNameMap";
|
|
|
4
4
|
export * from "./constants";
|
|
5
5
|
export { disableAllInputs, disableAllInputsExceptFor, disableMovementInputs, disableShootingInputs, enableAllInputs, enableAllInputsExceptFor, } from "./features/disableInputs";
|
|
6
6
|
export { forgottenSwitch } from "./features/forgottenSwitch";
|
|
7
|
+
export { getCollectibleItemPoolType } from "./features/getCollectibleItemPoolType";
|
|
7
8
|
export { runInNFrames, runNextFrame } from "./features/runInNFrames";
|
|
8
9
|
export * from "./features/saveDataManager/exports";
|
|
9
10
|
export { hasSirenStolenFamiliar, setFamiliarNoSirenSteal, } from "./features/sirenHelpers";
|
package/dist/index.lua
CHANGED
|
@@ -51,6 +51,11 @@ do
|
|
|
51
51
|
local forgottenSwitch = ____forgottenSwitch.forgottenSwitch
|
|
52
52
|
____exports.forgottenSwitch = forgottenSwitch
|
|
53
53
|
end
|
|
54
|
+
do
|
|
55
|
+
local ____getCollectibleItemPoolType = require("features.getCollectibleItemPoolType")
|
|
56
|
+
local getCollectibleItemPoolType = ____getCollectibleItemPoolType.getCollectibleItemPoolType
|
|
57
|
+
____exports.getCollectibleItemPoolType = getCollectibleItemPoolType
|
|
58
|
+
end
|
|
54
59
|
do
|
|
55
60
|
local ____runInNFrames = require("features.runInNFrames")
|
|
56
61
|
local runInNFrames = ____runInNFrames.runInNFrames
|
package/dist/upgradeMod.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ import { ModUpgraded } from "./types/ModUpgraded";
|
|
|
5
5
|
*
|
|
6
6
|
* Example:
|
|
7
7
|
* ```
|
|
8
|
-
* const
|
|
9
|
-
* const
|
|
8
|
+
* const modVanilla = RegisterMod("My Mod", 1);
|
|
9
|
+
* const mod = upgradeMod(modVanilla);
|
|
10
10
|
*
|
|
11
11
|
* // Subscribe to vanilla callbacks
|
|
12
12
|
* mod.AddCallback(ModCallbacks.MC_POST_UPDATE, postUpdate);
|
|
13
13
|
*
|
|
14
14
|
* // Subscribe to custom callbacks
|
|
15
|
-
*
|
|
15
|
+
* mod.AddCallbackCustom(ModCallbacksCustom.MC_POST_ITEM_PICKUP, postItemPickup);
|
|
16
16
|
* ```
|
|
17
17
|
*
|
|
18
18
|
* For a list of all custom callbacks, check out the
|
package/dist/upgradeMod.lua
CHANGED
|
@@ -60,6 +60,8 @@ local ____disableInputs = require("features.disableInputs")
|
|
|
60
60
|
local disableInputsInit = ____disableInputs.disableInputsInit
|
|
61
61
|
local ____forgottenSwitch = require("features.forgottenSwitch")
|
|
62
62
|
local forgottenSwitchInit = ____forgottenSwitch.forgottenSwitchInit
|
|
63
|
+
local ____getCollectibleItemPoolType = require("features.getCollectibleItemPoolType")
|
|
64
|
+
local getCollectibleItemPoolTypeInit = ____getCollectibleItemPoolType.getCollectibleItemPoolTypeInit
|
|
63
65
|
local ____runInNFrames = require("features.runInNFrames")
|
|
64
66
|
local runInNFramesInit = ____runInNFrames.runInNFramesInit
|
|
65
67
|
local ____main = require("features.saveDataManager.main")
|
|
@@ -100,6 +102,7 @@ end
|
|
|
100
102
|
function initFeatures(self, mod)
|
|
101
103
|
disableInputsInit(nil, mod)
|
|
102
104
|
forgottenSwitchInit(nil, mod)
|
|
105
|
+
getCollectibleItemPoolTypeInit(nil, mod)
|
|
103
106
|
runInNFramesInit(nil, mod)
|
|
104
107
|
sirenHelpersInit(nil, mod)
|
|
105
108
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.460",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist/**/*.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^1.0.
|
|
28
|
+
"isaac-typescript-definitions": "^1.0.278",
|
|
29
29
|
"isaacscript-lint": "^1.0.67",
|
|
30
30
|
"typedoc": "^0.22.9",
|
|
31
31
|
"typescript": "4.4.4",
|