1 require('script/moflib')
2 require('script/common')
3 require('script/bubble')
5 --{{{ question_attached
6 function question_attached(item_tween)
7 local items = load_game_data('gamedata.item_profile')
9 for i = 1, #items, 1 do
10 local name = get_icon_image_tag(items[i].icon_type) ..
11 '<layout w="360" h="32" xalign="left" yalign="center">' .. items[i].name .. '</layout>'
12 if tonumber(items[i].attached) == 1 then
13 if tonumber(items[i].equipped) == 1 then
14 table.insert(list, name .. '<layout w="100" h="32" xalign="right" yalign="center"><col name="blue">(
\91\95\94õ
\92\86)</col></layout>')
16 table.insert(list, name)
20 return question('
\8f\8a\8e\9d\83A
\83C
\83e
\83\80(
\8ec
\82è0
\83X
\83\8d\83b
\83g)', list, nil, nil, item_tween)
24 function question_stored(item_tween)
25 local items = load_game_data('gamedata.item_profile')
27 for i = 1, #items, 1 do
28 local name = get_icon_image_tag(items[i].icon_type) ..
29 '<layout w="360" h="32" xalign="left" yalign="center">' .. items[i].name .. '</layout>'
30 if tonumber(items[i].stored) == 1 then
31 table.insert(list, name)
34 return question('
\91q
\8cÉ
\83A
\83C
\83e
\83\80', list, nil, nil, item_tween)
38 function question_relic(item_tween)
39 local relics = load_game_data('gamedata.relic_profile')
41 for i = 1, #relics, 1 do
42 if relics[i].num ~= 0 then
43 local name = get_icon_image_tag(relics[i].icon_type) ..
44 '<layout w="360" h="32" xalign="left" yalign="center">' .. relics[i].name .. '</layout>' ..
45 '<layout w="100" h="32" xalign="right" yalign="center">' .. relics[i].num .. '
\83\96</layout>'
46 table.insert(list, name)
49 return question('
\83\8c\83\8a\83b
\83N', list, nil, nil, item_tween) -- relic
\82Í
\91S
\95\94disable
52 --{{{ question_setup_weapon
53 function question_setup_weapon(item_tween)
54 local items = load_game_data('gamedata.item_profile')
58 for i = 1, #items, 1 do
59 local type = tonumber(items[i].type);
61 if items[i].equipped == '1' then
62 state = '<layout w="100" h="32" xalign="right" yalign="center">(
\91\95\94õ
\92\86)</layout></col>'
63 elseif items[i].attached == '1' then
64 state = '<layout w="100" h="32" xalign="right" yalign="center"><col name="blue">(
\8f\8a\8e\9d)</col></layout>'
65 elseif items[i].stored == '1' then
66 state = '<layout w="100" h="32" xalign="right" yalign="center"><col name="blue">(
\91q
\8cÉ)</col></layout>'
68 if type == ITEM_TYPE_KNIGH or type == ITEM_TYPE_SWORD or type == ITEM_TYPE_BLADE then
69 --
\91\95\94õ
\92\86\82¾
\82Á
\82½
\82çdisable
70 if items[i].equipped == '1' then
71 local name = get_icon_image_tag(items[i].icon_type) ..
72 '<col name="gray"><layout w="360" h="32" xalign="left" yalign="center">' .. items[i].name .. '</layout>'
73 table.insert(list, name .. state)
74 table.insert(disables, num_items)
76 local name = get_icon_image_tag(items[i].icon_type) ..
77 '<layout w="360" h="32" xalign="left" yalign="center">' .. items[i].name .. '</layout>'
78 table.insert(list, name .. state)
80 num_items = num_items + 1
83 return question('
\91\95\94õ
\82·
\82é
\95\90\8aí
\82ð
\91I
\91ð', list, nil, disables, item_tween)
86 --{{{ question_setup_armer
87 function question_setup_armer(item_tween)
88 local items = load_game_data('gamedata.item_profile')
92 for i = 1, #items, 1 do
93 local type = tonumber(items[i].type);
95 if items[i].equipped == '1' then
96 state = '<layout w="100" h="32" xalign="right" yalign="center">(
\91\95\94õ
\92\86)</layout></col>'
97 elseif items[i].attached == '1' then
98 state = '<layout w="100" h="32" xalign="right" yalign="center"><col name="blue">(
\8f\8a\8e\9d)</col></layout>'
99 elseif items[i].stored == '1' then
100 state = '<layout w="100" h="32" xalign="right" yalign="center"><col name="blue">(
\91q
\8cÉ)</col></layout>'
102 if type == ITEM_TYPE_ROBE or type == ITEM_TYPE_ARMER then
103 --
\91\95\94õ
\92\86\82¾
\82Á
\82½
\82çdisable
104 if items[i].equipped == '1' then
105 local name = get_icon_image_tag(items[i].icon_type) ..
106 '<col name="gray"><layout w="360" h="32" xalign="left" yalign="center">' .. items[i].name .. '</layout>'
107 table.insert(list, name .. state)
108 table.insert(disables, num_items)
110 local name = get_icon_image_tag(items[i].icon_type) ..
111 '<layout w="360" h="32" xalign="left" yalign="center">' .. items[i].name .. '</layout>'
112 table.insert(list, name .. state)
114 num_items = num_items + 1
118 return question('
\91\95\94õ
\82·
\82é
\96h
\8bï
\82ð
\91I
\91ð', list, nil, disables, item_tween)
121 --{{{ question_setup_item
122 function question_setup_item(item_tween)
123 local items = load_game_data('gamedata.item_profile')
127 for i = 1, #items, 1 do
129 if items[i].equipped == '1' then
130 state = '<layout w="100" h="32" xalign="right" yalign="center">(
\91\95\94õ
\92\86)</layout></col>'
131 elseif items[i].attached == '1' then
132 state = '<layout w="100" h="32" xalign="right" yalign="center"><col name="blue">(
\8f\8a\8e\9d)</col></layout>'
133 elseif items[i].stored == '1' then
134 state = '<layout w="100" h="32" xalign="right" yalign="center"><col name="blue">(
\91q
\8cÉ)</col></layout>'
137 --
\91\95\94õ
\92\86\82¾
\82Á
\82½
\82çdisable
138 if items[i].equipped == '1' then
139 local name = get_icon_image_tag(items[i].icon_type) ..
140 '<col name="gray"><layout w="360" h="32" xalign="left" yalign="center">' .. items[i].name .. '</layout>'
141 table.insert(list, name .. state)
142 table.insert(disables, num_items)
144 local name = get_icon_image_tag(items[i].icon_type) ..
145 '<layout w="360" h="32" xalign="left" yalign="center">' .. items[i].name .. '</layout>'
146 table.insert(list, name .. state)
148 num_items = num_items + 1
150 return question('
\8f\8a\8e\9d\82·
\82é
\83A
\83C
\83e
\83\80\82ð
\91I
\91ð(
\8ec
\82è0
\83X
\83\8d\83b
\83g)', list, nil, disables, item_tween)
153 --{{{ question_setup_ideal
154 function question_setup_ideal(item_tween)
155 local items = load_game_data('gamedata.ideal_profile')
157 for i = 1, #items, 1 do
159 if items[i].attend == '1' then
160 state = '<layout w="100" h="32" xalign="right" yalign="center"><col name="blue">(
\8eQ
\89Á)</col></layout>'
162 local name = get_icon_image_tag(items[i].icon_type) ..
163 '<layout w="360" h="32" xalign="left" yalign="center">' .. items[i].name .. '</layout>'
164 table.insert(list, name .. state)
166 return question('
\8fo
\8c\82\90_
\97ì
\82ð
\91I
\91ð(
\8ec
\82è0
\83X
\83\8d\83b
\83g)', list, nil, nil, item_tween)
171 local base_width = 500
172 local base_height = 400
176 '<layout w="170" h="24" xalign="center">
\8f\8a\8e\9d\83A
\83C
\83e
\83\80</layout>',
177 '<layout w="170" h="24" xalign="center">
\91q
\8cÉ
\83A
\83C
\83e
\83\80</layout>',
178 '<layout w="170" h="24" xalign="center">
\83\8c\83\8a\83b
\83N</layout>',
180 local tab_menu = Question:new('
\83A
\83C
\83e
\83\80\8aÇ
\97\9d\83\81\83j
\83\85\81[', items, 'direction=horizontal')
181 local prop = tab_menu:get_properties()
182 local old_width, old_height = split(prop['preferred_size'], ',')
183 local x, y = layout(0.5, base_width, 0.5, 0.5, base_height, 0.5)
184 local width = base_width
186 -- tab_menu
\82Ìtween
\82ð
\90Ý
\92è
187 tab_menu:set_tween('open.position2', {[0] = {x, -height}, [20] = {x, y}}, 20)
188 tab_menu:set_tween('open.size2', {[0] = {width - old_width, height - old_height}}, 0)
189 tab_menu:set_tween('close.position2', {[0] = {x, y}, [20] = {x, -height}}, 20)
190 tab_menu:set_tween('close.size2', {[0] = {width - old_width, height - old_height}}, 0)
191 tab_menu:set_tween('close.color', {[5] = {1, 1, 1, 1}, [20] = {0, 1, 1, 1}}, 20)
193 local frame = tab_menu:show()
196 local key = get_key()
197 if key == KEY_UP then tab_menu:move_cursor_up()
198 elseif key == KEY_DOWN then tab_menu:move_cursor_down()
199 elseif key == KEY_LEFT then tab_menu:move_cursor_left()
200 elseif key == KEY_RIGHT then tab_menu:move_cursor_right()
201 elseif key == KEY_X then
202 sound("sound/cancel.wav")--
\83L
\83\83\83\93\83Z
\83\8b\89¹
203 frame = tab_menu:hide()
207 elseif key == KEY_Z then
208 local index = tab_menu:get_current()
209 sound("sound/decide.wav")--
\8c\88\92è
\89¹
210 -- tab_menu
\82Ì
\88Ê
\92u
\8cv
\8eZ
211 local prop = tab_menu:get_properties()
213 -- item_menu
\82Ì
\82½
\82ß
\82Ìtween
\8dì
\90¬
214 local item_tween = DefaultTween:new(x, y + height + 10, width, base_height - height) --
\88ê
\8fu
\82Å
\8c»
\82ê
\82é
216 question_attached(item_tween)
217 elseif index == 1 then
218 question_stored(item_tween)
219 elseif index == 2 then
220 question_relic(item_tween)
221 --question('
\83\8c\83\8a\83b
\83N', {'
\8dz
\90ÎX15', '
\96\82\8f»
\90ÎX10', '
\90Â
\8f»
\90ÎX2', '
\8cÃ
\95¶
\8f\91X4', '
\93ä
\82Ì
\89t
\91ÌX3'}, nil, nil, item_tween)
228 function setup_menu()
229 local base_width = 500
230 local base_height = 400
234 '<layout w="120" h="24" xalign="center">
\95\90\8aí</layout>',
235 '<layout w="120" h="24" xalign="center">
\96h
\8bï</layout>',
236 '<layout w="120" h="24" xalign="center">
\90_
\97ì</layout>',
237 '<layout w="120" h="24" xalign="center">
\83A
\83C
\83e
\83\80</layout>',
239 local tab_menu = Question:new('
\83Z
\83b
\83g
\83A
\83b
\83v
\83\81\83j
\83\85\81[', items, 'direction=horizontal')
240 local prop = tab_menu:get_properties()
241 local old_width, old_height = split(prop['preferred_size'], ',')
242 local x, y = layout(0.5, base_width, 0.5, 0.5, base_height, 0.5)
243 local width = base_width
245 -- tab_menu
\82Ìtween
\82ð
\90Ý
\92è
246 tab_menu:set_tween('open.position2', {[0] = {x, -height}, [20] = {x, y}}, 20)
247 tab_menu:set_tween('open.size2', {[0] = {width - old_width, height - old_height}}, 0)
248 tab_menu:set_tween('close.position2', {[0] = {x, y}, [20] = {x, -height}}, 20)
249 tab_menu:set_tween('close.size2', {[0] = {width - old_width, height - old_height}}, 0)
250 tab_menu:set_tween('close.color', {[5] = {1, 1, 1, 1}, [20] = {0, 1, 1, 1}}, 20)
252 local frame = tab_menu:show()
255 local key = get_key()
256 if key == KEY_UP then tab_menu:move_cursor_up()
257 elseif key == KEY_DOWN then tab_menu:move_cursor_down()
258 elseif key == KEY_LEFT then tab_menu:move_cursor_left()
259 elseif key == KEY_RIGHT then tab_menu:move_cursor_right()
260 elseif key == KEY_X then
261 sound("sound/cancel.wav")--
\83L
\83\83\83\93\83Z
\83\8b\89¹
262 frame = tab_menu:hide()
266 elseif key == KEY_Z then
267 local index = tab_menu:get_current()
268 sound("sound/decide.wav")--
\8c\88\92è
\89¹
269 -- tab_menu
\82Ì
\88Ê
\92u
\8cv
\8eZ
270 local prop = tab_menu:get_properties()
272 -- item_menu
\82Ì
\82½
\82ß
\82Ìtween
\8dì
\90¬
273 local item_tween = DefaultTween:new(x, y + height + 10, width, base_height - height) --
\88ê
\8fu
\82Å
\8c»
\82ê
\82é
275 question_setup_weapon(item_tween)
276 elseif index == 1 then
277 question_setup_armer(item_tween)
278 elseif index == 2 then
279 question_setup_ideal(item_tween)
280 elseif index == 3 then
281 question_setup_item(item_tween)
289 --pic = Picture:new('image/yukkuri.png')
290 --pic:set_tween('color', {[0] = {1, 1, 1}, [10] = {1, 0, 0}, [100] = {1, 0, 1, 1}})
291 --pic:set_tween('position2', {[0] = {200, 100}, [100] = {400, 200}})
292 --pic:set_tween('size2', {[0] = {100, 100}, [30] = {200, 200}, [60] = {100, 100}})
296 local items = {'
\83X
\83e
\81[
\83^
\83X', '
\83A
\83C
\83e
\83\80\8aÇ
\97\9d', '
\83Z
\83b
\83g
\83A
\83b
\83v', '
\83V
\83X
\83e
\83\80', '<col name="gray">
\83_
\83\93\83W
\83\87\83\93\92E
\8fo</col>'}
297 answer = question('
\83\81\83C
\83\93\83\81\83j
\83\85\81[', items, nil, {4}, RightSlideTween:new(0.2, 0.8, 0.3, 0.7, 20))
300 elseif answer == 1 then
301 --{{{
\83X
\83e
\81[
\83^
\83X
303 'HP 200/400
\83Q
\83C
\83\93 80%<nl/>
\8dU
\8c\82\97Í 200
\8aÑ
\92Ê
\97Í 20<nl/>
\95¨
\97\9d\96h
\8cä 100
\96\82\96@
\96h
\8cä 50',
304 '
\8f\8a\8e\9d\83A
\83C
\83e
\83\80\90\94 5<nl />
\8eg
\96ð
\90_
\97ì
\90\94 5
\90í
\93¬
\8eQ
\89Á
\90_
\97ì
\90\94 2',
305 '
\8f\8a\8e\9d\8bà 3JEM',
307 message('
\83\8a\81[
\83X', texts, '', ExtensionTween:new())
309 elseif answer == 2 then
311 elseif answer == 3 then
313 elseif answer == 4 then
314 --{{{
\83V
\83X
\83e
\83\80
315 answer = question('
\83V
\83X
\83e
\83\80\83\81\83j
\83\85\81[', {'
\83Z
\81[
\83u', '
\83\8d\81[
\83h', '
\8aÂ
\8b«
\90Ý
\92è', '
\82à
\82Ç
\82é'})
318 end --
\83\81\83C
\83\93\83\81\83j
\83\85\81[