isaacscript-common 33.3.0 → 33.4.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/dist/index.rollup.d.ts +30 -6
- package/dist/isaacscript-common.lua +19 -2
- package/dist/src/classes/features/other/ExtraConsoleCommands.d.ts +22 -6
- package/dist/src/classes/features/other/ExtraConsoleCommands.d.ts.map +1 -1
- package/dist/src/classes/features/other/ExtraConsoleCommands.lua +27 -1
- package/dist/src/classes/features/other/extraConsoleCommands/commands.d.ts.map +1 -1
- package/dist/src/functions/globals.d.ts +5 -0
- package/dist/src/functions/globals.d.ts.map +1 -1
- package/dist/src/functions/globals.lua +3 -0
- package/dist/src/functions/run.d.ts +3 -0
- package/dist/src/functions/run.d.ts.map +1 -1
- package/dist/src/functions/run.lua +3 -0
- package/package.json +1 -1
- package/src/classes/features/other/ExtraConsoleCommands.ts +63 -7
- package/src/classes/features/other/extraConsoleCommands/commands.ts +9 -4
- package/src/functions/globals.ts +5 -0
- package/src/functions/gridEntities.ts +2 -2
- package/src/functions/playerHealth.ts +2 -2
- package/src/functions/run.ts +3 -0
- package/src/functions/tears.ts +1 -1
- package/src/functions/ui.ts +3 -3
package/dist/index.rollup.d.ts
CHANGED
|
@@ -4144,7 +4144,19 @@ export declare type Expand<T> = T extends infer O ? {
|
|
|
4144
4144
|
[K in keyof O]: O[K];
|
|
4145
4145
|
} : never;
|
|
4146
4146
|
|
|
4147
|
+
/**
|
|
4148
|
+
* When you enable this feature, many custom commands will be added to the in-game console. See the
|
|
4149
|
+
* [dedicated command list](ExtraConsoleCommandsList) for more information about them.
|
|
4150
|
+
*
|
|
4151
|
+
* Note that in order to avoid conflicts, if two or more mods enable this feature, then the first
|
|
4152
|
+
* loaded one will control all of the command logic. When this occurs, a global variable of
|
|
4153
|
+
* `__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE` will be created and will automatically be
|
|
4154
|
+
* used by the non-main instances. For this reason, if you use multiple mods with
|
|
4155
|
+
* `isaacscript-common` and a custom command from the standard library is not working properly, then
|
|
4156
|
+
* you might need to get another mod author to update their version of `isaacscript-common`.
|
|
4157
|
+
*/
|
|
4147
4158
|
declare class ExtraConsoleCommands extends Feature {
|
|
4159
|
+
private readonly isMainFeature;
|
|
4148
4160
|
private readonly commandFunctionMap;
|
|
4149
4161
|
private readonly postUpdate;
|
|
4150
4162
|
private readonly evaluateCacheDamage;
|
|
@@ -4158,10 +4170,12 @@ declare class ExtraConsoleCommands extends Feature {
|
|
|
4158
4170
|
/**
|
|
4159
4171
|
* Helper function to add a custom console command.
|
|
4160
4172
|
*
|
|
4161
|
-
* The standard library comes with many existing console commands that
|
|
4162
|
-
* but you can also add your own commands that are useful for your
|
|
4163
|
-
* add commands to the existing command system than to add your own
|
|
4164
|
-
* `EXECUTE_CMD` callback.
|
|
4173
|
+
* The standard library comes with [many existing console commands](ExtraConsoleCommandsList) that
|
|
4174
|
+
* are useful for debugging, but you can also add your own commands that are useful for your
|
|
4175
|
+
* particular mod. It's easier to add commands to the existing command system than to add your own
|
|
4176
|
+
* logic manually to the `EXECUTE_CMD` callback.
|
|
4177
|
+
*
|
|
4178
|
+
* This function is intended to be called when your mod is first loading.
|
|
4165
4179
|
*
|
|
4166
4180
|
* In order to use this function, you must upgrade your mod with
|
|
4167
4181
|
* `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
|
|
@@ -4170,8 +4184,10 @@ declare class ExtraConsoleCommands extends Feature {
|
|
|
4170
4184
|
/**
|
|
4171
4185
|
* Helper function to remove a custom console command.
|
|
4172
4186
|
*
|
|
4173
|
-
* The standard library comes with many existing console commands that
|
|
4174
|
-
* If you want to disable one of them, use this function.
|
|
4187
|
+
* The standard library comes with [many existing console commands](ExtraConsoleCommandsList) that
|
|
4188
|
+
* are useful for debugging. If you want to disable one of them, use this function.
|
|
4189
|
+
*
|
|
4190
|
+
* This function is intended to be called when your mod is first loading.
|
|
4175
4191
|
*
|
|
4176
4192
|
* In order to use this function, you must upgrade your mod with
|
|
4177
4193
|
* `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
|
|
@@ -16144,6 +16160,11 @@ export declare function setStage(stage: LevelStage, stageType: StageType, reseed
|
|
|
16144
16160
|
/** Helper function to convert a set of flags to a single `BitFlags` object. */
|
|
16145
16161
|
export declare function setToBitFlags<T extends BitFlag | BitFlag128>(set: Set<T> | ReadonlySet<T>): BitFlags<T>;
|
|
16146
16162
|
|
|
16163
|
+
/**
|
|
16164
|
+
* Sets the `traceback` and `getTraceback` functions to be global functions.
|
|
16165
|
+
*
|
|
16166
|
+
* This is useful when editing Lua files when troubleshooting.
|
|
16167
|
+
*/
|
|
16147
16168
|
export declare function setTracebackFunctionsGlobal(): void;
|
|
16148
16169
|
|
|
16149
16170
|
/**
|
|
@@ -16165,6 +16186,9 @@ export declare function setTrinketSprite(trinket: EntityPickup, pngPath: string
|
|
|
16165
16186
|
*
|
|
16166
16187
|
* This is useful to revert the behavior where playing on a set and restarting the game will not
|
|
16167
16188
|
* take you to a new seed.
|
|
16189
|
+
*
|
|
16190
|
+
* Under the hood, this function calls the `Seeds.Reset` method and the
|
|
16191
|
+
* `Seeds.Restart(Challenge.NULL)` method.
|
|
16168
16192
|
*/
|
|
16169
16193
|
export declare function setUnseeded(): void;
|
|
16170
16194
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 33.
|
|
3
|
+
isaacscript-common 33.4.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -50598,6 +50598,8 @@ local addFlag = ____flag.addFlag
|
|
|
50598
50598
|
local bitFlags = ____flag.bitFlags
|
|
50599
50599
|
local ____map = require("src.functions.map")
|
|
50600
50600
|
local getMapPartialMatch = ____map.getMapPartialMatch
|
|
50601
|
+
local ____utils = require("src.functions.utils")
|
|
50602
|
+
local assertDefined = ____utils.assertDefined
|
|
50601
50603
|
local ____Feature = require("src.classes.private.Feature")
|
|
50602
50604
|
local Feature = ____Feature.Feature
|
|
50603
50605
|
local commands = require("src.classes.features.other.extraConsoleCommands.commands")
|
|
@@ -50694,6 +50696,11 @@ function ExtraConsoleCommands.prototype.____constructor(self)
|
|
|
50694
50696
|
end
|
|
50695
50697
|
return nil
|
|
50696
50698
|
end
|
|
50699
|
+
self.isMainFeature = __ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE == nil
|
|
50700
|
+
if not self.isMainFeature then
|
|
50701
|
+
return
|
|
50702
|
+
end
|
|
50703
|
+
__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE = self
|
|
50697
50704
|
self.callbacksUsed = {
|
|
50698
50705
|
{ModCallback.POST_UPDATE, self.postUpdate},
|
|
50699
50706
|
{ModCallback.EVALUATE_CACHE, self.evaluateCacheDamage, {CacheFlag.DAMAGE}},
|
|
@@ -50712,6 +50719,11 @@ function ExtraConsoleCommands.prototype.____constructor(self)
|
|
|
50712
50719
|
end
|
|
50713
50720
|
end
|
|
50714
50721
|
function ExtraConsoleCommands.prototype.addConsoleCommand(self, commandName, commandFunction)
|
|
50722
|
+
if not self.isMainFeature then
|
|
50723
|
+
assertDefined(nil, __ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE, "Failed to find the non-main isaacscript-common extra console commands feature in the global variable.")
|
|
50724
|
+
__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE:addConsoleCommand(commandName, commandFunction)
|
|
50725
|
+
return
|
|
50726
|
+
end
|
|
50715
50727
|
if isVanillaConsoleCommand(nil, commandName) then
|
|
50716
50728
|
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.")
|
|
50717
50729
|
end
|
|
@@ -50722,8 +50734,13 @@ function ExtraConsoleCommands.prototype.addConsoleCommand(self, commandName, com
|
|
|
50722
50734
|
end
|
|
50723
50735
|
__TS__DecorateLegacy({Exported}, ExtraConsoleCommands.prototype, "addConsoleCommand", true)
|
|
50724
50736
|
function ExtraConsoleCommands.prototype.removeConsoleCommand(self, commandName)
|
|
50737
|
+
if not self.isMainFeature then
|
|
50738
|
+
assertDefined(nil, __ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE, "Failed to find the non-main isaacscript-common extra console commands feature in the global variable.")
|
|
50739
|
+
__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE:removeConsoleCommand(commandName)
|
|
50740
|
+
return
|
|
50741
|
+
end
|
|
50725
50742
|
if not self.commandFunctionMap:has(commandName) then
|
|
50726
|
-
error(("Failed to remove the console command of \"" .. commandName) .. "\", since it does not already exist in the map.")
|
|
50743
|
+
error(("Failed to remove the console command of \"" .. commandName) .. "\", since it does not already exist in the command map.")
|
|
50727
50744
|
end
|
|
50728
50745
|
self.commandFunctionMap:delete(commandName)
|
|
50729
50746
|
end
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { Feature } from "../../private/Feature";
|
|
2
|
+
/**
|
|
3
|
+
* When you enable this feature, many custom commands will be added to the in-game console. See the
|
|
4
|
+
* [dedicated command list](ExtraConsoleCommandsList) for more information about them.
|
|
5
|
+
*
|
|
6
|
+
* Note that in order to avoid conflicts, if two or more mods enable this feature, then the first
|
|
7
|
+
* loaded one will control all of the command logic. When this occurs, a global variable of
|
|
8
|
+
* `__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE` will be created and will automatically be
|
|
9
|
+
* used by the non-main instances. For this reason, if you use multiple mods with
|
|
10
|
+
* `isaacscript-common` and a custom command from the standard library is not working properly, then
|
|
11
|
+
* you might need to get another mod author to update their version of `isaacscript-common`.
|
|
12
|
+
*/
|
|
2
13
|
export declare class ExtraConsoleCommands extends Feature {
|
|
14
|
+
private readonly isMainFeature;
|
|
3
15
|
private readonly commandFunctionMap;
|
|
4
16
|
private readonly postUpdate;
|
|
5
17
|
private readonly evaluateCacheDamage;
|
|
@@ -13,10 +25,12 @@ export declare class ExtraConsoleCommands extends Feature {
|
|
|
13
25
|
/**
|
|
14
26
|
* Helper function to add a custom console command.
|
|
15
27
|
*
|
|
16
|
-
* The standard library comes with many existing console commands that
|
|
17
|
-
* but you can also add your own commands that are useful for your
|
|
18
|
-
* add commands to the existing command system than to add your own
|
|
19
|
-
* `EXECUTE_CMD` callback.
|
|
28
|
+
* The standard library comes with [many existing console commands](ExtraConsoleCommandsList) that
|
|
29
|
+
* are useful for debugging, but you can also add your own commands that are useful for your
|
|
30
|
+
* particular mod. It's easier to add commands to the existing command system than to add your own
|
|
31
|
+
* logic manually to the `EXECUTE_CMD` callback.
|
|
32
|
+
*
|
|
33
|
+
* This function is intended to be called when your mod is first loading.
|
|
20
34
|
*
|
|
21
35
|
* In order to use this function, you must upgrade your mod with
|
|
22
36
|
* `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
|
|
@@ -25,8 +39,10 @@ export declare class ExtraConsoleCommands extends Feature {
|
|
|
25
39
|
/**
|
|
26
40
|
* Helper function to remove a custom console command.
|
|
27
41
|
*
|
|
28
|
-
* The standard library comes with many existing console commands that
|
|
29
|
-
* If you want to disable one of them, use this function.
|
|
42
|
+
* The standard library comes with [many existing console commands](ExtraConsoleCommandsList) that
|
|
43
|
+
* are useful for debugging. If you want to disable one of them, use this function.
|
|
44
|
+
*
|
|
45
|
+
* This function is intended to be called when your mod is first loading.
|
|
30
46
|
*
|
|
31
47
|
* In order to use this function, you must upgrade your mod with
|
|
32
48
|
* `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtraConsoleCommands.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ExtraConsoleCommands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExtraConsoleCommands.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ExtraConsoleCommands.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAShD;;;;;;;;;;GAUG;AACH,qBAAa,oBAAqB,SAAQ,OAAO;IAI/C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAU;IAExC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAG/B;IAoEJ,OAAO,CAAC,QAAQ,CAAC,UAAU,CAKzB;IAIF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAIlC;IAIF,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAIrC;IAIF,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAIjC;IAIF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAIlC;IAGF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAkD5B;IAGF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAWzB;IAGF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAI3B;IAGF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAYlC;IAEF;;;;;;;;;;;;OAYG;IAEI,iBAAiB,CACtB,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GACxC,IAAI;IA4BP;;;;;;;;;;OAUG;IAEI,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;CAoBvD"}
|
|
@@ -23,11 +23,22 @@ local addFlag = ____flag.addFlag
|
|
|
23
23
|
local bitFlags = ____flag.bitFlags
|
|
24
24
|
local ____map = require("src.functions.map")
|
|
25
25
|
local getMapPartialMatch = ____map.getMapPartialMatch
|
|
26
|
+
local ____utils = require("src.functions.utils")
|
|
27
|
+
local assertDefined = ____utils.assertDefined
|
|
26
28
|
local ____Feature = require("src.classes.private.Feature")
|
|
27
29
|
local Feature = ____Feature.Feature
|
|
28
30
|
local commands = require("src.classes.features.other.extraConsoleCommands.commands")
|
|
29
31
|
local ____v = require("src.classes.features.other.extraConsoleCommands.v")
|
|
30
32
|
local v = ____v.v
|
|
33
|
+
--- When you enable this feature, many custom commands will be added to the in-game console. See the
|
|
34
|
+
-- [dedicated command list](ExtraConsoleCommandsList) for more information about them.
|
|
35
|
+
--
|
|
36
|
+
-- Note that in order to avoid conflicts, if two or more mods enable this feature, then the first
|
|
37
|
+
-- loaded one will control all of the command logic. When this occurs, a global variable of
|
|
38
|
+
-- `__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE` will be created and will automatically be
|
|
39
|
+
-- used by the non-main instances. For this reason, if you use multiple mods with
|
|
40
|
+
-- `isaacscript-common` and a custom command from the standard library is not working properly, then
|
|
41
|
+
-- you might need to get another mod author to update their version of `isaacscript-common`.
|
|
31
42
|
____exports.ExtraConsoleCommands = __TS__Class()
|
|
32
43
|
local ExtraConsoleCommands = ____exports.ExtraConsoleCommands
|
|
33
44
|
ExtraConsoleCommands.name = "ExtraConsoleCommands"
|
|
@@ -119,6 +130,11 @@ function ExtraConsoleCommands.prototype.____constructor(self)
|
|
|
119
130
|
end
|
|
120
131
|
return nil
|
|
121
132
|
end
|
|
133
|
+
self.isMainFeature = __ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE == nil
|
|
134
|
+
if not self.isMainFeature then
|
|
135
|
+
return
|
|
136
|
+
end
|
|
137
|
+
__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE = self
|
|
122
138
|
self.callbacksUsed = {
|
|
123
139
|
{ModCallback.POST_UPDATE, self.postUpdate},
|
|
124
140
|
{ModCallback.EVALUATE_CACHE, self.evaluateCacheDamage, {CacheFlag.DAMAGE}},
|
|
@@ -137,6 +153,11 @@ function ExtraConsoleCommands.prototype.____constructor(self)
|
|
|
137
153
|
end
|
|
138
154
|
end
|
|
139
155
|
function ExtraConsoleCommands.prototype.addConsoleCommand(self, commandName, commandFunction)
|
|
156
|
+
if not self.isMainFeature then
|
|
157
|
+
assertDefined(nil, __ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE, "Failed to find the non-main isaacscript-common extra console commands feature in the global variable.")
|
|
158
|
+
__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE:addConsoleCommand(commandName, commandFunction)
|
|
159
|
+
return
|
|
160
|
+
end
|
|
140
161
|
if isVanillaConsoleCommand(nil, commandName) then
|
|
141
162
|
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.")
|
|
142
163
|
end
|
|
@@ -147,8 +168,13 @@ function ExtraConsoleCommands.prototype.addConsoleCommand(self, commandName, com
|
|
|
147
168
|
end
|
|
148
169
|
__TS__DecorateLegacy({Exported}, ExtraConsoleCommands.prototype, "addConsoleCommand", true)
|
|
149
170
|
function ExtraConsoleCommands.prototype.removeConsoleCommand(self, commandName)
|
|
171
|
+
if not self.isMainFeature then
|
|
172
|
+
assertDefined(nil, __ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE, "Failed to find the non-main isaacscript-common extra console commands feature in the global variable.")
|
|
173
|
+
__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE:removeConsoleCommand(commandName)
|
|
174
|
+
return
|
|
175
|
+
end
|
|
150
176
|
if not self.commandFunctionMap:has(commandName) then
|
|
151
|
-
error(("Failed to remove the console command of \"" .. commandName) .. "\", since it does not already exist in the map.")
|
|
177
|
+
error(("Failed to remove the console command of \"" .. commandName) .. "\", since it does not already exist in the command map.")
|
|
152
178
|
end
|
|
153
179
|
self.commandFunctionMap:delete(commandName)
|
|
154
180
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../../../src/classes/features/other/extraConsoleCommands/commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../../../src/classes/features/other/extraConsoleCommands/commands.ts"],"names":[],"mappings":"AAkJA;;;;GAIG;AACH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C;AAED,uDAAuD;AACvD,wBAAgB,MAAM,IAAI,IAAI,CAM7B;AAED,4CAA4C;AAC5C,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED,+CAA+C;AAC/C,wBAAgB,YAAY,IAAI,IAAI,CAInC;AAED,yDAAyD;AACzD,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAkB1C;AAED,wCAAwC;AACxC,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED,6CAA6C;AAC7C,wBAAgB,QAAQ,IAAI,IAAI,CAE/B;AAED,qDAAqD;AACrD,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,yDAAyD;AACzD,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,8CAA8C;AAC9C,wBAAgB,OAAO,IAAI,IAAI,CAG9B;AAED,sFAAsF;AACtF,wBAAgB,MAAM,IAAI,IAAI,CAQ7B;AAED,wFAAwF;AACxF,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA0BzC"}
|
|
@@ -18,5 +18,10 @@ export declare function logNewGlobals(): void;
|
|
|
18
18
|
* This is useful when printing out variables from the in-game debug console.
|
|
19
19
|
*/
|
|
20
20
|
export declare function setLogFunctionsGlobal(): void;
|
|
21
|
+
/**
|
|
22
|
+
* Sets the `traceback` and `getTraceback` functions to be global functions.
|
|
23
|
+
*
|
|
24
|
+
* This is useful when editing Lua files when troubleshooting.
|
|
25
|
+
*/
|
|
21
26
|
export declare function setTracebackFunctionsGlobal(): void;
|
|
22
27
|
//# sourceMappingURL=globals.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../../src/functions/globals.ts"],"names":[],"mappings":";AA6LA;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAAC,MAAM,CAAC,CAYvD;AAMD;;;GAGG;AACH,wBAAgB,aAAa,IAAI,aAAa,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAcnE;AAED,wBAAgB,aAAa,IAAI,IAAI,CAapC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAS5C;AAED,wBAAgB,2BAA2B,IAAI,IAAI,CAKlD"}
|
|
1
|
+
{"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../../src/functions/globals.ts"],"names":[],"mappings":";AA6LA;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAAC,MAAM,CAAC,CAYvD;AAMD;;;GAGG;AACH,wBAAgB,aAAa,IAAI,aAAa,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAcnE;AAED,wBAAgB,aAAa,IAAI,IAAI,CAapC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAS5C;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAKlD"}
|
|
@@ -254,6 +254,9 @@ function ____exports.setLogFunctionsGlobal(self)
|
|
|
254
254
|
end
|
|
255
255
|
end
|
|
256
256
|
end
|
|
257
|
+
--- Sets the `traceback` and `getTraceback` functions to be global functions.
|
|
258
|
+
--
|
|
259
|
+
-- This is useful when editing Lua files when troubleshooting.
|
|
257
260
|
function ____exports.setTracebackFunctionsGlobal(self)
|
|
258
261
|
local globals = _G
|
|
259
262
|
globals.getTraceback = getTraceback
|
|
@@ -28,6 +28,9 @@ export declare function restart(character?: PlayerType): void;
|
|
|
28
28
|
*
|
|
29
29
|
* This is useful to revert the behavior where playing on a set and restarting the game will not
|
|
30
30
|
* take you to a new seed.
|
|
31
|
+
*
|
|
32
|
+
* Under the hood, this function calls the `Seeds.Reset` method and the
|
|
33
|
+
* `Seeds.Restart(Challenge.NULL)` method.
|
|
31
34
|
*/
|
|
32
35
|
export declare function setUnseeded(): void;
|
|
33
36
|
//# sourceMappingURL=run.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAOtC;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAUlD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAKrC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAiBpD;AAED
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAOtC;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAUlD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAKrC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAiBpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
|
|
@@ -59,6 +59,9 @@ end
|
|
|
59
59
|
--
|
|
60
60
|
-- This is useful to revert the behavior where playing on a set and restarting the game will not
|
|
61
61
|
-- take you to a new seed.
|
|
62
|
+
--
|
|
63
|
+
-- Under the hood, this function calls the `Seeds.Reset` method and the
|
|
64
|
+
-- `Seeds.Restart(Challenge.NULL)` method.
|
|
62
65
|
function ____exports.setUnseeded(self)
|
|
63
66
|
local seeds = game:GetSeeds()
|
|
64
67
|
seeds:Reset()
|
package/package.json
CHANGED
|
@@ -11,14 +11,33 @@ import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
|
|
|
11
11
|
import { isVanillaConsoleCommand } from "../../../functions/console";
|
|
12
12
|
import { addFlag, bitFlags } from "../../../functions/flag";
|
|
13
13
|
import { getMapPartialMatch } from "../../../functions/map";
|
|
14
|
+
import { assertDefined } from "../../../functions/utils";
|
|
14
15
|
import { Feature } from "../../private/Feature";
|
|
15
16
|
import * as commands from "./extraConsoleCommands/commands";
|
|
16
17
|
import { v } from "./extraConsoleCommands/v";
|
|
17
18
|
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
20
|
+
declare let __ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE:
|
|
21
|
+
| ExtraConsoleCommands
|
|
22
|
+
| undefined;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* When you enable this feature, many custom commands will be added to the in-game console. See the
|
|
26
|
+
* [dedicated command list](ExtraConsoleCommandsList) for more information about them.
|
|
27
|
+
*
|
|
28
|
+
* Note that in order to avoid conflicts, if two or more mods enable this feature, then the first
|
|
29
|
+
* loaded one will control all of the command logic. When this occurs, a global variable of
|
|
30
|
+
* `__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE` will be created and will automatically be
|
|
31
|
+
* used by the non-main instances. For this reason, if you use multiple mods with
|
|
32
|
+
* `isaacscript-common` and a custom command from the standard library is not working properly, then
|
|
33
|
+
* you might need to get another mod author to update their version of `isaacscript-common`.
|
|
34
|
+
*/
|
|
18
35
|
export class ExtraConsoleCommands extends Feature {
|
|
19
36
|
/** @internal */
|
|
20
37
|
public override v = v;
|
|
21
38
|
|
|
39
|
+
private readonly isMainFeature: boolean;
|
|
40
|
+
|
|
22
41
|
private readonly commandFunctionMap = new Map<
|
|
23
42
|
string,
|
|
24
43
|
(params: string) => void
|
|
@@ -28,6 +47,16 @@ export class ExtraConsoleCommands extends Feature {
|
|
|
28
47
|
constructor() {
|
|
29
48
|
super();
|
|
30
49
|
|
|
50
|
+
// Only one instance of this feature can be instantiated across all mods.
|
|
51
|
+
this.isMainFeature =
|
|
52
|
+
__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE === undefined;
|
|
53
|
+
if (!this.isMainFeature) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this
|
|
58
|
+
__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE = this;
|
|
59
|
+
|
|
31
60
|
this.callbacksUsed = [
|
|
32
61
|
// 1
|
|
33
62
|
[ModCallback.POST_UPDATE, this.postUpdate],
|
|
@@ -211,10 +240,12 @@ export class ExtraConsoleCommands extends Feature {
|
|
|
211
240
|
/**
|
|
212
241
|
* Helper function to add a custom console command.
|
|
213
242
|
*
|
|
214
|
-
* The standard library comes with many existing console commands that
|
|
215
|
-
* but you can also add your own commands that are useful for your
|
|
216
|
-
* add commands to the existing command system than to add your own
|
|
217
|
-
* `EXECUTE_CMD` callback.
|
|
243
|
+
* The standard library comes with [many existing console commands](ExtraConsoleCommandsList) that
|
|
244
|
+
* are useful for debugging, but you can also add your own commands that are useful for your
|
|
245
|
+
* particular mod. It's easier to add commands to the existing command system than to add your own
|
|
246
|
+
* logic manually to the `EXECUTE_CMD` callback.
|
|
247
|
+
*
|
|
248
|
+
* This function is intended to be called when your mod is first loading.
|
|
218
249
|
*
|
|
219
250
|
* In order to use this function, you must upgrade your mod with
|
|
220
251
|
* `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
|
|
@@ -224,6 +255,18 @@ export class ExtraConsoleCommands extends Feature {
|
|
|
224
255
|
commandName: string,
|
|
225
256
|
commandFunction: (params: string) => void,
|
|
226
257
|
): void {
|
|
258
|
+
if (!this.isMainFeature) {
|
|
259
|
+
assertDefined(
|
|
260
|
+
__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE,
|
|
261
|
+
"Failed to find the non-main isaacscript-common extra console commands feature in the global variable.",
|
|
262
|
+
);
|
|
263
|
+
__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE.addConsoleCommand(
|
|
264
|
+
commandName,
|
|
265
|
+
commandFunction,
|
|
266
|
+
);
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
|
|
227
270
|
if (isVanillaConsoleCommand(commandName)) {
|
|
228
271
|
error(
|
|
229
272
|
`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.`,
|
|
@@ -242,17 +285,30 @@ export class ExtraConsoleCommands extends Feature {
|
|
|
242
285
|
/**
|
|
243
286
|
* Helper function to remove a custom console command.
|
|
244
287
|
*
|
|
245
|
-
* The standard library comes with many existing console commands that
|
|
246
|
-
* If you want to disable one of them, use this function.
|
|
288
|
+
* The standard library comes with [many existing console commands](ExtraConsoleCommandsList) that
|
|
289
|
+
* are useful for debugging. If you want to disable one of them, use this function.
|
|
290
|
+
*
|
|
291
|
+
* This function is intended to be called when your mod is first loading.
|
|
247
292
|
*
|
|
248
293
|
* In order to use this function, you must upgrade your mod with
|
|
249
294
|
* `ISCFeature.EXTRA_CONSOLE_COMMANDS`.
|
|
250
295
|
*/
|
|
251
296
|
@Exported
|
|
252
297
|
public removeConsoleCommand(commandName: string): void {
|
|
298
|
+
if (!this.isMainFeature) {
|
|
299
|
+
assertDefined(
|
|
300
|
+
__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE,
|
|
301
|
+
"Failed to find the non-main isaacscript-common extra console commands feature in the global variable.",
|
|
302
|
+
);
|
|
303
|
+
__ISAACSCRIPT_COMMON_EXTRA_CONSOLE_COMMANDS_FEATURE.removeConsoleCommand(
|
|
304
|
+
commandName,
|
|
305
|
+
);
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
|
|
253
309
|
if (!this.commandFunctionMap.has(commandName)) {
|
|
254
310
|
error(
|
|
255
|
-
`Failed to remove the console command of "${commandName}", since it does not already exist in the map.`,
|
|
311
|
+
`Failed to remove the console command of "${commandName}", since it does not already exist in the command map.`,
|
|
256
312
|
);
|
|
257
313
|
}
|
|
258
314
|
|
|
@@ -10,7 +10,12 @@ eslint "sort-exports/sort-exports": [
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* __DOCS_LINE_THAT_WILL_BE_AUTOMATICALLY_REMOVED__
|
|
14
|
+
*
|
|
15
|
+
* This is a list of custom console commands that are included with the standard library. By
|
|
16
|
+
* default, they will not be enabled. You can enable them by upgrading your mod with
|
|
17
|
+
* `ISCFeature.EXTRA_CONSOLE_COMMANDS`. (Also see the [Extra Console Commands](ExtraConsoleCommands)
|
|
18
|
+
* feature documentation.)
|
|
14
19
|
*
|
|
15
20
|
* As a quality of life feature, you do not have to match the casing of the command. For example,
|
|
16
21
|
* you can type the "addCharges" command as "addcharges", and it will still work the same.
|
|
@@ -22,9 +27,9 @@ eslint "sort-exports/sort-exports": [
|
|
|
22
27
|
* `ISCFeature.EXTRA_CONSOLE_COMMANDS` when upgrading your mod. (See the "Extra Console Commands
|
|
23
28
|
* (Init)" page for more details.)
|
|
24
29
|
*
|
|
25
|
-
* Each command has a corresponding function of the same name, but these functions are not
|
|
26
|
-
*
|
|
27
|
-
*
|
|
30
|
+
* Each command has a corresponding function of the same name, but these functions are not exported
|
|
31
|
+
* for end-user consumption. (This is to cut down on namespace conflicts and because the names of
|
|
32
|
+
* the functions are not very descriptive.)
|
|
28
33
|
*
|
|
29
34
|
* @module
|
|
30
35
|
*/
|
package/src/functions/globals.ts
CHANGED
|
@@ -262,6 +262,11 @@ export function setLogFunctionsGlobal(): void {
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
+
/**
|
|
266
|
+
* Sets the `traceback` and `getTraceback` functions to be global functions.
|
|
267
|
+
*
|
|
268
|
+
* This is useful when editing Lua files when troubleshooting.
|
|
269
|
+
*/
|
|
265
270
|
export function setTracebackFunctionsGlobal(): void {
|
|
266
271
|
const globals = _G as Record<string, unknown>;
|
|
267
272
|
|
|
@@ -266,13 +266,13 @@ export function getGridEntitiesInRadius(
|
|
|
266
266
|
targetPosition: Vector,
|
|
267
267
|
radius: number,
|
|
268
268
|
): GridEntity[] {
|
|
269
|
-
radius =
|
|
269
|
+
radius = Math.abs(radius);
|
|
270
270
|
const topLeftOffset = VectorOne.mul(-radius);
|
|
271
271
|
const mostTopLeftPosition = targetPosition.add(topLeftOffset);
|
|
272
272
|
const room = game.GetRoom();
|
|
273
273
|
|
|
274
274
|
const diameter = radius * 2;
|
|
275
|
-
const iterations =
|
|
275
|
+
const iterations = Math.ceil(diameter / DISTANCE_OF_GRID_TILE);
|
|
276
276
|
const separation = diameter / iterations;
|
|
277
277
|
|
|
278
278
|
const gridEntities: GridEntity[] = [];
|
|
@@ -136,7 +136,7 @@ export function getPlayerAvailableHeartSlots(player: EntityPlayer): int {
|
|
|
136
136
|
const effectiveMaxHearts = player.GetEffectiveMaxHearts();
|
|
137
137
|
const normalAndBoneHeartContainers = effectiveMaxHearts / 2;
|
|
138
138
|
const soulHearts = player.GetSoulHearts();
|
|
139
|
-
const soulHeartContainers =
|
|
139
|
+
const soulHeartContainers = Math.ceil(soulHearts / 2);
|
|
140
140
|
const totalHeartContainers =
|
|
141
141
|
normalAndBoneHeartContainers + soulHeartContainers;
|
|
142
142
|
const brokenHearts = player.GetBrokenHearts();
|
|
@@ -197,7 +197,7 @@ export function getPlayerHealth(player: EntityPlayer): PlayerHealth {
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
// This is the number of individual hearts shown in the HUD, minus heart containers.
|
|
200
|
-
const extraHearts =
|
|
200
|
+
const extraHearts = Math.ceil(soulHearts / 2) + boneHearts;
|
|
201
201
|
|
|
202
202
|
// Since bone hearts can be inserted anywhere between soul hearts, we need a separate counter to
|
|
203
203
|
// track which soul heart we're currently at.
|
package/src/functions/run.ts
CHANGED
|
@@ -81,6 +81,9 @@ export function restart(character?: PlayerType): void {
|
|
|
81
81
|
*
|
|
82
82
|
* This is useful to revert the behavior where playing on a set and restarting the game will not
|
|
83
83
|
* take you to a new seed.
|
|
84
|
+
*
|
|
85
|
+
* Under the hood, this function calls the `Seeds.Reset` method and the
|
|
86
|
+
* `Seeds.Restart(Challenge.NULL)` method.
|
|
84
87
|
*/
|
|
85
88
|
export function setUnseeded(): void {
|
|
86
89
|
const seeds = game.GetSeeds();
|
package/src/functions/tears.ts
CHANGED
|
@@ -31,7 +31,7 @@ export function addTearsStat(player: EntityPlayer, tearsStat: float): void {
|
|
|
31
31
|
* - In this context, the "tears stat" represents what is shown on the in-game stat UI.
|
|
32
32
|
*/
|
|
33
33
|
export function getFireDelay(tearsStat: float): float {
|
|
34
|
-
return
|
|
34
|
+
return Math.max(30 / tearsStat - 1, -0.9999);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/**
|
package/src/functions/ui.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { copyVector } from "./vector";
|
|
|
15
15
|
*/
|
|
16
16
|
export function getHUDOffsetVector(): Readonly<Vector> {
|
|
17
17
|
// Convert e.g. 0.4 to 4.
|
|
18
|
-
const hudOffset =
|
|
18
|
+
const hudOffset = Math.floor(Options.HUDOffset * 10);
|
|
19
19
|
|
|
20
20
|
// Expected values are integers between 1 and 10.
|
|
21
21
|
if (hudOffset < 1 || hudOffset > 10) {
|
|
@@ -145,9 +145,9 @@ export function getVisibleHearts(player: EntityPlayer): int {
|
|
|
145
145
|
const soulHearts = player.GetSoulHearts();
|
|
146
146
|
const boneHearts = player.GetBoneHearts();
|
|
147
147
|
|
|
148
|
-
const maxHearts =
|
|
148
|
+
const maxHearts = Math.max(effectiveMaxHearts, boneHearts * 2);
|
|
149
149
|
|
|
150
|
-
let visibleHearts =
|
|
150
|
+
let visibleHearts = Math.ceil((maxHearts + soulHearts) / 2);
|
|
151
151
|
if (visibleHearts < 1) {
|
|
152
152
|
visibleHearts = 1;
|
|
153
153
|
}
|