cyross-ruby-miyako 2.0.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.
Files changed (125) hide show
  1. data/README +977 -0
  2. data/Rakefile +7 -0
  3. data/img/cursor.png +0 -0
  4. data/img/cursors.png +0 -0
  5. data/img/dice.png +0 -0
  6. data/img/wait_cursor.png +0 -0
  7. data/img/win_base.png +0 -0
  8. data/img/window.png +0 -0
  9. data/install_miyako.rb +75 -0
  10. data/lib/Miyako/API/audio.rb +198 -0
  11. data/lib/Miyako/API/basic_data.rb +431 -0
  12. data/lib/Miyako/API/bitmap.rb +35 -0
  13. data/lib/Miyako/API/choices.rb +308 -0
  14. data/lib/Miyako/API/collision.rb +444 -0
  15. data/lib/Miyako/API/diagram.rb +573 -0
  16. data/lib/Miyako/API/drawing.rb +110 -0
  17. data/lib/Miyako/API/fixedmap.rb +315 -0
  18. data/lib/Miyako/API/font.rb +384 -0
  19. data/lib/Miyako/API/input.rb +440 -0
  20. data/lib/Miyako/API/layout.rb +451 -0
  21. data/lib/Miyako/API/map.rb +403 -0
  22. data/lib/Miyako/API/map_event.rb +198 -0
  23. data/lib/Miyako/API/modules.rb +109 -0
  24. data/lib/Miyako/API/movie.rb +151 -0
  25. data/lib/Miyako/API/parts.rb +154 -0
  26. data/lib/Miyako/API/plane.rb +131 -0
  27. data/lib/Miyako/API/screen.rb +257 -0
  28. data/lib/Miyako/API/shape.rb +362 -0
  29. data/lib/Miyako/API/sprite.rb +338 -0
  30. data/lib/Miyako/API/sprite_animation.rb +461 -0
  31. data/lib/Miyako/API/spriteunit.rb +113 -0
  32. data/lib/Miyako/API/story.rb +224 -0
  33. data/lib/Miyako/API/textbox.rb +496 -0
  34. data/lib/Miyako/API/viewport.rb +435 -0
  35. data/lib/Miyako/API/yuki.rb +779 -0
  36. data/lib/Miyako/EXT/miyako_cairo.rb +60 -0
  37. data/lib/Miyako/EXT/raster_scroll.rb +138 -0
  38. data/lib/Miyako/EXT/slides.rb +136 -0
  39. data/lib/Miyako/miyako.rb +172 -0
  40. data/miyako.png +0 -0
  41. data/miyako_banner.png +0 -0
  42. data/miyako_no_katana/extconf.rb +34 -0
  43. data/miyako_no_katana/miyako_no_katana.c +3301 -0
  44. data/sample/Animation1/m1ku.rb +89 -0
  45. data/sample/Animation1/m1ku_arm_0.png +0 -0
  46. data/sample/Animation1/m1ku_arm_1.png +0 -0
  47. data/sample/Animation1/m1ku_arm_2.png +0 -0
  48. data/sample/Animation1/m1ku_arm_3.png +0 -0
  49. data/sample/Animation1/m1ku_back.jpg +0 -0
  50. data/sample/Animation1/m1ku_body.png +0 -0
  51. data/sample/Animation1/m1ku_eye_0.png +0 -0
  52. data/sample/Animation1/m1ku_eye_1.png +0 -0
  53. data/sample/Animation1/m1ku_eye_2.png +0 -0
  54. data/sample/Animation1/m1ku_eye_3.png +0 -0
  55. data/sample/Animation1/m1ku_hair_front.png +0 -0
  56. data/sample/Animation1/m1ku_hair_rear.png +0 -0
  57. data/sample/Animation1/readme.txt +72 -0
  58. data/sample/Animation2/lex.rb +95 -0
  59. data/sample/Animation2/lex_back.png +0 -0
  60. data/sample/Animation2/lex_body.png +0 -0
  61. data/sample/Animation2/lex_roadroller.png +0 -0
  62. data/sample/Animation2/lex_wheel_0.png +0 -0
  63. data/sample/Animation2/lex_wheel_1.png +0 -0
  64. data/sample/Animation2/lex_wheel_2.png +0 -0
  65. data/sample/Animation2/readme.txt +72 -0
  66. data/sample/Animation2/song_title.png +0 -0
  67. data/sample/Diagram_sample/back.png +0 -0
  68. data/sample/Diagram_sample/chr01.png +0 -0
  69. data/sample/Diagram_sample/chr02.png +0 -0
  70. data/sample/Diagram_sample/cursor.png +0 -0
  71. data/sample/Diagram_sample/diagram_sample_yuki2.rb +283 -0
  72. data/sample/Diagram_sample/readme.txt +87 -0
  73. data/sample/Diagram_sample/wait_cursor.png +0 -0
  74. data/sample/Room3/blue.rb +250 -0
  75. data/sample/Room3/ending.rb +175 -0
  76. data/sample/Room3/green.rb +185 -0
  77. data/sample/Room3/image/akamatsu.png +0 -0
  78. data/sample/Room3/image/aoyama.png +0 -0
  79. data/sample/Room3/image/congra.png +0 -0
  80. data/sample/Room3/image/congratulation.png +0 -0
  81. data/sample/Room3/image/congratulation_bg.png +0 -0
  82. data/sample/Room3/image/cursor.png +0 -0
  83. data/sample/Room3/image/midori.png +0 -0
  84. data/sample/Room3/image/mittsu_no_oheya.png +0 -0
  85. data/sample/Room3/image/mittsu_no_oheya_logo.png +0 -0
  86. data/sample/Room3/image/room_blue.png +0 -0
  87. data/sample/Room3/image/room_green.png +0 -0
  88. data/sample/Room3/image/room_red.png +0 -0
  89. data/sample/Room3/image/start.png +0 -0
  90. data/sample/Room3/image/three_doors.png +0 -0
  91. data/sample/Room3/image/wait_cursor.png +0 -0
  92. data/sample/Room3/main.rb +102 -0
  93. data/sample/Room3/main_component.rb +58 -0
  94. data/sample/Room3/readme.txt +76 -0
  95. data/sample/Room3/red.rb +200 -0
  96. data/sample/Room3/room3.rb +26 -0
  97. data/sample/Room3/title.rb +171 -0
  98. data/sample/fixed_map_test/cursor.png +0 -0
  99. data/sample/fixed_map_test/fixed_map_sample.rb +149 -0
  100. data/sample/fixed_map_test/map.csv +19 -0
  101. data/sample/fixed_map_test/map_01.png +0 -0
  102. data/sample/fixed_map_test/map_sample.rb +121 -0
  103. data/sample/fixed_map_test/mapchip.csv +23 -0
  104. data/sample/fixed_map_test/monster.png +0 -0
  105. data/sample/fixed_map_test/readme.txt +72 -0
  106. data/sample/map_test/chara.rb +50 -0
  107. data/sample/map_test/chr1.png +0 -0
  108. data/sample/map_test/cursor.png +0 -0
  109. data/sample/map_test/main_parts.rb +48 -0
  110. data/sample/map_test/main_scene.rb +137 -0
  111. data/sample/map_test/map.png +0 -0
  112. data/sample/map_test/map2.png +0 -0
  113. data/sample/map_test/map_layer.csv +127 -0
  114. data/sample/map_test/map_manager.rb +92 -0
  115. data/sample/map_test/map_test.rb +23 -0
  116. data/sample/map_test/mapchip.csv +21 -0
  117. data/sample/map_test/oasis.rb +65 -0
  118. data/sample/map_test/readme.txt +87 -0
  119. data/sample/map_test/route.rb +144 -0
  120. data/sample/map_test/sea.png +0 -0
  121. data/sample/map_test/town.rb +68 -0
  122. data/sample/map_test/wait_cursor.png +0 -0
  123. data/sample/map_test/window.png +0 -0
  124. data/win/miyako_no_katana.so +0 -0
  125. metadata +194 -0
@@ -0,0 +1,87 @@
1
+ *******************************************************************************
2
+ �y ��Җ� �z�@�T�C���X��
3
+ �y �\�t�g�� �z�@Miyako v1.5�T���v��(�J�ڐ}�`��)
4
+ �y �o�[�W���� �z�@1.2.1
5
+ �y �쐬�� �z�@2008/06/06
6
+ �y ��� �z�@�t���[�E�F�A
7
+ �y �J������ �z�@Ruby 1.8.6-p114
8
+ �y �����^�C�� �z�@Miyako v1.5RC3
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 v1.5pre7�ȍ~�ɑΉ�����AMiyako�T���v���v���O�����ł��B
19
+ �@�L�����N�^�̑��d�X�N���[�����s���܂�(���ꂾ���ł����E�E�E)
20
+
21
+ �EMiyako�ɂ‚���
22
+
23
+ �@Miyako�Ɋւ��ẮA�ȉ���URL���Q�l�ɂ��Ă��������B
24
+ http://www.twin.ne.jp/~cyross/Miyako/
25
+
26
+ �@Miyako(Ruby�ARuby/SDL�܂�)�̃C���X�g�[���Ɋւ��܂��ẮA
27
+ ��LURL��H���ē�����A�[�J�C�u���ꂽMiyako���C�u������
28
+ �W�J����ƁAreadme.txt�������܂��̂ŁA����������Q�Ɖ������B
29
+
30
+ �@�{�T���v���ł́AMiyako��Windows��œ��삷�邱�Ƃ�O��ɂ��Ă��܂��B
31
+ �i�C���X�g�[������Ruby���s�‹���ActiveRuby�ł��邱�Ƃ��O���
32
+ �@���Ă��܂��j
33
+
34
+ �E�N�����@
35
+
36
+ �@�G�N�X�v���[���[���J���A�{�T���v���̃t�H���_���ŁA�udiagram_sample.rb�v��
37
+ �_�u���N���b�N���܂��B
38
+ �@�������́A�R�}���h���C����œ������ꍇ�́A�{�T���v���̃f�B���N�g����
39
+ �ړ����āA�ȉ��̃R�}���h����͂��܂��B
40
+
41
+ �@ruby diagram_sample.rb
42
+
43
+ �E�Ɛӎ���
44
+
45
+ �@�{�T���v���͖��ۏ؂ł��B�����{�T���v�����g�p���邱�Ƃɂ��s��E�g���u��
46
+ ���N�������Ƃ��Ă��A�����Ȃ�g���u���ɑ΂���ӔC�𕉂�Ȃ����Ƃ��������������B
47
+
48
+ �@�{�T���v���́A�C��BSD���C�Z���X�Ɋ�Â����]�ځE�Ĕz�z�����‚��܂��B
49
+
50
+ �@�܂��A�{�T���v���ł́A�w�i�摜�ɁA�w�i�摜�f�ޏW�u�}�E�ʌi�v�̋����摜���g�p���Ă��܂��B
51
+ �@http://naox.cool.ne.jp/bonkai1/
52
+
53
+ �E�X�V����
54
+
55
+ �@(1.1)
56
+ �@�E�����S�̂���‚̑J�ڐ}�`���ɂ܂Ƃ߂�(����q�̑J�ڐ}���ł���T���v��)
57
+ �@�EYuki�ɂ�郁�b�Z�[�W�\����lj�
58
+
59
+ �@(1.2)
60
+ �@�E�J�ڐ}�`���N���X���̏C��
61
+
62
+ �@(1.2.1)
63
+ �@�ERC3�Œlj�����Yuki::Yuki2�N���X�Ή���diagram_sample_yuki2.rb��lj�
64
+
65
+ �EBSD���C�Z���X��
66
+
67
+ Copyright (c) 2008, Cyross Makoto
68
+
69
+ All rights reserved.
70
+
71
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
72
+
73
+ �ERedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
74
+ �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.
75
+ �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.
76
+
77
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
78
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
79
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
80
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
81
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
82
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
83
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
84
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
85
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
86
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
87
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,250 @@
1
+ class Blue
2
+ include Story::Scene
3
+ include MainComponent
4
+
5
+ def init
6
+ @yuki = Yuki.new
7
+ @yuki.select_textbox(message_box[:box])
8
+ @yuki.select_commandbox(command_box[:box])
9
+ @aoyama = Sprite.new(:file => "image/aoyama.png", :type => :ck)
10
+ @aoyama.center.bottom
11
+ @yuki.regist_parts(:aoyama, @aoyama)
12
+
13
+ @room = Sprite.new(:file => "image/room_blue.png", :type => :as)
14
+ @room.center.bottom
15
+
16
+ var[:aoyama_aisatsu] = false if var[:aoyama_aisatsu] == nil
17
+ var[:release_aoyama_book] = false if var[:release_aoyama_book] == nil
18
+ var[:search_bookmark] = false if var[:search_bookmark] == nil
19
+ var[:look_video_base] = false if var[:look_video_base] == nil
20
+ var[:get_bookmark] = false if var[:get_bookmark] == nil
21
+ var[:release_akamatsu_book] = false if var[:release_akamatsu_book] == nil
22
+ end
23
+
24
+ def setup
25
+ @yuki.setup
26
+ @yuki.exec_plot(self.method(:plot))
27
+ end
28
+
29
+ def update
30
+ return nil if Input.quit_or_escape?
31
+ message_box.update_animation
32
+ command_box.update_animation
33
+ @yuki.update
34
+ r = @yuki.executing? ? @now : @yuki.result
35
+ if @yuki.is_scenario?(r)
36
+ @yuki.exec_plot(r)
37
+ r = @now
38
+ end
39
+ return r
40
+ end
41
+
42
+ def render
43
+ @room.render
44
+ @yuki.render
45
+ message_box.render
46
+ command_box.render if @yuki.selecting?
47
+ end
48
+
49
+ def get_command
50
+ return [Yuki::Command.new("挨拶する", nil, lambda{var[:aoyama_aisatsu]==false}, self.method(:blue2)),
51
+ Yuki::Command.new("辺りを見る", nil, lambda{var[:aoyama_aisatsu]==true}, self.method(:look_blue)),
52
+ Yuki::Command.new("話す", nil, lambda{var[:aoyama_aisatsu]==true}, self.method(:talk)),
53
+ Yuki::Command.new("渡す", nil, lambda{var[:aoyama_aisatsu]==true && var[:release_aoyama_book]==true && var[:release_akamatsu_book]==false}, self.method(:send1)),
54
+ Yuki::Command.new("探す", nil, lambda{var[:search_bookmark]==true && var[:get_bookmark]==false}, self.method(:search)),
55
+ Yuki::Command.new("戻る", nil, lambda{var[:aoyama_aisatsu]==true}, MainScene)]
56
+ end
57
+
58
+ def get_search
59
+ "どこを?"
60
+ return [Yuki::Command.new("壁", nil, nil, self.method(:wall)),
61
+ Yuki::Command.new("テレビ", nil, nil, self.method(:tv)),
62
+ Yuki::Command.new("テレビ台", nil, nil, self.method(:tv_base)),
63
+ Yuki::Command.new("ビデオデッキ", nil, lambda{var[:look_video_base] == true}, self.method(:video)),
64
+ Yuki::Command.new("テレビゲーム機", nil, lambda{var[:look_video_base] == true}, self.method(:tv_game)),
65
+ Yuki::Command.new("ソファー", nil, nil, self.method(:sofar)),
66
+ Yuki::Command.new("ベッド", nil, nil, self.method(:bed)),
67
+ Yuki::Command.new("戻る", nil, nil, "ret")]
68
+ end
69
+
70
+ def plot(yuki)
71
+ yuki.text "青の扉から中に入った。"
72
+ yuki.pause.clear
73
+ yuki.show :aoyama
74
+ yuki.text "目の前には"
75
+ yuki.color(:cyan){var[:aoyama_aisatsu]==true ? "青山くん" : "男の子"}
76
+ yuki.text "が居る。"
77
+ yuki.cr
78
+ return self.method(:main_command)
79
+ end
80
+
81
+ def main_command(yuki)
82
+ loop do
83
+ yuki.show :aoyama
84
+ yuki.text "どうする?"
85
+ yuki.command get_command
86
+ yuki.clear
87
+ return yuki.select_result if yuki.is_scene?(yuki.select_result)
88
+ yuki.select_result.call(yuki) if yuki.is_scenario?(yuki.select_result)
89
+ end
90
+ end
91
+
92
+ def blue2(yuki)
93
+ yuki.text "「オレの名前は"
94
+ yuki.color(:cyan){"青山"}
95
+ yuki.text "。よろしくな」"
96
+ yuki.pause.clear
97
+ var[:aoyama_aisatsu]=true
98
+ end
99
+
100
+ def look_blue(yuki)
101
+ yuki.text "部屋の中は整然としている。"
102
+ yuki.pause.cr
103
+ yuki.text "中にはテレビとソファーがあり、"
104
+ yuki.cr
105
+ yuki.text "ゆったりとくつろげるようになっている。"
106
+ yuki.pause.clear
107
+ end
108
+
109
+ def talk(yuki)
110
+ yuki.text "「まぁ、オレはこうやってのんびりするのが"
111
+ yuki.cr
112
+ yuki.text " 好きなんだな。"
113
+ yuki.pause.cr
114
+ yuki.text " とはいえども、いわゆるニートってやつじゃない。"
115
+ yuki.pause.clear
116
+ yuki.text " ここには無いが、パソコン使って"
117
+ yuki.cr
118
+ yuki.text " 株の取引やってるわけさ。」"
119
+ yuki.pause.clear
120
+ end
121
+
122
+ def send1(yuki)
123
+ yuki.text "あなたは、みどりさんから受け取っていた本を返した。"
124
+ yuki.pause.clear
125
+ yuki.text "「おお、サンキュ。"
126
+ yuki.pause.cr
127
+ yuki.text " みどりから受け取ったのか。"
128
+ yuki.pause.cr
129
+ yuki.text " じゃああんたも、"
130
+ yuki.color(:red){"ブチギレみどり"}
131
+ yuki.text "を見たってわけか。」"
132
+ yuki.pause.clear
133
+ yuki.text "そのとき、どこからともなく声が聞こえた。"
134
+ yuki.wait 0.5
135
+ yuki.cr
136
+ yuki.color(:red){
137
+ yuki.text "『なあぁぁぁんですってぇぇぇぇ"
138
+ yuki.wait 0.5
139
+ yuki.cr
140
+ yuki.text "私のどこがブチ切れてるってぇぇぇ!?』"
141
+ }
142
+ yuki.pause.cr
143
+ yuki.text "「・・・ほらね。」"
144
+ yuki.pause.clear
145
+ yuki.text "「じゃあ、ついでにオレからも、"
146
+ yuki.pause.cr
147
+ yuki.text " 隣りの赤松さんところへ行って、"
148
+ yuki.pause.cr
149
+ yuki.text " この本を返してきてくれないかなぁ?"
150
+ yuki.pause.cr
151
+ yuki.text " 頼むよ。」"
152
+ yuki.pause.clear
153
+ yuki.text " 赤松さんの本を受け取った。"
154
+ yuki.pause.clear
155
+ var[:release_akamatsu_book] = true
156
+ end
157
+
158
+ def search(yuki)
159
+ yuki.text "「どうぞ」"
160
+ yuki.cr
161
+ yuki.hide :aoyama
162
+ return search_command(yuki)
163
+ end
164
+
165
+ def search_command(yuki)
166
+ loop do
167
+ yuki.command get_search, "ret"
168
+ yuki.clear
169
+ break if yuki.select_result.kind_of?(String) && yuki.select_result == "ret"
170
+ yuki.select_result.call(yuki) if yuki.is_scenario?(yuki.select_result)
171
+ end
172
+ end
173
+
174
+ def wall(yuki)
175
+ yuki.text "壁を調べてみた。"
176
+ yuki.pause.cr
177
+ yuki.text "何もないようだ。"
178
+ yuki.pause.clear
179
+ end
180
+
181
+ def tv(yuki)
182
+ yuki.text "テレビを調べてみた。"
183
+ yuki.pause.cr
184
+ yuki.text "テレビを点けてみた。"
185
+ yuki.pause.cr
186
+ yuki.text "・・・つまらんなぁ、この番組。"
187
+ yuki.pause.clear
188
+ end
189
+
190
+ def tv_base(yuki)
191
+ yuki.text "テレビ台を調べてみた。"
192
+ yuki.pause.cr
193
+ yuki.text "中にはビデオデッキとテレビゲーム機があるようだ。"
194
+ yuki.pause.clear
195
+ var[:look_video_base] = true
196
+ end
197
+
198
+ def video(yuki)
199
+ yuki.text "ビデオデッキを調べてみた。"
200
+ yuki.pause.cr
201
+ yuki.text "いわゆるHDDビデオデッキだ。"
202
+ yuki.pause.clear
203
+ video2(yuki) if var[:get_bookmark]==false
204
+ end
205
+
206
+ def video2(yuki)
207
+ yuki.text "・・・"
208
+ yuki.wait 0.3
209
+ yuki.text "ン!? 何か挟まってる。"
210
+ yuki.pause.cr
211
+ yuki.text "引っ張り出してみると、"
212
+ yuki.color(:red){"真っ赤な栞"}
213
+ yuki.text "だ。"
214
+ yuki.pause.cr
215
+ yuki.color(:red){"栞"}
216
+ yuki.text "を見つけ出した!"
217
+ yuki.pause.cr
218
+ yuki.text "「良かったなぁ、見つかって。」"
219
+ yuki.pause.clear
220
+ var[:get_bookmark] = true
221
+ end
222
+
223
+ def tv_game(yuki)
224
+ yuki.text "テレビゲーム機を調べてみた。"
225
+ yuki.pause.cr
226
+ yuki.text "・・・このゲーム機、対応ゲーム出てる?"
227
+ yuki.pause.clear
228
+ end
229
+
230
+ def sofar(yuki)
231
+ yuki.text "ソファーを調べてみた。"
232
+ yuki.pause.cr
233
+ yuki.text "ふかふかだ。"
234
+ yuki.wait 0.5
235
+ yuki.text "ここで寝そべりたい・・・。"
236
+ yuki.pause.clear
237
+ end
238
+
239
+ def bed(yuki)
240
+ yuki.text "ベッドを調べてみた。"
241
+ yuki.pause.cr
242
+ yuki.text "ソファーより固そうだ。"
243
+ yuki.pause.clear
244
+ end
245
+
246
+ def dispose
247
+ @aoyama.dispose
248
+ @room.dispose
249
+ end
250
+ end
@@ -0,0 +1,175 @@
1
+ # エンディング定義
2
+ class Ending
3
+ include Story::Scene
4
+ include MainComponent
5
+
6
+ def init
7
+ @yuki = Yuki.new
8
+ @yuki.select_textbox(message_box[:box])
9
+ @bg = Sprite.new(:file => "image/congratulation_bg.png", :type => :as)
10
+ @bg.oh = @bg.h / 2
11
+ @anim = SpriteAnimation.new(:sprite=>@bg, :wait=>0.5)
12
+ @cong_text = Sprite.new(:file=>"image/congra.png", :type => :ck)
13
+ @cong_text.centering
14
+ @visible_cong_text = false
15
+ @cong_man = Sprite.new(:file=>"image/congratulation.png", :type => :ck)
16
+ @cong_man.center.bottom
17
+ @visible_cong_man = false
18
+ @timer = WaitCounter.new(3)
19
+ @staff_roll = [Shape.text(:font=>message_box[:box].font, :align=>:center){
20
+ text "シナリオ・グラフィック・"
21
+ cr
22
+ text "スクリプティング・その他雑用"
23
+ cr.cr
24
+ text "サイロス 誠"
25
+ },
26
+ Shape.text(:font=>message_box[:box].font){ text "Powerd By Miyako 2.0" }
27
+ ]
28
+ @staff_roll.each{|st|
29
+ st.snap(message_box)
30
+ st.centering
31
+ }
32
+ @index = -1
33
+
34
+ @end_roll = Shape.text(:font=>message_box[:box].font){ text "T H E  E N D" }
35
+ @end_roll.snap(message_box)
36
+ @end_roll.centering
37
+ @yuki.regist_parts(:end_roll, @end_roll)
38
+
39
+ @exec = self.method(:view_in1)
40
+ end
41
+
42
+ def setup
43
+ @yuki.setup
44
+ @anim.start
45
+ @timer.start
46
+ end
47
+
48
+ def update
49
+ return nil if Input.quit_or_escape?
50
+ @anim.update_animation
51
+ return @exec.call
52
+ end
53
+
54
+ def render
55
+ @anim.render
56
+ @cong_text.render
57
+ @cong_man.render if @visible_cong_man
58
+ if @exec == self.method(:plot_executing)
59
+ @yuki.render
60
+ message_box.render
61
+ @staff_roll[@index].render if @index >= 0
62
+ end
63
+ end
64
+
65
+ def view_in1
66
+ if @timer.finish?
67
+ @visible_cong_man = true
68
+ @timer.start
69
+ @exec = self.method(:view_in2)
70
+ end
71
+ return @now
72
+ end
73
+
74
+ def view_in2
75
+ if @timer.finish?
76
+ @exec = self.method(:plot_executing)
77
+ @yuki.exec_plot(self.method(:plot))
78
+ end
79
+ return @now
80
+ end
81
+
82
+ def plot_executing
83
+ message_box.update_animation
84
+ command_box.update_animation
85
+ @yuki.update
86
+ r = @yuki.executing? ? @now : @yuki.result
87
+ if @yuki.is_scenario?(r)
88
+ @yuki.exec_plot(r)
89
+ r = @now
90
+ end
91
+ return r
92
+ end
93
+
94
+ def plot(yuki)
95
+ yuki.text "「コ〜ン "
96
+ yuki.wait 0.3
97
+ yuki.text "グラッチュ "
98
+ yuki.wait 0.3
99
+ yuki.text "レ〜ショ〜ン♪」"
100
+ yuki.pause.cr
101
+ yuki.text "「いやぁ、"
102
+ yuki.wait 0.2
103
+ yuki.text "見事難関をクリアしたとはオドロキだ!"
104
+ yuki.pause.cr
105
+ yuki.text " 君には全くもって、感服だ!」"
106
+ yuki.pause.clear
107
+ yuki.text "「勿論、クリアしたんだから"
108
+ yuki.wait 0.5
109
+ yuki.cr
110
+ yuki.text " 商品をプレゼントしなくちゃね!」"
111
+ yuki.pause.clear
112
+ text_wait "「まずは", "・", "・", "・"
113
+ yuki.text "「青いはいからうどん」1年分!"
114
+ yuki.wait 0.5
115
+ yuki.cr
116
+ text_wait " 次に", "・", "・", "・"
117
+ yuki.text "いつも真っ赤「炎天下ツアー」!"
118
+ yuki.wait 0.5
119
+ yuki.cr
120
+ text_wait " 最後に", "・", "・", "・"
121
+ yuki.text "「緑のバルーン」提供の沖縄旅行!"
122
+ yuki.wait 0.5
123
+ yuki.cr
124
+ yuki.text " 現地集合現地解散!"
125
+ yuki.wait 0.5
126
+ yuki.cr
127
+ yuki.text " さ、遠慮せずにうけとってくれ!」"
128
+ yuki.pause.clear
129
+ yuki.text "「今日は見事クリアされたけど、"
130
+ yuki.cr
131
+ yuki.text " 次回はもっと"
132
+ yuki.color(:red){ "ヒィヒィ"}
133
+ yuki.text "言わせる"
134
+ yuki.cr
135
+ yuki.text " 仕掛けを用意するから覚悟しとけよ〜!」"
136
+ yuki.pause.clear
137
+ yuki.text "「次回の挑戦者はキミだ!"
138
+ yuki.wait 0.5
139
+ yuki.cr
140
+ yuki.text " じゃ、また来週! "
141
+ yuki.wait 0.5
142
+ yuki.text "バイバ〜イ!」"
143
+ yuki.pause.clear
144
+ staff_roll
145
+ yuki.show :end_roll
146
+ yuki.pause.clear
147
+ yuki.hide :end_roll
148
+ return nil
149
+ end
150
+
151
+ def text_wait(*txt)
152
+ txt.each{|t|
153
+ @yuki.text t
154
+ @yuki.wait 0.3
155
+ }
156
+ end
157
+
158
+ def staff_roll
159
+ @staff_roll.length.times{|idx|
160
+ @index = idx
161
+ @yuki.wait 2.0
162
+ }
163
+ @index = -1
164
+ end
165
+
166
+ def final
167
+ @anim.stop
168
+ end
169
+
170
+ def dispose
171
+ @cong_man.dispose
172
+ @cong_text.dispose
173
+ @anim.dispose
174
+ end
175
+ end
@@ -0,0 +1,185 @@
1
+ class Green
2
+ include Story::Scene
3
+ include MainComponent
4
+
5
+ def init
6
+ @yuki = Yuki.new
7
+ @yuki.select_textbox(message_box[:box])
8
+ @yuki.select_commandbox(command_box[:box])
9
+ @midori = Sprite.new(:file => "image/midori.png", :type => :ck)
10
+ @midori.center.bottom
11
+ @yuki.regist_parts(:midori, @midori)
12
+
13
+ @room = Sprite.new(:file => "image/room_green.png", :type => :as)
14
+ @room.center.bottom
15
+
16
+ var[:midori_aisatsu] = false if var[:midori_aisatsu] == nil
17
+ var[:release_aoyama_book] = false if var[:release_aoyama_book] == nil
18
+ var[:midori_talk] = 0 if var[:midori_talk] == nil
19
+
20
+ @talks = Array.new(6){|i| self.method("talk#{i}".to_sym)}
21
+ end
22
+
23
+ def setup
24
+ @yuki.setup
25
+ @yuki.exec_plot(self.method(:plot))
26
+ end
27
+
28
+ def update
29
+ return nil if Input.quit_or_escape?
30
+ message_box.update_animation
31
+ command_box.update_animation
32
+ @yuki.update
33
+ r = @yuki.executing? ? @now : @yuki.result
34
+ if @yuki.is_scenario?(r)
35
+ @yuki.exec_plot(r)
36
+ r = @now
37
+ end
38
+ return r
39
+ end
40
+
41
+ def render
42
+ @room.render
43
+ @yuki.render
44
+ message_box.render
45
+ command_box.render if @yuki.selecting?
46
+ end
47
+
48
+ def get_command
49
+ return [Yuki::Command.new("挨拶する", nil, lambda{var[:midori_aisatsu]==false}, self.method(:green2)),
50
+ Yuki::Command.new("辺りを見る", nil, lambda{var[:midori_aisatsu]==true}, self.method(:look_green)),
51
+ Yuki::Command.new("話す", nil, lambda{var[:midori_aisatsu]==true}, self.method(:talk)),
52
+ Yuki::Command.new("戻る", nil, lambda{var[:midori_aisatsu]==true}, MainScene)]
53
+ end
54
+
55
+ def plot(yuki)
56
+ yuki.text "緑の扉から中に入った。"
57
+ yuki.pause.clear
58
+ yuki.show :midori
59
+ yuki.text "目の前には"
60
+ yuki.color(:green){var[:midori_aisatsu]==true ? "みどりさん" : "女の人"}
61
+ yuki.text "が居る。"
62
+ yuki.cr
63
+ return self.method(:main_command)
64
+ end
65
+
66
+ def main_command(yuki)
67
+ loop do
68
+ yuki.text "どうする?"
69
+ yuki.command get_command
70
+ yuki.clear
71
+ return yuki.select_result if yuki.is_scene?(yuki.select_result)
72
+ yuki.select_result.call(yuki) if yuki.is_scenario?(yuki.select_result)
73
+ end
74
+ end
75
+
76
+ def green2(yuki)
77
+ yuki.text "「私の名前はみどり。よろしくぅ」"
78
+ yuki.pause.clear
79
+ var[:midori_aisatsu]=true
80
+ end
81
+
82
+ def look_green(yuki)
83
+ yuki.text "部屋の中は、いたってシンプルだ。"
84
+ yuki.pause.cr
85
+ yuki.text "女の子らしく、鏡台がある。"
86
+ yuki.pause.clear
87
+ end
88
+
89
+ def talk(yuki)
90
+ @talks[var[:midori_talk]].call(yuki)
91
+ end
92
+
93
+ def talk0(yuki)
94
+ yuki.text "「普通の大学生よぉ。」"
95
+ yuki.pause.clear
96
+ var[:midori_talk] += 1
97
+ end
98
+
99
+ def talk1(yuki)
100
+ yuki.text "「最近はぁ、"
101
+ yuki.wait 0.3
102
+ yuki.cr
103
+ yuki.text " お菓子作りにぃ、"
104
+ yuki.wait 0.3
105
+ yuki.cr
106
+ yuki.text " 凝ってる、"
107
+ yuki.wait 0.3
108
+ yuki.text "みたいな?」"
109
+ yuki.pause.clear
110
+ var[:midori_talk] += 1
111
+ end
112
+
113
+ def talk2(yuki)
114
+ yuki.text "「・・・え、"
115
+ yuki.wait 0.3
116
+ yuki.text "流行らないってぇ?"
117
+ yuki.wait 0.3
118
+ yuki.cr
119
+ yuki.text " 駄目よぉ。流行に流されてちゃ。」"
120
+ yuki.pause.clear
121
+ var[:midori_talk] += 1
122
+ end
123
+
124
+ def talk3(yuki)
125
+ yuki.text "「何事もぉ、"
126
+ yuki.wait 0.3
127
+ yuki.cr
128
+ yuki.text " ゴーイングマイウェイってやっていかないとぉ、"
129
+ yuki.wait 0.3
130
+ yuki.cr
131
+ yuki.text " 体持たないよっ!?」"
132
+ yuki.pause.clear
133
+ var[:midori_talk] += 1
134
+ end
135
+
136
+ def talk4(yuki)
137
+ yuki.text "「・・・ああ、そうそう!"
138
+ yuki.wait 0.3
139
+ yuki.cr
140
+ yuki.text " この本、"
141
+ yuki.wait 0.3
142
+ yuki.text "隣の青山くんのところから"
143
+ yuki.cr
144
+ yuki.text " 借りてきてたんだけどぉ、"
145
+ yuki.cr
146
+ yuki.text " 返しといてくれないかなぁ?"
147
+ yuki.wait 1.0
148
+ yuki.text "・"
149
+ yuki.wait 0.5
150
+ yuki.text "・"
151
+ yuki.wait 0.5
152
+ yuki.text "・"
153
+ yuki.wait 1.0
154
+ yuki.clear
155
+ yuki.size(32){
156
+ yuki.color(:red){
157
+ yuki.text " さっさと"
158
+ yuki.wait 0.5
159
+ yuki.cr
160
+ yuki.text " 持って行け"
161
+ yuki.wait 0.5
162
+ yuki.cr
163
+ yuki.text " っつてんだろぉ!"
164
+ }
165
+ }
166
+ yuki.text "」"
167
+ yuki.pause.clear
168
+ yuki.text "ひゃあ。"
169
+ yuki.wait 0.5
170
+ yuki.text " 結局、本を無理矢理渡された。"
171
+ yuki.pause.clear
172
+ var[:release_aoyama_book] = true
173
+ var[:midori_talk] += 1
174
+ end
175
+
176
+ def talk5(yuki)
177
+ yuki.text "「ちゃんと本渡してくれたぁ?」"
178
+ yuki.pause.clear
179
+ end
180
+
181
+ def dispose
182
+ @midori.dispose
183
+ @room.dispose
184
+ end
185
+ end
Binary file
Binary file
Binary file