isaacscript-common 1.0.344 → 1.0.345
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.
|
@@ -45,16 +45,16 @@ function getCurrentHealthValue(self, player, healthType)
|
|
|
45
45
|
return player:GetHearts()
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
|
-
____cond10 = ____cond10 or (____switch10 == HealthType.
|
|
48
|
+
____cond10 = ____cond10 or (____switch10 == HealthType.SOUL)
|
|
49
49
|
if ____cond10 then
|
|
50
50
|
do
|
|
51
|
-
return player:
|
|
51
|
+
return player:GetSoulHearts()
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
|
-
____cond10 = ____cond10 or (____switch10 == HealthType.
|
|
54
|
+
____cond10 = ____cond10 or (____switch10 == HealthType.ETERNAL)
|
|
55
55
|
if ____cond10 then
|
|
56
56
|
do
|
|
57
|
-
return player:
|
|
57
|
+
return player:GetEternalHearts()
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
____cond10 = ____cond10 or (____switch10 == HealthType.BLACK)
|
|
@@ -63,22 +63,22 @@ function getCurrentHealthValue(self, player, healthType)
|
|
|
63
63
|
return player:GetBlackHearts()
|
|
64
64
|
end
|
|
65
65
|
end
|
|
66
|
-
____cond10 = ____cond10 or (____switch10 == HealthType.
|
|
66
|
+
____cond10 = ____cond10 or (____switch10 == HealthType.GOLDEN)
|
|
67
67
|
if ____cond10 then
|
|
68
68
|
do
|
|
69
|
-
return player:
|
|
69
|
+
return player:GetGoldenHearts()
|
|
70
70
|
end
|
|
71
71
|
end
|
|
72
|
-
____cond10 = ____cond10 or (____switch10 == HealthType.
|
|
72
|
+
____cond10 = ____cond10 or (____switch10 == HealthType.BONE)
|
|
73
73
|
if ____cond10 then
|
|
74
74
|
do
|
|
75
|
-
return player:
|
|
75
|
+
return player:GetBoneHearts()
|
|
76
76
|
end
|
|
77
77
|
end
|
|
78
|
-
____cond10 = ____cond10 or (____switch10 == HealthType.
|
|
78
|
+
____cond10 = ____cond10 or (____switch10 == HealthType.ROTTEN)
|
|
79
79
|
if ____cond10 then
|
|
80
80
|
do
|
|
81
|
-
return player:
|
|
81
|
+
return player:GetRottenHearts()
|
|
82
82
|
end
|
|
83
83
|
end
|
|
84
84
|
____cond10 = ____cond10 or (____switch10 == HealthType.MAX_HEARTS)
|
package/dist/functions/math.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
export declare function getAngleDifference(angle1: float, angle2: float): float;
|
|
3
|
+
export declare function getCircleDiscretizedPoints(centerPos: Vector, distance: int, numPoints: int): Vector[];
|
|
3
4
|
export declare function isEven(num: int): boolean;
|
|
4
5
|
export declare function isOdd(num: int): boolean;
|
|
5
6
|
/**
|
package/dist/functions/math.lua
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
require("lualib_bundle");
|
|
2
3
|
local ____exports = {}
|
|
3
4
|
function ____exports.getAngleDifference(self, angle1, angle2)
|
|
4
5
|
local subtractedAngle = angle1 - angle2
|
|
5
6
|
return ((subtractedAngle + 180) % 360) - 180
|
|
6
7
|
end
|
|
8
|
+
function ____exports.getCircleDiscretizedPoints(self, centerPos, distance, numPoints)
|
|
9
|
+
local positions = {}
|
|
10
|
+
local leftOfCenter = Vector(-distance, 0)
|
|
11
|
+
do
|
|
12
|
+
local i = 0
|
|
13
|
+
while i < numPoints do
|
|
14
|
+
local rotatedPosition = leftOfCenter:Rotated((i * 360) / numPoints)
|
|
15
|
+
local positionFromCenter = centerPos + rotatedPosition
|
|
16
|
+
__TS__ArrayPush(positions, positionFromCenter)
|
|
17
|
+
i = i + 1
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
return positions
|
|
21
|
+
end
|
|
7
22
|
function ____exports.isEven(self, num)
|
|
8
23
|
return (num & 1) == 0
|
|
9
24
|
end
|
|
@@ -138,10 +138,10 @@ function ____exports.getLastHeart(self, player)
|
|
|
138
138
|
end
|
|
139
139
|
return HealthType.RED
|
|
140
140
|
end
|
|
141
|
-
local numBits = getNumBitsOfN(nil, blackHearts)
|
|
142
|
-
local finalBit = getKBitOfN(nil, numBits - 1, blackHearts)
|
|
143
|
-
local isBlack = finalBit == 1
|
|
144
141
|
if soulHearts > 0 then
|
|
142
|
+
local numBits = getNumBitsOfN(nil, blackHearts)
|
|
143
|
+
local finalBit = getKBitOfN(nil, numBits - 1, blackHearts)
|
|
144
|
+
local isBlack = finalBit == 1
|
|
145
145
|
if isBlack then
|
|
146
146
|
return HealthType.BLACK
|
|
147
147
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.345",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"dist/**/*.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^1.0.
|
|
28
|
+
"isaac-typescript-definitions": "^1.0.230",
|
|
29
29
|
"isaacscript-lint": "^1.0.63",
|
|
30
30
|
"typedoc": "^0.22.5",
|
|
31
|
-
"typescript": "4.4.
|
|
31
|
+
"typescript": "4.4.4",
|
|
32
32
|
"typescript-to-lua": "^1.0.1"
|
|
33
33
|
}
|
|
34
34
|
}
|