sscharter 0.4.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/sscharter/chart.rb +3 -1
- data/lib/sscharter/version.rb +1 -1
- data/lib/sscharter.rb +11 -1
- data/tutorial/tutorial.md +24 -21
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cf8712de608bd077ecf7de07876ffeeda198252406ed21039e8877e4ef3b0a2
|
4
|
+
data.tar.gz: 25ee7a29c99c52c5bccf381cf876ef1b392e09ad654f3aae5765ddf8c4e32a44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05d2ddfa497d740bdda3e6011baa155bb9836d6e64d5448557db89a6dc7ff9aefcc47a251c1e6bc171ede0fa4c85898b7a5c1949c403b7d602b51aba6896beca
|
7
|
+
data.tar.gz: 5c54bfc3a2b9ccefc1f8f08085f98ed9abd13bf938b19e60c08967e503483999a8f02447a4a17a976b825ba1dc048c814107740078072eecba6e22790f96f42c
|
data/Gemfile.lock
CHANGED
data/lib/sscharter/chart.rb
CHANGED
@@ -7,7 +7,7 @@ class Sunniesnow::Chart
|
|
7
7
|
using Sunniesnow::Utils
|
8
8
|
|
9
9
|
attr_accessor :title, :artist, :charter
|
10
|
-
attr_accessor :difficulty_name, :difficulty_color, :difficulty
|
10
|
+
attr_accessor :difficulty_name, :difficulty_color, :difficulty, :difficulty_sup
|
11
11
|
attr_reader :events
|
12
12
|
|
13
13
|
def initialize
|
@@ -17,6 +17,7 @@ class Sunniesnow::Chart
|
|
17
17
|
@difficulty_name = ''
|
18
18
|
@difficulty_color = '#000000'
|
19
19
|
@difficulty = ''
|
20
|
+
@difficulty_sup = ''
|
20
21
|
@events = []
|
21
22
|
end
|
22
23
|
|
@@ -28,6 +29,7 @@ class Sunniesnow::Chart
|
|
28
29
|
difficultyName: @difficulty_name,
|
29
30
|
difficultyColor: @difficulty_color,
|
30
31
|
difficulty: @difficulty,
|
32
|
+
difficultySup: @difficulty_sup,
|
31
33
|
events: @events
|
32
34
|
}.to_json
|
33
35
|
end
|
data/lib/sscharter/version.rb
CHANGED
data/lib/sscharter.rb
CHANGED
@@ -221,6 +221,11 @@ class Sunniesnow::Charter
|
|
221
221
|
end
|
222
222
|
|
223
223
|
def check
|
224
|
+
if !@x.is_a?(Numeric) || !@y.is_a?(Numeric)
|
225
|
+
raise ArgumentError, 'x and y must be numbers'
|
226
|
+
end
|
227
|
+
@x = @x.to_f
|
228
|
+
@y = @y.to_f
|
224
229
|
%i[@relative_time @speed @relative_beat @beat_speed].each do |key|
|
225
230
|
value = instance_variable_get key
|
226
231
|
raise ArgumentError, "cannot specify both #@time_key and #{key}" if @time_key && value&.!=(0)
|
@@ -363,6 +368,10 @@ class Sunniesnow::Charter
|
|
363
368
|
@difficulty = difficulty.to_s
|
364
369
|
end
|
365
370
|
|
371
|
+
def difficulty_sup difficulty_sup
|
372
|
+
@difficulty_sup = difficulty_sup.to_s
|
373
|
+
end
|
374
|
+
|
366
375
|
def offset offset
|
367
376
|
raise ArgumentError, 'offset must be a number' unless offset.is_a? Numeric
|
368
377
|
@current_offset = offset.to_f
|
@@ -591,7 +600,7 @@ class Sunniesnow::Charter
|
|
591
600
|
event :big_text, duration_beats.to_r, text: text.to_s
|
592
601
|
end
|
593
602
|
|
594
|
-
%i[grid hexagon checkerboard diamond_grid pentagon turntable].each do |method_name|
|
603
|
+
%i[grid hexagon checkerboard diamond_grid pentagon turntable hexagram].each do |method_name|
|
595
604
|
define_method method_name do |duration_beats = 0|
|
596
605
|
unless duration_beats.is_a? Numeric
|
597
606
|
raise ArgumentError, 'duration_beats must be a number'
|
@@ -614,6 +623,7 @@ class Sunniesnow::Charter
|
|
614
623
|
result.difficulty_name = @difficulty_name
|
615
624
|
result.difficulty_color = @difficulty_color
|
616
625
|
result.difficulty = @difficulty
|
626
|
+
result.difficulty_sup = @difficulty_sup
|
617
627
|
@events.each { result.events.push _1.to_sunniesnow }
|
618
628
|
result
|
619
629
|
end
|
data/tutorial/tutorial.md
CHANGED
@@ -563,6 +563,7 @@ There are totally 7 different kinds of background patterns:
|
|
563
563
|
| diamond grid | `diamond_grid duration_beats=0` |
|
564
564
|
| pentagon | `pentagon duration_beats=0` |
|
565
565
|
| turntable | `turntable duration_beats=0` |
|
566
|
+
| hexagram | `hexagram duration_beats=0` |
|
566
567
|
|
567
568
|
Most of them only has one optional argument, specifying the duration.
|
568
569
|
The big text is different in that it needs an additional required argument,
|
@@ -669,13 +670,14 @@ The transformation is done like this:
|
|
669
670
|
> y'=\mathtt{yx}\cdot x+\mathtt{yy}\cdot y.
|
670
671
|
> ```
|
671
672
|
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
673
|
+
> [!NOTE]
|
674
|
+
> When doing spatial transformations,
|
675
|
+
> you do not need to worry about the direction of flick notes.
|
676
|
+
> They are taken care of as well.
|
677
|
+
>
|
678
|
+
> For background patterns,
|
679
|
+
> they are ignored when doing spatial transformations.
|
680
|
+
> They are still affected by temporal transformations, though.
|
679
681
|
|
680
682
|
Therefore, you can also apply, say, a horizontal flip on the duplicated notes like this:
|
681
683
|
|
@@ -789,9 +791,10 @@ end
|
|
789
791
|
|
790
792
|
### BPM changes
|
791
793
|
|
792
|
-
|
793
|
-
|
794
|
-
|
794
|
+
> [!NOTE]
|
795
|
+
> Because *Big-D* does not have BPM changes,
|
796
|
+
> this part of the tutorial will not be used in the actual chart of *Big-D*.
|
797
|
+
> You may still try it out, though.
|
795
798
|
|
796
799
|
You can use `bpm` to set the BPM starting at the current beat.
|
797
800
|
|
@@ -918,7 +921,7 @@ For example, in the expression
|
|
918
921
|
> ```
|
919
922
|
>
|
920
923
|
> the argument `speed:` is a keyword argument in the call of `tp_chain`.
|
921
|
-
The value of the keyword argument is `100`.
|
924
|
+
> The value of the keyword argument is `100`.
|
922
925
|
|
923
926
|
Knowing how to specify the position and time of the spawning of a tip point,
|
924
927
|
then creating tip points is just as easy as filling events in the code block
|
@@ -958,16 +961,16 @@ transform duplicate notes do
|
|
958
961
|
end
|
959
962
|
```
|
960
963
|
|
961
|
-
|
962
|
-
Just like `group`, `tip_point_chain` and `tip_point_drop`
|
963
|
-
may also not preserve beat.
|
964
|
-
You can let them not preserve beat by specifying the keyword argument `preserve_beat: false`:
|
965
|
-
|
966
|
-
```ruby
|
967
|
-
tp_chain 0, 100, speed: 100, preserve_beat: false do
|
968
|
-
|
969
|
-
end
|
970
|
-
```
|
964
|
+
> [!NOTE]
|
965
|
+
> Just like `group`, `tip_point_chain` and `tip_point_drop`
|
966
|
+
> may also not preserve beat.
|
967
|
+
> You can let them not preserve beat by specifying the keyword argument `preserve_beat: false`:
|
968
|
+
>
|
969
|
+
> ```ruby
|
970
|
+
> tp_chain 0, 100, speed: 100, preserve_beat: false do
|
971
|
+
> # notes...
|
972
|
+
> end
|
973
|
+
> ```
|
971
974
|
|
972
975
|
Now, the whole source codes file should look like this:
|
973
976
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sscharter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ulysses Zhan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
137
|
requirements: []
|
138
|
-
rubygems_version: 3.4.
|
138
|
+
rubygems_version: 3.4.22
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: A Ruby DSL for writing Sunniesnow charts
|