redscript-mc 3.0.1 → 3.0.2

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 (225) hide show
  1. package/.github/workflows/ci.yml +1 -0
  2. package/README.md +119 -313
  3. package/README.zh.md +118 -314
  4. package/ROADMAP.md +5 -5
  5. package/dist/data/impl_test/function/counter/get.mcfunction +5 -0
  6. package/dist/data/impl_test/function/counter/inc.mcfunction +7 -0
  7. package/dist/data/impl_test/function/counter/new.mcfunction +4 -0
  8. package/dist/data/impl_test/function/load.mcfunction +1 -0
  9. package/dist/data/impl_test/function/test_impl.mcfunction +10 -0
  10. package/dist/data/minecraft/tags/function/load.json +5 -0
  11. package/dist/data/playground/function/load.mcfunction +1 -0
  12. package/dist/data/playground/function/start.mcfunction +4 -0
  13. package/dist/data/playground/function/start__say_macro_t1.mcfunction +1 -0
  14. package/dist/data/playground/function/stop.mcfunction +5 -0
  15. package/dist/data/playground/function/stop__say_macro_t0.mcfunction +1 -0
  16. package/dist/data/stdlib_queue8_test/function/__queue_append_apply.mcfunction +4 -0
  17. package/dist/data/stdlib_queue8_test/function/__queue_peek_apply.mcfunction +4 -0
  18. package/dist/data/stdlib_queue8_test/function/__queue_size_raw_apply.mcfunction +4 -0
  19. package/dist/data/stdlib_queue8_test/function/load.mcfunction +1 -0
  20. package/dist/data/stdlib_queue8_test/function/queue_clear.mcfunction +6 -0
  21. package/dist/data/stdlib_queue8_test/function/queue_empty__merge_1.mcfunction +5 -0
  22. package/dist/data/stdlib_queue8_test/function/queue_empty__then_0.mcfunction +5 -0
  23. package/dist/data/stdlib_queue8_test/function/queue_peek__merge_1.mcfunction +13 -0
  24. package/dist/data/stdlib_queue8_test/function/queue_peek__then_0.mcfunction +5 -0
  25. package/dist/data/stdlib_queue8_test/function/queue_pop__merge_1.mcfunction +15 -0
  26. package/dist/data/stdlib_queue8_test/function/queue_pop__then_0.mcfunction +5 -0
  27. package/dist/data/stdlib_queue8_test/function/queue_push__const_11.mcfunction +6 -0
  28. package/dist/data/stdlib_queue8_test/function/queue_push__const_22.mcfunction +6 -0
  29. package/dist/data/stdlib_queue8_test/function/queue_size.mcfunction +13 -0
  30. package/dist/data/stdlib_queue8_test/function/test_queue_push_and_size.mcfunction +13 -0
  31. package/dist/data/test/function/load.mcfunction +1 -0
  32. package/dist/data/test/function/say_at.mcfunction +6 -0
  33. package/dist/data/test/function/test.mcfunction +4 -0
  34. package/dist/pack.mcmeta +6 -0
  35. package/dist/package.json +1 -1
  36. package/dist/src/__tests__/formatter-extra.test.d.ts +7 -0
  37. package/dist/src/__tests__/formatter-extra.test.js +123 -0
  38. package/dist/src/__tests__/global-vars.test.d.ts +13 -0
  39. package/dist/src/__tests__/global-vars.test.js +156 -0
  40. package/dist/src/__tests__/lint/new-rules.test.d.ts +9 -0
  41. package/dist/src/__tests__/lint/new-rules.test.js +402 -0
  42. package/dist/src/__tests__/lsp-rename.test.d.ts +8 -0
  43. package/dist/src/__tests__/lsp-rename.test.js +157 -0
  44. package/dist/src/__tests__/mc-integration/say-fstring.test.d.ts +11 -0
  45. package/dist/src/__tests__/mc-integration/say-fstring.test.js +220 -0
  46. package/dist/src/__tests__/mc-integration/stdlib-coverage-2.test.js +1 -1
  47. package/dist/src/__tests__/mc-integration/stdlib-coverage-3.test.js +1 -1
  48. package/dist/src/__tests__/mc-integration/stdlib-coverage-4.test.js +1 -1
  49. package/dist/src/__tests__/mc-integration/stdlib-coverage-5.test.js +1 -1
  50. package/dist/src/__tests__/mc-integration/stdlib-coverage-6.test.js +1 -1
  51. package/dist/src/__tests__/mc-integration/stdlib-coverage-7.test.js +1 -1
  52. package/dist/src/__tests__/mc-integration/stdlib-coverage-8.test.js +1 -1
  53. package/dist/src/__tests__/mc-syntax.test.js +4 -1
  54. package/dist/src/__tests__/monomorphize-coverage.test.d.ts +9 -0
  55. package/dist/src/__tests__/monomorphize-coverage.test.js +204 -0
  56. package/dist/src/__tests__/optimizer-cse.test.d.ts +7 -0
  57. package/dist/src/__tests__/optimizer-cse.test.js +226 -0
  58. package/dist/src/__tests__/parser.test.js +4 -13
  59. package/dist/src/__tests__/repl-server-extra.test.js +6 -7
  60. package/dist/src/__tests__/repl-server.test.js +5 -7
  61. package/dist/src/__tests__/stdlib/queue.test.js +6 -6
  62. package/dist/src/cli.js +0 -0
  63. package/dist/src/lexer/index.js +2 -1
  64. package/dist/src/lint/index.d.ts +12 -5
  65. package/dist/src/lint/index.js +730 -5
  66. package/dist/src/lsp/main.js +0 -0
  67. package/dist/src/mc-test/client.d.ts +21 -0
  68. package/dist/src/mc-test/client.js +34 -0
  69. package/dist/src/mir/lower.js +108 -6
  70. package/dist/src/optimizer/interprocedural.js +37 -2
  71. package/dist/src/parser/decl-parser.d.ts +19 -0
  72. package/dist/src/parser/decl-parser.js +323 -0
  73. package/dist/src/parser/expr-parser.d.ts +46 -0
  74. package/dist/src/parser/expr-parser.js +759 -0
  75. package/dist/src/parser/index.d.ts +8 -129
  76. package/dist/src/parser/index.js +13 -2262
  77. package/dist/src/parser/stmt-parser.d.ts +28 -0
  78. package/dist/src/parser/stmt-parser.js +577 -0
  79. package/dist/src/parser/type-parser.d.ts +20 -0
  80. package/dist/src/parser/type-parser.js +257 -0
  81. package/dist/src/parser/utils.d.ts +34 -0
  82. package/dist/src/parser/utils.js +141 -0
  83. package/docs/dev/README-mc-integration-tests.md +141 -0
  84. package/docs/lint-rules.md +162 -0
  85. package/docs/stdlib/bigint.md +2 -0
  86. package/editors/vscode/README.md +63 -41
  87. package/editors/vscode/out/extension.js +1881 -1776
  88. package/editors/vscode/out/lsp-server.js +4257 -3651
  89. package/editors/vscode/package-lock.json +3 -3
  90. package/editors/vscode/package.json +1 -1
  91. package/examples/loops-demo.mcrs +87 -0
  92. package/package.json +1 -1
  93. package/redscript-docs/docs/en/stdlib/advanced.md +629 -0
  94. package/redscript-docs/docs/en/stdlib/bigint.md +316 -0
  95. package/redscript-docs/docs/en/stdlib/bits.md +292 -0
  96. package/redscript-docs/docs/en/stdlib/bossbar.md +177 -0
  97. package/redscript-docs/docs/en/stdlib/calculus.md +289 -0
  98. package/redscript-docs/docs/en/stdlib/color.md +353 -0
  99. package/redscript-docs/docs/en/stdlib/combat.md +88 -0
  100. package/redscript-docs/docs/en/stdlib/cooldown.md +82 -0
  101. package/redscript-docs/docs/en/stdlib/dialog.md +155 -0
  102. package/redscript-docs/docs/en/stdlib/easing.md +558 -0
  103. package/redscript-docs/docs/en/stdlib/ecs.md +475 -0
  104. package/redscript-docs/docs/en/stdlib/effects.md +324 -0
  105. package/redscript-docs/docs/en/stdlib/events.md +3 -0
  106. package/redscript-docs/docs/en/stdlib/expr.md +45 -0
  107. package/redscript-docs/docs/en/stdlib/fft.md +141 -0
  108. package/redscript-docs/docs/en/stdlib/geometry.md +430 -0
  109. package/redscript-docs/docs/en/stdlib/graph.md +259 -0
  110. package/redscript-docs/docs/en/stdlib/heap.md +185 -0
  111. package/redscript-docs/docs/en/stdlib/interactions.md +179 -0
  112. package/redscript-docs/docs/en/stdlib/inventory.md +97 -0
  113. package/redscript-docs/docs/en/stdlib/linalg.md +557 -0
  114. package/redscript-docs/docs/en/stdlib/list.md +559 -0
  115. package/redscript-docs/docs/en/stdlib/map.md +140 -0
  116. package/redscript-docs/docs/en/stdlib/math.md +193 -0
  117. package/redscript-docs/docs/en/stdlib/math_hp.md +149 -0
  118. package/redscript-docs/docs/en/stdlib/matrix.md +403 -0
  119. package/redscript-docs/docs/en/stdlib/mobs.md +965 -0
  120. package/redscript-docs/docs/en/stdlib/noise.md +244 -0
  121. package/redscript-docs/docs/en/stdlib/ode.md +253 -0
  122. package/redscript-docs/docs/en/stdlib/parabola.md +342 -0
  123. package/redscript-docs/docs/en/stdlib/particles.md +311 -0
  124. package/redscript-docs/docs/en/stdlib/pathfind.md +255 -0
  125. package/redscript-docs/docs/en/stdlib/physics.md +493 -0
  126. package/redscript-docs/docs/en/stdlib/player.md +78 -0
  127. package/redscript-docs/docs/en/stdlib/quaternion.md +673 -0
  128. package/redscript-docs/docs/en/stdlib/queue.md +134 -0
  129. package/redscript-docs/docs/en/stdlib/random.md +223 -0
  130. package/redscript-docs/docs/en/stdlib/result.md +143 -0
  131. package/redscript-docs/docs/en/stdlib/scheduler.md +183 -0
  132. package/redscript-docs/docs/en/stdlib/set_int.md +190 -0
  133. package/redscript-docs/docs/en/stdlib/sets.md +101 -0
  134. package/redscript-docs/docs/en/stdlib/signal.md +400 -0
  135. package/redscript-docs/docs/en/stdlib/sort.md +104 -0
  136. package/redscript-docs/docs/en/stdlib/spawn.md +147 -0
  137. package/redscript-docs/docs/en/stdlib/state.md +142 -0
  138. package/redscript-docs/docs/en/stdlib/strings.md +154 -0
  139. package/redscript-docs/docs/en/stdlib/tags.md +3451 -0
  140. package/redscript-docs/docs/en/stdlib/teams.md +153 -0
  141. package/redscript-docs/docs/en/stdlib/timer.md +246 -0
  142. package/redscript-docs/docs/en/stdlib/vec.md +158 -0
  143. package/redscript-docs/docs/en/stdlib/world.md +298 -0
  144. package/redscript-docs/docs/zh/stdlib/advanced.md +615 -0
  145. package/redscript-docs/docs/zh/stdlib/bigint.md +316 -0
  146. package/redscript-docs/docs/zh/stdlib/bits.md +292 -0
  147. package/redscript-docs/docs/zh/stdlib/bossbar.md +170 -0
  148. package/redscript-docs/docs/zh/stdlib/calculus.md +287 -0
  149. package/redscript-docs/docs/zh/stdlib/color.md +353 -0
  150. package/redscript-docs/docs/zh/stdlib/combat.md +88 -0
  151. package/redscript-docs/docs/zh/stdlib/cooldown.md +84 -0
  152. package/redscript-docs/docs/zh/stdlib/dialog.md +152 -0
  153. package/redscript-docs/docs/zh/stdlib/easing.md +558 -0
  154. package/redscript-docs/docs/zh/stdlib/ecs.md +472 -0
  155. package/redscript-docs/docs/zh/stdlib/effects.md +324 -0
  156. package/redscript-docs/docs/zh/stdlib/events.md +3 -0
  157. package/redscript-docs/docs/zh/stdlib/expr.md +37 -0
  158. package/redscript-docs/docs/zh/stdlib/fft.md +128 -0
  159. package/redscript-docs/docs/zh/stdlib/geometry.md +430 -0
  160. package/redscript-docs/docs/zh/stdlib/graph.md +259 -0
  161. package/redscript-docs/docs/zh/stdlib/heap.md +185 -0
  162. package/redscript-docs/docs/zh/stdlib/interactions.md +160 -0
  163. package/redscript-docs/docs/zh/stdlib/inventory.md +94 -0
  164. package/redscript-docs/docs/zh/stdlib/linalg.md +543 -0
  165. package/redscript-docs/docs/zh/stdlib/list.md +561 -0
  166. package/redscript-docs/docs/zh/stdlib/map.md +132 -0
  167. package/redscript-docs/docs/zh/stdlib/math.md +193 -0
  168. package/redscript-docs/docs/zh/stdlib/math_hp.md +143 -0
  169. package/redscript-docs/docs/zh/stdlib/matrix.md +396 -0
  170. package/redscript-docs/docs/zh/stdlib/mobs.md +965 -0
  171. package/redscript-docs/docs/zh/stdlib/noise.md +244 -0
  172. package/redscript-docs/docs/zh/stdlib/ode.md +243 -0
  173. package/redscript-docs/docs/zh/stdlib/parabola.md +337 -0
  174. package/redscript-docs/docs/zh/stdlib/particles.md +307 -0
  175. package/redscript-docs/docs/zh/stdlib/pathfind.md +255 -0
  176. package/redscript-docs/docs/zh/stdlib/physics.md +493 -0
  177. package/redscript-docs/docs/zh/stdlib/player.md +78 -0
  178. package/redscript-docs/docs/zh/stdlib/quaternion.md +669 -0
  179. package/redscript-docs/docs/zh/stdlib/queue.md +124 -0
  180. package/redscript-docs/docs/zh/stdlib/random.md +222 -0
  181. package/redscript-docs/docs/zh/stdlib/result.md +147 -0
  182. package/redscript-docs/docs/zh/stdlib/scheduler.md +173 -0
  183. package/redscript-docs/docs/zh/stdlib/set_int.md +180 -0
  184. package/redscript-docs/docs/zh/stdlib/sets.md +107 -0
  185. package/redscript-docs/docs/zh/stdlib/signal.md +373 -0
  186. package/redscript-docs/docs/zh/stdlib/sort.md +104 -0
  187. package/redscript-docs/docs/zh/stdlib/spawn.md +142 -0
  188. package/redscript-docs/docs/zh/stdlib/state.md +134 -0
  189. package/redscript-docs/docs/zh/stdlib/strings.md +107 -0
  190. package/redscript-docs/docs/zh/stdlib/tags.md +3451 -0
  191. package/redscript-docs/docs/zh/stdlib/teams.md +150 -0
  192. package/redscript-docs/docs/zh/stdlib/timer.md +254 -0
  193. package/redscript-docs/docs/zh/stdlib/vec.md +158 -0
  194. package/redscript-docs/docs/zh/stdlib/world.md +289 -0
  195. package/src/__tests__/formatter-extra.test.ts +139 -0
  196. package/src/__tests__/global-vars.test.ts +171 -0
  197. package/src/__tests__/lint/new-rules.test.ts +437 -0
  198. package/src/__tests__/lsp-rename.test.ts +171 -0
  199. package/src/__tests__/mc-integration/say-fstring.test.ts +211 -0
  200. package/src/__tests__/mc-integration/stdlib-coverage-2.test.ts +1 -1
  201. package/src/__tests__/mc-integration/stdlib-coverage-3.test.ts +1 -1
  202. package/src/__tests__/mc-integration/stdlib-coverage-4.test.ts +1 -1
  203. package/src/__tests__/mc-integration/stdlib-coverage-5.test.ts +1 -1
  204. package/src/__tests__/mc-integration/stdlib-coverage-6.test.ts +1 -1
  205. package/src/__tests__/mc-integration/stdlib-coverage-7.test.ts +1 -1
  206. package/src/__tests__/mc-integration/stdlib-coverage-8.test.ts +1 -1
  207. package/src/__tests__/mc-syntax.test.ts +3 -0
  208. package/src/__tests__/monomorphize-coverage.test.ts +220 -0
  209. package/src/__tests__/optimizer-cse.test.ts +250 -0
  210. package/src/__tests__/parser.test.ts +4 -13
  211. package/src/__tests__/repl-server-extra.test.ts +6 -6
  212. package/src/__tests__/repl-server.test.ts +5 -6
  213. package/src/__tests__/stdlib/queue.test.ts +6 -6
  214. package/src/lexer/index.ts +2 -1
  215. package/src/lint/index.ts +713 -5
  216. package/src/mc-test/client.ts +40 -0
  217. package/src/mir/lower.ts +111 -2
  218. package/src/optimizer/interprocedural.ts +40 -2
  219. package/src/parser/decl-parser.ts +349 -0
  220. package/src/parser/expr-parser.ts +838 -0
  221. package/src/parser/index.ts +17 -2558
  222. package/src/parser/stmt-parser.ts +585 -0
  223. package/src/parser/type-parser.ts +276 -0
  224. package/src/parser/utils.ts +173 -0
  225. package/src/stdlib/queue.mcrs +19 -6
@@ -0,0 +1,558 @@
1
+ # Easing
2
+
3
+ > 本文档由 `src/stdlib/easing.mcrs` 自动生成,请勿手动编辑。
4
+
5
+ ## API 列表
6
+
7
+ - [ease_linear](#ease-linear)
8
+ - [ease_in_quad](#ease-in-quad)
9
+ - [ease_out_quad](#ease-out-quad)
10
+ - [ease_in_out_quad](#ease-in-out-quad)
11
+ - [ease_in_cubic](#ease-in-cubic)
12
+ - [ease_out_cubic](#ease-out-cubic)
13
+ - [ease_in_out_cubic](#ease-in-out-cubic)
14
+ - [ease_in_quart](#ease-in-quart)
15
+ - [ease_out_quart](#ease-out-quart)
16
+ - [ease_in_sine](#ease-in-sine)
17
+ - [ease_out_sine](#ease-out-sine)
18
+ - [ease_in_out_sine](#ease-in-out-sine)
19
+ - [ease_in_expo](#ease-in-expo)
20
+ - [ease_out_expo](#ease-out-expo)
21
+ - [ease_in_back](#ease-in-back)
22
+ - [ease_out_back](#ease-out-back)
23
+ - [ease_in_out_back](#ease-in-out-back)
24
+ - [ease_out_bounce](#ease-out-bounce)
25
+ - [ease_in_bounce](#ease-in-bounce)
26
+ - [ease_in_out_bounce](#ease-in-out-bounce)
27
+ - [ease_smooth](#ease-smooth)
28
+ - [ease_smoother](#ease-smoother)
29
+
30
+ ---
31
+
32
+ ## `ease_linear` <Badge type="info" text="v1.0.0" />
33
+
34
+ 线性缓动,无加速或减速
35
+
36
+ ```redscript
37
+ fn ease_linear(t: int): int
38
+ ```
39
+
40
+ **参数**
41
+
42
+ | 参数 | 说明 |
43
+ |------|------|
44
+ | `t` | 进度 ×10000,范围 [0, 10000] |
45
+
46
+ **返回:** t(恒等函数)
47
+
48
+ **示例**
49
+
50
+ ```redscript
51
+ let v: int = ease_linear(5000) // result: 5000 (50%)
52
+ ```
53
+
54
+ ---
55
+
56
+ ## `ease_in_quad` <Badge type="info" text="v1.0.0" />
57
+
58
+ 二次方缓入,慢开始快结束
59
+
60
+ ```redscript
61
+ fn ease_in_quad(t: int): int
62
+ ```
63
+
64
+ **参数**
65
+
66
+ | 参数 | 说明 |
67
+ |------|------|
68
+ | `t` | 进度 ×10000 |
69
+
70
+ **返回:** t²
71
+
72
+ **示例**
73
+
74
+ ```redscript
75
+ let v: int = ease_in_quad(5000) // result: 2500 (25%)
76
+ ```
77
+
78
+ ---
79
+
80
+ ## `ease_out_quad` <Badge type="info" text="v1.0.0" />
81
+
82
+ 二次方缓出,快开始慢结束
83
+
84
+ ```redscript
85
+ fn ease_out_quad(t: int): int
86
+ ```
87
+
88
+ **参数**
89
+
90
+ | 参数 | 说明 |
91
+ |------|------|
92
+ | `t` | 进度 ×10000 |
93
+
94
+ **返回:** 1 - (1-t)²
95
+
96
+ **示例**
97
+
98
+ ```redscript
99
+ let v: int = ease_out_quad(5000) // result: 7500 (75%)
100
+ ```
101
+
102
+ ---
103
+
104
+ ## `ease_in_out_quad` <Badge type="info" text="v1.0.0" />
105
+
106
+ 二次方缓入缓出,两端慢中间快
107
+
108
+ ```redscript
109
+ fn ease_in_out_quad(t: int): int
110
+ ```
111
+
112
+ **参数**
113
+
114
+ | 参数 | 说明 |
115
+ |------|------|
116
+ | `t` | 进度 ×10000 |
117
+
118
+ **返回:** 前半段 2t²,后半段 1 - 2*(1-t)²
119
+
120
+ **示例**
121
+
122
+ ```redscript
123
+ let v: int = ease_in_out_quad(2500) // result: 1250 (12.5%)
124
+ ```
125
+
126
+ ---
127
+
128
+ ## `ease_in_cubic` <Badge type="info" text="v1.0.0" />
129
+
130
+ 三次方缓入(比二次方更强烈)
131
+
132
+ ```redscript
133
+ fn ease_in_cubic(t: int): int
134
+ ```
135
+
136
+ **参数**
137
+
138
+ | 参数 | 说明 |
139
+ |------|------|
140
+ | `t` | 进度 ×10000 |
141
+
142
+ **返回:** t³
143
+
144
+ **示例**
145
+
146
+ ```redscript
147
+ let v: int = ease_in_cubic(5000) // result: 1250 (12.5%)
148
+ ```
149
+
150
+ ---
151
+
152
+ ## `ease_out_cubic` <Badge type="info" text="v1.0.0" />
153
+
154
+ 三次方缓出
155
+
156
+ ```redscript
157
+ fn ease_out_cubic(t: int): int
158
+ ```
159
+
160
+ **参数**
161
+
162
+ | 参数 | 说明 |
163
+ |------|------|
164
+ | `t` | 进度 ×10000 |
165
+
166
+ **返回:** 1 - (1-t)³
167
+
168
+ **示例**
169
+
170
+ ```redscript
171
+ let v: int = ease_out_cubic(5000) // result: 8750 (87.5%)
172
+ ```
173
+
174
+ ---
175
+
176
+ ## `ease_in_out_cubic` <Badge type="info" text="v1.0.0" />
177
+
178
+ Cubic ease-in-out — slow start and end, fast middle (stronger than quadratic).
179
+
180
+ ```redscript
181
+ fn ease_in_out_cubic(t: int): int
182
+ ```
183
+
184
+ **参数**
185
+
186
+ | 参数 | 说明 |
187
+ |------|------|
188
+ | `t` | Progress ×10000, range [0, 10000] |
189
+
190
+ **返回:** 4t³ for t < 0.5, else 1 - 4*(1-t)³
191
+
192
+ **示例**
193
+
194
+ ```redscript
195
+ let v: int = ease_in_out_cubic(5000) // result: 5000 (50%)
196
+ ```
197
+
198
+ ---
199
+
200
+ ## `ease_in_quart` <Badge type="info" text="v1.0.0" />
201
+
202
+ Quartic ease-in — very slow start, very fast end (t⁴).
203
+
204
+ ```redscript
205
+ fn ease_in_quart(t: int): int
206
+ ```
207
+
208
+ **参数**
209
+
210
+ | 参数 | 说明 |
211
+ |------|------|
212
+ | `t` | Progress ×10000, range [0, 10000] |
213
+
214
+ **返回:** t⁴
215
+
216
+ **示例**
217
+
218
+ ```redscript
219
+ let v: int = ease_in_quart(5000) // result: 625 (6.25%)
220
+ ```
221
+
222
+ ---
223
+
224
+ ## `ease_out_quart` <Badge type="info" text="v1.0.0" />
225
+
226
+ Quartic ease-out — very fast start, very slow end (1 - (1-t)⁴).
227
+
228
+ ```redscript
229
+ fn ease_out_quart(t: int): int
230
+ ```
231
+
232
+ **参数**
233
+
234
+ | 参数 | 说明 |
235
+ |------|------|
236
+ | `t` | Progress ×10000, range [0, 10000] |
237
+
238
+ **返回:** 1 - (1-t)⁴
239
+
240
+ **示例**
241
+
242
+ ```redscript
243
+ let v: int = ease_out_quart(5000) // result: 9375 (93.75%)
244
+ ```
245
+
246
+ ---
247
+
248
+ ## `ease_in_sine` <Badge type="info" text="v1.0.0" />
249
+
250
+ Sinusoidal ease-in — starts slow, accelerates (approximated with polynomial).
251
+
252
+ ```redscript
253
+ fn ease_in_sine(t: int): int
254
+ ```
255
+
256
+ **参数**
257
+
258
+ | 参数 | 说明 |
259
+ |------|------|
260
+ | `t` | Progress ×10000, range [0, 10000] |
261
+
262
+ **返回:** Approximate 1 - cos(t*π/2)
263
+
264
+ **示例**
265
+
266
+ ```redscript
267
+ let v: int = ease_in_sine(5000) // ≈ 2929 (sin curve at 50%)
268
+ ```
269
+
270
+ ---
271
+
272
+ ## `ease_out_sine` <Badge type="info" text="v1.0.0" />
273
+
274
+ Sinusoidal ease-out — fast start, decelerates gently (approximated).
275
+
276
+ ```redscript
277
+ fn ease_out_sine(t: int): int
278
+ ```
279
+
280
+ **参数**
281
+
282
+ | 参数 | 说明 |
283
+ |------|------|
284
+ | `t` | Progress ×10000, range [0, 10000] |
285
+
286
+ **返回:** Approximate sin(t*π/2)
287
+
288
+ **示例**
289
+
290
+ ```redscript
291
+ let v: int = ease_out_sine(5000) // ≈ 7071
292
+ ```
293
+
294
+ ---
295
+
296
+ ## `ease_in_out_sine` <Badge type="info" text="v1.0.0" />
297
+
298
+ Sinusoidal ease-in-out — smooth start and end via sine wave.
299
+
300
+ ```redscript
301
+ fn ease_in_out_sine(t: int): int
302
+ ```
303
+
304
+ **参数**
305
+
306
+ | 参数 | 说明 |
307
+ |------|------|
308
+ | `t` | Progress ×10000, range [0, 10000] |
309
+
310
+ **返回:** Approximate -(cos(π*t) - 1) / 2
311
+
312
+ **示例**
313
+
314
+ ```redscript
315
+ let v: int = ease_in_out_sine(5000) // result: 5000 (symmetrical)
316
+ ```
317
+
318
+ ---
319
+
320
+ ## `ease_in_expo` <Badge type="info" text="v1.0.0" />
321
+
322
+ Exponential ease-in — nearly zero at start, explosive at end.
323
+
324
+ ```redscript
325
+ fn ease_in_expo(t: int): int
326
+ ```
327
+
328
+ **参数**
329
+
330
+ | 参数 | 说明 |
331
+ |------|------|
332
+ | `t` | Progress ×10000, range [0, 10000] |
333
+
334
+ **返回:** Approximate 2^(10t-10) (uses cubic proxy)
335
+
336
+ **示例**
337
+
338
+ ```redscript
339
+ let v: int = ease_in_expo(8000) // very small until close to the end
340
+ ```
341
+
342
+ ---
343
+
344
+ ## `ease_out_expo` <Badge type="info" text="v1.0.0" />
345
+
346
+ Exponential ease-out — explosive start, slows to near-zero at end.
347
+
348
+ ```redscript
349
+ fn ease_out_expo(t: int): int
350
+ ```
351
+
352
+ **参数**
353
+
354
+ | 参数 | 说明 |
355
+ |------|------|
356
+ | `t` | Progress ×10000, range [0, 10000] |
357
+
358
+ **返回:** 1 - ease_in_expo(1 - t)
359
+
360
+ **示例**
361
+
362
+ ```redscript
363
+ let v: int = ease_out_expo(2000) // large value even early
364
+ ```
365
+
366
+ ---
367
+
368
+ ## `ease_in_back` <Badge type="info" text="v1.0.0" />
369
+
370
+ 后退缓入,运动前先轻微后退(过冲预备)
371
+
372
+ ```redscript
373
+ fn ease_in_back(t: int): int
374
+ ```
375
+
376
+ **参数**
377
+
378
+ | 参数 | 说明 |
379
+ |------|------|
380
+ | `t` | 进度 ×10000 |
381
+
382
+ **返回:** 可能短暂低于 0
383
+
384
+ **示例**
385
+
386
+ ```redscript
387
+ let v: int = ease_in_back(2000) // negative briefly, then rises
388
+ ```
389
+
390
+ ---
391
+
392
+ ## `ease_out_back` <Badge type="info" text="v1.0.0" />
393
+
394
+ Back ease-out — overshoots target then settles back.
395
+
396
+ ```redscript
397
+ fn ease_out_back(t: int): int
398
+ ```
399
+
400
+ **参数**
401
+
402
+ | 参数 | 说明 |
403
+ |------|------|
404
+ | `t` | Progress ×10000, range [0, 10000] |
405
+
406
+ **返回:** Mirrored ease_in_back (may briefly exceed 10000)
407
+
408
+ **示例**
409
+
410
+ ```redscript
411
+ let v: int = ease_out_back(8000) // overshoots near the end
412
+ ```
413
+
414
+ ---
415
+
416
+ ## `ease_in_out_back` <Badge type="info" text="v1.0.0" />
417
+
418
+ Back ease-in-out — pullback on entry, overshoot on exit.
419
+
420
+ ```redscript
421
+ fn ease_in_out_back(t: int): int
422
+ ```
423
+
424
+ **参数**
425
+
426
+ | 参数 | 说明 |
427
+ |------|------|
428
+ | `t` | Progress ×10000, range [0, 10000] |
429
+
430
+ **返回:** Combined back ease, symmetric around t=5000
431
+
432
+ **示例**
433
+
434
+ ```redscript
435
+ let v: int = ease_in_out_back(5000) // result: 5000 (midpoint)
436
+ ```
437
+
438
+ ---
439
+
440
+ ## `ease_out_bounce` <Badge type="info" text="v1.0.0" />
441
+
442
+ 弹跳缓出,结尾模拟球落地弹跳
443
+
444
+ ```redscript
445
+ fn ease_out_bounce(t: int): int
446
+ ```
447
+
448
+ **参数**
449
+
450
+ | 参数 | 说明 |
451
+ |------|------|
452
+ | `t` | 进度 ×10000 |
453
+
454
+ **返回:** 分段弹跳曲线,范围 [0, 10000]
455
+
456
+ **示例**
457
+
458
+ ```redscript
459
+ let v: int = ease_out_bounce(8000) // bouncing near the end
460
+ ```
461
+
462
+ ---
463
+
464
+ ## `ease_in_bounce` <Badge type="info" text="v1.0.0" />
465
+
466
+ Bounce ease-in — bounces at the start before settling into forward motion.
467
+
468
+ ```redscript
469
+ fn ease_in_bounce(t: int): int
470
+ ```
471
+
472
+ **参数**
473
+
474
+ | 参数 | 说明 |
475
+ |------|------|
476
+ | `t` | Progress ×10000, range [0, 10000] |
477
+
478
+ **返回:** Mirrored ease_out_bounce
479
+
480
+ **示例**
481
+
482
+ ```redscript
483
+ let v: int = ease_in_bounce(2000) // bouncing at the start
484
+ ```
485
+
486
+ ---
487
+
488
+ ## `ease_in_out_bounce` <Badge type="info" text="v1.0.0" />
489
+
490
+ Bounce ease-in-out — bounce on both entry and exit.
491
+
492
+ ```redscript
493
+ fn ease_in_out_bounce(t: int): int
494
+ ```
495
+
496
+ **参数**
497
+
498
+ | 参数 | 说明 |
499
+ |------|------|
500
+ | `t` | Progress ×10000, range [0, 10000] |
501
+
502
+ **返回:** Symmetric bounce easing
503
+
504
+ **示例**
505
+
506
+ ```redscript
507
+ let v: int = ease_in_out_bounce(5000) // result: 5000 (midpoint)
508
+ ```
509
+
510
+ ---
511
+
512
+ ## `ease_smooth` <Badge type="info" text="v1.0.0" />
513
+
514
+ 平滑步进缓动(Hermite 三次曲线:3t² - 2t³)
515
+
516
+ ```redscript
517
+ fn ease_smooth(t: int): int
518
+ ```
519
+
520
+ **参数**
521
+
522
+ | 参数 | 说明 |
523
+ |------|------|
524
+ | `t` | 进度 ×10000 |
525
+
526
+ **返回:** 3t² - 2t³
527
+
528
+ **示例**
529
+
530
+ ```redscript
531
+ let v: int = ease_smooth(5000) // result: 5000 (symmetric)
532
+ ```
533
+
534
+ ---
535
+
536
+ ## `ease_smoother` <Badge type="info" text="v1.0.0" />
537
+
538
+ 更平滑步进(Ken Perlin 五次曲线:6t⁵ - 15t⁴ + 10t³)
539
+
540
+ ```redscript
541
+ fn ease_smoother(t: int): int
542
+ ```
543
+
544
+ **参数**
545
+
546
+ | 参数 | 说明 |
547
+ |------|------|
548
+ | `t` | 进度 ×10000 |
549
+
550
+ **返回:** 6t⁵ - 15t⁴ + 10t³
551
+
552
+ **示例**
553
+
554
+ ```redscript
555
+ let v: int = ease_smoother(5000) // result: 5000 (symmetric)
556
+ ```
557
+
558
+ ---