isaacscript-common 33.5.0 → 33.5.1
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 +1 -0
- package/dist/isaacscript-common.lua +5 -3
- package/dist/src/functions/globals.d.ts +1 -0
- package/dist/src/functions/globals.d.ts.map +1 -1
- package/dist/src/functions/globals.lua +1 -0
- package/dist/src/functions/run.d.ts +1 -1
- package/dist/src/functions/run.d.ts.map +1 -1
- package/dist/src/functions/run.lua +4 -2
- package/package.json +1 -1
- package/src/functions/globals.ts +1 -0
- package/src/functions/run.ts +4 -2
package/dist/index.rollup.d.ts
CHANGED
|
@@ -9585,6 +9585,7 @@ export declare function logMap(this: void, map: Map<AnyNotNil, unknown>, name?:
|
|
|
9585
9585
|
|
|
9586
9586
|
export declare function logMusic(this: void): void;
|
|
9587
9587
|
|
|
9588
|
+
/** Helper function to log any added global variables in the Isaac Lua environment. */
|
|
9588
9589
|
export declare function logNewGlobals(): void;
|
|
9589
9590
|
|
|
9590
9591
|
export declare function logPlayerEffects(this: void, player: EntityPlayer): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 33.5.
|
|
3
|
+
isaacscript-common 33.5.1
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -24401,7 +24401,6 @@ local ____exports = {}
|
|
|
24401
24401
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
24402
24402
|
local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
|
|
24403
24403
|
local Difficulty = ____isaac_2Dtypescript_2Ddefinitions.Difficulty
|
|
24404
|
-
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
24405
24404
|
local SlotVariant = ____isaac_2Dtypescript_2Ddefinitions.SlotVariant
|
|
24406
24405
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
24407
24406
|
local game = ____cachedClasses.game
|
|
@@ -24409,6 +24408,8 @@ local ____constants = require("src.core.constants")
|
|
|
24409
24408
|
local VectorZero = ____constants.VectorZero
|
|
24410
24409
|
local ____constantsFirstLast = require("src.core.constantsFirstLast")
|
|
24411
24410
|
local FIRST_CHARACTER = ____constantsFirstLast.FIRST_CHARACTER
|
|
24411
|
+
local ____characters = require("src.functions.characters")
|
|
24412
|
+
local getCharacterName = ____characters.getCharacterName
|
|
24412
24413
|
local ____entitiesSpecific = require("src.functions.entitiesSpecific")
|
|
24413
24414
|
local spawnSlot = ____entitiesSpecific.spawnSlot
|
|
24414
24415
|
local ____log = require("src.functions.log")
|
|
@@ -24439,7 +24440,8 @@ function ____exports.restart(self, character)
|
|
|
24439
24440
|
error(("Restarting as a character of " .. tostring(character)) .. " would crash the game.")
|
|
24440
24441
|
end
|
|
24441
24442
|
local command = "restart " .. tostring(character)
|
|
24442
|
-
|
|
24443
|
+
local characterName = getCharacterName(nil, character)
|
|
24444
|
+
log((((("Restarting the run as " .. characterName) .. " (") .. tostring(character)) .. ") with a console command of: ") .. command)
|
|
24443
24445
|
Isaac.ExecuteCommand(command)
|
|
24444
24446
|
end
|
|
24445
24447
|
function ____exports.setUnseeded(self)
|
|
@@ -11,6 +11,7 @@ export declare function getDefaultGlobals(): ReadonlySet<string>;
|
|
|
11
11
|
* Returns a sorted array of key/value tuples.
|
|
12
12
|
*/
|
|
13
13
|
export declare function getNewGlobals(): ReadonlyArray<[AnyNotNil, unknown]>;
|
|
14
|
+
/** Helper function to log any added global variables in the Isaac Lua environment. */
|
|
14
15
|
export declare function logNewGlobals(): void;
|
|
15
16
|
/**
|
|
16
17
|
* Converts every `isaacscript-common` function that begins with "log" to a global function.
|
|
@@ -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;;;;GAIG;AACH,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,sFAAsF;AACtF,wBAAgB,aAAa,IAAI,IAAI,CAapC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAS5C;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAKlD"}
|
|
@@ -227,6 +227,7 @@ function ____exports.getNewGlobals(self)
|
|
|
227
227
|
__TS__ArraySort(newGlobals, sortTwoDimensionalArray)
|
|
228
228
|
return newGlobals
|
|
229
229
|
end
|
|
230
|
+
--- Helper function to log any added global variables in the Isaac Lua environment.
|
|
230
231
|
function ____exports.logNewGlobals(self)
|
|
231
232
|
local newGlobals = ____exports.getNewGlobals(nil)
|
|
232
233
|
log("List of added global variables in the Isaac environment:")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlayerType } from "isaac-typescript-definitions";
|
|
1
|
+
import type { PlayerType } from "isaac-typescript-definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to see if the current run can unlock achievements. For example, if playing on a
|
|
4
4
|
* set seed or in a victory lap, achievements are disabled.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAa/D;;;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,CAkBpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
|
|
@@ -2,7 +2,6 @@ local ____exports = {}
|
|
|
2
2
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
3
|
local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
|
|
4
4
|
local Difficulty = ____isaac_2Dtypescript_2Ddefinitions.Difficulty
|
|
5
|
-
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
6
5
|
local SlotVariant = ____isaac_2Dtypescript_2Ddefinitions.SlotVariant
|
|
7
6
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
8
7
|
local game = ____cachedClasses.game
|
|
@@ -10,6 +9,8 @@ local ____constants = require("src.core.constants")
|
|
|
10
9
|
local VectorZero = ____constants.VectorZero
|
|
11
10
|
local ____constantsFirstLast = require("src.core.constantsFirstLast")
|
|
12
11
|
local FIRST_CHARACTER = ____constantsFirstLast.FIRST_CHARACTER
|
|
12
|
+
local ____characters = require("src.functions.characters")
|
|
13
|
+
local getCharacterName = ____characters.getCharacterName
|
|
13
14
|
local ____entitiesSpecific = require("src.functions.entitiesSpecific")
|
|
14
15
|
local spawnSlot = ____entitiesSpecific.spawnSlot
|
|
15
16
|
local ____log = require("src.functions.log")
|
|
@@ -52,7 +53,8 @@ function ____exports.restart(self, character)
|
|
|
52
53
|
error(("Restarting as a character of " .. tostring(character)) .. " would crash the game.")
|
|
53
54
|
end
|
|
54
55
|
local command = "restart " .. tostring(character)
|
|
55
|
-
|
|
56
|
+
local characterName = getCharacterName(nil, character)
|
|
57
|
+
log((((("Restarting the run as " .. characterName) .. " (") .. tostring(character)) .. ") with a console command of: ") .. command)
|
|
56
58
|
Isaac.ExecuteCommand(command)
|
|
57
59
|
end
|
|
58
60
|
--- Helper function to change the run status to that of an unseeded run with a new random seed.
|
package/package.json
CHANGED
package/src/functions/globals.ts
CHANGED
|
@@ -231,6 +231,7 @@ export function getNewGlobals(): ReadonlyArray<[AnyNotNil, unknown]> {
|
|
|
231
231
|
return newGlobals;
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
/** Helper function to log any added global variables in the Isaac Lua environment. */
|
|
234
235
|
export function logNewGlobals(): void {
|
|
235
236
|
const newGlobals = getNewGlobals();
|
|
236
237
|
|
package/src/functions/run.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import type { PlayerType } from "isaac-typescript-definitions";
|
|
1
2
|
import {
|
|
2
3
|
Challenge,
|
|
3
4
|
Difficulty,
|
|
4
|
-
PlayerType,
|
|
5
5
|
SlotVariant,
|
|
6
6
|
} from "isaac-typescript-definitions";
|
|
7
7
|
import { game } from "../core/cachedClasses";
|
|
8
8
|
import { VectorZero } from "../core/constants";
|
|
9
9
|
import { FIRST_CHARACTER } from "../core/constantsFirstLast";
|
|
10
|
+
import { getCharacterName } from "./characters";
|
|
10
11
|
import { spawnSlot } from "./entitiesSpecific";
|
|
11
12
|
import { log } from "./log";
|
|
12
13
|
|
|
@@ -70,8 +71,9 @@ export function restart(character?: PlayerType): void {
|
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
const command = `restart ${character}`;
|
|
74
|
+
const characterName = getCharacterName(character);
|
|
73
75
|
log(
|
|
74
|
-
`Restarting the run as
|
|
76
|
+
`Restarting the run as ${characterName} (${character}) with a console command of: ${command}`,
|
|
75
77
|
);
|
|
76
78
|
Isaac.ExecuteCommand(command);
|
|
77
79
|
}
|