isaacscript-common 59.4.0 → 59.4.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/isaacscript-common.lua +12 -4
- package/dist/src/functions/challenges.d.ts.map +1 -1
- package/dist/src/functions/challenges.lua +8 -2
- package/dist/src/functions/run.d.ts.map +1 -1
- package/dist/src/functions/run.lua +3 -1
- package/package.json +1 -1
- package/src/functions/challenges.ts +11 -2
- package/src/functions/run.ts +3 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 59.4.
|
|
3
|
+
isaacscript-common 59.4.1
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -22689,7 +22689,9 @@ function ____exports.restart(self, character)
|
|
|
22689
22689
|
end
|
|
22690
22690
|
function ____exports.setRunSeed(self, startSeedOrStartSeedString)
|
|
22691
22691
|
local startSeedString = isString(nil, startSeedOrStartSeedString) and startSeedOrStartSeedString or Seeds.Seed2String(startSeedOrStartSeedString)
|
|
22692
|
-
|
|
22692
|
+
local command = "seed " .. startSeedString
|
|
22693
|
+
log("Restarting the run to set a seed with a console command of: " .. command)
|
|
22694
|
+
Isaac.ExecuteCommand(command)
|
|
22693
22695
|
end
|
|
22694
22696
|
function ____exports.setUnseeded(self)
|
|
22695
22697
|
local seeds = game:GetSeeds()
|
|
@@ -54634,13 +54636,17 @@ local DEFAULT_CHALLENGE_CHARACTER = ____challengeCharacters.DEFAULT_CHALLENGE_CH
|
|
|
54634
54636
|
local ____challengeNames = require("src.objects.challengeNames")
|
|
54635
54637
|
local CHALLENGE_NAMES = ____challengeNames.CHALLENGE_NAMES
|
|
54636
54638
|
local DEFAULT_CHALLENGE_NAME = ____challengeNames.DEFAULT_CHALLENGE_NAME
|
|
54639
|
+
local ____log = require("src.functions.log")
|
|
54640
|
+
local log = ____log.log
|
|
54637
54641
|
function ____exports.onAnyChallenge(self)
|
|
54638
54642
|
local challenge = Isaac.GetChallenge()
|
|
54639
54643
|
return challenge ~= Challenge.NULL
|
|
54640
54644
|
end
|
|
54641
54645
|
function ____exports.clearChallenge(self)
|
|
54642
54646
|
if ____exports.onAnyChallenge(nil) then
|
|
54643
|
-
|
|
54647
|
+
local command = "challenge " .. tostring(Challenge.NULL)
|
|
54648
|
+
log("Restarting the run to clear the current challenge with a console command of: " .. command)
|
|
54649
|
+
Isaac.ExecuteCommand(command)
|
|
54644
54650
|
end
|
|
54645
54651
|
end
|
|
54646
54652
|
function ____exports.getChallengeBoss(self, challenge)
|
|
@@ -54662,7 +54668,9 @@ function ____exports.onChallenge(self, ...)
|
|
|
54662
54668
|
end
|
|
54663
54669
|
function ____exports.setChallenge(self, challenge)
|
|
54664
54670
|
if not ____exports.onChallenge(nil, challenge) then
|
|
54665
|
-
|
|
54671
|
+
local command = "challenge " .. tostring(challenge)
|
|
54672
|
+
log("Restarting the run to set a challenge with a console command of: " .. command)
|
|
54673
|
+
Isaac.ExecuteCommand(command)
|
|
54666
54674
|
end
|
|
54667
54675
|
end
|
|
54668
54676
|
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"challenges.d.ts","sourceRoot":"","sources":["../../../src/functions/challenges.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"challenges.d.ts","sourceRoot":"","sources":["../../../src/functions/challenges.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAezD;;;;;;;GAOG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAQrC;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAK7D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAKtE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAK7D;AAED,qEAAqE;AACrE,wBAAgB,cAAc,IAAI,OAAO,CAGxC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAG/D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAQvD"}
|
|
@@ -12,6 +12,8 @@ local DEFAULT_CHALLENGE_CHARACTER = ____challengeCharacters.DEFAULT_CHALLENGE_CH
|
|
|
12
12
|
local ____challengeNames = require("src.objects.challengeNames")
|
|
13
13
|
local CHALLENGE_NAMES = ____challengeNames.CHALLENGE_NAMES
|
|
14
14
|
local DEFAULT_CHALLENGE_NAME = ____challengeNames.DEFAULT_CHALLENGE_NAME
|
|
15
|
+
local ____log = require("src.functions.log")
|
|
16
|
+
local log = ____log.log
|
|
15
17
|
--- Helper function to see if the player is playing any challenge.
|
|
16
18
|
function ____exports.onAnyChallenge(self)
|
|
17
19
|
local challenge = Isaac.GetChallenge()
|
|
@@ -25,7 +27,9 @@ end
|
|
|
25
27
|
-- Under the hood, this function executes the `challenge 0` console command.
|
|
26
28
|
function ____exports.clearChallenge(self)
|
|
27
29
|
if ____exports.onAnyChallenge(nil) then
|
|
28
|
-
|
|
30
|
+
local command = "challenge " .. tostring(Challenge.NULL)
|
|
31
|
+
log("Restarting the run to clear the current challenge with a console command of: " .. command)
|
|
32
|
+
Isaac.ExecuteCommand(command)
|
|
29
33
|
end
|
|
30
34
|
end
|
|
31
35
|
--- Get the final boss of a challenge. This will only work for vanilla challenges.
|
|
@@ -68,7 +72,9 @@ end
|
|
|
68
72
|
-- Under the hood, this function executes the `challenge 0` console command.
|
|
69
73
|
function ____exports.setChallenge(self, challenge)
|
|
70
74
|
if not ____exports.onChallenge(nil, challenge) then
|
|
71
|
-
|
|
75
|
+
local command = "challenge " .. tostring(challenge)
|
|
76
|
+
log("Restarting the run to set a challenge with a console command of: " .. command)
|
|
77
|
+
Isaac.ExecuteCommand(command)
|
|
72
78
|
end
|
|
73
79
|
end
|
|
74
80
|
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAGL,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAUtC,qDAAqD;AACrD,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAK9C;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAUlD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,UAAU,EAAE,CAO7C;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAKrC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAGtC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAkBpD;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,0BAA0B,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAGL,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAUtC,qDAAqD;AACrD,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAK9C;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAUlD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,UAAU,EAAE,CAO7C;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAKrC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAGtC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAkBpD;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,0BAA0B,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAQ1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
|
|
@@ -102,7 +102,9 @@ end
|
|
|
102
102
|
-- seed string (e.g. "AAJ2 8V9C").
|
|
103
103
|
function ____exports.setRunSeed(self, startSeedOrStartSeedString)
|
|
104
104
|
local startSeedString = isString(nil, startSeedOrStartSeedString) and startSeedOrStartSeedString or Seeds.Seed2String(startSeedOrStartSeedString)
|
|
105
|
-
|
|
105
|
+
local command = "seed " .. startSeedString
|
|
106
|
+
log("Restarting the run to set a seed with a console command of: " .. command)
|
|
107
|
+
Isaac.ExecuteCommand(command)
|
|
106
108
|
end
|
|
107
109
|
--- Helper function to change the run status to that of an unseeded run with a new random seed.
|
|
108
110
|
--
|
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
CHALLENGE_NAMES,
|
|
13
13
|
DEFAULT_CHALLENGE_NAME,
|
|
14
14
|
} from "../objects/challengeNames";
|
|
15
|
+
import { log } from "./log";
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Helper function to clear the current challenge, which will restart the run on a new random
|
|
@@ -23,7 +24,11 @@ import {
|
|
|
23
24
|
*/
|
|
24
25
|
export function clearChallenge(): void {
|
|
25
26
|
if (onAnyChallenge()) {
|
|
26
|
-
|
|
27
|
+
const command = `challenge ${Challenge.NULL}`;
|
|
28
|
+
log(
|
|
29
|
+
`Restarting the run to clear the current challenge with a console command of: ${command}`,
|
|
30
|
+
);
|
|
31
|
+
Isaac.ExecuteCommand(command);
|
|
27
32
|
}
|
|
28
33
|
}
|
|
29
34
|
|
|
@@ -92,6 +97,10 @@ export function onChallenge(...challenges: Challenge[]): boolean {
|
|
|
92
97
|
*/
|
|
93
98
|
export function setChallenge(challenge: Challenge): void {
|
|
94
99
|
if (!onChallenge(challenge)) {
|
|
95
|
-
|
|
100
|
+
const command = `challenge ${challenge}`;
|
|
101
|
+
log(
|
|
102
|
+
`Restarting the run to set a challenge with a console command of: ${command}`,
|
|
103
|
+
);
|
|
104
|
+
Isaac.ExecuteCommand(command);
|
|
96
105
|
}
|
|
97
106
|
}
|
package/src/functions/run.ts
CHANGED
|
@@ -136,7 +136,9 @@ export function setRunSeed(startSeedOrStartSeedString: Seed | string): void {
|
|
|
136
136
|
? startSeedOrStartSeedString
|
|
137
137
|
: Seeds.Seed2String(startSeedOrStartSeedString);
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
const command = `seed ${startSeedString}`;
|
|
140
|
+
log(`Restarting the run to set a seed with a console command of: ${command}`);
|
|
141
|
+
Isaac.ExecuteCommand(command);
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
/**
|