isaacscript-common 4.5.0 → 4.6.0
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/constants.d.ts +0 -3
- package/constantsFirstLast.d.ts +0 -3
- package/features/characterHealthConversion.d.ts +6 -0
- package/features/characterHealthConversion.lua +4 -1
- package/features/characterStats.d.ts +5 -0
- package/features/characterStats.lua +1 -1
- package/features/collectibleItemPoolType.lua +2 -2
- package/features/debugDisplay/debugDisplay.d.ts +4 -0
- package/features/debugDisplay/debugDisplay.lua +2 -0
- package/features/deployJSONRoom.lua +4 -6
- package/features/{disableSound.d.ts → disableAllSound.d.ts} +0 -0
- package/features/{disableSound.lua → disableAllSound.lua} +3 -3
- package/features/disableInputs.lua +2 -2
- package/features/extraConsoleCommands/exports.d.ts +26 -0
- package/features/extraConsoleCommands/exports.lua +54 -0
- package/features/extraConsoleCommands/init.d.ts +1 -25
- package/features/extraConsoleCommands/init.lua +166 -195
- package/features/extraConsoleCommands/v.d.ts +8 -0
- package/features/extraConsoleCommands/v.lua +11 -0
- package/features/fadeInRemover.lua +2 -2
- package/features/fastReset.lua +1 -1
- package/features/forgottenSwitch.lua +2 -2
- package/features/persistentEntities.lua +6 -1
- package/features/playerInventory.lua +2 -2
- package/features/ponyDetection.lua +2 -2
- package/features/preventCollectibleRotation.lua +2 -2
- package/features/registerHotkey.d.ts +3 -0
- package/features/registerHotkey.lua +50 -0
- package/features/roomClearFrame.lua +2 -2
- package/features/runInNFrames.lua +2 -2
- package/features/saveDataManager/exports.lua +1 -0
- package/features/sirenHelpers.lua +2 -2
- package/features/stageHistory.lua +2 -2
- package/features/taintedLazarusPlayers.lua +2 -2
- package/featuresInitialized.lua +1 -1
- package/functions/gridEntity.d.ts +12 -0
- package/functions/gridEntity.lua +15 -2
- package/functions/rng.lua +6 -2
- package/functions/rooms.d.ts +1 -0
- package/functions/rooms.lua +1 -0
- package/functions/run.d.ts +5 -2
- package/functions/run.lua +5 -2
- package/functions/saveFile.lua +3 -0
- package/functions/stage.d.ts +6 -1
- package/functions/stage.lua +7 -0
- package/functions/utils.d.ts +5 -0
- package/functions/utils.lua +7 -0
- package/index.d.ts +4 -4
- package/index.lua +22 -24
- package/initFeatures.lua +6 -6
- package/lualib_bundle.lua +6 -3
- package/maps/roomTypeMap.lua +0 -1
- package/objects/roomTypeGotoPrefixes.d.ts +4 -0
- package/objects/roomTypeGotoPrefixes.lua +35 -0
- package/objects/roomTypeNames.lua +0 -1
- package/package.json +2 -2
- package/sets/consoleCommandsSet.d.ts +5 -0
- package/sets/consoleCommandsSet.lua +61 -0
- package/types/PickingUpItem.d.ts +3 -3
- package/types/PickingUpItem.lua +3 -3
- package/enums/StageTravelEntityState.d.ts +0 -4
- package/enums/StageTravelEntityState.lua +0 -7
- package/enums/StageTravelState.d.ts +0 -6
- package/enums/StageTravelState.lua +0 -11
- package/features/customTrapdoor/constants.d.ts +0 -5
- package/features/customTrapdoor/constants.lua +0 -7
- package/features/customTrapdoor/exports.d.ts +0 -37
- package/features/customTrapdoor/exports.lua +0 -120
- package/features/customTrapdoor/init.d.ts +0 -1
- package/features/customTrapdoor/init.lua +0 -11
- package/features/customTrapdoor/stageTravel.d.ts +0 -0
- package/features/customTrapdoor/stageTravel.lua +0 -0
- package/features/customTrapdoor/trapdoor.d.ts +0 -0
- package/features/customTrapdoor/trapdoor.lua +0 -0
- package/features/customTrapdoor/v.d.ts +0 -14
- package/features/customTrapdoor/v.lua +0 -16
- package/interfaces/StageTravelEntityDescription.d.ts +0 -5
- package/interfaces/StageTravelEntityDescription.lua +0 -2
package/constants.d.ts
CHANGED
package/constantsFirstLast.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module Constants (First and Last)
|
|
3
|
-
*/
|
|
4
1
|
import { Card, CollectibleType, PillColor, PillEffect, PlayerType, TrinketType } from "isaac-typescript-definitions";
|
|
5
2
|
/** Equal to `CollectibleType.SAD_ONION`. */
|
|
6
3
|
export declare const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Easily create custom characters that have the same health mechanic as Blue Baby (red heart
|
|
3
|
+
* containers --> soul hearts) or Black Judas (red heart containers --> black hearts).
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
1
7
|
import { HeartSubType, PlayerType } from "isaac-typescript-definitions";
|
|
2
8
|
export declare type ConversionHeartSubType = HeartSubType.SOUL | HeartSubType.BLACK;
|
|
3
9
|
/**
|
|
@@ -65,7 +65,7 @@ function prePickupCollisionHeart(self, pickup, collider)
|
|
|
65
65
|
end
|
|
66
66
|
return false
|
|
67
67
|
end
|
|
68
|
-
local FEATURE_NAME = "
|
|
68
|
+
local FEATURE_NAME = "characterHealthConversion"
|
|
69
69
|
characterHealthReplacementMap = __TS__New(Map)
|
|
70
70
|
---
|
|
71
71
|
-- @internal
|
|
@@ -79,6 +79,9 @@ end
|
|
|
79
79
|
-- Call this function once at the beginning of your mod to declare the health conversion type.
|
|
80
80
|
function ____exports.registerCharacterHealthConversion(self, playerType, conversionHeartSubType)
|
|
81
81
|
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
82
|
+
if characterHealthReplacementMap:has(playerType) then
|
|
83
|
+
error(("Failed to register a character of type " .. tostring(playerType)) .. " because there is already an existing registered character with that type.")
|
|
84
|
+
end
|
|
82
85
|
characterHealthReplacementMap:set(playerType, conversionHeartSubType)
|
|
83
86
|
end
|
|
84
87
|
return ____exports
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Easily create custom characters that have base stats different from that of Isaac.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { CacheFlag, PlayerType } from "isaac-typescript-definitions";
|
|
2
7
|
/**
|
|
3
8
|
* Helper function to manage the stats for a vanilla or custom character. Call this function once at
|
|
@@ -25,7 +25,7 @@ function evaluateCache(self, player, cacheFlag)
|
|
|
25
25
|
local delta = stat - defaultStat
|
|
26
26
|
addStat(nil, player, cacheFlag, delta)
|
|
27
27
|
end
|
|
28
|
-
local FEATURE_NAME = "
|
|
28
|
+
local FEATURE_NAME = "characterStats"
|
|
29
29
|
charactersStatMap = __TS__New(Map)
|
|
30
30
|
---
|
|
31
31
|
-- @internal
|
|
@@ -24,12 +24,12 @@ function postPickupInitCollectible(self, pickup)
|
|
|
24
24
|
local lastItemPoolType = itemPool:GetLastPool()
|
|
25
25
|
v.run.collectibleItemPoolTypeMap:set(ptrHash, lastItemPoolType)
|
|
26
26
|
end
|
|
27
|
-
local FEATURE_NAME = "
|
|
27
|
+
local FEATURE_NAME = "collectibleItemPoolType"
|
|
28
28
|
v = {run = {collectibleItemPoolTypeMap = __TS__New(Map)}}
|
|
29
29
|
---
|
|
30
30
|
-- @internal
|
|
31
31
|
function ____exports.collectibleItemPoolTypeInit(self, mod)
|
|
32
|
-
saveDataManager(nil,
|
|
32
|
+
saveDataManager(nil, FEATURE_NAME, v)
|
|
33
33
|
mod:AddCallback(ModCallback.POST_PICKUP_INIT, postPickupInitCollectible, PickupVariant.COLLECTIBLE)
|
|
34
34
|
end
|
|
35
35
|
--- Helper function to get the item pool type that a given collectible came from. Since there is no
|
|
@@ -152,6 +152,8 @@ function postPressurePlateRender(self, pressurePlate)
|
|
|
152
152
|
local text = debugDisplayTextCallbacks:pressurePlate(pressurePlate)
|
|
153
153
|
renderTextOnEntity(nil, pressurePlate, text)
|
|
154
154
|
end
|
|
155
|
+
--- The debug display feature is only initialized when the extra console commands feature is
|
|
156
|
+
-- initialized.
|
|
155
157
|
function ____exports.debugDisplayInit(self, mod)
|
|
156
158
|
saveDataManager(
|
|
157
159
|
nil,
|
|
@@ -37,6 +37,7 @@ local removeAllBombs = ____entitySpecific.removeAllBombs
|
|
|
37
37
|
local removeAllPickups = ____entitySpecific.removeAllPickups
|
|
38
38
|
local ____gridEntity = require("functions.gridEntity")
|
|
39
39
|
local convertXMLGridEntityType = ____gridEntity.convertXMLGridEntityType
|
|
40
|
+
local getAllGridIndexes = ____gridEntity.getAllGridIndexes
|
|
40
41
|
local getGridEntities = ____gridEntity.getGridEntities
|
|
41
42
|
local removeAllGridExcept = ____gridEntity.removeAllGridExcept
|
|
42
43
|
local removeGrid = ____gridEntity.removeGrid
|
|
@@ -59,8 +60,6 @@ local setRoomCleared = ____rooms.setRoomCleared
|
|
|
59
60
|
local setRoomUncleared = ____rooms.setRoomUncleared
|
|
60
61
|
local ____spawnCollectible = require("functions.spawnCollectible")
|
|
61
62
|
local spawnCollectible = ____spawnCollectible.spawnCollectible
|
|
62
|
-
local ____utils = require("functions.utils")
|
|
63
|
-
local erange = ____utils.erange
|
|
64
63
|
local ____runInNFrames = require("features.runInNFrames")
|
|
65
64
|
local runNextGameFrame = ____runInNFrames.runNextGameFrame
|
|
66
65
|
local ____exports = require("features.saveDataManager.exports")
|
|
@@ -182,10 +181,9 @@ function removeSpecificNPCs(self)
|
|
|
182
181
|
end
|
|
183
182
|
function fillRoomWithDecorations(self)
|
|
184
183
|
local room = game:GetRoom()
|
|
185
|
-
local gridSize = room:GetGridSize()
|
|
186
184
|
local roomListIndex = getRoomListIndex(nil)
|
|
187
185
|
local decorationGridIndexes = v.level.roomToDecorationGridIndexesMap:getAndSetDefault(roomListIndex)
|
|
188
|
-
for ____, gridIndex in ipairs(
|
|
186
|
+
for ____, gridIndex in ipairs(getAllGridIndexes(nil)) do
|
|
189
187
|
do
|
|
190
188
|
local existingGridEntity = room:GetGridEntity(gridIndex)
|
|
191
189
|
if existingGridEntity ~= nil then
|
|
@@ -451,7 +449,7 @@ function getPitFrame(self, L, R, U, D, UL, UR, DL, DR)
|
|
|
451
449
|
end
|
|
452
450
|
return F
|
|
453
451
|
end
|
|
454
|
-
FEATURE_NAME = "
|
|
452
|
+
FEATURE_NAME = "deployJSONRoom"
|
|
455
453
|
NPC_TYPES_TO_NOT_REMOVE = __TS__New(Set, {EntityType.DARK_ESAU})
|
|
456
454
|
PERSISTENT_ENTITY_TYPES = __TS__New(Set, {EntityType.WALL_HUGGER})
|
|
457
455
|
v = {
|
|
@@ -471,7 +469,7 @@ v = {
|
|
|
471
469
|
---
|
|
472
470
|
-- @internal
|
|
473
471
|
function ____exports.deployJSONRoomInit(self, mod)
|
|
474
|
-
saveDataManager(nil,
|
|
472
|
+
saveDataManager(nil, FEATURE_NAME, v)
|
|
475
473
|
mod:AddCallback(ModCallback.PRE_USE_ITEM, preUseItemWeNeedToGoDeeper, CollectibleType.WE_NEED_TO_GO_DEEPER)
|
|
476
474
|
mod:AddCallbackCustom(ModCallbackCustom.POST_NEW_ROOM_REORDERED, postNewRoomReordered)
|
|
477
475
|
end
|
|
File without changes
|
|
@@ -19,13 +19,13 @@ function postRender(self)
|
|
|
19
19
|
end
|
|
20
20
|
stopAllSoundEffects(nil)
|
|
21
21
|
end
|
|
22
|
-
local FEATURE_NAME = "
|
|
22
|
+
local FEATURE_NAME = "disableAllSound"
|
|
23
23
|
local musicWasEnabled = false
|
|
24
24
|
v = {run = {disableSoundSet = __TS__New(Set)}}
|
|
25
25
|
---
|
|
26
26
|
-- @internal
|
|
27
|
-
function ____exports.
|
|
28
|
-
saveDataManager(nil,
|
|
27
|
+
function ____exports.disableAllSoundInit(self, mod)
|
|
28
|
+
saveDataManager(nil, FEATURE_NAME, v)
|
|
29
29
|
mod:AddCallback(ModCallback.POST_RENDER, postRender)
|
|
30
30
|
end
|
|
31
31
|
--- Helper function to stop muting all sound effects and music.
|
|
@@ -44,7 +44,7 @@ function getReturnValue(self, buttonAction, booleanCallback)
|
|
|
44
44
|
end
|
|
45
45
|
return nil
|
|
46
46
|
end
|
|
47
|
-
local FEATURE_NAME = "
|
|
47
|
+
local FEATURE_NAME = "disableInputs"
|
|
48
48
|
v = {run = {
|
|
49
49
|
disableInputsWithWhitelistMap = __TS__New(Map),
|
|
50
50
|
enableInputsWithBlacklistMap = __TS__New(Map)
|
|
@@ -52,7 +52,7 @@ v = {run = {
|
|
|
52
52
|
---
|
|
53
53
|
-- @internal
|
|
54
54
|
function ____exports.disableInputsInit(self, mod)
|
|
55
|
-
saveDataManager(nil,
|
|
55
|
+
saveDataManager(nil, FEATURE_NAME, v)
|
|
56
56
|
mod:AddCallback(ModCallback.INPUT_ACTION, isActionPressed, InputHook.IS_ACTION_PRESSED)
|
|
57
57
|
mod:AddCallback(ModCallback.INPUT_ACTION, isActionTriggered, InputHook.IS_ACTION_TRIGGERED)
|
|
58
58
|
mod:AddCallback(ModCallback.INPUT_ACTION, getActionValue, InputHook.GET_ACTION_VALUE)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ModUpgraded } from "../../classes/ModUpgraded";
|
|
2
|
+
/**
|
|
3
|
+
* Enables extra console commands which are useful for debugging. See [the
|
|
4
|
+
* docs](https://isaacscript.github.io/isaacscript-common/features/extraConsoleCommands_listCommands)
|
|
5
|
+
* for the specific commands that are added.
|
|
6
|
+
*/
|
|
7
|
+
export declare function enableExtraConsoleCommands(mod: ModUpgraded): void;
|
|
8
|
+
/**
|
|
9
|
+
* Helper function to add a custom console command.
|
|
10
|
+
*
|
|
11
|
+
* The standard library comes with many existing console commands that are useful for debugging, but
|
|
12
|
+
* you can also add your own commands that are useful for your particular mod. It's easier to add
|
|
13
|
+
* commands to the existing command system than to add logic manually to the ExecuteCmd callback.
|
|
14
|
+
*
|
|
15
|
+
* Before using this function, you must first invoke `enableExtraConsoleCommands`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function addConsoleCommand(commandName: string, commandFunction: (params: string) => void): void;
|
|
18
|
+
/**
|
|
19
|
+
* Helper function to remove a custom console command.
|
|
20
|
+
*
|
|
21
|
+
* The standard library comes with many existing console commands that are useful for debugging. If
|
|
22
|
+
* you want to disable one of them, use this function.
|
|
23
|
+
*
|
|
24
|
+
* Before using this function, you must first invoke `enableExtraConsoleCommands`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function removeConsoleCommand(commandName: string): void;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local ____utils = require("functions.utils")
|
|
5
|
+
local isVanillaConsoleCommand = ____utils.isVanillaConsoleCommand
|
|
6
|
+
local ____init = require("features.extraConsoleCommands.init")
|
|
7
|
+
local extraConsoleCommandsInit = ____init.extraConsoleCommandsInit
|
|
8
|
+
local ____v = require("features.extraConsoleCommands.v")
|
|
9
|
+
local extraConsoleCommandsFunctionMap = ____v.extraConsoleCommandsFunctionMap
|
|
10
|
+
local isExtraConsoleCommandsInitialized = ____v.isExtraConsoleCommandsInitialized
|
|
11
|
+
--- Enables extra console commands which are useful for debugging. See [the
|
|
12
|
+
-- docs](https://isaacscript.github.io/isaacscript-common/features/extraConsoleCommands_listCommands)
|
|
13
|
+
-- for the specific commands that are added.
|
|
14
|
+
function ____exports.enableExtraConsoleCommands(self, mod)
|
|
15
|
+
if isExtraConsoleCommandsInitialized(nil) then
|
|
16
|
+
error("The extra console commands are already initialized.")
|
|
17
|
+
end
|
|
18
|
+
extraConsoleCommandsInit(nil, mod)
|
|
19
|
+
end
|
|
20
|
+
--- Helper function to add a custom console command.
|
|
21
|
+
--
|
|
22
|
+
-- The standard library comes with many existing console commands that are useful for debugging, but
|
|
23
|
+
-- you can also add your own commands that are useful for your particular mod. It's easier to add
|
|
24
|
+
-- commands to the existing command system than to add logic manually to the ExecuteCmd callback.
|
|
25
|
+
--
|
|
26
|
+
-- Before using this function, you must first invoke `enableExtraConsoleCommands`.
|
|
27
|
+
function ____exports.addConsoleCommand(self, commandName, commandFunction)
|
|
28
|
+
if not isExtraConsoleCommandsInitialized(nil) then
|
|
29
|
+
error("The \"extraConsoleCommands\" feature is not initialized. Before adding extra console commands, you must first enable the feature by invoking the \"enableExtraConsoleCommands\" function.")
|
|
30
|
+
end
|
|
31
|
+
if isVanillaConsoleCommand(nil, commandName) then
|
|
32
|
+
error(("Failed to add a new console command of \"" .. commandName) .. "\" because that name already belongs to a vanilla command. You must pick a non-colliding name.")
|
|
33
|
+
end
|
|
34
|
+
if extraConsoleCommandsFunctionMap:has(commandName) then
|
|
35
|
+
error(("Failed to add a new console command of \"" .. commandName) .. "\" because there is already an existing custom command by that name. If you want to overwrite a command from the standard library, you can use the \"removeExtraConsoleCommand\" function.")
|
|
36
|
+
end
|
|
37
|
+
extraConsoleCommandsFunctionMap:set(commandName, commandFunction)
|
|
38
|
+
end
|
|
39
|
+
--- Helper function to remove a custom console command.
|
|
40
|
+
--
|
|
41
|
+
-- The standard library comes with many existing console commands that are useful for debugging. If
|
|
42
|
+
-- you want to disable one of them, use this function.
|
|
43
|
+
--
|
|
44
|
+
-- Before using this function, you must first invoke `enableExtraConsoleCommands`.
|
|
45
|
+
function ____exports.removeConsoleCommand(self, commandName)
|
|
46
|
+
if not isExtraConsoleCommandsInitialized(nil) then
|
|
47
|
+
error("The \"extraConsoleCommands\" feature is not initialized. Before removing console commands, you must first enable the feature by invoking the \"enableExtraConsoleCommands\" function.")
|
|
48
|
+
end
|
|
49
|
+
if not extraConsoleCommandsFunctionMap:has(commandName) then
|
|
50
|
+
error(("Failed to remove the console command of \"" .. commandName) .. "\", since it does not already exist in the map.")
|
|
51
|
+
end
|
|
52
|
+
extraConsoleCommandsFunctionMap:delete(commandName)
|
|
53
|
+
end
|
|
54
|
+
return ____exports
|
|
@@ -1,26 +1,2 @@
|
|
|
1
1
|
import { ModUpgraded } from "../../classes/ModUpgraded";
|
|
2
|
-
|
|
3
|
-
* Enables extra console commands which are useful for debugging. See [the
|
|
4
|
-
* docs](https://isaacscript.github.io/isaacscript-common/features/extraConsoleCommands_listCommands)
|
|
5
|
-
* for the specific commands that are added.
|
|
6
|
-
*/
|
|
7
|
-
export declare function enableExtraConsoleCommands(mod: ModUpgraded): void;
|
|
8
|
-
/**
|
|
9
|
-
* Helper function to add a custom console command.
|
|
10
|
-
*
|
|
11
|
-
* The standard library comes with many existing console commands that are useful for debugging, but
|
|
12
|
-
* you can also add your own commands that are useful for your particular mod. It's easier to add
|
|
13
|
-
* commands to the existing command system than to add logic manually to the ExecuteCmd callback.
|
|
14
|
-
*
|
|
15
|
-
* Before using this function, you must first invoke `enableExtraConsoleCommands`.
|
|
16
|
-
*/
|
|
17
|
-
export declare function addConsoleCommand(commandName: string, commandFunction: (params: string) => void): void;
|
|
18
|
-
/**
|
|
19
|
-
* Helper function to remove a custom console command.
|
|
20
|
-
*
|
|
21
|
-
* The standard library comes with many existing console commands that are useful for debugging. If
|
|
22
|
-
* you want to disable one of them, use this function.
|
|
23
|
-
*
|
|
24
|
-
* Before using this function, you must first invoke `enableExtraConsoleCommands`.
|
|
25
|
-
*/
|
|
26
|
-
export declare function removeConsoleCommand(commandName: string): void;
|
|
2
|
+
export declare function extraConsoleCommandsInit(mod: ModUpgraded): void;
|