-
Notifications
You must be signed in to change notification settings - Fork 1
/
DemoMap.kt
244 lines (215 loc) · 8.87 KB
/
DemoMap.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
package com.tairitsu.compose.arcaea
import com.tairitsu.compose.arcaea.dsl.Bar
import com.tairitsu.compose.arcaea.dsl.bar
import java.io.File
import kotlin.math.floor
fun main() {
mapSet {
id = "composingdream"
titleLocalized = LocalizedString("Composing Dream")
idx = 330
artist = "ZZM"
bpm = "124"
bpmBase = 124.0
set = "dream"
purchase = "dream"
audioPreview = 31985L
audioPreviewEnd = 51340L
side = MapSet.Side.LIGHT
difficulties.future {
rating = 0
chartDesigner = "Eric_Lian"
jacketDesigner = "Eric_Lian"
// The timing setting for your main timing group
timing(
// The first bar starts at 1986ms
offset = 1986,
// The speed of this song is 124bpm
bpm = 124,
// 4 beats for every bar
beats = 4,
)
// Bar number and beat number starts at 0
// How to create a normal note.
listOf(3, 1, 4, 2).withIndex().forEach { (index, value) ->
// Designing the [index]th bar
bar(index) {
// Create a normal note at the first beat of the [index]th bar
normalNote(0, value)
}
}
// How to create a hold note.
listOf(3, 1, 4, 2).withIndex().forEach { (index, value) ->
// Designing the [index + 4]th bar
bar(index + 4) {
// Create a hold note at the first beat of the [index + 4]th bar,
// and this hold ends at the third beat of the [index + 4]th bar
holdNote(0, 3, value)
}
}
// How to create an arc note.
bar(8) {
// Create an arc note at the first beat of the 8th bar, and this arc ends at the third beat of the 8th bar
arcNote(0, 3, 0.0 to 1.0, s, 0.0 to 1.0, ArcNote.Color.BLUE)
// Of course, you can create a note not located at the 8th bar.
// Create an arc note at the first beat of the 9th bar, and this arc ends at the third beat of the 9th bar
arcNote(4, 7, 1.0 to 1.0, s, 1.0 to 1.0, ArcNote.Color.RED)
}
bar(10) {
arcNote(0, 3, 0.0 to 1.0, si, 1.0 to 0.0, ArcNote.Color.BLUE)
arcNote(4, 7, 1.0 to 1.0, si, 0.0 to 0.0, ArcNote.Color.RED)
}
// How to create an arc tap
bar(12) {
// Create a guiding line
arcNote(0, 4, 1.0 to 1.0, s, 0.5 to 0.25) {
// and create an arc tap
arctap(2)
}
normalNote(0, 1)
normalNote(1, 3)
normalNote(3, 2)
}
bar(13) {
arcNote(0, 4, 0.0 to 1.0, s, 0.5 to 0.25) {
arctap(2)
}
normalNote(0, 4)
normalNote(1, 2)
normalNote(3, 3)
}
// That's it
// You can use your Kotlin skill to create your own map as you like
// Maybe you can use your geometry knowledge to draw an awesome picture by creating tons of guiding lines
// Maybe you can analyze the music of this map to create some cool effects
// No matter how, it is time for you.
bar(14) {
arcNote(0, 4, 0.0 to 1.0, so, 0.75 to 0.0) {
arctap(2)
}
arcNote(0, 4, 1.0 to 1.0, so, 0.25 to 0.0) {
arctap(1)
}
normalNote(0, 1)
normalNote(3, 4)
}
bar(15) {
d(8)
var aArc: Bar.ArcNote.ArcTapList? = null
var bArc: Bar.ArcNote.ArcTapList? = null
arcNote(0, 8, 0.75 to 0.0, sisi, 0.0 to 1.0) {
aArc = this
}
arcNote(0, 8, 0.25 to 0.0, sisi, 1.0 to 1.0) {
bArc = this
}
(0..7).forEach {
(if (it % 2 == 0) aArc else bArc)!!.arctap(it)
}
normalNote(5, 1)
normalNote(6, 4)
normalNote(7, 1)
}
timingGroup("BarLineEffect") {
timing(offset = 1986, bpm = 124, beats = 4)
}
addBarLineEffect(bar(16).startTime.toDouble())
bar(16) {
d(16)
arcNote(0, 5, 0.0 to 1.0, siso, 1.25 to 0.1, ArcNote.Color.BLUE)
arcNote(6, 11, 0.0 to 1.0, siso, 1.05 to 0.17, ArcNote.Color.RED)
arcNote(12, 15, 0.0 to 1.0, siso, 0.85 to 0.25, ArcNote.Color.BLUE)
}
bar(17) {
d(16)
arcNote(0, 5, 1.0 to 1.0, siso, -0.25 to 0.1, ArcNote.Color.RED)
arcNote(6, 11, 1.0 to 1.0, siso, -0.05 to 0.17, ArcNote.Color.BLUE)
arcNote(12, 15, 1.0 to 1.0, siso, 0.15 to 0.25, ArcNote.Color.RED)
}
bar(18) {
d(8)
arcNote(0, 3, 0.0 to 1.0, siso, 1.0 to 1.0, ArcNote.Color.BLUE)
normalNote(5, 2)
normalNote(6, 3)
normalNote(7, 2)
}
bar(19) {
d(8)
holdNote(0, 2, 1)
holdNote(3, 5, 2)
holdNote(6, 7, 4)
}
addBarLineEffect(bar(20).startTime.toDouble())
bar(20) {
d(8)
arcNote(0, 3, 0.0 to 1.0, s, 0.7 to 1.0, ArcNote.Color.BLUE)
arcNote(3, 6, 0.7 to 1.0, s, 0.0 to 1.0, ArcNote.Color.BLUE)
arcNote(3, 6, 1.0 to 1.0, s, 0.3 to 1.0, ArcNote.Color.RED)
arcNote(6, 8, 0.3 to 1.0, s, 1.0 to 1.0, ArcNote.Color.RED)
}
bar(21) {
d(8)
arcNote(0, 3, 1.0 to 1.0, s, 0.3 to 1.0, ArcNote.Color.RED)
arcNote(3, 6, 0.3 to 1.0, s, 1.0 to 1.0, ArcNote.Color.RED)
arcNote(6, 8, 1.0 to 1.0, s, 1.0 to 1.0, ArcNote.Color.RED)
arcNote(3, 6, 0.0 to 1.0, s, 0.7 to 1.0, ArcNote.Color.BLUE)
arcNote(6, 8, 0.7 to 1.0, s, 0.0 to 1.0, ArcNote.Color.BLUE)
}
bar(22) {
d(8)
arcNote(0, 2, 0.0 to 1.0, si, 0.5 to 0.0, ArcNote.Color.BLUE)
arcNote(2, 3, 0.5 to 0.0, s, 0.5 to 0.0, ArcNote.Color.BLUE)
arcNote(3, 4, 0.5 to 0.0, s, 0.5 to 0.0, ArcNote.Color.BLUE)
arcNote(0, 2, 1.0 to 1.0, si, 0.5 to 0.0, ArcNote.Color.RED)
arcNote(2, 3, 0.5 to 0.0, s, 0.5 to 0.0, ArcNote.Color.RED)
val leftInput = 0.0 to 1.0
val rightInput = 1.0 to 1.0
val midInput = 0.5 to 1.0
val pa = 0.0 to 0.5
val pb = 0.5 to 1.0
val pc = 1.0 to 0.5
listOf(leftInput, rightInput).forEach { a ->
listOf(pa, pb, pc).forEach { b ->
arcNote(0, 2, a, si, b)
}
}
arcNote(2, 5, pa, s, pa) { arctap(5) }
arcNote(2, 7, pb, s, pb) { arctap(7) }
arcNote(2, 6, pc, s, pc) { arctap(6) }
listOf(leftInput, midInput, rightInput).forEach { arcNote(5, 8, pa, b, it) }
listOf(leftInput, midInput, rightInput).forEach { arcNote(7, 8, pb, b, it) }
listOf(leftInput, midInput, rightInput).forEach { arcNote(6, 8, pc, b, it) }
}
bar(23) {
d(8)
val leftInput = 0.0 to 1.0
val rightInput = 1.0 to 1.0
val midInput = 0.5 to 1.0
arcNote(0, 3, midInput, s, midInput)
arcNote(0, 6, leftInput, s, leftInput)
arcNote(0, 4, rightInput, s, rightInput, ArcNote.Color.RED)
arcNote(3, 7, midInput, s, midInput, ArcNote.Color.BLUE)
arcNote(6, 8, leftInput, s, leftInput, ArcNote.Color.RED)
arcNote(4, 8, rightInput, si, leftInput)
arcNote(7, 8, midInput, si, leftInput)
}
bar(24) {
normalNote(0, 1)
}
}
}.writeToFolder(File(File(System.getProperty("user.home")), "aff-compose"))
}
fun Difficulty.addBarLineEffect(startTime: Double) {
timingGroup("BarLineEffect") {
val barDuration = 60000.0 / 124 * 4
val endTime = startTime + barDuration * 2
var t = startTime
var iterCount = 0
while (t < endTime) {
iterCount++
t += iterCount * 4
val c = floor(t).toLong()
arcNote(c, c + 1, -0.5 to 0.0, s, 1.5 to 0.0)
}
}
}