cyross-ruby-miyako 2.0.5.1.0 → 2.1.0
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.
- data/README +1092 -929
- data/Rakefile +7 -7
- data/defines.h +144 -144
- data/extern.h +29 -29
- data/install_miyako.rb +87 -87
- data/lib/Miyako/API/audio.rb +572 -198
- data/lib/Miyako/API/basic_data.rb +825 -573
- data/lib/Miyako/API/bitmap.rb +534 -507
- data/lib/Miyako/API/choices.rb +481 -475
- data/lib/Miyako/API/collision.rb +486 -460
- data/lib/Miyako/API/diagram.rb +586 -561
- data/lib/Miyako/API/drawing.rb +151 -151
- data/lib/Miyako/API/exceptions.rb +105 -0
- data/lib/Miyako/API/fixedmap.rb +462 -428
- data/lib/Miyako/API/font.rb +430 -403
- data/lib/Miyako/API/input.rb +456 -447
- data/lib/Miyako/API/layout.rb +636 -433
- data/lib/Miyako/API/map.rb +583 -529
- data/lib/Miyako/API/map_event.rb +222 -198
- data/lib/Miyako/API/modules.rb +357 -109
- data/lib/Miyako/API/movie.rb +166 -154
- data/lib/Miyako/API/parts.rb +276 -189
- data/lib/Miyako/API/plane.rb +205 -166
- data/lib/Miyako/API/screen.rb +341 -325
- data/lib/Miyako/API/shape.rb +443 -443
- data/lib/Miyako/API/sprite.rb +771 -752
- data/lib/Miyako/API/sprite_animation.rb +490 -481
- data/lib/Miyako/API/sprite_list.rb +1135 -0
- data/lib/Miyako/API/spriteunit.rb +168 -147
- data/lib/Miyako/API/story.rb +350 -300
- data/lib/Miyako/API/textbox.rb +770 -725
- data/lib/Miyako/API/utility.rb +419 -388
- data/lib/Miyako/API/viewport.rb +189 -139
- data/lib/Miyako/API/yuki.rb +1226 -996
- data/lib/Miyako/EXT/miyako_cairo.rb +62 -62
- data/lib/Miyako/EXT/raster_scroll.rb +138 -138
- data/lib/Miyako/EXT/slides.rb +157 -157
- data/lib/Miyako/miyako.rb +201 -171
- data/lib/Miyako/miyako_require_only.rb +35 -0
- data/miyako_basicdata.c +590 -590
- data/miyako_bitmap.c +1225 -1225
- data/miyako_collision.c +403 -403
- data/miyako_drawing.c +187 -187
- data/miyako_font.c +334 -334
- data/miyako_hsv.c +830 -830
- data/miyako_input_audio.c +254 -0
- data/miyako_layout.c +191 -191
- data/miyako_no_katana.c +1078 -1074
- data/miyako_sprite2.c +431 -0
- data/miyako_transform.c +438 -438
- data/miyako_utility.c +288 -288
- data/sample/Animation1/m1ku.rb +68 -68
- data/sample/Animation2/lex.rb +96 -96
- data/sample/Diagram_sample/diagram_sample_yuki2.rb +328 -386
- data/sample/Room3/blue.rb +297 -297
- data/sample/Room3/ending.rb +180 -180
- data/sample/Room3/green.rb +220 -220
- data/sample/Room3/main.rb +119 -119
- data/sample/Room3/main_component.rb +59 -59
- data/sample/Room3/red.rb +227 -227
- data/sample/Room3/room3.rb +25 -27
- data/sample/Room3/title.rb +184 -184
- data/sample/ball_action_sample.rb +204 -204
- data/sample/blit_rop.rb +70 -70
- data/sample/cairo_sample.rb +25 -25
- data/sample/circle_collision_test.rb +66 -66
- data/sample/collision_test.rb +33 -33
- data/sample/collision_test2.rb +108 -108
- data/sample/fixed_map_test/fixed_map_sample.rb +140 -140
- data/sample/fixed_map_test/readme.txt +72 -72
- data/sample/map_test/chara.rb +58 -58
- data/sample/map_test/main_parts.rb +69 -69
- data/sample/map_test/main_scene.rb +153 -153
- data/sample/map_test/map_manager.rb +75 -75
- data/sample/map_test/map_test.rb +23 -23
- data/sample/map_test/oasis.rb +71 -71
- data/sample/map_test/readme.txt +89 -89
- data/sample/map_test/route.rb +157 -157
- data/sample/map_test/town.rb +74 -74
- data/sample/polygon_test.rb +35 -35
- data/sample/rasterscroll.rb +24 -24
- data/sample/takahashi.rb +42 -42
- data/sample/textbox_sample.rb +189 -189
- data/sample/transform.rb +54 -54
- data/sample/utility_test.rb +73 -73
- data/sample/utility_test2.rb +61 -61
- data/sample/utility_test3.rb +64 -64
- data/sample/utility_test4.rb +73 -73
- data/uninstall_miyako.rb +19 -19
- data/win/miyako_no_katana.so +0 -0
- metadata +7 -2
data/sample/Room3/green.rb
CHANGED
@@ -1,220 +1,220 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
class Green
|
3
|
-
include Story::Scene
|
4
|
-
include MainComponent
|
5
|
-
|
6
|
-
def init
|
7
|
-
@yuki = Yuki.new
|
8
|
-
@yuki.select_textbox(message_box[:box])
|
9
|
-
@yuki.select_commandbox(command_box[:box])
|
10
|
-
@midori = Sprite.new(:file => "image/midori.png", :type => :ck)
|
11
|
-
@midori.center
|
12
|
-
@yuki.regist_parts(:midori, @midori)
|
13
|
-
|
14
|
-
@room = Sprite.new(:file => "image/room_green.png", :type => :as)
|
15
|
-
@room.center
|
16
|
-
|
17
|
-
var[:midori_aisatsu] = false if var[:midori_aisatsu] == nil
|
18
|
-
var[:release_aoyama_book] = false if var[:release_aoyama_book] == nil
|
19
|
-
var[:midori_talk] = 0 if var[:midori_talk] == nil
|
20
|
-
|
21
|
-
@talks = Array.new(6){|i| self.method("talk#{i}".to_sym).call}
|
22
|
-
|
23
|
-
@yuki.vars[:var] = var
|
24
|
-
@yuki.vars[:main_command] = main_command
|
25
|
-
@yuki.vars[:command] = get_command
|
26
|
-
@yuki.vars[:talks] = @talks
|
27
|
-
end
|
28
|
-
|
29
|
-
def setup
|
30
|
-
@yuki.setup
|
31
|
-
message_box.start
|
32
|
-
command_box.start
|
33
|
-
@yuki.start_plot(plot)
|
34
|
-
end
|
35
|
-
|
36
|
-
def update
|
37
|
-
return nil if Input.quit_or_escape?
|
38
|
-
message_box.update_animation
|
39
|
-
command_box.update_animation
|
40
|
-
@yuki.update
|
41
|
-
r = @yuki.executing? ? @now : @yuki.result
|
42
|
-
if @yuki.is_scenario?(r)
|
43
|
-
@yuki.start_plot(r)
|
44
|
-
r = @now
|
45
|
-
end
|
46
|
-
return r
|
47
|
-
end
|
48
|
-
|
49
|
-
def render
|
50
|
-
@room.render
|
51
|
-
@yuki.render
|
52
|
-
message_box.render
|
53
|
-
command_box.render if @yuki.selecting?
|
54
|
-
end
|
55
|
-
|
56
|
-
def get_command
|
57
|
-
return [Yuki::Command.new("挨拶する", nil, lambda{var[:midori_aisatsu]==false}, green2),
|
58
|
-
Yuki::Command.new("辺りを見る", nil, lambda{var[:midori_aisatsu]==true}, look_green),
|
59
|
-
Yuki::Command.new("話す", nil, lambda{var[:midori_aisatsu]==true}, talk),
|
60
|
-
Yuki::Command.new("戻る", nil, lambda{var[:midori_aisatsu]==true}, MainScene)]
|
61
|
-
end
|
62
|
-
|
63
|
-
def plot
|
64
|
-
yuki_plot do
|
65
|
-
text "緑の扉から中に入った。"
|
66
|
-
pause.clear
|
67
|
-
show :midori
|
68
|
-
text "目の前には"
|
69
|
-
color(:green){vars[:var][:midori_aisatsu]==true ? "みどりさん" : "女の人"}
|
70
|
-
text "が居る。"
|
71
|
-
cr
|
72
|
-
vars[:main_command]
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
def main_command
|
77
|
-
yuki_plot do
|
78
|
-
loop do
|
79
|
-
text "どうする?"
|
80
|
-
command vars[:command]
|
81
|
-
clear
|
82
|
-
break select_result if is_scene?(select_result)
|
83
|
-
call_plot(select_result) if is_scenario?(select_result)
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
def green2
|
89
|
-
yuki_plot do
|
90
|
-
text "「私の名前はみどり。よろしくぅ」"
|
91
|
-
pause.clear
|
92
|
-
vars[:var][:midori_aisatsu]=true
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
def look_green
|
97
|
-
yuki_plot do
|
98
|
-
text "部屋の中は、いたってシンプルだ。"
|
99
|
-
pause.cr
|
100
|
-
text "女の子らしく、鏡台がある。"
|
101
|
-
pause.clear
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
def talk
|
106
|
-
yuki_plot do
|
107
|
-
call_plot(vars[:talks][vars[:var][:midori_talk]])
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
def talk0
|
112
|
-
yuki_plot do
|
113
|
-
text "「普通の大学生よぉ。」"
|
114
|
-
pause.clear
|
115
|
-
vars[:var][:midori_talk] += 1
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
def talk1
|
120
|
-
yuki_plot do
|
121
|
-
text "「最近はぁ、"
|
122
|
-
wait 0.3
|
123
|
-
cr
|
124
|
-
text " お菓子作りにぃ、"
|
125
|
-
wait 0.3
|
126
|
-
cr
|
127
|
-
text " 凝ってる、"
|
128
|
-
wait 0.3
|
129
|
-
text "みたいな?」"
|
130
|
-
pause.clear
|
131
|
-
vars[:var][:midori_talk] += 1
|
132
|
-
end
|
133
|
-
end
|
134
|
-
|
135
|
-
def talk2
|
136
|
-
yuki_plot do
|
137
|
-
text "「・・・え、"
|
138
|
-
wait 0.3
|
139
|
-
text "流行らないってぇ?"
|
140
|
-
wait 0.3
|
141
|
-
cr
|
142
|
-
text " 駄目よぉ。流行に流されてちゃ。」"
|
143
|
-
pause.clear
|
144
|
-
vars[:var][:midori_talk] += 1
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
def talk3
|
149
|
-
yuki_plot do
|
150
|
-
text "「何事もぉ、"
|
151
|
-
wait 0.3
|
152
|
-
cr
|
153
|
-
text " ゴーイングマイウェイってやっていかないとぉ、"
|
154
|
-
wait 0.3
|
155
|
-
cr
|
156
|
-
text " 体持たないよっ!?」"
|
157
|
-
pause.clear
|
158
|
-
vars[:var][:midori_talk] += 1
|
159
|
-
end
|
160
|
-
end
|
161
|
-
|
162
|
-
def talk4
|
163
|
-
yuki_plot do
|
164
|
-
text "「・・・ああ、そうそう!"
|
165
|
-
wait 0.3
|
166
|
-
cr
|
167
|
-
text " この本、"
|
168
|
-
wait 0.3
|
169
|
-
text "隣の青山くんのところから"
|
170
|
-
cr
|
171
|
-
text " 借りてきてたんだけどぉ、"
|
172
|
-
cr
|
173
|
-
text " 返しといてくれないかなぁ?"
|
174
|
-
wait 1.0
|
175
|
-
text "・"
|
176
|
-
wait 0.5
|
177
|
-
text "・"
|
178
|
-
wait 0.5
|
179
|
-
text "・"
|
180
|
-
wait 1.0
|
181
|
-
clear
|
182
|
-
size(32){
|
183
|
-
color(:red){
|
184
|
-
text " さっさと"
|
185
|
-
wait 0.5
|
186
|
-
cr
|
187
|
-
text " 持って行け"
|
188
|
-
wait 0.5
|
189
|
-
cr
|
190
|
-
text " っつてんだろぉ!"
|
191
|
-
}
|
192
|
-
}
|
193
|
-
text "」"
|
194
|
-
pause.clear
|
195
|
-
text "ひゃあ。"
|
196
|
-
wait 0.5
|
197
|
-
text " 結局、本を無理矢理渡された。"
|
198
|
-
pause.clear
|
199
|
-
vars[:var][:release_aoyama_book] = true
|
200
|
-
vars[:var][:midori_talk] += 1
|
201
|
-
end
|
202
|
-
end
|
203
|
-
|
204
|
-
def talk5
|
205
|
-
yuki_plot do
|
206
|
-
text "「ちゃんと本渡してくれたぁ?」"
|
207
|
-
pause.clear
|
208
|
-
end
|
209
|
-
end
|
210
|
-
|
211
|
-
def final
|
212
|
-
message_box.stop
|
213
|
-
command_box.stop
|
214
|
-
end
|
215
|
-
|
216
|
-
def dispose
|
217
|
-
@midori.dispose
|
218
|
-
@room.dispose
|
219
|
-
end
|
220
|
-
end
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
class Green
|
3
|
+
include Story::Scene
|
4
|
+
include MainComponent
|
5
|
+
|
6
|
+
def init
|
7
|
+
@yuki = Yuki.new
|
8
|
+
@yuki.select_textbox(message_box[:box])
|
9
|
+
@yuki.select_commandbox(command_box[:box])
|
10
|
+
@midori = Sprite.new(:file => "image/midori.png", :type => :ck)
|
11
|
+
@midori.center!.bottom!
|
12
|
+
@yuki.regist_parts(:midori, @midori)
|
13
|
+
|
14
|
+
@room = Sprite.new(:file => "image/room_green.png", :type => :as)
|
15
|
+
@room.center!.bottom!
|
16
|
+
|
17
|
+
var[:midori_aisatsu] = false if var[:midori_aisatsu] == nil
|
18
|
+
var[:release_aoyama_book] = false if var[:release_aoyama_book] == nil
|
19
|
+
var[:midori_talk] = 0 if var[:midori_talk] == nil
|
20
|
+
|
21
|
+
@talks = Array.new(6){|i| self.method("talk#{i}".to_sym).call}
|
22
|
+
|
23
|
+
@yuki.vars[:var] = var
|
24
|
+
@yuki.vars[:main_command] = main_command
|
25
|
+
@yuki.vars[:command] = get_command
|
26
|
+
@yuki.vars[:talks] = @talks
|
27
|
+
end
|
28
|
+
|
29
|
+
def setup
|
30
|
+
@yuki.setup
|
31
|
+
message_box.start
|
32
|
+
command_box.start
|
33
|
+
@yuki.start_plot(plot)
|
34
|
+
end
|
35
|
+
|
36
|
+
def update
|
37
|
+
return nil if Input.quit_or_escape?
|
38
|
+
message_box.update_animation
|
39
|
+
command_box.update_animation
|
40
|
+
@yuki.update
|
41
|
+
r = @yuki.executing? ? @now : @yuki.result
|
42
|
+
if @yuki.is_scenario?(r)
|
43
|
+
@yuki.start_plot(r)
|
44
|
+
r = @now
|
45
|
+
end
|
46
|
+
return r
|
47
|
+
end
|
48
|
+
|
49
|
+
def render
|
50
|
+
@room.render
|
51
|
+
@yuki.render
|
52
|
+
message_box.render
|
53
|
+
command_box.render if @yuki.selecting?
|
54
|
+
end
|
55
|
+
|
56
|
+
def get_command
|
57
|
+
return [Yuki::Command.new("挨拶する", nil, lambda{var[:midori_aisatsu]==false}, green2),
|
58
|
+
Yuki::Command.new("辺りを見る", nil, lambda{var[:midori_aisatsu]==true}, look_green),
|
59
|
+
Yuki::Command.new("話す", nil, lambda{var[:midori_aisatsu]==true}, talk),
|
60
|
+
Yuki::Command.new("戻る", nil, lambda{var[:midori_aisatsu]==true}, MainScene)]
|
61
|
+
end
|
62
|
+
|
63
|
+
def plot
|
64
|
+
yuki_plot do
|
65
|
+
text "緑の扉から中に入った。"
|
66
|
+
pause.clear
|
67
|
+
show :midori
|
68
|
+
text "目の前には"
|
69
|
+
color(:green){vars[:var][:midori_aisatsu]==true ? "みどりさん" : "女の人"}
|
70
|
+
text "が居る。"
|
71
|
+
cr
|
72
|
+
vars[:main_command]
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def main_command
|
77
|
+
yuki_plot do
|
78
|
+
loop do
|
79
|
+
text "どうする?"
|
80
|
+
command vars[:command]
|
81
|
+
clear
|
82
|
+
break select_result if is_scene?(select_result)
|
83
|
+
call_plot(select_result) if is_scenario?(select_result)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def green2
|
89
|
+
yuki_plot do
|
90
|
+
text "「私の名前はみどり。よろしくぅ」"
|
91
|
+
pause.clear
|
92
|
+
vars[:var][:midori_aisatsu]=true
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def look_green
|
97
|
+
yuki_plot do
|
98
|
+
text "部屋の中は、いたってシンプルだ。"
|
99
|
+
pause.cr
|
100
|
+
text "女の子らしく、鏡台がある。"
|
101
|
+
pause.clear
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def talk
|
106
|
+
yuki_plot do
|
107
|
+
call_plot(vars[:talks][vars[:var][:midori_talk]])
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
def talk0
|
112
|
+
yuki_plot do
|
113
|
+
text "「普通の大学生よぉ。」"
|
114
|
+
pause.clear
|
115
|
+
vars[:var][:midori_talk] += 1
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
def talk1
|
120
|
+
yuki_plot do
|
121
|
+
text "「最近はぁ、"
|
122
|
+
wait 0.3
|
123
|
+
cr
|
124
|
+
text " お菓子作りにぃ、"
|
125
|
+
wait 0.3
|
126
|
+
cr
|
127
|
+
text " 凝ってる、"
|
128
|
+
wait 0.3
|
129
|
+
text "みたいな?」"
|
130
|
+
pause.clear
|
131
|
+
vars[:var][:midori_talk] += 1
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def talk2
|
136
|
+
yuki_plot do
|
137
|
+
text "「・・・え、"
|
138
|
+
wait 0.3
|
139
|
+
text "流行らないってぇ?"
|
140
|
+
wait 0.3
|
141
|
+
cr
|
142
|
+
text " 駄目よぉ。流行に流されてちゃ。」"
|
143
|
+
pause.clear
|
144
|
+
vars[:var][:midori_talk] += 1
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
def talk3
|
149
|
+
yuki_plot do
|
150
|
+
text "「何事もぉ、"
|
151
|
+
wait 0.3
|
152
|
+
cr
|
153
|
+
text " ゴーイングマイウェイってやっていかないとぉ、"
|
154
|
+
wait 0.3
|
155
|
+
cr
|
156
|
+
text " 体持たないよっ!?」"
|
157
|
+
pause.clear
|
158
|
+
vars[:var][:midori_talk] += 1
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
def talk4
|
163
|
+
yuki_plot do
|
164
|
+
text "「・・・ああ、そうそう!"
|
165
|
+
wait 0.3
|
166
|
+
cr
|
167
|
+
text " この本、"
|
168
|
+
wait 0.3
|
169
|
+
text "隣の青山くんのところから"
|
170
|
+
cr
|
171
|
+
text " 借りてきてたんだけどぉ、"
|
172
|
+
cr
|
173
|
+
text " 返しといてくれないかなぁ?"
|
174
|
+
wait 1.0
|
175
|
+
text "・"
|
176
|
+
wait 0.5
|
177
|
+
text "・"
|
178
|
+
wait 0.5
|
179
|
+
text "・"
|
180
|
+
wait 1.0
|
181
|
+
clear
|
182
|
+
size(32){
|
183
|
+
color(:red){
|
184
|
+
text " さっさと"
|
185
|
+
wait 0.5
|
186
|
+
cr
|
187
|
+
text " 持って行け"
|
188
|
+
wait 0.5
|
189
|
+
cr
|
190
|
+
text " っつてんだろぉ!"
|
191
|
+
}
|
192
|
+
}
|
193
|
+
text "」"
|
194
|
+
pause.clear
|
195
|
+
text "ひゃあ。"
|
196
|
+
wait 0.5
|
197
|
+
text " 結局、本を無理矢理渡された。"
|
198
|
+
pause.clear
|
199
|
+
vars[:var][:release_aoyama_book] = true
|
200
|
+
vars[:var][:midori_talk] += 1
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
def talk5
|
205
|
+
yuki_plot do
|
206
|
+
text "「ちゃんと本渡してくれたぁ?」"
|
207
|
+
pause.clear
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
def final
|
212
|
+
message_box.stop
|
213
|
+
command_box.stop
|
214
|
+
end
|
215
|
+
|
216
|
+
def dispose
|
217
|
+
@midori.dispose
|
218
|
+
@room.dispose
|
219
|
+
end
|
220
|
+
end
|
data/sample/Room3/main.rb
CHANGED
@@ -1,120 +1,120 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
class MainScene
|
3
|
-
include Story::Scene
|
4
|
-
include MainComponent
|
5
|
-
|
6
|
-
def init
|
7
|
-
@yuki = Yuki.new(message_box[:box], command_box[:box]){|box, cbox|
|
8
|
-
select_textbox(box)
|
9
|
-
select_commandbox(cbox)
|
10
|
-
}
|
11
|
-
@yuki.select_plot(plot)
|
12
|
-
@doors = Sprite.new(:file=>"image/three_doors.png", :type=>:as)
|
13
|
-
@doors.center
|
14
|
-
|
15
|
-
var[:sekkaku] = true if var[:sekkaku] == nil
|
16
|
-
var[:aikotoba] = false if var[:aikotoba] == nil
|
17
|
-
|
18
|
-
@yuki.vars[:var] = var
|
19
|
-
@yuki.vars[:tell_aikotoba] = tell_aikotoba
|
20
|
-
@yuki.vars[:ending] = Ending
|
21
|
-
@yuki.vars[:red] = Red
|
22
|
-
@yuki.vars[:blue] = Blue
|
23
|
-
@yuki.vars[:green] = Green
|
24
|
-
@yuki.vars[:now] = @now
|
25
|
-
@yuki.vars[:command]= get_command
|
26
|
-
end
|
27
|
-
|
28
|
-
def setup
|
29
|
-
@yuki.setup
|
30
|
-
message_box.start
|
31
|
-
command_box.start
|
32
|
-
@yuki.start_plot(plot)
|
33
|
-
end
|
34
|
-
|
35
|
-
def update
|
36
|
-
return nil if Input.quit_or_escape?
|
37
|
-
message_box.update_animation
|
38
|
-
command_box.update_animation
|
39
|
-
@yuki.update
|
40
|
-
r = @yuki.executing? ? @now : @yuki.result
|
41
|
-
@yuki.start_plot(plot) if (@yuki.executing? == false && r == @now)
|
42
|
-
return r
|
43
|
-
end
|
44
|
-
|
45
|
-
def get_command
|
46
|
-
return [Yuki::Command.new("緑の扉から入る", nil, nil, Green),
|
47
|
-
Yuki::Command.new("赤の扉から入る", nil, lambda{var[:sekkaku] == true }, red_sekkaku),
|
48
|
-
Yuki::Command.new("赤の扉から入る", nil, lambda{var[:sekkaku] == false}, Red),
|
49
|
-
Yuki::Command.new("青の扉から入る", nil, nil, Blue),
|
50
|
-
Yuki::Command.new("合い言葉を言う", nil, lambda{var[:aikotoba] == true}, tell_aikotoba)]
|
51
|
-
end
|
52
|
-
|
53
|
-
def plot
|
54
|
-
yuki_plot{
|
55
|
-
ret = vars[:now]
|
56
|
-
text "目の前には緑、赤、青の3つの扉がある。"
|
57
|
-
cr
|
58
|
-
text "どうする?"
|
59
|
-
cr
|
60
|
-
command vars[:command]
|
61
|
-
ret = select_result if is_scene?(select_result)
|
62
|
-
ret = call_plot(select_result) if is_scenario?(select_result)
|
63
|
-
clear
|
64
|
-
vars[:var][:sekkaku] = false
|
65
|
-
ret
|
66
|
-
}
|
67
|
-
end
|
68
|
-
|
69
|
-
def main_command
|
70
|
-
end
|
71
|
-
|
72
|
-
def red_sekkaku
|
73
|
-
yuki_plot{
|
74
|
-
text "せっかくだから、赤の扉に入ってみよう"
|
75
|
-
pause.clear
|
76
|
-
vars[:red]
|
77
|
-
}
|
78
|
-
end
|
79
|
-
|
80
|
-
def tell_aikotoba
|
81
|
-
yuki_plot{
|
82
|
-
text "「こんなゲーム、"
|
83
|
-
wait 0.5
|
84
|
-
text "まじになっちゃって "
|
85
|
-
wait 0.5
|
86
|
-
text "どうするの!」"
|
87
|
-
pause.clear
|
88
|
-
vars[:ending]
|
89
|
-
}
|
90
|
-
end
|
91
|
-
|
92
|
-
def render
|
93
|
-
@doors.render
|
94
|
-
message_box.render
|
95
|
-
command_box.render if @yuki.selecting?
|
96
|
-
end
|
97
|
-
|
98
|
-
def final
|
99
|
-
message_box.stop
|
100
|
-
command_box.stop
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
class Blue
|
105
|
-
include Story::Scene
|
106
|
-
|
107
|
-
def update
|
108
|
-
return nil if Input.quit_or_escape?
|
109
|
-
return @now
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
class Green
|
114
|
-
include Story::Scene
|
115
|
-
|
116
|
-
def update
|
117
|
-
return nil if Input.quit_or_escape?
|
118
|
-
return @now
|
119
|
-
end
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
class MainScene
|
3
|
+
include Story::Scene
|
4
|
+
include MainComponent
|
5
|
+
|
6
|
+
def init
|
7
|
+
@yuki = Yuki.new(message_box[:box], command_box[:box]){|box, cbox|
|
8
|
+
select_textbox(box)
|
9
|
+
select_commandbox(cbox)
|
10
|
+
}
|
11
|
+
@yuki.select_plot(plot)
|
12
|
+
@doors = Sprite.new(:file=>"image/three_doors.png", :type=>:as)
|
13
|
+
@doors.center!.bottom!
|
14
|
+
|
15
|
+
var[:sekkaku] = true if var[:sekkaku] == nil
|
16
|
+
var[:aikotoba] = false if var[:aikotoba] == nil
|
17
|
+
|
18
|
+
@yuki.vars[:var] = var
|
19
|
+
@yuki.vars[:tell_aikotoba] = tell_aikotoba
|
20
|
+
@yuki.vars[:ending] = Ending
|
21
|
+
@yuki.vars[:red] = Red
|
22
|
+
@yuki.vars[:blue] = Blue
|
23
|
+
@yuki.vars[:green] = Green
|
24
|
+
@yuki.vars[:now] = @now
|
25
|
+
@yuki.vars[:command]= get_command
|
26
|
+
end
|
27
|
+
|
28
|
+
def setup
|
29
|
+
@yuki.setup
|
30
|
+
message_box.start
|
31
|
+
command_box.start
|
32
|
+
@yuki.start_plot(plot)
|
33
|
+
end
|
34
|
+
|
35
|
+
def update
|
36
|
+
return nil if Input.quit_or_escape?
|
37
|
+
message_box.update_animation
|
38
|
+
command_box.update_animation
|
39
|
+
@yuki.update
|
40
|
+
r = @yuki.executing? ? @now : @yuki.result
|
41
|
+
@yuki.start_plot(plot) if (@yuki.executing? == false && r == @now)
|
42
|
+
return r
|
43
|
+
end
|
44
|
+
|
45
|
+
def get_command
|
46
|
+
return [Yuki::Command.new("緑の扉から入る", nil, nil, Green),
|
47
|
+
Yuki::Command.new("赤の扉から入る", nil, lambda{var[:sekkaku] == true }, red_sekkaku),
|
48
|
+
Yuki::Command.new("赤の扉から入る", nil, lambda{var[:sekkaku] == false}, Red),
|
49
|
+
Yuki::Command.new("青の扉から入る", nil, nil, Blue),
|
50
|
+
Yuki::Command.new("合い言葉を言う", nil, lambda{var[:aikotoba] == true}, tell_aikotoba)]
|
51
|
+
end
|
52
|
+
|
53
|
+
def plot
|
54
|
+
yuki_plot{
|
55
|
+
ret = vars[:now]
|
56
|
+
text "目の前には緑、赤、青の3つの扉がある。"
|
57
|
+
cr
|
58
|
+
text "どうする?"
|
59
|
+
cr
|
60
|
+
command vars[:command]
|
61
|
+
ret = select_result if is_scene?(select_result)
|
62
|
+
ret = call_plot(select_result) if is_scenario?(select_result)
|
63
|
+
clear
|
64
|
+
vars[:var][:sekkaku] = false
|
65
|
+
ret
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
def main_command
|
70
|
+
end
|
71
|
+
|
72
|
+
def red_sekkaku
|
73
|
+
yuki_plot{
|
74
|
+
text "せっかくだから、赤の扉に入ってみよう"
|
75
|
+
pause.clear
|
76
|
+
vars[:red]
|
77
|
+
}
|
78
|
+
end
|
79
|
+
|
80
|
+
def tell_aikotoba
|
81
|
+
yuki_plot{
|
82
|
+
text "「こんなゲーム、"
|
83
|
+
wait 0.5
|
84
|
+
text "まじになっちゃって "
|
85
|
+
wait 0.5
|
86
|
+
text "どうするの!」"
|
87
|
+
pause.clear
|
88
|
+
vars[:ending]
|
89
|
+
}
|
90
|
+
end
|
91
|
+
|
92
|
+
def render
|
93
|
+
@doors.render
|
94
|
+
message_box.render
|
95
|
+
command_box.render if @yuki.selecting?
|
96
|
+
end
|
97
|
+
|
98
|
+
def final
|
99
|
+
message_box.stop
|
100
|
+
command_box.stop
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
class Blue
|
105
|
+
include Story::Scene
|
106
|
+
|
107
|
+
def update
|
108
|
+
return nil if Input.quit_or_escape?
|
109
|
+
return @now
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
class Green
|
114
|
+
include Story::Scene
|
115
|
+
|
116
|
+
def update
|
117
|
+
return nil if Input.quit_or_escape?
|
118
|
+
return @now
|
119
|
+
end
|
120
120
|
end
|