isaacscript-common 1.0.458 → 1.0.462
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/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/collectibles.d.ts +5 -5
- package/dist/functions/collectibles.lua +11 -11
- package/dist/functions/player.d.ts +7 -7
- package/dist/functions/rooms.d.ts +10 -3
- package/dist/functions/rooms.lua +6 -16
- package/dist/functions/trinketGive.d.ts +1 -1
- 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
|
@@ -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;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
-
/**
|
|
3
|
-
* Helper function to change the item on an item pedestal. Simply updating the SubType is not
|
|
4
|
-
* sufficient because you also need to update the sprite.
|
|
5
|
-
*/
|
|
6
|
-
export declare function changeCollectibleSubType(collectible: EntityPickup, newCollectibleType: CollectibleType | int): void;
|
|
7
2
|
export declare function collectibleHasTag(collectibleType: CollectibleType | int, tag: ItemConfigTag): boolean;
|
|
8
3
|
/**
|
|
9
4
|
* Helper function to get the heart cost that a collectible item would be if it were being offered
|
|
@@ -49,3 +44,8 @@ export declare function removeAllCollectibles(): void;
|
|
|
49
44
|
export declare function removeCollectibleFromItemTracker(collectibleType: CollectibleType | int): void;
|
|
50
45
|
export declare function setCollectibleBlind(pickup: EntityPickup): void;
|
|
51
46
|
export declare function setCollectibleSprite(pickup: EntityPickup, pngPath: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* Helper function to change the item on an item pedestal. Simply updating the SubType is not
|
|
49
|
+
* sufficient because you also need to update the sprite.
|
|
50
|
+
*/
|
|
51
|
+
export declare function setCollectibleSubType(collectible: EntityPickup, newCollectibleType: CollectibleType | int): void;
|
|
@@ -19,17 +19,6 @@ end
|
|
|
19
19
|
COLLECTIBLE_SPRITE_LAYER = 1
|
|
20
20
|
local BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png"
|
|
21
21
|
local GLITCHED_ITEM_THRESHOLD = 4000000000
|
|
22
|
-
function ____exports.changeCollectibleSubType(self, collectible, newCollectibleType)
|
|
23
|
-
collectible.SubType = newCollectibleType
|
|
24
|
-
local itemConfig = Isaac.GetItemConfig()
|
|
25
|
-
local itemConfigItem = itemConfig:GetCollectible(newCollectibleType)
|
|
26
|
-
if itemConfigItem == nil then
|
|
27
|
-
error(
|
|
28
|
-
"Failed to get the item config for: " .. tostring(newCollectibleType)
|
|
29
|
-
)
|
|
30
|
-
end
|
|
31
|
-
____exports.setCollectibleSprite(nil, collectible, itemConfigItem.GfxFileName)
|
|
32
|
-
end
|
|
33
22
|
function ____exports.collectibleHasTag(self, collectibleType, tag)
|
|
34
23
|
local itemConfig = Isaac.GetItemConfig()
|
|
35
24
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
@@ -135,4 +124,15 @@ end
|
|
|
135
124
|
function ____exports.setCollectibleBlind(self, pickup)
|
|
136
125
|
____exports.setCollectibleSprite(nil, pickup, BLIND_ITEM_PNG_PATH)
|
|
137
126
|
end
|
|
127
|
+
function ____exports.setCollectibleSubType(self, collectible, newCollectibleType)
|
|
128
|
+
collectible.SubType = newCollectibleType
|
|
129
|
+
local itemConfig = Isaac.GetItemConfig()
|
|
130
|
+
local itemConfigItem = itemConfig:GetCollectible(newCollectibleType)
|
|
131
|
+
if itemConfigItem == nil then
|
|
132
|
+
error(
|
|
133
|
+
"Failed to get the item config for: " .. tostring(newCollectibleType)
|
|
134
|
+
)
|
|
135
|
+
end
|
|
136
|
+
____exports.setCollectibleSprite(nil, collectible, itemConfigItem.GfxFileName)
|
|
137
|
+
end
|
|
138
138
|
return ____exports
|
|
@@ -14,12 +14,12 @@ import { PocketItemDescription } from "../types/PocketItemDescription";
|
|
|
14
14
|
export declare type PlayerIndex = int & {
|
|
15
15
|
__playerIndexBrand: unknown;
|
|
16
16
|
};
|
|
17
|
-
export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
|
|
18
|
-
export declare function addTrinketCostume(player: EntityPlayer, trinketType: TrinketType): void;
|
|
17
|
+
export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType | int): void;
|
|
18
|
+
export declare function addTrinketCostume(player: EntityPlayer, trinketType: TrinketType | int): void;
|
|
19
19
|
/** Iterates over all players and checks if any player is close enough to the specified position. */
|
|
20
20
|
export declare function anyPlayerCloserThan(position: Vector, distance: float): boolean;
|
|
21
|
-
export declare function anyPlayerHasCollectible(collectibleType: CollectibleType): boolean;
|
|
22
|
-
export declare function anyPlayerHasTrinket(trinketType: TrinketType): boolean;
|
|
21
|
+
export declare function anyPlayerHasCollectible(collectibleType: CollectibleType | int): boolean;
|
|
22
|
+
export declare function anyPlayerHasTrinket(trinketType: TrinketType | int): boolean;
|
|
23
23
|
export declare function anyPlayerIs(matchingCharacter: PlayerType): boolean;
|
|
24
24
|
/**
|
|
25
25
|
* Helper function to get how long Azazel's Brimstone laser should be. You can pass either an
|
|
@@ -134,7 +134,7 @@ export declare function getTotalCharge(player: EntityPlayer, activeSlot: ActiveS
|
|
|
134
134
|
* Returns the total number of collectibles amongst all players. For example, if player 1 has 1 Sad
|
|
135
135
|
* Onion and player 2 has 2 Sad Onions, then this function would return 3.
|
|
136
136
|
*/
|
|
137
|
-
export declare function getTotalPlayerCollectibles(collectibleType: CollectibleType): int;
|
|
137
|
+
export declare function getTotalPlayerCollectibles(collectibleType: CollectibleType | int): int;
|
|
138
138
|
/** After touching a white fire, a player will turn into The Lost until they clear a room. */
|
|
139
139
|
export declare function hasLostCurse(player: EntityPlayer): boolean;
|
|
140
140
|
/**
|
|
@@ -188,7 +188,7 @@ export declare function isKeeper(player: EntityPlayer): boolean;
|
|
|
188
188
|
export declare function isLost(player: EntityPlayer): boolean;
|
|
189
189
|
/** Helper function for detecting when a player is Tainted Lazarus or Dead Tainted Lazarus. */
|
|
190
190
|
export declare function isTaintedLazarus(player: EntityPlayer): boolean;
|
|
191
|
-
export declare function removeCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
|
|
191
|
+
export declare function removeCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType | int): void;
|
|
192
192
|
/**
|
|
193
193
|
* Helper function to remove the Dead Eye multiplier from a player.
|
|
194
194
|
*
|
|
@@ -196,7 +196,7 @@ export declare function removeCollectibleCostume(player: EntityPlayer, collectib
|
|
|
196
196
|
* chance of working, so this function calls it 100 times to be safe.
|
|
197
197
|
*/
|
|
198
198
|
export declare function removeDeadEyeMultiplier(player: EntityPlayer): void;
|
|
199
|
-
export declare function removeTrinketCostume(player: EntityPlayer, trinketType: TrinketType): void;
|
|
199
|
+
export declare function removeTrinketCostume(player: EntityPlayer, trinketType: TrinketType | int): void;
|
|
200
200
|
/**
|
|
201
201
|
* If you want to stop the player from shooting without the blindfold costume, then simply call
|
|
202
202
|
* `player.TryRemoveNullCostume(NullItemID.ID_BLINDFOLD)` after invoking this function.
|
|
@@ -79,10 +79,18 @@ export declare function getRoomVisitedCount(): int;
|
|
|
79
79
|
* equal to `Vector(80, 160)`.
|
|
80
80
|
*/
|
|
81
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
|
+
*/
|
|
82
86
|
export declare function in2x1Room(): boolean;
|
|
83
87
|
export declare function inAngelShop(): boolean;
|
|
84
88
|
export declare function inBeastRoom(): boolean;
|
|
85
|
-
|
|
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;
|
|
86
94
|
/**
|
|
87
95
|
* Helper function for determining whether the current room is a crawlspace. Use this function over
|
|
88
96
|
* comparing to `GridRooms.ROOM_DUNGEON_IDX` directly since there is a special case of the player
|
|
@@ -95,8 +103,7 @@ export declare function inCrawlspace(): boolean;
|
|
|
95
103
|
*/
|
|
96
104
|
export declare function inDeathCertificateArea(): boolean;
|
|
97
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. */
|
|
98
107
|
export declare function inLRoom(): boolean;
|
|
99
|
-
export declare function inLambRoom(): boolean;
|
|
100
108
|
export declare function inGenesisRoom(): boolean;
|
|
101
|
-
export declare function inItLivesRoom(): boolean;
|
|
102
109
|
export declare function inStartingRoom(): boolean;
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -17,9 +17,6 @@ function ____exports.getRoomIndex(self)
|
|
|
17
17
|
local roomDesc = level:GetCurrentRoomDesc()
|
|
18
18
|
return roomDesc.SafeGridIndex
|
|
19
19
|
end
|
|
20
|
-
local IT_LIVES_ROOM_VARIANTS = {1090, 1091, 1092, 1093, 1094}
|
|
21
|
-
local BLUE_BABY_ROOM_VARIANTS = {3390, 3391, 3392, 3393}
|
|
22
|
-
local LAMB_ROOM_VARIANTS = {5130}
|
|
23
20
|
function ____exports.changeRoom(self, roomIndex)
|
|
24
21
|
local game = Game()
|
|
25
22
|
local level = game:GetLevel()
|
|
@@ -145,10 +142,13 @@ function ____exports.inBeastRoom(self)
|
|
|
145
142
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
146
143
|
return (roomIndex == GridRooms.ROOM_DUNGEON_IDX) and (roomSubType == 4)
|
|
147
144
|
end
|
|
148
|
-
function ____exports.
|
|
145
|
+
function ____exports.inBossRoomOf(self, bossID)
|
|
146
|
+
local game = Game()
|
|
147
|
+
local room = game:GetRoom()
|
|
148
|
+
local roomType = room:GetType()
|
|
149
149
|
local roomStageID = ____exports.getRoomStageID(nil)
|
|
150
|
-
local
|
|
151
|
-
return (roomStageID == 0) and
|
|
150
|
+
local roomSubType = ____exports.getRoomSubType(nil)
|
|
151
|
+
return ((roomType == RoomType.ROOM_BOSS) and (roomStageID == 0)) and (roomSubType == bossID)
|
|
152
152
|
end
|
|
153
153
|
function ____exports.inCrawlspace(self)
|
|
154
154
|
local roomIndex = ____exports.getRoomIndex(nil)
|
|
@@ -169,11 +169,6 @@ function ____exports.inLRoom(self)
|
|
|
169
169
|
local roomShape = room:GetRoomShape()
|
|
170
170
|
return (((roomShape == RoomShape.ROOMSHAPE_LTL) or (roomShape == RoomShape.ROOMSHAPE_LTR)) or (roomShape == RoomShape.ROOMSHAPE_LBL)) or (roomShape == RoomShape.ROOMSHAPE_LBR)
|
|
171
171
|
end
|
|
172
|
-
function ____exports.inLambRoom(self)
|
|
173
|
-
local roomStageID = ____exports.getRoomStageID(nil)
|
|
174
|
-
local roomVariant = ____exports.getRoomVariant(nil)
|
|
175
|
-
return (roomStageID == 0) and __TS__ArrayIncludes(LAMB_ROOM_VARIANTS, roomVariant)
|
|
176
|
-
end
|
|
177
172
|
function ____exports.inGenesisRoom(self)
|
|
178
173
|
local game = Game()
|
|
179
174
|
local room = game:GetRoom()
|
|
@@ -182,11 +177,6 @@ function ____exports.inGenesisRoom(self)
|
|
|
182
177
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
183
178
|
return ((roomType == RoomType.ROOM_ISAACS) and (roomVariant == GENESIS_ROOM_VARIANT)) and (roomSubType == GENESIS_ROOM_SUBTYPE)
|
|
184
179
|
end
|
|
185
|
-
function ____exports.inItLivesRoom(self)
|
|
186
|
-
local roomStageID = ____exports.getRoomStageID(nil)
|
|
187
|
-
local roomVariant = ____exports.getRoomVariant(nil)
|
|
188
|
-
return (roomStageID == 0) and __TS__ArrayIncludes(IT_LIVES_ROOM_VARIANTS, roomVariant)
|
|
189
|
-
end
|
|
190
180
|
function ____exports.inStartingRoom(self)
|
|
191
181
|
local game = Game()
|
|
192
182
|
local level = game:GetLevel()
|
|
@@ -15,7 +15,7 @@ export interface TrinketSituation {
|
|
|
15
15
|
*
|
|
16
16
|
* @returns Null if the player does not have the trinket, or TrinketSituation if they do.
|
|
17
17
|
*/
|
|
18
|
-
export declare function temporarilyRemoveTrinkets(player: EntityPlayer, trinketType: TrinketType): TrinketSituation | undefined;
|
|
18
|
+
export declare function temporarilyRemoveTrinkets(player: EntityPlayer, trinketType: TrinketType | int): TrinketSituation | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* Helper function to restore the player's trinkets back to the way they were before the
|
|
21
21
|
* `temporarilyRemoveTrinket` function was used. It will re-smelt any smelted trinkets that were
|
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.462",
|
|
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.280",
|
|
29
29
|
"isaacscript-lint": "^1.0.67",
|
|
30
30
|
"typedoc": "^0.22.9",
|
|
31
31
|
"typescript": "4.4.4",
|