ruby-miyako 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 +1115 -0
- data/Rakefile +7 -0
- data/defines.h +144 -0
- data/extconf.rb +44 -0
- data/extern.h +29 -0
- data/img/cursor.png +0 -0
- data/img/cursors.png +0 -0
- data/img/dice.png +0 -0
- data/img/wait_cursor.png +0 -0
- data/img/win_base.png +0 -0
- data/img/window.png +0 -0
- data/install_miyako.rb +87 -0
- data/lib/Miyako/API/audio.rb +584 -0
- data/lib/Miyako/API/basic_data.rb +1026 -0
- data/lib/Miyako/API/bitmap.rb +534 -0
- data/lib/Miyako/API/choices.rb +481 -0
- data/lib/Miyako/API/collision.rb +638 -0
- data/lib/Miyako/API/diagram.rb +586 -0
- data/lib/Miyako/API/drawing.rb +151 -0
- data/lib/Miyako/API/exceptions.rb +105 -0
- data/lib/Miyako/API/fixedmap.rb +462 -0
- data/lib/Miyako/API/font.rb +430 -0
- data/lib/Miyako/API/input.rb +456 -0
- data/lib/Miyako/API/layout.rb +644 -0
- data/lib/Miyako/API/map.rb +583 -0
- data/lib/Miyako/API/map_event.rb +222 -0
- data/lib/Miyako/API/modules.rb +357 -0
- data/lib/Miyako/API/movie.rb +166 -0
- data/lib/Miyako/API/parts.rb +188 -0
- data/lib/Miyako/API/plane.rb +205 -0
- data/lib/Miyako/API/screen.rb +341 -0
- data/lib/Miyako/API/shape.rb +443 -0
- data/lib/Miyako/API/sprite.rb +773 -0
- data/lib/Miyako/API/sprite_animation.rb +494 -0
- data/lib/Miyako/API/sprite_list.rb +1135 -0
- data/lib/Miyako/API/spriteunit.rb +168 -0
- data/lib/Miyako/API/story.rb +350 -0
- data/lib/Miyako/API/textbox.rb +773 -0
- data/lib/Miyako/API/utility.rb +419 -0
- data/lib/Miyako/API/viewport.rb +190 -0
- data/lib/Miyako/API/yuki.rb +1180 -0
- data/lib/Miyako/EXT/miyako_cairo.rb +62 -0
- data/lib/Miyako/EXT/raster_scroll.rb +138 -0
- data/lib/Miyako/EXT/slides.rb +157 -0
- data/lib/Miyako/miyako.rb +201 -0
- data/lib/Miyako/miyako_require_only.rb +35 -0
- data/logo/EGSR_logo.png +0 -0
- data/logo/EGSR_logo_bg.png +0 -0
- data/logo/EGSR_logo_fg.png +0 -0
- data/logo/EGSR_title_banner.png +0 -0
- data/logo/EGSR_title_logo.png +0 -0
- data/logo/miyako.png +0 -0
- data/logo/miyako_banner.png +0 -0
- data/logo/space.png +0 -0
- data/miyako_basicdata.c +484 -0
- data/miyako_bitmap.c +1225 -0
- data/miyako_collision.c +403 -0
- data/miyako_drawing.c +187 -0
- data/miyako_font.c +334 -0
- data/miyako_hsv.c +830 -0
- data/miyako_input_audio.c +254 -0
- data/miyako_layout.c +191 -0
- data/miyako_no_katana.c +1086 -0
- data/miyako_sprite2.c +431 -0
- data/miyako_transform.c +438 -0
- data/miyako_utility.c +288 -0
- data/sample/Animation1/m1ku.rb +68 -0
- data/sample/Animation1/m1ku_arm_0.png +0 -0
- data/sample/Animation1/m1ku_arm_1.png +0 -0
- data/sample/Animation1/m1ku_arm_2.png +0 -0
- data/sample/Animation1/m1ku_arm_3.png +0 -0
- data/sample/Animation1/m1ku_back.jpg +0 -0
- data/sample/Animation1/m1ku_body.png +0 -0
- data/sample/Animation1/m1ku_eye_0.png +0 -0
- data/sample/Animation1/m1ku_eye_1.png +0 -0
- data/sample/Animation1/m1ku_eye_2.png +0 -0
- data/sample/Animation1/m1ku_eye_3.png +0 -0
- data/sample/Animation1/m1ku_hair_front.png +0 -0
- data/sample/Animation1/m1ku_hair_rear.png +0 -0
- data/sample/Animation1/readme.txt +72 -0
- data/sample/Animation2/lex.rb +96 -0
- data/sample/Animation2/lex_back.png +0 -0
- data/sample/Animation2/lex_body.png +0 -0
- data/sample/Animation2/lex_roadroller.png +0 -0
- data/sample/Animation2/lex_wheel_0.png +0 -0
- data/sample/Animation2/lex_wheel_1.png +0 -0
- data/sample/Animation2/lex_wheel_2.png +0 -0
- data/sample/Animation2/readme.txt +72 -0
- data/sample/Animation2/song_title.png +0 -0
- data/sample/Diagram_sample/back.png +0 -0
- data/sample/Diagram_sample/chr01.png +0 -0
- data/sample/Diagram_sample/chr02.png +0 -0
- data/sample/Diagram_sample/cursor.png +0 -0
- data/sample/Diagram_sample/diagram_sample_yuki2.rb +329 -0
- data/sample/Diagram_sample/readme.txt +90 -0
- data/sample/Diagram_sample/wait_cursor.png +0 -0
- data/sample/Room3/blue.rb +297 -0
- data/sample/Room3/ending.rb +180 -0
- data/sample/Room3/green.rb +220 -0
- data/sample/Room3/image/akamatsu.png +0 -0
- data/sample/Room3/image/aoyama.png +0 -0
- data/sample/Room3/image/congra.png +0 -0
- data/sample/Room3/image/congratulation.png +0 -0
- data/sample/Room3/image/congratulation_bg.png +0 -0
- data/sample/Room3/image/cursor.png +0 -0
- data/sample/Room3/image/midori.png +0 -0
- data/sample/Room3/image/mittsu_no_oheya.png +0 -0
- data/sample/Room3/image/mittsu_no_oheya_logo.png +0 -0
- data/sample/Room3/image/room_blue.png +0 -0
- data/sample/Room3/image/room_green.png +0 -0
- data/sample/Room3/image/room_red.png +0 -0
- data/sample/Room3/image/start.png +0 -0
- data/sample/Room3/image/three_doors.png +0 -0
- data/sample/Room3/image/wait_cursor.png +0 -0
- data/sample/Room3/main.rb +120 -0
- data/sample/Room3/main_component.rb +59 -0
- data/sample/Room3/readme.txt +76 -0
- data/sample/Room3/red.rb +227 -0
- data/sample/Room3/room3.rb +25 -0
- data/sample/Room3/title.rb +184 -0
- data/sample/ball_action_sample.rb +204 -0
- data/sample/blit_rop.rb +70 -0
- data/sample/cairo_sample.rb +25 -0
- data/sample/circle_collision_test.rb +66 -0
- data/sample/collision_test.rb +33 -0
- data/sample/collision_test2.rb +108 -0
- data/sample/fixed_map_test/cursor.png +0 -0
- data/sample/fixed_map_test/fixed_map_sample.rb +140 -0
- data/sample/fixed_map_test/map.csv +19 -0
- data/sample/fixed_map_test/map_01.png +0 -0
- data/sample/fixed_map_test/mapchip.csv +23 -0
- data/sample/fixed_map_test/monster.png +0 -0
- data/sample/fixed_map_test/readme.txt +72 -0
- data/sample/map_test/chara.rb +58 -0
- data/sample/map_test/chr1.png +0 -0
- data/sample/map_test/cursor.png +0 -0
- data/sample/map_test/main_parts.rb +69 -0
- data/sample/map_test/main_scene.rb +153 -0
- data/sample/map_test/map.png +0 -0
- data/sample/map_test/map2.png +0 -0
- data/sample/map_test/map_layer.csv +127 -0
- data/sample/map_test/map_manager.rb +75 -0
- data/sample/map_test/map_test.rb +23 -0
- data/sample/map_test/mapchip.csv +21 -0
- data/sample/map_test/oasis.rb +71 -0
- data/sample/map_test/readme.txt +89 -0
- data/sample/map_test/route.rb +157 -0
- data/sample/map_test/sea.png +0 -0
- data/sample/map_test/town.rb +74 -0
- data/sample/map_test/wait_cursor.png +0 -0
- data/sample/map_test/window.png +0 -0
- data/sample/polygon_test.rb +35 -0
- data/sample/rasterscroll.rb +25 -0
- data/sample/takahashi.rb +42 -0
- data/sample/text.png +0 -0
- data/sample/textbox_sample.rb +192 -0
- data/sample/transform.rb +54 -0
- data/sample/utility_test.rb +73 -0
- data/sample/utility_test2.rb +61 -0
- data/sample/utility_test3.rb +64 -0
- data/sample/utility_test4.rb +73 -0
- data/uninstall_miyako.rb +19 -0
- data/win/miyako_no_katana.so +0 -0
- metadata +216 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
# エンディング定義
|
|
3
|
+
class Ending
|
|
4
|
+
include Story::Scene
|
|
5
|
+
include MainComponent
|
|
6
|
+
|
|
7
|
+
def init
|
|
8
|
+
@yuki = Yuki.new
|
|
9
|
+
|
|
10
|
+
def @yuki.text_wait(*txt)
|
|
11
|
+
txt.each{|t|
|
|
12
|
+
text t
|
|
13
|
+
wait 0.3
|
|
14
|
+
}
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
@yuki.select_textbox(message_box[:box])
|
|
18
|
+
@bg = Sprite.new(:file => "image/congratulation_bg.png", :type => :as)
|
|
19
|
+
@bg.oh = @bg.h / 2
|
|
20
|
+
@anim = SpriteAnimation.new(:sprite=>@bg, :wait=>0.5)
|
|
21
|
+
@cong_text = Sprite.new(:file=>"image/congra.png", :type => :ck)
|
|
22
|
+
@cong_text.centering!
|
|
23
|
+
@visible_cong_text = false
|
|
24
|
+
@cong_man = Sprite.new(:file=>"image/congratulation.png", :type => :ck)
|
|
25
|
+
@cong_man.center!.bottom!
|
|
26
|
+
@visible_cong_man = false
|
|
27
|
+
@timer = WaitCounter.new(3)
|
|
28
|
+
@staff_roll = [Shape.text(:font=>message_box[:box].font, :align=>:center){
|
|
29
|
+
text "シナリオ・グラフィック・"
|
|
30
|
+
cr
|
|
31
|
+
text "スクリプティング・その他雑用"
|
|
32
|
+
cr.cr
|
|
33
|
+
text "サイロス 誠"
|
|
34
|
+
},
|
|
35
|
+
Shape.text(:font=>message_box[:box].font){ text "Powerd By Miyako 2.0" }
|
|
36
|
+
]
|
|
37
|
+
@staff_roll.each{|st|
|
|
38
|
+
st.snap(message_box)
|
|
39
|
+
st.centering!
|
|
40
|
+
}
|
|
41
|
+
@index = -1
|
|
42
|
+
|
|
43
|
+
@end_roll = Shape.text(:font=>message_box[:box].font){ text "T H E E N D" }
|
|
44
|
+
@end_roll.snap(message_box)
|
|
45
|
+
@end_roll.centering!
|
|
46
|
+
@yuki.regist_parts(:end_roll, @end_roll)
|
|
47
|
+
@yuki.vars[:staff_roll] = self.method(:staff_roll)
|
|
48
|
+
|
|
49
|
+
@exec = self.method(:view_in1)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def setup
|
|
53
|
+
@yuki.setup
|
|
54
|
+
@anim.start
|
|
55
|
+
@timer.start
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def update
|
|
59
|
+
return nil if Input.quit_or_escape?
|
|
60
|
+
@anim.update_animation
|
|
61
|
+
return @exec.call
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def render
|
|
65
|
+
@anim.render
|
|
66
|
+
@cong_text.render
|
|
67
|
+
@cong_man.render if @visible_cong_man
|
|
68
|
+
if @exec == self.method(:plot_executing)
|
|
69
|
+
@yuki.render
|
|
70
|
+
message_box.render
|
|
71
|
+
@staff_roll[@index].render if @index >= 0
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def view_in1
|
|
76
|
+
if @timer.finish?
|
|
77
|
+
@visible_cong_man = true
|
|
78
|
+
@timer.start
|
|
79
|
+
@exec = self.method(:view_in2)
|
|
80
|
+
end
|
|
81
|
+
return @now
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def view_in2
|
|
85
|
+
if @timer.finish?
|
|
86
|
+
@exec = self.method(:plot_executing)
|
|
87
|
+
@yuki.start_plot(plot)
|
|
88
|
+
end
|
|
89
|
+
return @now
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def plot_executing
|
|
93
|
+
message_box.update_animation
|
|
94
|
+
command_box.update_animation
|
|
95
|
+
@yuki.update
|
|
96
|
+
r = @yuki.executing? ? @now : @yuki.result
|
|
97
|
+
if @yuki.is_scenario?(r)
|
|
98
|
+
@yuki.exec_plot(r)
|
|
99
|
+
r = @now
|
|
100
|
+
end
|
|
101
|
+
return r
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def plot
|
|
105
|
+
yuki_plot do
|
|
106
|
+
text "「コ〜ン "
|
|
107
|
+
wait 0.3
|
|
108
|
+
text "グラッチュ "
|
|
109
|
+
wait 0.3
|
|
110
|
+
text "レ〜ショ〜ン♪」"
|
|
111
|
+
pause.cr
|
|
112
|
+
text "「いやぁ、"
|
|
113
|
+
wait 0.2
|
|
114
|
+
text "見事難関をクリアしたとはオドロキだ!"
|
|
115
|
+
pause.cr
|
|
116
|
+
text " 君には全くもって、感服だ!」"
|
|
117
|
+
pause.clear
|
|
118
|
+
text "「勿論、クリアしたんだから"
|
|
119
|
+
wait 0.5
|
|
120
|
+
cr
|
|
121
|
+
text " 商品をプレゼントしなくちゃね!」"
|
|
122
|
+
pause.clear
|
|
123
|
+
text_wait "「まずは", "・", "・", "・"
|
|
124
|
+
text "「青いはいからうどん」1年分!"
|
|
125
|
+
wait 0.5
|
|
126
|
+
cr
|
|
127
|
+
text_wait " 次に", "・", "・", "・"
|
|
128
|
+
text "いつも真っ赤「炎天下ツアー」!"
|
|
129
|
+
wait 0.5
|
|
130
|
+
cr
|
|
131
|
+
text_wait " 最後に", "・", "・", "・"
|
|
132
|
+
text "「緑のバルーン」提供の沖縄旅行!"
|
|
133
|
+
wait 0.5
|
|
134
|
+
cr
|
|
135
|
+
text " 現地集合現地解散!"
|
|
136
|
+
wait 0.5
|
|
137
|
+
cr
|
|
138
|
+
text " さ、遠慮せずにうけとってくれ!」"
|
|
139
|
+
pause.clear
|
|
140
|
+
text "「今日は見事クリアされたけど、"
|
|
141
|
+
cr
|
|
142
|
+
text " 次回はもっと"
|
|
143
|
+
color(:red){ "ヒィヒィ"}
|
|
144
|
+
text "言わせる"
|
|
145
|
+
cr
|
|
146
|
+
text " 仕掛けを用意するから覚悟しとけよ〜!」"
|
|
147
|
+
pause.clear
|
|
148
|
+
text "「次回の挑戦者はキミだ!"
|
|
149
|
+
wait 0.5
|
|
150
|
+
cr
|
|
151
|
+
text " じゃ、また来週! "
|
|
152
|
+
wait 0.5
|
|
153
|
+
text "バイバ〜イ!」"
|
|
154
|
+
pause.clear
|
|
155
|
+
vars[:staff_roll].call
|
|
156
|
+
show :end_roll
|
|
157
|
+
pause.clear
|
|
158
|
+
hide :end_roll
|
|
159
|
+
nil
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def staff_roll
|
|
164
|
+
@staff_roll.length.times{|idx|
|
|
165
|
+
@index = idx
|
|
166
|
+
@yuki.wait 2.0
|
|
167
|
+
}
|
|
168
|
+
@index = -1
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def final
|
|
172
|
+
@anim.stop
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
def dispose
|
|
176
|
+
@cong_man.dispose
|
|
177
|
+
@cong_text.dispose
|
|
178
|
+
@anim.dispose
|
|
179
|
+
end
|
|
180
|
+
end
|
|
@@ -0,0 +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!.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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +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!.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
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
# 共通部品クラス
|
|
3
|
+
# メッセージテキストボックス、コマンドボックスを定義
|
|
4
|
+
module MainComponent
|
|
5
|
+
def self.create_textbox(size, font, color)
|
|
6
|
+
# ポーズカーソル作成
|
|
7
|
+
wc = Sprite.new(:file=>"image/wait_cursor.png", :type=>:ac)
|
|
8
|
+
wc.oh = wc.w
|
|
9
|
+
wc = SpriteAnimation.new(:sprite => wc, :wait => 0.2, :pattern_list => [0, 1, 2, 3, 2, 1])
|
|
10
|
+
|
|
11
|
+
# 選択カーソル作成
|
|
12
|
+
sc = Sprite.new(:file=>"image/cursor.png", :type=>:ac)
|
|
13
|
+
sc.oh = sc.w
|
|
14
|
+
sc = SpriteAnimation.new(:sprite => sc, :wait => 0.2, :pattern_list => [0, 1, 2, 3, 2, 1])
|
|
15
|
+
|
|
16
|
+
tb = TextBox.new(:size=>size, :font=>font, :wait_cursor=>wc, :select_cursor=>sc)
|
|
17
|
+
tb.set_wait_cursor_position{|wc,tbox| wc.right!.bottom! } # ウェイトカーソルとボックスの右下に
|
|
18
|
+
|
|
19
|
+
bg = Sprite.new(:size=>tb.size.map{|n| n + 4}, :type=>:ac)
|
|
20
|
+
bg.fill(color)
|
|
21
|
+
|
|
22
|
+
box = Parts.new(bg.size)
|
|
23
|
+
box[:bg] = bg
|
|
24
|
+
box[:bg].centering!
|
|
25
|
+
box[:box] = tb
|
|
26
|
+
box[:box].centering!
|
|
27
|
+
|
|
28
|
+
return box
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# 共通変数
|
|
32
|
+
@@vars = { }
|
|
33
|
+
|
|
34
|
+
def var
|
|
35
|
+
return @@vars
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# フォント作成
|
|
39
|
+
font = Font.sans_serif
|
|
40
|
+
font.size = 24
|
|
41
|
+
font.use_shadow = true
|
|
42
|
+
|
|
43
|
+
# メッセージボックス作成
|
|
44
|
+
@@message_box = self.create_textbox(Size.new(24, 4), font, [0, 0, 255, 128])
|
|
45
|
+
@@message_box.center!.bottom!{|body| (0.1).ratio(body) }
|
|
46
|
+
|
|
47
|
+
@@command_box = self.create_textbox(Size.new( 8, 4), font, [0, 255, 0, 128])
|
|
48
|
+
@@command_box.right!{|body| (0.05).ratio(body) }.top!{|body| (0.05).ratio(body) }
|
|
49
|
+
|
|
50
|
+
# メッセージボックスを動かさないこと前提
|
|
51
|
+
def message_box
|
|
52
|
+
return @@message_box
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# メッセージボックスを動かさないこと前提
|
|
56
|
+
def command_box
|
|
57
|
+
return @@command_box
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
*******************************************************************************
|
|
2
|
+
�y ��Җ� �z�@�T�C���X��
|
|
3
|
+
�y �\�t�g�� �z�@Miyako v2.0�T���v��(�A�h�x���`���[�Q�[���u�݂��̕����v)
|
|
4
|
+
�y �o�[�W���� �z�@2.0
|
|
5
|
+
�y �쐬�� �z�@2009/04/13
|
|
6
|
+
�y ��� �z�@�t���[�E�F�A
|
|
7
|
+
�y �J������ �z�@Ruby 1.9.1-p0
|
|
8
|
+
�y �����^�C�� �z�@Miyako v2.0
|
|
9
|
+
�y �Ή��@�� �z�@Windows 2000/XP/Vista�ALinux
|
|
10
|
+
�y �Ĕz�z �z�@�C��BSD���C�Z���X�ɂ��
|
|
11
|
+
�y �]�� �z�@�C��BSD���C�Z���X�ɂ��
|
|
12
|
+
�y�z�[���y�[�W�z�@http://www.twin.ne.jp/~cyross/Miyako/
|
|
13
|
+
�y �A���� �z�@cyross@po.twin.ne.jp
|
|
14
|
+
*******************************************************************************
|
|
15
|
+
|
|
16
|
+
�E�T�v
|
|
17
|
+
|
|
18
|
+
�@���̃v���O�����́AMiyako v2.0�ȍ~�ɑΉ�����AMiyako�T���v���v���O�����ł��B
|
|
19
|
+
�@�A�h�x���`���[�Q�[����V�Ԃ��Ƃ��ł��܂��B
|
|
20
|
+
�@�Ƃ���e���r�ԑg�̃Q�[���R�[�i�[�A�R�̕����̌������ɂ���A��ؓ�ł͂����Ȃ��ʁX���ǂ��ɂ����āA�N���A�ɕK�v�ȁu�������t�v�������o���Ă��������B
|
|
21
|
+
|
|
22
|
+
�EMiyako�ɂ���
|
|
23
|
+
|
|
24
|
+
�@Miyako�Ɋւ��ẮA�ȉ���URL���Q�l�ɂ��Ă��������B
|
|
25
|
+
(���C���T�C�g)
|
|
26
|
+
http://www.twin.ne.jp/~cyross/Miyako/
|
|
27
|
+
(Wiki)
|
|
28
|
+
http://wiki.fdiary.net/MiyakoDevSrc/
|
|
29
|
+
|
|
30
|
+
�@Miyako(Ruby�ARuby/SDL�܂�)�̃C���X�g�[���Ɋւ��܂��ẮA
|
|
31
|
+
��LURL��H���ē�����A�[�J�C�u���ꂽMiyako���C�u������
|
|
32
|
+
�W�J����ƁAreadme.txt�������܂��̂ŁA����������Q�Ɖ������B
|
|
33
|
+
|
|
34
|
+
�@�{�T���v���ł́AMiyako��Windows��œ��삷�邱�Ƃ�O��ɂ��Ă��܂��B
|
|
35
|
+
�i�C���X�g�[������Ruby���s����ActiveRuby�ł��邱�Ƃ��O���
|
|
36
|
+
�@���Ă��܂��j
|
|
37
|
+
|
|
38
|
+
�E�N�����@
|
|
39
|
+
|
|
40
|
+
�@�G�N�X�v���[���[���J���A�{�T���v���̃t�H���_���ŁA�uroom3.rb�v��
|
|
41
|
+
�_�u���N���b�N���܂��B
|
|
42
|
+
�@�������́A�R�}���h���C����œ������ꍇ�́A�{�T���v���̃f�B���N�g����
|
|
43
|
+
�ړ����āA�ȉ��̃R�}���h����͂��܂��B
|
|
44
|
+
|
|
45
|
+
�@ruby room3.rb
|
|
46
|
+
|
|
47
|
+
�E�Ɛӎ���
|
|
48
|
+
|
|
49
|
+
�@�{�T���v���͖��ۏł��B�����{�T���v�����g�p���邱�Ƃɂ��s��E�g���u��
|
|
50
|
+
���N�������Ƃ��Ă��A�����Ȃ�g���u���ɑ���ӔC��Ȃ����Ƃ��������������B
|
|
51
|
+
|
|
52
|
+
�@�{�T���v���́A�C��BSD���C�Z���X�Ɋ�Â����]�ځE�Ĕz�z�������܂��B
|
|
53
|
+
|
|
54
|
+
�EBSD���C�Z���X��
|
|
55
|
+
|
|
56
|
+
Copyright (c) 2008, Cyross Makoto
|
|
57
|
+
|
|
58
|
+
All rights reserved.
|
|
59
|
+
|
|
60
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
61
|
+
|
|
62
|
+
�ERedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
63
|
+
�ERedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
64
|
+
�ENeither the name of the Cyross Makoto nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
65
|
+
|
|
66
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
67
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
68
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
69
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
70
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
71
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
72
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
73
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
74
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
75
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
76
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|