赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 605 |
最后登录 | 2021-2-21 |
在线时间 | 6 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 70
- 在线时间
- 6 小时
- 注册时间
- 2007-12-18
- 帖子
- 214
|
- #==============================================================================
- # ■ Game_Interpreter
- #------------------------------------------------------------------------------
- # 执行事件命令的解释器。本类在 Game_System 类
- # 与 Game_Event 类的内部使用。
- #==============================================================================
- class Game_Interpreter
- #--------------------------------------------------------------------------
- # ● 得失物品自动提示的刷新时间控制
- #--------------------------------------------------------------------------
- def call_6RgetItem(para1, para2 = nil, para3 = nil)
- temp_window = Window_Gain_Item.new(para1, para2, para3)
- Sound.play_shop
- for i in 0..120
- Graphics.update
- Input.update
- if Input.trigger?(Input::C) or Input.trigger?(Input::B)
- Sound.play_cancel
- break
- end
- end
- for i in 0..15
- temp_window.opacity -= 20
- temp_window.contents_opacity -= 16
- temp_window.update
- Graphics.update
- end
- temp_window.dispose
- temp_window = nil
- end
- #--------------------------------------------------------------------------
- # ● 增减金钱
- #--------------------------------------------------------------------------
- def command_125
- value = operate_value(@params[0], @params[1], @params[2])
- $game_party.gain_gold(value)
- call_6RgetItem("gold", value)
- return true
- end
- #--------------------------------------------------------------------------
- # ● 增减物品
- #--------------------------------------------------------------------------
- def command_126
- value = operate_value(@params[1], @params[2], @params[3])
- $game_party.gain_item($data_items[@params[0]], value)
- $game_map.need_refresh = true
- call_6RgetItem("item", $data_items[@params[0]], value)
- return true
- end
- #--------------------------------------------------------------------------
- # ● 增减武器
- #--------------------------------------------------------------------------
- def command_127
- value = operate_value(@params[1], @params[2], @params[3])
- $game_party.gain_item($data_weapons[@params[0]], value, @params[4])
- call_6RgetItem("item", $data_weapons[@params[0]], value)
- return true
- end
- #--------------------------------------------------------------------------
- # ● 增减防具
- #--------------------------------------------------------------------------
- def command_128
- value = operate_value(@params[1], @params[2], @params[3])
- $game_party.gain_item($data_armors[@params[0]], value, @params[4])
- call_6RgetItem("item", $data_armors[@params[0]], value)
- return true
- end
- end
- #==============================================================================
- # ■ Window_Gain_Item
- #------------------------------------------------------------------------------
- # 显示获得物品的窗口。
- #==============================================================================
- class Window_Gain_Item < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化窗口
- #--------------------------------------------------------------------------
- def initialize(para1, para2 = nil, para3 = nil)
- super(0, 0, 160, WLH + 32)
- self.z = 10000
- case para1
- when "item"
- str = "获得"
- if para3 < 0 then
- str = "失去"
- para3 = - para3
- end
- winwidth = contents.text_size(" 你获得了: ? " + para3.to_s).width + 24 + contents.text_size(para2.name).width
- self.width = winwidth + 64
- self.height = 64
- self.x = (Graphics.width - self.width) / 2
- self.y = (Graphics.height - self.height) / 2
- create_contents
- self.contents.draw_text(0, 0, self.width, 32, " 你" + str + "了: ")
- tx = contents.text_size(" 你" + str + "了:").width
- draw_item_name(para2, tx , 0, true)
- self.contents.draw_text(tx + 24, 0, self.width, 32, para2.name)
- tx = contents.text_size(" 你" + str + "了: ").width + 24 + contents.text_size(para2.name).width
- self.contents.draw_text(tx, 0, self.width, 32, " ?" + para3.to_s)
- when "gold"
- str = "获得"
- if para2 < 0 then
- str = "失去"
- para2 = - para2
- end
- winwidth = contents.text_size(" 你获得了: " + Vocab.gold.to_s).width + contents.text_size(para2).width
- self.width = winwidth + 64
- self.height = 64
- self.x = (Graphics.width - self.width) / 2
- self.y = (Graphics.height - self.height) / 2
- create_contents
- self.contents.draw_text(0, 0, self.width, 32, " 你" + str + "了: #{para2} " + Vocab.gold.to_s)
- end
- end
- #--------------------------------------------------------------------------
- # ● 物品名的描画
- # item : 物品(特技、武器、防具可)
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # enabled : 有效标记录。是false 的时候半透明绘画
- #--------------------------------------------------------------------------
- def draw_item_name(item, x, y, enabled = true)
- if item != nil
- draw_icon(item.icon_index, x, y, enabled)
- self.contents.font.color = normal_color
- self.contents.font.color.alpha = enabled ? 255 : 128
- end
- end
- end
复制代码
66的物品得失自动提示脚本... 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|