-
Notifications
You must be signed in to change notification settings - Fork 0
/
ArcTapJumpShard.kt
118 lines (105 loc) · 4.15 KB
/
ArcTapJumpShard.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
package io.sn.aetherium.implementations.shards
import com.tairitsu.compose.arcaea.Difficulty
import com.tairitsu.compose.arcaea.LocalizedString
import com.tairitsu.compose.arcaea.pos
import io.sn.aetherium.implementations.adjustZoomingConst
import io.sn.aetherium.implementations.noteJumpGetFrame
import io.sn.aetherium.objects.*
import io.sn.aetherium.objects.animcfg.AnimationBasicConfigurtion
import io.sn.aetherium.utils.addAnimation
import io.sn.aetherium.utils.linear
@ShardInfo("arctapjump")
class ArcTapJumpShard : AetheriumShard() {
override val isInternal: Boolean
get() = true
override val name: LocalizedString
get() = LocalizedString("Arctap Jump") {
zhHans = "Arctap 跳跃"
}
override val digestionInfo: ShardDigestionArgsInfo = ShardDigestionArgsInfo {
addInfo(
"globalOffset",
ShardDigestionArgsInfo.Item.Type.LONG,
ShardDigestion.Union.Restriction.songGlobalOffsetPlaceholder,
"Anim: Global Offset"
) {
zhHans = "帧动画: 歌曲长度"
}
addInfo("fps", ShardDigestionArgsInfo.Item.Type.INT, ShardDigestion.Union(60), "Anim: FPS") {
zhHans = "帧动画: 质量 (FPS)"
}
addInfo("bpm", ShardDigestionArgsInfo.Item.Type.DOUBLE, ShardDigestion.Union.Restriction.songBpmPlaceholder, "Anim: BPM") {
zhHans = "帧动画: BPM"
}
addInfo(
"timingStart",
ShardDigestionArgsInfo.Item.Type.TIMING,
ShardDigestion.Union.Restriction.editorCurrentTiming,
"Start Timing"
) {
zhHans = "起始时间"
}
addInfo(
"timingEnd",
ShardDigestionArgsInfo.Item.Type.TIMING,
ShardDigestion.Union.Restriction.editorDelayTiming(1000L),
"End Timing"
) {
zhHans = "结束时间"
}
addInfo("positionStart", ShardDigestionArgsInfo.Item.Type.POSITION, "Start Position") {
zhHans = "起始位置"
}
addInfo("positionEnd", ShardDigestionArgsInfo.Item.Type.POSITION, "End Position") {
zhHans = "结束位置"
}
addInfo("showFirstFrame", ShardDigestionArgsInfo.Item.Type.BOOLEAN, ShardDigestion.Union(false), "Show first frame?") {
zhHans = "是否显示第一帧"
}
addInfo("control", ShardDigestionArgsInfo.Item.Type.STRING, ShardDigestion.Union("0:2000"), "Gravity Control") {
zhHans = "重力参数"
}
}
override fun generator(): Difficulty.() -> Unit = {
val timingList = arrayOf(digestTiming("timingStart"), digestTiming("timingEnd"), -1)
val posStart = digestPosition("positionStart")
val posEnd = digestPosition("positionEnd")
val showFirstFrame = digestBoolean("showFirstFrame")
val positionXList = arrayOf(posStart.x, posEnd.x, 0.0)
val positionYList = arrayOf(posStart.y, posEnd.y, 0.0)
val control = digestString("control")
val animBasicCfg = AnimationBasicConfigurtion(
digestInt("fps"),
digestDouble("bpm"),
digestLong("globalOffset")
)
val controlMap = mutableMapOf<Int, Long>()
control.split(";").forEach {
val (at, zoom) = it.split(":")
controlMap[at.toInt()] = zoom.toLong()
}
repeat(timingList.size - 1) {
if (timingList[it + 1] == -1L || timingList[it] == -1L) {
return@repeat
}
if (controlMap.containsKey(it)) {
adjustZoomingConst(controlMap[it]!!)
}
addAnimation(
animBasicCfg,
timingList[it],
timingList[it + 1] - timingList[it],
Triple(1.0, 1.0, linear), // not used
Triple(
positionXList[it] pos positionYList[it],
positionXList[it] pos positionYList[it],
linear
),
0,
showFirstFrame,
noteJumpGetFrame,
positionXList[it + 1] pos positionYList[it + 1]
)
}
}
}