赞 | 1 |
VIP | 0 |
好人卡 | 12 |
积分 | 2 |
经验 | 52910 |
最后登录 | 2024-8-20 |
在线时间 | 835 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 196
- 在线时间
- 835 小时
- 注册时间
- 2012-9-16
- 帖子
- 1811
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 yangjunyin2002 于 2013-8-4 14:28 编辑
写在前面
又随便写了个脚本,话说终于写了个309行的脚本啦~(注释占了几十行吧...)
然后呢,无聊着就发上来,注释是刚才随便加上去的。。。(我还写了个地图快捷功能脚本,等我发布后,如果这个脚本和地图快捷功能脚本一起用会发生...所以我加了个注释提醒下,如果使用了就改下脚本哪里哪里的。。。)...我不废话了我(众:你还在废话!)然后上截图和脚本和范例吧。。。最好下范例。。。
哎呀!我一不小心..把脚本里注释的“商店”写成“菜单”了。。。所以请忽视“十分华丽的菜单脚本”这些注释吧。。。
截图
脚本
建议直接下载范例...- =begin
- ┌─────────────────────────┐
- │ 此脚本来自小y游戏制作室,使用和转载请保留此信息。│
- └─────────────────────────┘
- ┌─────────────────────┐
- │ 此脚本来自66RPG,使用和转载请保留此信息。│
- └─────────────────────┘
- 小y脚本站:http://www.ygameSprite.com/(已失效)
- -----------------------------------------------------------------------------
- *新·华丽商店画面*
- by.小y
- -----------------------------------------------------------------------------
- ■ 说明
- 十分华丽的菜单脚本。
- ■ 功能
- 此脚本与一般的菜单脚本的不同点:
- ☞商店画面中的窗口透明度为0,十分简洁而美观
- ☞商店画面各个窗口坐标大幅度更改,十分独特
- ☞商店画面里增加“物品”、“装备”选项,即买即试
- ☞商店画面增加背景图
- ■ 使用
- 插入脚本,在游戏Graphics\System文件夹中插入一张名称为“商店背景”
- 的图片(也可以在306行设定商店背景图的名称)。
- ■ 注意 【醒目】
- 如果你和小y的“地图快捷功能”脚本一起使用,那请注意了!!!因为地图
- 快捷功能脚本的场景是直接返回地图画面而不是菜单画面的,所以,你需要把
- 77行和91行的$scene = Scene_Menu.new那句改成$scene = Scene_Map.new!
- -----------------------------------------------------------------------------
- =end
- #---------------------------------------
- # ● 脚本部分
- #---------------------------------------
- #-----------------
- # Window_Gold1
- #-----------------
- class Window_Gold1 < Window_Base
- def initialize(x, y)
- super(x, y, 160, WLH + 32)
- refresh
- end
- def refresh
- self.contents.clear
- draw_currency_value($game_party.gold, 4, 0, 120)
- end
- end
- #-----------------
- # Window_Help1
- #-----------------
- class Window_Help1 < Window_Base
- def initialize
- super(0, 356, 544, WLH + 32)
- end
- def set_text(text, align = 0)
- if text != @text or align != @align
- self.contents.clear
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 0, self.width - 40, WLH, text, align)
- @text = text
- @align = align
- end
- end
- end
- #-----------------
- # Scene_Equip
- #-----------------
- class Scene_Equip < Scene_Base
- def return_scene
- if $scene_home == true
- $scene_equip = true
- $scene_home = false
- $scene = Scene_Shop.new
- else
- $scene = Scene_Menu.new(2)
- end
- end
- end
- #-----------------
- # Scene_Item
- #-----------------
- class Scene_Item < Scene_Base
- def return_scene
- if $scene_home == true
- $scene_equip = true
- $scene_home = false
- $scene = Scene_Shop.new
- else
- $scene = Scene_Menu.new(0)
- end
- end
- end
- #-----------------
- # Scene_Shop
- #-----------------
- class Scene_Shop < Scene_Base
- def start
- super
- create_menu_background
- create_command_window
- @rw = Window_ShopBackground.new(0,0)
- @rw.opacity = 0
- @help1_window = Window_Help1.new
- @gold1_window = Window_Gold1.new(360, 320)#(370, 32)
- @dummy_window = Window_Base.new(159, 112, 385, 304)#(0, 112, 544, 304)
- @buy_window = Window_ShopBuy.new(20, 52)#(0, 112)
- @buy_window.active = false
- @buy_window.visible = false
- @buy_window.help_window = @help1_window
- @sell_window = Window_ShopSell.new(20, 52, 484, 324)#524,364#(0, 112, 544, 304)
- @sell_window.active = false
- @sell_window.visible = false
- @sell_window.help_window = @help1_window
- @number_window = Window_ShopNumber.new(120, 52)#(0, 112)
- @number_window.active = false
- @number_window.visible = false
- @status_window = Window_ShopStatus.new(304, 52)#(304, 112)
- @status_window.visible = false
- @status_window.opacity=0
- @buy_window.opacity=0
- @gold1_window.opacity=0
- @help1_window.opacity=0
- @number_window.opacity=0
- @sell_window.opacity=0
- @status_window.opacity=0
- @dummy_window.opacity=0
- @command_window.opacity=0
- end
- def terminate
- super
- dispose_menu_background
- dispose_command_window
- @rw.dispose
- @help1_window.dispose
- @gold1_window.dispose
- @dummy_window.dispose
- @buy_window.dispose
- @sell_window.dispose
- @number_window.dispose
- @status_window.dispose
- end
- def update
- super
- update_menu_background
- @help1_window.update
- @command_window.update
- @gold1_window.update
- @dummy_window.update
- @buy_window.update
- @sell_window.update
- @number_window.update
- @status_window.update
- if @command_window.active
- update_command_selection
- elsif @buy_window.active
- update_buy_selection
- elsif @sell_window.active
- update_sell_selection
- elsif @number_window.active
- update_number_input
- end
- end
- def create_command_window
- s1 = Vocab::ShopBuy
- s2 = Vocab::ShopSell
- s3 = Vocab::item
- s4 = Vocab::equip
- s5 = Vocab::ShopCancel
- @command_window = Window_Command.new(414, [s1, s2, s3, s4, s5], 5)#384,3
- @command_window.x = 80
- @command_window.y = 7#56
- if $game_temp.shop_purchase_only
- @command_window.draw_item(1, false)
- end
- end
- def update_command_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- case @command_window.index
- when 0 # 购买
- Sound.play_decision
- @command_window.active = false
- @dummy_window.visible = false
- @buy_window.active = true
- @buy_window.visible = true
- @buy_window.refresh
- @status_window.visible = true
- when 1 # 卖出
- if $game_temp.shop_purchase_only
- Sound.play_buzzer
- else
- Sound.play_decision
- @command_window.active = false
- @dummy_window.visible = false
- @sell_window.active = true
- @sell_window.visible = true
- @sell_window.refresh
- end
- when 2 # 背包
- Sound.play_decision
- $scene_home = true
- $scene = Scene_Item.new
- when 3 # 装备
- Sound.play_decision
- $scene_home = true
- $scene = Scene_Equip.new(0)
- when 4 # 取消
- Sound.play_decision
- $scene = Scene_Map.new
- end
- end
- end
- def update_buy_selection
- @status_window.item = @buy_window.item
- if Input.trigger?(Input::B)
- Sound.play_cancel
- @command_window.active = true
- @dummy_window.visible = true
- @buy_window.active = false
- @buy_window.visible = false
- @status_window.visible = false
- @status_window.item = nil
- @help1_window.set_text("")
- return
- end
- if Input.trigger?(Input::C)
- @item = @buy_window.item
- number = $game_party.item_number(@item)
- if @item == nil or @item.price > $game_party.gold or number == 99
- Sound.play_buzzer
- else
- Sound.play_decision
- max = @item.price == 0 ? 99 : $game_party.gold / @item.price
- max = [max, 99 - number].min
- @buy_window.active = false
- @buy_window.visible = false
- @number_window.set(@item, max, @item.price)
- @number_window.active = true
- @number_window.visible = true
- end
- end
- end
- def update_sell_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- @command_window.active = true
- @dummy_window.visible = true
- @sell_window.active = false
- @sell_window.visible = false
- @status_window.item = nil
- @help1_window.set_text("")
- elsif Input.trigger?(Input::C)
- @item = @sell_window.item
- @status_window.item = @item
- if @item == nil or @item.price == 0
- Sound.play_buzzer
- else
- Sound.play_decision
- max = $game_party.item_number(@item)
- @sell_window.active = false
- @sell_window.visible = false
- @number_window.set(@item, max, @item.price / 2)
- @number_window.active = true
- @number_window.visible = true
- @status_window.visible = true
- end
- end
- end
- def decide_number_input
- Sound.play_shop
- @number_window.active = false
- @number_window.visible = false
- case @command_window.index
- when 0 # 购买
- $game_party.lose_gold(@number_window.number * @item.price)
- $game_party.gain_item(@item, @number_window.number)
- @gold1_window.refresh
- @buy_window.refresh
- @status_window.refresh
- @buy_window.active = true
- @buy_window.visible = true
- when 1 # 卖出
- $game_party.gain_gold(@number_window.number * (@item.price / 2))
- $game_party.lose_item(@item, @number_window.number)
- @gold1_window.refresh
- @sell_window.refresh
- @status_window.refresh
- @sell_window.active = true
- @sell_window.visible = true
- @status_window.visible = false
- end
- end
- end
- #-----------------
- # Window_ShopBackground
- #-----------------
- class Window_ShopBackground < Window_Base
- def initialize(x, y)
- super(0, 0, 544, 416)
- self.z = 0
- rectrw = Rect.new(0, 0, 640, 480)
- rw = Cache.system("商店背景")
- self.contents.blt(0, 0, rw, rectrw)
- end
- end
复制代码范例
华丽商店脚本-范例.zip
(566.53 KB, 下载次数: 184)
|
|