isaacscript-common 1.2.248 → 1.2.249

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.
@@ -0,0 +1,30 @@
1
+ export declare function easeInSine(x: number): number;
2
+ export declare function easeOutSine(x: number): number;
3
+ export declare function easeInOutSine(x: number): number;
4
+ export declare function easeInCubic(x: number): number;
5
+ export declare function easeOutCubic(x: number): number;
6
+ export declare function easeInOutCubic(x: number): number;
7
+ export declare function easeInQuint(x: number): number;
8
+ export declare function easeOutQuint(x: number): number;
9
+ export declare function easeInOutQuint(x: number): number;
10
+ export declare function easeInCirc(x: number): number;
11
+ export declare function easeOutCirc(x: number): number;
12
+ export declare function easeInOutCirc(x: number): number;
13
+ export declare function easeInElastic(x: number): number;
14
+ export declare function easeOutElastic(x: number): number;
15
+ export declare function easeInOutElastic(x: number): number;
16
+ export declare function easeInQuad(x: number): number;
17
+ export declare function easeOutQuad(x: number): number;
18
+ export declare function easeInOutQuad(x: number): number;
19
+ export declare function easeInQuart(x: number): number;
20
+ export declare function easeOutQuart(x: number): number;
21
+ export declare function easeInOutQuart(x: number): number;
22
+ export declare function easeInExpo(x: number): number;
23
+ export declare function easeOutExpo(x: number): number;
24
+ export declare function easeInOutExpo(x: number): number;
25
+ export declare function easeInBack(x: number): number;
26
+ export declare function easeOutBack(x: number): number;
27
+ export declare function easeInOutBack(x: number): number;
28
+ export declare function easeInBounce(x: number): number;
29
+ export declare function easeOutBounce(x: number): number;
30
+ export declare function easeInOutBounce(x: number): number;
@@ -0,0 +1,116 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____exports = {}
3
+ function ____exports.easeOutBounce(self, x)
4
+ local n1 = 7.5625
5
+ local d1 = 2.75
6
+ if x < 1 / d1 then
7
+ return n1 * x * x
8
+ end
9
+ if x < 2 / d1 then
10
+ x = x - 1.5 / d1
11
+ return n1 * x * x + 0.75
12
+ end
13
+ if x < 2.5 / d1 then
14
+ x = x - 2.25 / d1
15
+ return n1 * x * x + 0.9375
16
+ end
17
+ x = x - 2.625 / d1
18
+ return n1 * x * x + 0.984375
19
+ end
20
+ function ____exports.easeInSine(self, x)
21
+ return 1 - math.cos(x * math.pi / 2)
22
+ end
23
+ function ____exports.easeOutSine(self, x)
24
+ return math.sin(x * math.pi / 2)
25
+ end
26
+ function ____exports.easeInOutSine(self, x)
27
+ return -(math.cos(math.pi * x) - 1) / 2
28
+ end
29
+ function ____exports.easeInCubic(self, x)
30
+ return x * x * x
31
+ end
32
+ function ____exports.easeOutCubic(self, x)
33
+ return 1 - (1 - x) ^ 3
34
+ end
35
+ function ____exports.easeInOutCubic(self, x)
36
+ return x < 0.5 and 4 * x * x * x or 1 - (-2 * x + 2) ^ 3 / 2
37
+ end
38
+ function ____exports.easeInQuint(self, x)
39
+ return x * x * x * x * x
40
+ end
41
+ function ____exports.easeOutQuint(self, x)
42
+ return 1 - (1 - x) ^ 5
43
+ end
44
+ function ____exports.easeInOutQuint(self, x)
45
+ return x < 0.5 and 16 * x * x * x * x * x or 1 - (-2 * x + 2) ^ 5 / 2
46
+ end
47
+ function ____exports.easeInCirc(self, x)
48
+ return 1 - math.sqrt(1 - x ^ 2)
49
+ end
50
+ function ____exports.easeOutCirc(self, x)
51
+ return math.sqrt(1 - (x - 1) ^ 2)
52
+ end
53
+ function ____exports.easeInOutCirc(self, x)
54
+ return x < 0.5 and (1 - math.sqrt(1 - (2 * x) ^ 2)) / 2 or (math.sqrt(1 - (-2 * x + 2) ^ 2) + 1) / 2
55
+ end
56
+ function ____exports.easeInElastic(self, x)
57
+ local c4 = 2 * math.pi / 3
58
+ return x == 0 and 0 or (x == 1 and 1 or -2 ^ (10 * x - 10) * math.sin((x * 10 - 10.75) * c4))
59
+ end
60
+ function ____exports.easeOutElastic(self, x)
61
+ local c4 = 2 * math.pi / 3
62
+ return x == 0 and 0 or (x == 1 and 1 or 2 ^ (-10 * x) * math.sin((x * 10 - 0.75) * c4) + 1)
63
+ end
64
+ function ____exports.easeInOutElastic(self, x)
65
+ local c5 = 2 * math.pi / 4.5
66
+ return x == 0 and 0 or (x == 1 and 1 or (x < 0.5 and -(2 ^ (20 * x - 10) * math.sin((20 * x - 11.125) * c5)) / 2 or 2 ^ (-20 * x + 10) * math.sin((20 * x - 11.125) * c5) / 2 + 1))
67
+ end
68
+ function ____exports.easeInQuad(self, x)
69
+ return x * x
70
+ end
71
+ function ____exports.easeOutQuad(self, x)
72
+ return 1 - (1 - x) * (1 - x)
73
+ end
74
+ function ____exports.easeInOutQuad(self, x)
75
+ return x < 0.5 and 2 * x * x or 1 - (-2 * x + 2) ^ 2 / 2
76
+ end
77
+ function ____exports.easeInQuart(self, x)
78
+ return x * x * x * x
79
+ end
80
+ function ____exports.easeOutQuart(self, x)
81
+ return 1 - (1 - x) ^ 4
82
+ end
83
+ function ____exports.easeInOutQuart(self, x)
84
+ return x < 0.5 and 8 * x * x * x * x or 1 - (-2 * x + 2) ^ 4 / 2
85
+ end
86
+ function ____exports.easeInExpo(self, x)
87
+ return x == 0 and 0 or 2 ^ (10 * x - 10)
88
+ end
89
+ function ____exports.easeOutExpo(self, x)
90
+ return x == 1 and 1 or 1 - 2 ^ (-10 * x)
91
+ end
92
+ function ____exports.easeInOutExpo(self, x)
93
+ return x == 0 and 0 or (x == 1 and 1 or (x < 0.5 and 2 ^ (20 * x - 10) / 2 or (2 - 2 ^ (-20 * x + 10)) / 2))
94
+ end
95
+ function ____exports.easeInBack(self, x)
96
+ local c1 = 1.70158
97
+ local c3 = c1 + 1
98
+ return c3 * x * x * x - c1 * x * x
99
+ end
100
+ function ____exports.easeOutBack(self, x)
101
+ local c1 = 1.70158
102
+ local c3 = c1 + 1
103
+ return 1 + c3 * (x - 1) ^ 3 + c1 * (x - 1) ^ 2
104
+ end
105
+ function ____exports.easeInOutBack(self, x)
106
+ local c1 = 1.70158
107
+ local c2 = c1 * 1.525
108
+ return x < 0.5 and (2 * x) ^ 2 * ((c2 + 1) * 2 * x - c2) / 2 or ((2 * x - 2) ^ 2 * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2
109
+ end
110
+ function ____exports.easeInBounce(self, x)
111
+ return 1 - ____exports.easeOutBounce(nil, 1 - x)
112
+ end
113
+ function ____exports.easeInOutBounce(self, x)
114
+ return x < 0.5 and (1 - ____exports.easeOutBounce(nil, 1 - 2 * x)) / 2 or (1 + ____exports.easeOutBounce(nil, 2 * x - 1)) / 2
115
+ end
116
+ return ____exports
package/dist/index.d.ts CHANGED
@@ -45,6 +45,7 @@ export * from "./functions/debug";
45
45
  export { deepCopy } from "./functions/deepCopy";
46
46
  export { deepCopyTests } from "./functions/deepCopyTests";
47
47
  export * from "./functions/doors";
48
+ export * from "./functions/easing";
48
49
  export * from "./functions/entity";
49
50
  export * from "./functions/entitySpecific";
50
51
  export * from "./functions/familiars";
package/dist/index.lua CHANGED
@@ -363,6 +363,14 @@ do
363
363
  end
364
364
  end
365
365
  end
366
+ do
367
+ local ____export = require("functions.easing")
368
+ for ____exportKey, ____exportValue in pairs(____export) do
369
+ if ____exportKey ~= "default" then
370
+ ____exports[____exportKey] = ____exportValue
371
+ end
372
+ end
373
+ end
366
374
  do
367
375
  local ____export = require("functions.entity")
368
376
  for ____exportKey, ____exportValue in pairs(____export) do
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.248",
3
+ "version": "1.2.249",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",