赞 | 12 |
VIP | 107 |
好人卡 | 6 |
积分 | 4 |
经验 | 31122 |
最后登录 | 2024-6-29 |
在线时间 | 1606 小时 |
Lv2.观梦者 傻♂逼
- 梦石
- 0
- 星屑
- 374
- 在线时间
- 1606 小时
- 注册时间
- 2007-3-13
- 帖子
- 6562
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
不管有没有原料都会失败!
- $food = {}
- $food["火鸡"] = [1,2,3,4]
- $food["紫菜"] = [5,6,7,8]
- $food["你好"] = [5,6,7,8]
- $fod = ["火鸡","紫菜","你好"]
- $help = ["圣诞节的必须品,超级好吃哦!","紫菜,酸酸甜甜!","你好"]
- class Scene_Cook
- def main
- @halp_window = Window_Help.new
- @tmp = []
- @command_window = Window_Command.new(640,$fod)
- @halp_window.x = 1
- @halp_window.y = 2 * 32
- @command_window.x = 1
- @command_window.y = 4 * 32
- Audio.me_stop
- Audio.bgs_stop
- # 执行过渡
- Graphics.transition
- @pic = Sprite.new
- @picindex = RPG::Cache.picture($fod[@command_window.index])
- @pic.bitmap = @picindex
- @pic.y = @command_window.y + @command_window.height
- # $index = @command_window.index
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果画面被切换就中断循环
- if $scene != self
- break
- end
- end
- @pic.bitmap.dispose
- @pic.dispose
- @halp_window.dispose
- @command_window.dispose
- end
- def update
- @command_window.update
- if Input.trigger?(Input::B)
- $scene = Scene_Map.new
- end
- if $index != @command_window.index
- #刷新图片\HELP
- for i in 0...$fod.size
- if i == @command_window.index
- @halp_window.set_text($help[i])
- end
- end
-
- $index = @command_window.index
- @pic.bitmap.dispose
- @picindex = RPG::Cache.picture($fod[@command_window.index])
- @pic.bitmap = @picindex
- @pic.y = @command_window.y + @command_window.height
- end
- if Input.trigger?(Input::C)
- for i in 0...$fod.size
- if i == @command_window.index
- cook(i)
- end
- end
- end
- end
- def cook(index)
- @ok = true
- x = $fod[index]
- liao = $food[x]
- for i in liao
- if $game_party.item_number(liao) == 0
- @ok = false
- end
- end
- if @ok
- for i in liao
- $game_party.lose_item(i,1)
- end
- for i in $data_items.size
- if $data_items[i].name == x
- q = $data_items[i].name == x
- end
- end
- $game_party.gain_armor(q,1)
- @halp_window.set_text(x + "制作完成!")
- else
- @halp_window.set_text(x + "原料不足,制作失败!!!")
- end
- end
- end
复制代码 版务信息:本贴由楼主自主结贴~ |
|