isaacscript-common 9.0.1 → 9.2.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.
Files changed (37) hide show
  1. package/dist/callbacks/postPlayerCollectible.d.ts.map +1 -1
  2. package/dist/callbacks/postPlayerCollectible.lua +63 -58
  3. package/dist/enums/ModCallbackCustom.d.ts +4 -2
  4. package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
  5. package/dist/features/customTrapdoor/exports.d.ts +0 -6
  6. package/dist/features/customTrapdoor/exports.d.ts.map +1 -1
  7. package/dist/features/customTrapdoor/exports.lua +0 -6
  8. package/dist/features/playerInventory.d.ts.map +1 -1
  9. package/dist/features/playerInventory.lua +4 -48
  10. package/dist/features/saveDataManager/main.d.ts.map +1 -1
  11. package/dist/features/saveDataManager/main.lua +8 -0
  12. package/dist/functions/debug.d.ts +25 -0
  13. package/dist/functions/debug.d.ts.map +1 -1
  14. package/dist/functions/debug.lua +50 -0
  15. package/dist/functions/log.d.ts +2 -7
  16. package/dist/functions/log.d.ts.map +1 -1
  17. package/dist/functions/log.lua +9 -31
  18. package/dist/functions/stage.d.ts +7 -0
  19. package/dist/functions/stage.d.ts.map +1 -1
  20. package/dist/functions/stage.lua +9 -0
  21. package/dist/index.d.ts +14 -8
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.lua +0 -8
  24. package/package.json +1 -1
  25. package/src/callbacks/postPlayerCollectible.ts +126 -69
  26. package/src/enums/ModCallbackCustom.ts +4 -2
  27. package/src/features/customTrapdoor/exports.ts +0 -6
  28. package/src/features/playerInventory.ts +5 -61
  29. package/src/features/saveDataManager/main.ts +15 -0
  30. package/src/functions/debug.ts +49 -0
  31. package/src/functions/log.ts +15 -35
  32. package/src/functions/stage.ts +13 -0
  33. package/src/index.ts +0 -1
  34. package/dist/functions/dev.d.ts +0 -20
  35. package/dist/functions/dev.d.ts.map +0 -1
  36. package/dist/functions/dev.lua +0 -34
  37. package/src/functions/dev.ts +0 -31
@@ -178,6 +178,19 @@ export function onFinalFloor(): boolean {
178
178
  );
179
179
  }
180
180
 
181
+ /**
182
+ * Returns whether or not the player is on the first floor of the particular run.
183
+ *
184
+ * This is tricky to determine because we have to handle the cases of Downpour/Dross 1 not being the
185
+ * first floor and The Ascent.
186
+ */
187
+ export function onFirstFloor(): boolean {
188
+ const effectiveStage = getEffectiveStage();
189
+ const isOnAscent = onAscent();
190
+
191
+ return effectiveStage === 1 && !isOnAscent;
192
+ }
193
+
181
194
  export function onRepentanceStage(): boolean {
182
195
  const level = game.GetLevel();
183
196
  const stageType = level.GetStageType();
package/src/index.ts CHANGED
@@ -67,7 +67,6 @@ export * from "./functions/curses";
67
67
  export * from "./functions/debug";
68
68
  export * from "./functions/deepCopy";
69
69
  export * from "./functions/deepCopyTests";
70
- export * from "./functions/dev";
71
70
  export * from "./functions/dimensions";
72
71
  export * from "./functions/direction";
73
72
  export * from "./functions/doors";
@@ -1,20 +0,0 @@
1
- import { ModUpgraded } from "../classes/ModUpgraded";
2
- /**
3
- * Helper function to enable some IsaacScript features that are useful when developing a mod. They
4
- * should not be enabled when your mod goes to production (i.e. when it is uploaded to the Steam
5
- * Workshop).
6
- *
7
- * The list of development features that are enabled are as follows:
8
- *
9
- * - `saveDataManagerSetGlobal` - Sets your local variables registered with the save data manager as
10
- * global variables so you can access them from the in-game console.
11
- * - `setLogFunctionsGlobal` - Sets the various log functions global so that you can access them
12
- * from the in-game console.
13
- * - `enableExtraConsoleCommands` - Enables many extra in-game console commands that make warping
14
- * around easier (like e.g. `angel` to warp to the Angel Room).
15
- * - `enableFastReset` - Makes it so that the r key resets the game instantaneously.
16
- * - `removeFadeIn` - Removes the slow fade in that occurs at the beginning of the run, so that you
17
- * can immediately start playing or testing.
18
- */
19
- export declare function enableDevFeatures(mod: ModUpgraded): void;
20
- //# sourceMappingURL=dev.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/functions/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAOrD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAMxD"}
@@ -1,34 +0,0 @@
1
- local ____exports = {}
2
- local ____exports = require("features.extraConsoleCommands.exports")
3
- local enableExtraConsoleCommands = ____exports.enableExtraConsoleCommands
4
- local ____fadeInRemover = require("features.fadeInRemover")
5
- local removeFadeIn = ____fadeInRemover.removeFadeIn
6
- local ____fastReset = require("features.fastReset")
7
- local enableFastReset = ____fastReset.enableFastReset
8
- local ____exports = require("features.saveDataManager.exports")
9
- local saveDataManagerSetGlobal = ____exports.saveDataManagerSetGlobal
10
- local ____log = require("functions.log")
11
- local setLogFunctionsGlobal = ____log.setLogFunctionsGlobal
12
- --- Helper function to enable some IsaacScript features that are useful when developing a mod. They
13
- -- should not be enabled when your mod goes to production (i.e. when it is uploaded to the Steam
14
- -- Workshop).
15
- --
16
- -- The list of development features that are enabled are as follows:
17
- --
18
- -- - `saveDataManagerSetGlobal` - Sets your local variables registered with the save data manager as
19
- -- global variables so you can access them from the in-game console.
20
- -- - `setLogFunctionsGlobal` - Sets the various log functions global so that you can access them
21
- -- from the in-game console.
22
- -- - `enableExtraConsoleCommands` - Enables many extra in-game console commands that make warping
23
- -- around easier (like e.g. `angel` to warp to the Angel Room).
24
- -- - `enableFastReset` - Makes it so that the r key resets the game instantaneously.
25
- -- - `removeFadeIn` - Removes the slow fade in that occurs at the beginning of the run, so that you
26
- -- can immediately start playing or testing.
27
- function ____exports.enableDevFeatures(self, mod)
28
- saveDataManagerSetGlobal(nil)
29
- setLogFunctionsGlobal(nil)
30
- enableExtraConsoleCommands(nil, mod)
31
- enableFastReset(nil)
32
- removeFadeIn(nil)
33
- end
34
- return ____exports
@@ -1,31 +0,0 @@
1
- import { ModUpgraded } from "../classes/ModUpgraded";
2
- import { enableExtraConsoleCommands } from "../features/extraConsoleCommands/exports";
3
- import { removeFadeIn } from "../features/fadeInRemover";
4
- import { enableFastReset } from "../features/fastReset";
5
- import { saveDataManagerSetGlobal } from "../features/saveDataManager/exports";
6
- import { setLogFunctionsGlobal } from "./log";
7
-
8
- /**
9
- * Helper function to enable some IsaacScript features that are useful when developing a mod. They
10
- * should not be enabled when your mod goes to production (i.e. when it is uploaded to the Steam
11
- * Workshop).
12
- *
13
- * The list of development features that are enabled are as follows:
14
- *
15
- * - `saveDataManagerSetGlobal` - Sets your local variables registered with the save data manager as
16
- * global variables so you can access them from the in-game console.
17
- * - `setLogFunctionsGlobal` - Sets the various log functions global so that you can access them
18
- * from the in-game console.
19
- * - `enableExtraConsoleCommands` - Enables many extra in-game console commands that make warping
20
- * around easier (like e.g. `angel` to warp to the Angel Room).
21
- * - `enableFastReset` - Makes it so that the r key resets the game instantaneously.
22
- * - `removeFadeIn` - Removes the slow fade in that occurs at the beginning of the run, so that you
23
- * can immediately start playing or testing.
24
- */
25
- export function enableDevFeatures(mod: ModUpgraded): void {
26
- saveDataManagerSetGlobal();
27
- setLogFunctionsGlobal();
28
- enableExtraConsoleCommands(mod);
29
- enableFastReset();
30
- removeFadeIn();
31
- }