isaacscript-common 1.0.596 → 1.0.597

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.
@@ -11,6 +11,7 @@ export declare function getStage(): LevelStage;
11
11
  export declare function getStageType(): StageType;
12
12
  /** Helper function to directly warp to a specific stage using the "stage" console command. */
13
13
  export declare function goToStage(stage: LevelStage, stageType: StageType): void;
14
+ export declare function isRepentanceStage(stageType: int): boolean;
14
15
  export declare function onCathedral(): boolean;
15
16
  export declare function onChest(): boolean;
16
17
  export declare function onDarkRoom(): boolean;
@@ -2,47 +2,50 @@
2
2
  local ____exports = {}
3
3
  local ____util = require("functions.util")
4
4
  local ensureAllCases = ____util.ensureAllCases
5
+ function ____exports.isRepentanceStage(self, stageType)
6
+ return stageType == StageType.STAGETYPE_REPENTANCE or stageType == StageType.STAGETYPE_REPENTANCE_B
7
+ end
5
8
  function ____exports.onRepentanceStage(self)
6
9
  local game = Game()
7
10
  local level = game:GetLevel()
8
11
  local stageType = level:GetStageType()
9
- return stageType == StageType.STAGETYPE_REPENTANCE or stageType == StageType.STAGETYPE_REPENTANCE_B
12
+ return ____exports.isRepentanceStage(nil, stageType)
10
13
  end
11
14
  function ____exports.stageTypeToLetter(self, stageType)
12
15
  repeat
13
- local ____switch14 = stageType
14
- local ____cond14 = ____switch14 == StageType.STAGETYPE_ORIGINAL
15
- if ____cond14 then
16
+ local ____switch15 = stageType
17
+ local ____cond15 = ____switch15 == StageType.STAGETYPE_ORIGINAL
18
+ if ____cond15 then
16
19
  do
17
20
  return ""
18
21
  end
19
22
  end
20
- ____cond14 = ____cond14 or ____switch14 == StageType.STAGETYPE_WOTL
21
- if ____cond14 then
23
+ ____cond15 = ____cond15 or ____switch15 == StageType.STAGETYPE_WOTL
24
+ if ____cond15 then
22
25
  do
23
26
  return "a"
24
27
  end
25
28
  end
26
- ____cond14 = ____cond14 or ____switch14 == StageType.STAGETYPE_AFTERBIRTH
27
- if ____cond14 then
29
+ ____cond15 = ____cond15 or ____switch15 == StageType.STAGETYPE_AFTERBIRTH
30
+ if ____cond15 then
28
31
  do
29
32
  return "b"
30
33
  end
31
34
  end
32
- ____cond14 = ____cond14 or ____switch14 == StageType.STAGETYPE_GREEDMODE
33
- if ____cond14 then
35
+ ____cond15 = ____cond15 or ____switch15 == StageType.STAGETYPE_GREEDMODE
36
+ if ____cond15 then
34
37
  do
35
38
  return ""
36
39
  end
37
40
  end
38
- ____cond14 = ____cond14 or ____switch14 == StageType.STAGETYPE_REPENTANCE
39
- if ____cond14 then
41
+ ____cond15 = ____cond15 or ____switch15 == StageType.STAGETYPE_REPENTANCE
42
+ if ____cond15 then
40
43
  do
41
44
  return "c"
42
45
  end
43
46
  end
44
- ____cond14 = ____cond14 or ____switch14 == StageType.STAGETYPE_REPENTANCE_B
45
- if ____cond14 then
47
+ ____cond15 = ____cond15 or ____switch15 == StageType.STAGETYPE_REPENTANCE_B
48
+ if ____cond15 then
46
49
  do
47
50
  return "d"
48
51
  end
@@ -1335,6 +1335,15 @@ Map = Map
1335
1335
 
1336
1336
  __TS__MathAtan2 = math.atan2 or math.atan
1337
1337
 
1338
+ function __TS__MathSign(val)
1339
+ if val > 0 then
1340
+ return 1
1341
+ elseif val < 0 then
1342
+ return -1
1343
+ end
1344
+ return 0
1345
+ end
1346
+
1338
1347
  function __TS__Number(value)
1339
1348
  local valueType = type(value)
1340
1349
  if valueType == "number" then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.596",
3
+ "version": "1.0.597",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",
@@ -28,8 +28,8 @@
28
28
  "isaac-typescript-definitions": "^1.0.331",
29
29
  "isaacscript-lint": "^1.0.79",
30
30
  "isaacscript-tsconfig": "^1.1.8",
31
- "typedoc": "^0.22.10",
32
- "typescript": "^4.5.4",
33
- "typescript-to-lua": "^1.3.1"
31
+ "typedoc": "^0.22.11",
32
+ "typescript": "^4.5.5",
33
+ "typescript-to-lua": "^1.3.3"
34
34
  }
35
35
  }