设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1953|回复: 6
打印 上一主题 下一主题

[已经解决] 装备属性显示问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
114 小时
注册时间
2012-4-25
帖子
163
跳转到指定楼层
1
发表于 2012-8-2 11:45:07 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
就是吧鼠标放到一个物品或者装备图标上就会显示这个装备或者物品的全部属性要是能在显示一下图片 更好 类似网游一样的显示属性  
什么攻击 暴击 附加属性 之类的显示   急求,一定要给我哦,我非常的期待 各位大神 帮我下

Lv1.梦旅人

梦石
0
星屑
50
在线时间
10 小时
注册时间
2012-8-1
帖子
60
2
发表于 2012-8-2 12:23:15 | 只看该作者
个人认为(仅限个人认为)
这个纯事件是绝对做不出来的
脚本 估计也少不了
貌似我自己做XP游戏 还没有做到 鼠标的境界
楼主很厉害的样子


PS:你以前问过的问题 要认可 帮助过你的人啊
?
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
112 小时
注册时间
2011-7-13
帖子
71
3
发表于 2012-8-2 13:43:35 手机端发表。 | 只看该作者
我只知道可以
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
114 小时
注册时间
2012-4-25
帖子
163
4
 楼主| 发表于 2012-8-2 15:46:49 | 只看该作者
谢谢你们的回答
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
112
在线时间
1421 小时
注册时间
2008-8-30
帖子
999
5
发表于 2012-8-2 16:21:54 | 只看该作者
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2012-8-6
帖子
60
6
发表于 2012-8-6 10:49:18 | 只看该作者
樓主要的是詳盡幫助腳本?
主站內有這個腳本
跟随光标移动的详尽帮助(by xuelong).rar (191.88 KB, 下载次数: 491)
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
46
在线时间
223 小时
注册时间
2010-7-7
帖子
213
7
发表于 2012-8-6 17:05:54 | 只看该作者
本帖最后由 hcm 于 2012-8-20 08:54 编辑
  1. #==============================================================================
  2. # 禾西製作 / Created by Quarcy
  3. #==============================================================================
  4. class Window_Help < Window_Base
  5.   attr_reader :materia
  6.   #--------------------------------------------------------------------------
  7.   # ● 定義不顯示的屬性與狀態
  8.   #--------------------------------------------------------------------------
  9.   def unshown
  10.     @unshow_elements = [17, 18]
  11.     @unshow_states = []
  12.   end
  13.   #--------------------------------------------------------------------------
  14.   # ● 初始化對象
  15.   #--------------------------------------------------------------------------
  16.   def initialize
  17.     super(0, 0, 640, 64)
  18.     self.opacity = 150
  19.     self.z=150
  20.     self.visible = false
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 設置文本
  24.   #     data  : 窗口顯示的字符串/物品資料
  25.   #     align : 對齊方式 (0..左對齊、1..中間對齊、2..右對齊)
  26.   #--------------------------------------------------------------------------
  27.   def set_text(data, align=0)
  28.     #------------------------------------------------------------------------
  29.     # ● 當資料爲文字時候
  30.     #------------------------------------------------------------------------
  31.     # 如果文本或對齊方式至少一方与上次的不同
  32.     if data != @text or align != @align
  33.       if data.is_a?(String)
  34.         # 再描繪文本
  35.         self.width = 640
  36.         self.height = 64
  37.         self.x=0
  38.         self.y=0
  39.         self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  40.         self.contents.clear
  41.         self.contents.font.color = normal_color
  42.         self.contents.font.size = 20
  43.         self.contents.draw_text(4, 0, self.width - 40, 32, data, align)
  44.         @text = data
  45.         @align = align
  46.         @actor = nil
  47.         self.visible = true
  48.       end
  49.     end
  50.     return if data.is_a?(String)
  51.     #------------------------------------------------------------------------
  52.     # ● 當沒有資料時候
  53.     #------------------------------------------------------------------------
  54.     if data.nil?
  55.       self.visible=false
  56.     else
  57.       self.visible=true
  58.     end
  59.     #------------------------------------------------------------------------
  60.     # ● 當資料爲物品/技能時候
  61.     #------------------------------------------------------------------------
  62.     if data != nil && @data != data
  63.       self.width = 210
  64.       self.height = 430
  65.       self.x=0
  66.       self.y=200
  67.       unshown
  68.       non_auto_update(data)
  69.     else
  70.       return
  71.     end
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● 更新帮助窗口
  75.   #--------------------------------------------------------------------------
  76.   def non_auto_update(data=@data)
  77.     @data = data
  78.     case @data
  79.     when RPG::Item
  80.       set_item_text(@data)
  81.     when RPG::Weapon
  82.       set_equipment_text(@data)
  83.     when RPG::Armor
  84.       set_equipment_text(@data)
  85.     when RPG::Skill
  86.       set_skill_text(@data)
  87.     end
  88.   end
  89.   #--------------------------------------------------------------------------
  90.   # ● 裝備帮助窗口
  91.   #--------------------------------------------------------------------------
  92.   def set_equipment_text(equipment)
  93.     #------------------------------------------------------------------------
  94.     # ● 取得基本質料
  95.     #------------------------------------------------------------------------
  96.     # 取得屬性、附加狀態、解除狀態之副本
  97.     case equipment
  98.     when RPG::Weapon
  99.       element_set = equipment.element_set.clone
  100.       plus_state_set = equipment.plus_state_set.clone
  101.       minus_state_set = equipment.minus_state_set.clone
  102.       #----------------------#
  103.       # 過濾不顯示的狀態描述 #
  104.       #----------------------#
  105.       plus_state_set -= @unshow_states
  106.       minus_state_set -= @unshow_states
  107.     when RPG::Armor
  108.       element_set = equipment.guard_element_set.clone
  109.       guard_state_set = equipment.guard_state_set.clone
  110.       #----------------------#
  111.       # 過濾不顯示的狀態描述 #
  112.       #----------------------#
  113.       auto_state_id = equipment.auto_state_id
  114.       guard_state_set -= @unshow_states
  115.     end
  116.     #----------------------#
  117.     # 過濾不顯示的屬性描述 #
  118.     #----------------------#
  119.     element_set -= @unshow_elements
  120.     #--------------#
  121.     # 取得說明文字 #
  122.     #--------------#
  123.     description = equipment.description.clone
  124.     # 初始化數據設定
  125.     x = 0
  126.     y = 0
  127.     h = 0
  128.     phrase = {}
  129.    
  130.     # 基本文字設定
  131.     phrase["price"] = "价格:"
  132.     phrase["elements"] = "属性:"
  133.     phrase["minus_states"] = "解除状态:"
  134.     phrase["plus_states"] = "附加状态:"
  135.     phrase["guard_elements"] = "防御属性"
  136.     phrase["guard_states"] = "防御状态"
  137.     phrase["auto_state"] = "自动状态"

  138.     # 基本數據設定
  139. =begin
  140.     name_size = 名字文字大小
  141.     size = 描述文字大小
  142.     word = 每行的描述文字數
  143.     move = 全體描述偏移幅度
  144. =end
  145.     name_size = 18
  146.     size = 14
  147.     word = 12
  148.     move = 80
  149.     #------------------------------------------------------------------------
  150.     # ● 確定背景圖片的高度
  151.     #------------------------------------------------------------------------
  152.     h += (description.size/3/word)
  153.     h += 1 if (description.size/3%word) > 0
  154.     h += 1 if equipment.is_a?(RPG::Weapon)
  155.     now_h = h
  156.     h += 1
  157.     h += 1 unless equipment.pdef.zero?
  158.     h += 1 unless equipment.mdef.zero?
  159.     h += 1 if element_set.size > 0
  160.     h += 1 if element_set.size >= 5
  161.     case equipment
  162.     when RPG::Weapon
  163.       h += 1 unless minus_state_set.empty?
  164.       h += minus_state_set.size
  165.       h += 1 unless plus_state_set.empty?
  166.       h += plus_state_set.size
  167.     when RPG::Armor
  168.       h += 1 unless guard_state_set.empty?
  169.       h += guard_state_set.size
  170.       h += 1 unless auto_state_id.zero?
  171.     end
  172.     h += 1
  173.     h += 1 unless equipment.str_plus.zero?
  174.     h += 1 unless equipment.dex_plus.zero?
  175.     h += 1 unless equipment.agi_plus.zero?
  176.     h += 1 unless equipment.int_plus.zero?
  177.     h += materia_height_plus(equipment) unless self.materia.nil?
  178.     #------------------------------------------------------------------------
  179.     # ● 圖片顯示保證高度
  180.     #------------------------------------------------------------------------
  181.     h = 6 + now_h if (h - now_h) < 6
  182.     #------------------------------------------------------------------------
  183.     # ● 換算高度
  184.     #------------------------------------------------------------------------
  185.     self.height = h * size + name_size + 32
  186.     #------------------------------------------------------------------------
  187.     # ● 生成背景
  188.     #------------------------------------------------------------------------
  189.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  190.     self.contents.clear
  191.     #------------------------------------------------------------------------
  192.     # ● 名字描繪
  193.     #------------------------------------------------------------------------
  194.     text = equipment.name
  195.     self.contents.font.color = draw_name_color(equipment)
  196.     self.contents.font.size = name_size
  197.     if text.nil?
  198.       self.visible = false
  199.     else
  200.       self.visible = true
  201.       self.contents.draw_text(0, 0, text.size*7, name_size, text, 0)
  202.     end
  203.     #------------------------------------------------------------------------
  204.     # ● 說明描繪
  205.     #------------------------------------------------------------------------
  206.     x = 0
  207.     y += 1
  208.     while ((text = description.slice!(/./m)) != nil)
  209.       self.contents.font.color = normal_color
  210.       self.contents.font.size = size
  211.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  212.       x+=1
  213.       if x == word
  214.         x=0
  215.         y+=1   
  216.       end
  217.     end
  218.     #------------------------------------------------------------------------
  219.     # ● 圖標描繪
  220.     #------------------------------------------------------------------------
  221.     bitmap = RPG::Cache.icon(equipment.icon_name)
  222.     opacity = self.contents.font.color == normal_color ? 255 : 128
  223.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  224.   
  225.     #------------------------------------------------------------------------
  226.     # ● 攻擊力描繪(武器)
  227.     #------------------------------------------------------------------------
  228.     if equipment.is_a?(RPG::Weapon)
  229.       x = 0
  230.       y += 1
  231.       text = $data_system.words.atk+":"+equipment.atk.to_s
  232.       self.contents.font.color = normal_color
  233.       self.contents.font.size = size
  234.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  235.     end
  236.     #------------------------------------------------------------------------
  237.     # ● 價格描繪
  238.     #------------------------------------------------------------------------
  239.     x = 0
  240.     y += 1
  241.     text = phrase["price"] + equipment.price.to_s
  242.     self.contents.font.color = normal_color
  243.     self.contents.font.size = size
  244.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  245.     #------------------------------------------------------------------------
  246.     # ● 物理防禦
  247.     #------------------------------------------------------------------------
  248.     unless equipment.pdef.zero?
  249.       x = 0
  250.       y += 1
  251.       text = $data_system.words.pdef+":"+equipment.pdef.to_s
  252.       self.contents.font.color = normal_color
  253.       self.contents.font.size = size
  254.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  255.     end
  256.     #------------------------------------------------------------------------
  257.     # ● 魔法防禦
  258.     #------------------------------------------------------------------------
  259.     unless equipment.mdef.zero?
  260.       x = 0
  261.       y += 1
  262.       text=$data_system.words.mdef+":"+equipment.mdef.to_s
  263.       self.contents.font.color = normal_color
  264.       self.contents.font.size = size
  265.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  266.     end
  267.     #------------------------------------------------------------------------
  268.     # ● 屬性
  269.     #------------------------------------------------------------------------
  270.     if element_set.size > 0
  271.       x = 0
  272.       y += 1
  273.       text = phrase["elements"]
  274.       for i in 0...element_set.size
  275.         break if i > 4
  276.         text += $data_system.elements[element_set[i]]
  277.       end
  278.       self.contents.font.color = normal_color
  279.       self.contents.font.size = size
  280.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  281.     end
  282.     if element_set.size >= 5
  283.       x = (phrase["elements"].size)*5-4
  284.       y += 1
  285.       text = ""
  286.       for i in 4...element_set.size
  287.         text += $data_system.elements[element_set[i]]
  288.       end
  289.       self.contents.font.color = normal_color
  290.       self.contents.font.size = size
  291.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  292.     end
  293.     #------------------------------------------------------------------------
  294.     # ● 描述分流 武器/防具
  295.     #------------------------------------------------------------------------
  296.     case equipment
  297.     when RPG::Weapon
  298.       #------------------------------------------------------------------------
  299.       # ● 解除狀態(武器)
  300.       #------------------------------------------------------------------------
  301.       unless minus_state_set.empty?
  302.         x = 0
  303.         y += 1
  304.         text=phrase["minus_states"]
  305.         text=phrase["guard_states"]
  306.         self.contents.font.color = normal_color
  307.         self.contents.font.size = size
  308.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  309.         for i in 0...minus_state_set.size
  310.           y += 1
  311.           text = $data_states[minus_state_set[i]].name        
  312.           self.contents.font.color = normal_color
  313.           self.contents.font.size = size
  314.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  315.         end
  316.       end
  317.       #------------------------------------------------------------------------
  318.       # ● 附加狀態(武器)
  319.       #------------------------------------------------------------------------
  320.       unless plus_state_set.empty?
  321.         x = 0
  322.         y += 1
  323.         text = phrase["plus_states"]
  324.         self.contents.font.color = normal_color
  325.         self.contents.font.size = size
  326.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  327.         for i in 0...plus_state_set.size
  328.           y += 1
  329.           text=$data_states[plus_state_set[i]].name        
  330.           self.contents.font.color = normal_color
  331.           self.contents.font.size = size
  332.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  333.         end  
  334.       end
  335.     when RPG::Armor
  336.       #------------------------------------------------------------------------
  337.       # ● 防禦狀態(防具)
  338.       #------------------------------------------------------------------------
  339.       unless guard_state_set.empty?
  340.         x = 0
  341.         y += 1
  342.         text=phrase["guard_states"]
  343.         self.contents.font.color = normal_color
  344.         self.contents.font.size = size
  345.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  346.         for i in 0...guard_state_set.size
  347.           y += 1
  348.           text = $data_states[guard_state_set[i]].name        
  349.           self.contents.font.color = normal_color
  350.           self.contents.font.size = size
  351.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  352.         end
  353.       end
  354.       #------------------------------------------------------------------------
  355.       # ● 自動狀態(防具)
  356.       #------------------------------------------------------------------------
  357.       unless auto_state_id.zero?
  358.         x = 0
  359.         y += 1
  360.         text = phrase["auto_state"] + $data_states[auto_state_id].name
  361.         self.contents.font.color = normal_color
  362.         self.contents.font.size = size
  363.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  364.       end
  365.     end
  366.     #------------------------------------------------------------------------
  367.     # ● 空行
  368.     #------------------------------------------------------------------------
  369.     y+=1
  370.     #------------------------------------------------------------------------
  371.     # ● 力量
  372.     #------------------------------------------------------------------------
  373.     unless equipment.str_plus.zero?
  374.       x = 0
  375.       y += 1
  376.       h += 1
  377.       if equipment.str_plus > 0
  378.         text=$data_system.words.str+" +"+ equipment.str_plus.to_s
  379.       else
  380.         text=$data_system.words.str+" -"+ (-equipment.str_plus).to_s
  381.       end
  382.       self.contents.font.color = normal_color
  383.       self.contents.font.size = size
  384.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)  
  385.     end
  386.     #------------------------------------------------------------------------
  387.     # ● 靈巧
  388.     #------------------------------------------------------------------------
  389.     unless equipment.dex_plus.zero?
  390.       x = 0
  391.       y += 1
  392.       h += 1
  393.       if equipment.dex_plus > 0
  394.         text=$data_system.words.dex+" +"+ equipment.dex_plus.to_s
  395.       else
  396.         text=$data_system.words.dex+" -"+ (-equipment.dex_plus).to_s
  397.       end
  398.       self.contents.font.color = normal_color
  399.       self.contents.font.size = size
  400.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  401.     end
  402.     #------------------------------------------------------------------------
  403.     # ● 速度
  404.     #------------------------------------------------------------------------
  405.     unless equipment.agi_plus.zero?
  406.       x = 0
  407.       y += 1
  408.       h += 1
  409.       if equipment.agi_plus > 0
  410.         text=$data_system.words.agi+" +"+ equipment.agi_plus.to_s
  411.       else
  412.         text=$data_system.words.agi+" -"+ (-equipment.agi_plus).to_s
  413.       end
  414.       self.contents.font.color = normal_color
  415.       self.contents.font.size = size
  416.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  417.     end
  418.     #------------------------------------------------------------------------
  419.     # ● 智力
  420.     #------------------------------------------------------------------------
  421.     unless equipment.int_plus.zero?
  422.       x = 0
  423.       y += 1
  424.       h += 1
  425.       if equipment.int_plus > 0
  426.         text=$data_system.words.int+" +"+ equipment.int_plus.to_s
  427.       else
  428.         text=$data_system.words.int+" -"+ (-equipment.int_plus).to_s
  429.       end
  430.       self.contents.font.color = normal_color
  431.       self.contents.font.size = size
  432.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  433.     end
  434.     #------------------------------------------------------------------------
  435.     # ● 魔力石描繪
  436.     #------------------------------------------------------------------------
  437.     y += draw_materia(equipment, move, y, size) unless self.materia.nil?
  438.   end
  439.   #--------------------------------------------------------------------------
  440.   # ● 物品幫助窗口
  441.   #--------------------------------------------------------------------------
  442.   def set_item_text(item)
  443.     # 取得描述
  444.     description = item.description.clone
  445.     # 取得屬性、附加狀態、解除狀態之副本
  446.     element_set = item.element_set.clone
  447.     plus_state_set = item.plus_state_set.clone
  448.     minus_state_set = item.minus_state_set.clone
  449.     # 過濾不顯示的描述
  450.     element_set -= @unshow_elements
  451.     plus_state_set -= @unshow_states
  452.     minus_state_set -= @unshow_states
  453.     # 初始化數據設定
  454.     x = 0
  455.     y = 0
  456.     h = 0
  457.     phrase = {}
  458.     scope ={}
  459.     parameter_type = {}
  460.    
  461.     # 基本數據設定
  462. =begin
  463.     name_size = 名字文字大小
  464.     size = 描述文字大小
  465.     word = 每行的描述文字數
  466.     move = 全體描述偏移幅度
  467. =end
  468.     name_size = 18
  469.     size = 14
  470.     word = 12
  471.     move = 80
  472.    
  473.     # 基本文字設定
  474.     phrase["scope"] = "范围:"
  475.     phrase["price"] = "价格:"
  476.     phrase["recover_hp_rate"] = "HP 回复率:"
  477.     phrase["recover_hp"] = "HP 回复量:"
  478.     phrase["recover_sp_rate"] = "SP 回复率:"
  479.     phrase["recover_sp"] = "SP 回复量:"
  480.     phrase["elements"] = "属性:"
  481.     phrase["plus"] = "附加"
  482.     phrase["minus"] = "解除"
  483.     phrase["states"] = "状态"
  484.     scope[0] = "特殊物品"
  485.     scope[1] = "特殊物品"
  486.     scope[2] = "敌单体"
  487.     scope[3] = "敌全体"
  488.     scope[4] = "己方单体"
  489.     scope[5] = "己方全体"
  490.     scope[6] = "己方昏死单体"
  491.     scope[7] = "己方昏死全体"
  492.     scope[8] = "使用者"

  493.     parameter_type[1] = "MaxHP"
  494.     parameter_type[2] = "MaxSP"
  495.     parameter_type[3] = $data_system.words.str
  496.     parameter_type[4] = $data_system.words.dex
  497.     parameter_type[5] = $data_system.words.agi
  498.     parameter_type[6] = $data_system.words.int
  499.    
  500.     #依顯示内容確定自身高
  501.     h = (description.size/3/word)
  502.     h +=1 if (description.size/3%word)> 0
  503.     now_h = h
  504.     h +=3  # 空行,效果範圍,價格
  505.     h += 1 unless item.recover_hp_rate.zero?
  506.     h += 1 unless item.recover_hp.zero?
  507.     h += 1 unless item.recover_sp_rate.zero?
  508.     h += 1 unless item.recover_sp.zero?
  509.     h += 1 unless item.parameter_type.zero?
  510.     h += 1 unless element_set[0].nil?
  511.     h += 1 unless element_set[4].nil?
  512.     h += (1+plus_state_set.size) unless plus_state_set.empty?
  513.     h += (1+minus_state_set.size) unless minus_state_set.empty?
  514.     #------------------------------------------------------------------------
  515.     # ● 圖片顯示保證高度
  516.     #------------------------------------------------------------------------
  517.     h = 6 + now_h if (h - now_h) < 6
  518.     #------------------------------------------------------------------------
  519.     # ● 換算高度
  520.     #------------------------------------------------------------------------
  521.     self.height = h * size + name_size + 32
  522.     #------------------------------------------------------------------------
  523.     # ● 生成背景
  524.     #------------------------------------------------------------------------
  525.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  526.     self.contents.clear
  527.     #------------------------------------------------------------------------
  528.     # ● 名字描繪
  529.     #------------------------------------------------------------------------
  530.     text = item.name
  531.     self.contents.font.color = normal_color#顔色腳本
  532.     self.contents.font.size = name_size
  533.     if text.nil?
  534.       self.visible = false
  535.     else
  536.       self.visible = true
  537.       self.contents.draw_text(0,0, text.size*7, 20, text, 0)
  538.     end
  539.     #------------------------------------------------------------------------
  540.     # ● 說明描繪
  541.     #------------------------------------------------------------------------
  542.     x = 0
  543.     y += 1
  544.     while ((text = description.slice!(/./m)) != nil)
  545.       self.contents.font.color = normal_color
  546.       self.contents.font.size = size
  547.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  548.       x+=1
  549.       if x == word
  550.         x = 0
  551.         y += 1
  552.       end
  553.     end
  554.     #------------------------------------------------------------------------
  555.     # ● 圖標描繪
  556.     #------------------------------------------------------------------------
  557.     bitmap = RPG::Cache.icon(item.icon_name) unless item.icon_name.nil?
  558.     opacity = self.contents.font.color == normal_color ? 255 : 128
  559.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  560.     #------------------------------------------------------------------------
  561.     # ● 魔力石接口
  562.     #------------------------------------------------------------------------
  563.     unless self.materia.nil?
  564.       return if is_materia?(item)
  565.     end
  566.     #------------------------------------------------------------------------
  567.     # ● 效果範圍
  568.     #------------------------------------------------------------------------
  569.     text= phrase["scope"] + scope[item.scope]
  570.     x = 0
  571.     y += 1
  572.     self.contents.font.color = normal_color
  573.     self.contents.font.size = size
  574.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  575.     #------------------------------------------------------------------------
  576.     # ● 價格
  577.     #------------------------------------------------------------------------
  578.     x = 0
  579.     y += 1      
  580.     text = phrase["price"] + item.price.to_s
  581.     self.contents.font.color = normal_color
  582.     self.contents.font.size = size
  583.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  584.    
  585.     #------------------------------------------------------------------------
  586.     # ● HP回復率
  587.     #------------------------------------------------------------------------
  588.     unless item.recover_hp_rate.zero?  
  589.       x = 0
  590.       y += 1
  591.       text = phrase["recover_hp_rate"] + item.recover_hp_rate.to_s+"%"
  592.       self.contents.font.color = normal_color
  593.       self.contents.font.size = size
  594.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  595.     end
  596.     #------------------------------------------------------------------------
  597.     # ● HP回復量
  598.     #------------------------------------------------------------------------
  599.     unless item.recover_hp.zero?  
  600.       x = 0
  601.       y += 1      
  602.       text = phrase["recover_hp"] + item.recover_hp.to_s
  603.       self.contents.font.color = normal_color
  604.       self.contents.font.size = size
  605.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  606.     end
  607.     #------------------------------------------------------------------------
  608.     # ● SP回復率
  609.     #------------------------------------------------------------------------
  610.     unless item.recover_sp_rate.zero?
  611.       x = 0
  612.       y += 1      
  613.       text = phrase["recover_sp_rate"] + item.recover_sp_rate.to_s+"%"
  614.       self.contents.font.color = normal_color
  615.       self.contents.font.size = size
  616.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  617.     end
  618.     #------------------------------------------------------------------------
  619.     # ● SP回復量
  620.     #------------------------------------------------------------------------
  621.     unless item.recover_sp.zero?  
  622.       x = 0
  623.       y += 1      
  624.       text = phrase["elements"] + item.recover_sp.to_s
  625.       self.contents.font.color = normal_color
  626.       self.contents.font.size = size
  627.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  628.     end
  629.     #------------------------------------------------------------------------
  630.     # ● 能力值增加
  631.     #------------------------------------------------------------------------
  632.     unless item.parameter_type.zero?
  633.       x = 0
  634.       y += 1      
  635.       text= parameter_type[item.parameter_type]+" +"+item.parameter_points.to_s

  636.       self.contents.font.color = normal_color
  637.       self.contents.font.size = size
  638.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  639.     end
  640.     #------------------------------------------------------------------------
  641.     # ● 屬性
  642.     #------------------------------------------------------------------------
  643.     if element_set.size > 0
  644.       x = 0
  645.       y += 1
  646.       text = phrase["elements"]
  647.       for i in 0...element_set.size
  648.         break if i > 4
  649.         text += $data_system.elements[element_set[i]]
  650.       end
  651.       self.contents.font.color = normal_color
  652.       self.contents.font.size = size
  653.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  654.     end
  655.     if element_set.size >= 5
  656.       x = (phrase["elements"].size)*5-4
  657.       y += 1
  658.       text = ""
  659.       for i in 4...element_set.size
  660.         text += $data_system.elements[element_set[i]]
  661.       end
  662.       self.contents.font.color = normal_color
  663.       self.contents.font.size = size
  664.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  665.     end
  666.     #------------------------------------------------------------------------
  667.     # ● 狀態添加
  668.     #------------------------------------------------------------------------
  669.     unless plus_state_set.empty?
  670.       text = phrase["plus"]
  671.       x = 0
  672.       y += 1
  673.       self.contents.font.color = normal_color
  674.       self.contents.font.size = size
  675.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  676.       plus_state_set.each do |plus_state|
  677.         y += 1
  678.         text = $data_states[plus_state].name        
  679.         self.contents.font.color = normal_color
  680.         self.contents.font.size = size
  681.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)      
  682.       end  
  683.     end
  684.     #------------------------------------------------------------------------
  685.     # ● 狀態解除
  686.     #------------------------------------------------------------------------
  687.     unless minus_state_set.empty?
  688.       text = phrase["minus"]
  689.       x = 0
  690.       y += 1
  691.       self.contents.font.color = normal_color
  692.       self.contents.font.size = size
  693.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  694.       minus_state_set.each do |minus_state|
  695.         y += 1
  696.         text = $data_states[minus_state].name
  697.         self.contents.font.color = normal_color
  698.         self.contents.font.size = size
  699.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  700.       end
  701.     end
  702.   end
  703.   #--------------------------------------------------------------------------
  704.   # ● 技能帮助窗口
  705.   #--------------------------------------------------------------------------
  706.   def set_skill_text(skill)
  707.     # 取得描述
  708.     description = skill.description.clone
  709.     # 取得屬性、附加狀態、解除狀態之副本
  710.     element_set = skill.element_set.clone
  711.     plus_state_set = skill.plus_state_set.clone
  712.     minus_state_set = skill.minus_state_set.clone
  713.     # 過濾不顯示的描述
  714.     element_set -= @unshow_elements
  715.     plus_state_set -= @unshow_states
  716.     minus_state_set -= @unshow_states
  717.     # 初始化設定
  718.     x = 0
  719.     y = 0
  720.     h = 0
  721.     phrase = {}
  722.     scope = {}
  723.    
  724.     # 基本數據設定
  725. =begin
  726.     name_size = 名字文字大小
  727.     size = 描述文字大小
  728.     word = 每行的描述文字數
  729.     move = 全體描述偏移幅度
  730. =end
  731.     name_size = 18
  732.     size = 14
  733.     word = 12
  734.     move = 80
  735.    
  736.     # 基本文字設定
  737.     phrase["scope"] = "范围:"
  738.     #
  739.     phrase["power"] = "威力:"
  740.     phrase["cost_sp"] = "消耗SP:"
  741.     phrase["hit_rate"] = "命中率:"
  742.     phrase["elements"] = "攻击属性"
  743.     #
  744.     phrase["plus"] = "附加"
  745.     phrase["minus"] = "解除"
  746.     phrase["states"] = "状态"
  747.     scope[0] = "特殊技能"
  748.     scope[1] = "敌单体"
  749.     scope[2] = "敌全体"
  750.     scope[3] = "我方单体"
  751.     scope[4] = "我方全体"
  752.     scope[5] = "我方昏死(单体)"
  753.     scope[6] = "我方昏死(全体)"
  754.     scope[7] = "自身"

  755.    
  756.     #由描叙确定高
  757.     h =description.size/3/word
  758.     h += 1 if (description.size%3/word) > 0
  759.     h += 4  #空行,效果范围,消费SP,命中率
  760.     h += 1 unless skill.power.zero?
  761.     h += 1 unless element_set.empty?
  762.     h += 1 unless element_set[4].nil?
  763.     h += plus_state_set.size
  764.     h += minus_state_set.size
  765.     #------------------------------------------------------------------------
  766.     # ● 換算高度
  767.     #------------------------------------------------------------------------
  768.     self.height=h * size + name_size + 32  
  769.     self.contents = Bitmap.new(self.width - 32,self.height - 32)
  770.     self.contents.clear
  771.    
  772.     #------------------------------------------------------------------------
  773.     # ● 名字描述
  774.     #------------------------------------------------------------------------
  775.     text = skill.name
  776.     self.contents.font.color = Color.new(255, 255, 128, 255)
  777.     self.contents.font.size = name_size
  778.     if text!=nil
  779.       self.visible = true
  780.       self.contents.draw_text(0,0, text.size*7, name_size, text, 0)
  781.     else
  782.       self.visible = false
  783.     end
  784.    
  785.     #------------------------------------------------------------------------
  786.     # ● 說明描述
  787.     #------------------------------------------------------------------------
  788.     x = 0
  789.     y += 1
  790.     text = description
  791.     while ((text = description.slice!(/./m)) != nil)
  792.       self.contents.font.color = normal_color
  793.       self.contents.font.size = size
  794.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  795.       x+=1
  796.       if x==word#每行10个字
  797.         x = 0
  798.         y += 1      
  799.       end
  800.     end
  801.    
  802.     #------------------------------------------------------------------------
  803.     # ● 攻擊範圍
  804.     #------------------------------------------------------------------------
  805.     text = phrase["scope"] + scope[skill.scope]
  806.     x = 0
  807.     y += 1
  808.     self.contents.font.color = normal_color
  809.     self.contents.font.size = size
  810.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  811.     #------------------------------------------------------------------------
  812.     # ● 空一行
  813.     #------------------------------------------------------------------------
  814.     y += 1
  815.     #------------------------------------------------------------------------
  816.     # ● 威力描述
  817.     #------------------------------------------------------------------------
  818.     unless skill.power.zero?
  819.       power = skill.power > 0 ? skill.power : -1 * skill.power
  820.       text = phrase["power"] + power.to_s
  821.       x = 0
  822.       y += 1
  823.       self.contents.font.color = normal_color
  824.       self.contents.font.size = size  
  825.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  826.     end  
  827.     #------------------------------------------------------------------------
  828.     # ● 消費SP描述
  829.     #------------------------------------------------------------------------
  830.     text = phrase["cost_sp"] + skill.sp_cost.to_s
  831.     x = 0
  832.     y += 1
  833.     self.contents.font.color = normal_color
  834.     self.contents.font.size = size   
  835.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  836.     #------------------------------------------------------------------------
  837.     # ● 命中率描述
  838.     #------------------------------------------------------------------------
  839.     text = phrase["hit_rate"] + skill.hit.to_s + "%"
  840.     x = 0
  841.     y += 1
  842.     self.contents.font.color = normal_color
  843.     self.contents.font.size = size
  844.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  845.     #------------------------------------------------------------------------
  846.     # ● 攻擊屬性
  847.     #------------------------------------------------------------------------
  848.     if element_set.size > 0
  849.       text=phrase["elements"]
  850.       for i in 0...element_set.size
  851.         if i < 4
  852.           text+=$data_system.elements[element_set[i]]
  853.         else
  854.           break
  855.         end        
  856.       end
  857.       x = 0
  858.       y += 1
  859.       self.contents.font.color = normal_color
  860.       self.contents.font.size = size
  861.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  862.     end
  863.     if element_set.size >= 5
  864.       text=""
  865.       for i in 4...element_set.size
  866.         text+=$data_system.elements[element_set[i]]
  867.       end
  868.       x= (phrase["elements"].size)*3
  869.       y += 1
  870.       self.contents.font.color = normal_color
  871.       self.contents.font.size = size
  872.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  873.     end
  874.     #------------------------------------------------------------------------
  875.     # ● 狀態附加
  876.     #------------------------------------------------------------------------
  877.     unless plus_state_set.empty?
  878.       text= phrase["plus"]
  879.       x = 0
  880.       y += 1
  881.       self.contents.font.color = normal_color
  882.       self.contents.font.size = size
  883.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  884.       plus_state_set.each do |plus_state|
  885.         y += 1
  886.         text=$data_states[plus_state].name        
  887.         self.contents.font.color = normal_color
  888.         self.contents.font.size = size
  889.         self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)        
  890.       end  
  891.     end
  892.     #------------------------------------------------------------------------
  893.     # ●狀態解除
  894.     #------------------------------------------------------------------------
  895.     unless minus_state_set.empty?
  896.       text = phrase["minus"]
  897.       x = 0
  898.       y += 1
  899.       self.contents.font.color = normal_color
  900.       self.contents.font.size=size
  901.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  902.       minus_state_set.each do |minus_state|
  903.         y += 1
  904.         text=$data_states[minus_state].name        
  905.         self.contents.font.color = normal_color
  906.         self.contents.font.size=size
  907.         self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)        
  908.       end  
  909.     end     
  910.   end
  911.   #--------------------------------------------------------------------------
  912.   # ● 设置角色
  913.   #     actor : 要显示状态的角色
  914.   #--------------------------------------------------------------------------
  915.   def set_actor(actor)
  916.     if actor != @actor
  917.       self.contents.clear
  918.       draw_actor_name(actor, 4, 0)
  919.       draw_actor_state(actor, 140, 0)
  920.       draw_actor_hp(actor, 284, 0)
  921.       draw_actor_sp(actor, 460, 0)
  922.       @actor = actor
  923.       @text = nil
  924.       self.visible = true
  925.     end
  926.   end
  927.   #--------------------------------------------------------------------------
  928.   # ● 設置角色
  929.   #     actor : 要顯示狀態之角色
  930.   #--------------------------------------------------------------------------
  931.   def set_actor(actor)
  932.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  933.     if actor != @actor
  934.       self.contents.clear
  935.       draw_actor_name(actor, 4, 0)
  936.       draw_actor_state(actor, 140, 0)
  937.       draw_actor_hp(actor, 284, 0)
  938.       draw_actor_sp(actor, 460, 0)
  939.       @actor = actor
  940.       @text = nil
  941.       self.visible = true
  942.     end
  943.   end
  944.   #--------------------------------------------------------------------------
  945.   # ● 設置敵人
  946.   #     enemy : 要顯示名字與狀態之敵人
  947.   #--------------------------------------------------------------------------
  948.   def set_enemy(enemy)
  949.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  950.     text = enemy.name.sub(/[Ff][([0-9]+)]/) {""}
  951.     state_text = make_battler_state_text(enemy, 112, false)
  952.     if state_text != ""
  953.       text += "  " + state_text
  954.     end
  955.     set_text(text, 1)
  956.     self.visible = true
  957.   end
  958.   #--------------------------------------------------------------------------
  959.   # ● 校正帮助窗口位置
  960.   #--------------------------------------------------------------------------
  961.   def set_pos(x,y,width,oy,index,column_max)
  962.     #光标坐标
  963.     cursor_width = width / column_max - 32
  964.     xx = index % column_max * (cursor_width + 32)
  965.     yy = index / column_max * 32 - oy
  966.     self.x=xx+x+150
  967.     self.y=yy+y+30
  968.     if self.x+self.width>640
  969.       self.x=640-self.width
  970.     end
  971.     if self.y+self.height>480
  972.       self.y=480-self.height
  973.     end  
  974.   end
  975.   #------------------------------------------------------------------------
  976.   # ● 裝備名字顔色變化 接口
  977.   #------------------------------------------------------------------------
  978.   def draw_name_color(equipment)
  979.     return normal_color
  980.   end
  981.   #------------------------------------------------------------------------
  982.   # ● 自身身份確認
  983.   #------------------------------------------------------------------------
  984.   def original_help?
  985.     return false
  986.   end
  987. end

  988. #------------------------------------------------------------------------------



  989. #------------------------------------------------------------------------------
  990. #==============================================================================
  991. # ■ Window_Item
  992. #------------------------------------------------------------------------------
  993. #  物品画面、战斗画面、显示浏览物品的窗口。
  994. #==============================================================================

  995. class Window_Item < Window_Selectable
  996.   #--------------------------------------------------------------------------
  997.   # ● 初始化对像
  998.   #--------------------------------------------------------------------------
  999.   def initialize
  1000.     super(0, 64-64, 640, 416+64)
  1001.     @column_max = 2
  1002.     refresh
  1003.     self.index = 0
  1004.     # 战斗中的情况下将窗口移至中央并将其半透明化
  1005.     if $game_temp.in_battle
  1006.       self.y = 64
  1007.       self.height = 256
  1008.       self.back_opacity = 160
  1009.     end
  1010.   end
  1011.   #--------------------------------------------------------------------------
  1012.   # ● 刷新帮助文本
  1013.   #--------------------------------------------------------------------------
  1014.   def update_help
  1015.     @help_window.set_text(item)
  1016.     #校正帮助窗口位置
  1017.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1018.   end
  1019. end
  1020. #------------------------------------------------------------------------------



  1021. #------------------------------------------------------------------------------
  1022. #==============================================================================
  1023. # ■ Window_Skill
  1024. #------------------------------------------------------------------------------
  1025. #  特技画面、战斗画面、显示可以使用的特技浏览的窗口。
  1026. #==============================================================================

  1027. class Window_Skill < Window_Selectable
  1028.   #--------------------------------------------------------------------------
  1029.   # ● 初始化对像
  1030.   #     actor : 角色
  1031.   #--------------------------------------------------------------------------
  1032.   def initialize(actor)
  1033.     super(0, 128, 640, 352)
  1034.     @actor = actor
  1035.     @column_max = 2
  1036.    
  1037.     refresh
  1038.     self.index = 0
  1039.     # 战斗中的情况下将窗口移至中央并将其半透明化
  1040.     if $game_temp.in_battle
  1041.       self.y = 64
  1042.       self.height = 256
  1043.       self.back_opacity = 160
  1044.     end
  1045.   end
  1046.   #--------------------------------------------------------------------------
  1047.   # ● 刷新帮助文本
  1048.   #--------------------------------------------------------------------------

  1049.   def update_help
  1050.     @help_window.set_text(skill)
  1051.     #校正帮助窗口位置
  1052.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1053.   end
  1054. end
  1055. #------------------------------------------------------------------------------



  1056. #------------------------------------------------------------------------------
  1057. #==============================================================================
  1058. # ■ Window_SkillStatus
  1059. #------------------------------------------------------------------------------
  1060. #  显示特技画面、特技使用者的窗口。
  1061. #==============================================================================

  1062. class Window_SkillStatus < Window_Base
  1063.   #--------------------------------------------------------------------------
  1064.   # ● 初始化对像
  1065.   #     actor : 角色
  1066.   #--------------------------------------------------------------------------
  1067.   def initialize(actor)
  1068. # -------------------
  1069. # 修改開始
  1070.     super(0, 64-64, 640, 64+64)#★★★★★★★★★★★★★★★★★★★★
  1071. # 修改終了
  1072. # -------------------
  1073.     self.contents = Bitmap.new(width - 32, height - 32)
  1074.     @actor = actor
  1075.     refresh
  1076.   end
  1077. end
  1078. #------------------------------------------------------------------------------



  1079. #------------------------------------------------------------------------------
  1080. #==============================================================================
  1081. # ■ Window_EquipLeft
  1082. #------------------------------------------------------------------------------
  1083. #  装备画面的、显示角色能力值变化的窗口。
  1084. #==============================================================================
  1085. class Window_EquipLeft < Window_Base
  1086.   #--------------------------------------------------------------------------
  1087.   # ● 初始化对像
  1088.   #     actor : 角色
  1089.   #--------------------------------------------------------------------------
  1090.   def initialize(actor)
  1091. # -------------------
  1092. # 修改開始
  1093.     super(0, 64-64, 272, 416+64)#★★★★★★★★★★★★★★★★★★★★
  1094. # 修改終了
  1095. # -------------------
  1096.     self.contents = Bitmap.new(width - 32, height - 32)
  1097.     @actor = actor
  1098.     refresh
  1099.   end
  1100. end
  1101. #------------------------------------------------------------------------------



  1102. #------------------------------------------------------------------------------
  1103. #==============================================================================
  1104. # ■ Window_EquipRight
  1105. #------------------------------------------------------------------------------
  1106. #  装备画面、显示角色现在装备的物品的窗口。
  1107. #==============================================================================

  1108. class Window_EquipRight < Window_Selectable
  1109.   #--------------------------------------------------------------------------
  1110.   # ● 初始化对像
  1111.   #     actor : 角色
  1112.   #--------------------------------------------------------------------------
  1113.   def initialize(actor)
  1114. # -------------------
  1115. # 修改開始
  1116.     super(272, 64-64, 368, 256+64)#★★★★★★★★★★★★★★★★★★★★
  1117. # 修改終了
  1118. # -------------------
  1119.     self.contents = Bitmap.new(width - 32, height - 32)
  1120.     @actor = actor
  1121.     refresh
  1122.     self.index = 0
  1123.   end
  1124.   #--------------------------------------------------------------------------
  1125.   # ● 刷新帮助文本
  1126.   #--------------------------------------------------------------------------

  1127.   def update_help
  1128.     @help_window.set_text(item)
  1129.     #校正帮助窗口位置
  1130.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1131.   end
  1132. end
  1133. #------------------------------------------------------------------------------



  1134. #------------------------------------------------------------------------------
  1135. #==============================================================================
  1136. # ■ Window_EquipItem
  1137. #------------------------------------------------------------------------------
  1138. #  装备画面、显示浏览变更装备的候补物品的窗口。
  1139. #==============================================================================

  1140. class Window_EquipItem < Window_Selectable
  1141.   #--------------------------------------------------------------------------
  1142.   # ● 初始化对像
  1143.   #     actor      : 角色
  1144.   #     equip_type : 装备部位 (0~3)
  1145.   #--------------------------------------------------------------------------
  1146.   def initialize(actor, equip_type)
  1147. # -------------------
  1148. # 修改開始
  1149.     super(272, 320, 368, 160)#★★★★★★★★★★★★★★★★★★★★
  1150. # 修改終了
  1151. # -------------------
  1152.     @actor = actor
  1153.     @equip_type = equip_type
  1154.     @column_max = 1
  1155.    
  1156.     refresh
  1157.     self.active = false
  1158.     self.index = -1
  1159.   end
  1160.   def update_help
  1161.     @help_window.set_text(item)
  1162.     #校正帮助窗口位置
  1163.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1164.   end
  1165. end
  1166. #------------------------------------------------------------------------------



  1167. #------------------------------------------------------------------------------
  1168. #==============================================================================
  1169. # ■ Window_ShopCommand
  1170. #------------------------------------------------------------------------------
  1171. #  商店画面、选择要做的事的窗口
  1172. #==============================================================================

  1173. class Window_ShopCommand < Window_Selectable
  1174.   #--------------------------------------------------------------------------
  1175.   # ● 初始化对像
  1176.   #--------------------------------------------------------------------------
  1177.   def initialize
  1178. # -------------------
  1179. # 修改開始
  1180.     super(0, 64-64, 480, 64)#★★★★★★★★★★★★★★★★★
  1181. # 修改終了
  1182. # -------------------
  1183.     self.contents = Bitmap.new(width - 32, height - 32)
  1184.     @item_max = 3
  1185.     @column_max = 3
  1186.     @commands = ["买", "卖", "取消"]
  1187.     refresh
  1188.     self.index = 0
  1189.   end
  1190. end
  1191. #------------------------------------------------------------------------------



  1192. #------------------------------------------------------------------------------
  1193. #========================================================================================================================
  1194. # ■ Window_ShopBuy
  1195. #------------------------------------------------------------------------------
  1196. #  商店画面、浏览显示可以购买的商品的窗口。
  1197. #==============================================================================

  1198. class Window_ShopBuy < Window_Selectable
  1199.   #--------------------------------------------------------------------------
  1200.   # ● 初始化对像
  1201.   #     shop_goods : 商品
  1202.   #--------------------------------------------------------------------------
  1203.   def initialize(shop_goods)
  1204. # -------------------
  1205. # 修改開始
  1206.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  1207. # 修改終了
  1208. # -------------------
  1209.     @shop_goods = shop_goods
  1210.    
  1211.     refresh
  1212.     self.index = 0
  1213.   end
  1214.   #--------------------------------------------------------------------------
  1215.   # ● 刷新帮助文本
  1216.   #--------------------------------------------------------------------------

  1217.   def update_help
  1218.     @help_window.set_text(item)
  1219.     #校正帮助窗口位置
  1220.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1221.   end
  1222. end
  1223. #------------------------------------------------------------------------------



  1224. #------------------------------------------------------------------------------
  1225. #==============================================================================
  1226. # ■ Window_ShopSell
  1227. #------------------------------------------------------------------------------
  1228. #  商店画面、浏览显示可以卖掉的商品的窗口。
  1229. #==============================================================================

  1230. class Window_ShopSell < Window_Selectable
  1231.   #--------------------------------------------------------------------------
  1232.   # ● 初始化对像
  1233.   #--------------------------------------------------------------------------
  1234.   def initialize
  1235. # -------------------
  1236. # 修改開始
  1237.     super(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★★★★
  1238. # 修改終了
  1239. # -------------------
  1240.     @column_max = 2
  1241.    
  1242.     refresh
  1243.     self.index = 0
  1244.   end
  1245.   #--------------------------------------------------------------------------
  1246.   # ● 刷新帮助文本
  1247.   #--------------------------------------------------------------------------

  1248.   def update_help
  1249.     @help_window.set_text(item)
  1250.     #校正帮助窗口位置
  1251.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  1252.   end
  1253. end
  1254. #------------------------------------------------------------------------------



  1255. #------------------------------------------------------------------------------
  1256. #==============================================================================
  1257. # ■ Window_ShopNumber
  1258. #------------------------------------------------------------------------------
  1259. #  商店画面、输入买卖数量的窗口。
  1260. #==============================================================================
  1261. class Window_ShopNumber < Window_Base
  1262.   #--------------------------------------------------------------------------
  1263.   # ● 初始化对像
  1264.   #--------------------------------------------------------------------------
  1265.   def initialize
  1266. # -------------------
  1267. # 修改開始
  1268.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  1269. # 修改終了
  1270. # -------------------
  1271.     self.contents = Bitmap.new(width - 32, height - 32)
  1272.     @item = nil
  1273.     @max = 1
  1274.     @price = 0
  1275.     @number = 1
  1276.   end
  1277. end
  1278. #------------------------------------------------------------------------------



  1279. #------------------------------------------------------------------------------
  1280. #==============================================================================
  1281. # ■ Window_ShopStatus
  1282. #------------------------------------------------------------------------------
  1283. #  商店画面、显示物品所持数与角色装备的窗口。
  1284. #==============================================================================

  1285. class Window_ShopStatus < Window_Base
  1286.   #--------------------------------------------------------------------------
  1287.   # ● 初始化对像
  1288.   #--------------------------------------------------------------------------
  1289.   def initialize
  1290. # -------------------
  1291. # 修改開始
  1292.     super(368, 128-64, 272, 352+64)#★★★★★★★★★★★★
  1293. # 修改終了
  1294. # -------------------
  1295.     self.contents = Bitmap.new(width - 32, height - 32)
  1296.     @item = nil
  1297.     refresh
  1298.   end
  1299. end
  1300. #------------------------------------------------------------------------------



  1301. #------------------------------------------------------------------------------
  1302. #==============================================================================
  1303. # ■ Scene_Equip
  1304. #------------------------------------------------------------------------------
  1305. #  处理装备画面的类。
  1306. #==============================================================================

  1307. class Scene_Equip
  1308.   #--------------------------------------------------------------------------
  1309.   # ● 刷新画面 (右侧窗口被激活的情况下)
  1310.   #--------------------------------------------------------------------------
  1311.   def update_right
  1312. # -------------------
  1313. # 修改開始
  1314.     if @right_window.item==nil
  1315.         @help_window.visible=false
  1316.     else
  1317.         @help_window.visible=true
  1318.     end
  1319. # 修改終了
  1320. # -------------------
  1321.     # 按下 B 键的情况下
  1322.     if Input.trigger?(Input::B)
  1323.       # 演奏取消 SE
  1324.       $game_system.se_play($data_system.cancel_se)
  1325.       # 切换到菜单画面
  1326.       $scene = Scene_Menu.new(2)
  1327.       return
  1328.     end
  1329.     # 按下 C 键的情况下
  1330.     if Input.trigger?(Input::C)
  1331.       # 固定装备的情况下
  1332.       if @actor.equip_fix?(@right_window.index)
  1333.         # 演奏冻结 SE
  1334.         $game_system.se_play($data_system.buzzer_se)
  1335.         return
  1336.       end
  1337.       # 演奏确定 SE
  1338.       $game_system.se_play($data_system.decision_se)
  1339.       # 激活物品窗口
  1340.       @right_window.active = false
  1341.       @item_window.active = true
  1342.       @item_window.index = 0
  1343.       return
  1344.     end
  1345.     # 按下 R 键的情况下
  1346.     if Input.trigger?(Input::R)
  1347.       # 演奏光标 SE
  1348.       $game_system.se_play($data_system.cursor_se)
  1349.       # 移至下一位角色
  1350.       @actor_index += 1
  1351.       @actor_index %= $game_party.actors.size
  1352.       # 切换到别的装备画面
  1353.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  1354.       return
  1355.     end
  1356.     # 按下 L 键的情况下
  1357.     if Input.trigger?(Input::L)
  1358.       # 演奏光标 SE
  1359.       $game_system.se_play($data_system.cursor_se)
  1360.       # 移至上一位角色
  1361.       @actor_index += $game_party.actors.size - 1
  1362.       @actor_index %= $game_party.actors.size
  1363.       # 切换到别的装备画面
  1364.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  1365.       return
  1366.     end
  1367.   end
  1368.   #--------------------------------------------------------------------------
  1369.   # ● 刷新画面 (物品窗口被激活的情况下)
  1370.   #--------------------------------------------------------------------------
  1371.   def update_item
  1372. # -------------------
  1373. # 修改開始
  1374.     if @item_window.item==nil
  1375.         @help_window.visible=false
  1376.     else
  1377.         @help_window.visible=true
  1378.     end
  1379. # 修改終了
  1380. # -------------------
  1381.     # 按下 B 键的情况下
  1382.     if Input.trigger?(Input::B)
  1383.       # 演奏取消 SE
  1384.       $game_system.se_play($data_system.cancel_se)
  1385.       # 激活右侧窗口
  1386.       @right_window.active = true
  1387.       @item_window.active = false
  1388.       @item_window.index = -1
  1389.       return
  1390.     end
  1391.     # 按下 C 键的情况下
  1392.     if Input.trigger?(Input::C)
  1393.       # 演奏装备 SE
  1394.       $game_system.se_play($data_system.equip_se)
  1395.       # 获取物品窗口现在选择的装备数据
  1396.       item = @item_window.item
  1397.       # 变更装备
  1398.       @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  1399.       # 激活右侧窗口
  1400.       @right_window.active = true
  1401.       @item_window.active = false
  1402.       @item_window.index = -1
  1403.       # 再生成右侧窗口、物品窗口的内容
  1404.       @right_window.refresh
  1405.       @item_window.refresh
  1406.       return
  1407.     end
  1408.   end
  1409. end
  1410. #------------------------------------------------------------------------------



  1411. #------------------------------------------------------------------------------
  1412. #========================================================================================================================
  1413. # ■ Scene_Battle (分割定义 3)
  1414. #------------------------------------------------------------------------------
  1415. #  处理战斗画面的类。
  1416. #========================================================================================================================

  1417. class Scene_Battle
  1418.   #--------------------------------------------------------------------------
  1419.   # ● 刷新画面 (角色命令回合 : 选择特技)
  1420.   #--------------------------------------------------------------------------
  1421.   alias first_reupdate_phase3_skill_select update_phase3_skill_select
  1422.   def update_phase3_skill_select
  1423. # -------------------
  1424. # 修改開始
  1425.     @skill_window.help_window.visible = false#★★★★★★★★★★★★★
  1426. # 修改終了
  1427. # -------------------
  1428.     first_reupdate_phase3_skill_select
  1429.   end
  1430.   #--------------------------------------------------------------------------
  1431.   # ● 刷新画面 (角色命令回合 : 选择物品)
  1432.   #--------------------------------------------------------------------------
  1433.   alias first_reupdate_phase3_item_select update_phase3_item_select  
  1434.   def update_phase3_item_select
  1435. # -------------------
  1436. # 修改開始
  1437.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  1438. # 修改終了
  1439. # -------------------
  1440.     first_reupdate_phase3_item_select
  1441.   end
  1442.   #--------------------------------------------------------------------------
  1443.   # ● 开始选择特技
  1444.   #--------------------------------------------------------------------------
  1445.   def start_skill_select
  1446.     @skill_window = Window_Skill.new(@active_battler)
  1447.     @skill_window.help_window = Window_Help.new
  1448.     @actor_command_window.active = false
  1449.     @actor_command_window.visible = false
  1450.   end
  1451.   #--------------------------------------------------------------------------
  1452.   # ● 选择特技结束
  1453.   #--------------------------------------------------------------------------
  1454.   alias first_update_end_skill_select end_skill_select  
  1455.   def end_skill_select
  1456. # -------------------
  1457. # 修改開始
  1458.     @skill_window.help_window.visible = false#★★★★★★★★★★★★
  1459. # 修改終了
  1460. # -------------------
  1461.     first_update_end_skill_select
  1462.   end
  1463.   #--------------------------------------------------------------------------
  1464.   # ● 开始选择物品
  1465.   #--------------------------------------------------------------------------
  1466.   def start_item_select
  1467.     # 生成物品窗口
  1468.     @item_window = Window_Item.new
  1469.     # 关联帮助窗口
  1470. # -------------------
  1471. # 修改開始
  1472.     @item_window.help_window =  Window_Help.new#★★★★★★★★★★★★
  1473. # 修改終了
  1474. # -------------------
  1475.     # 无效化角色指令窗口
  1476.     @actor_command_window.active = false
  1477.     @actor_command_window.visible = false
  1478.   end
  1479.   #--------------------------------------------------------------------------
  1480.   # ● 结束选择物品
  1481.   #--------------------------------------------------------------------------
  1482.   alias first_update_end_item_select end_item_select
  1483.   def end_item_select
  1484. # -------------------
  1485. # 修改開始
  1486.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  1487. # 修改終了
  1488. # -------------------
  1489.     first_update_end_item_select
  1490.   end
  1491. end
  1492. #------------------------------------------------------------------------------



  1493. #------------------------------------------------------------------------------
  1494. #==============================================================================
  1495. # ■ Scene_Shop
  1496. #------------------------------------------------------------------------------
  1497. #  处理商店画面的类。
  1498. #==============================================================================

  1499. class Scene_Shop
  1500.   #--------------------------------------------------------------------------
  1501.   # ● 主处理
  1502.   #--------------------------------------------------------------------------
  1503. # --------------------
  1504. # 衝突可能
  1505.   def main
  1506.     # 生成帮助窗口
  1507. # -------------------
  1508. # 修改開始
  1509.     @help_window = Window_Help.new#★★★★★★★★★★★★★★★★
  1510. # 修改終了
  1511. # -------------------
  1512.     # 生成指令窗口
  1513.     @command_window = Window_ShopCommand.new
  1514.     # 生成金钱窗口
  1515.     @gold_window = Window_Gold.new
  1516.     @gold_window.x = 480
  1517. # -------------------
  1518. # 修改開始
  1519.     @gold_window.y = 64-64#★★★★★★★★★★★★★
  1520. # 修改終了
  1521. # -------------------
  1522.     # 生成时间窗口
  1523. # -------------------
  1524. # 修改開始
  1525.     @dummy_window = Window_Base.new(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★
  1526. # 修改終了
  1527. # -------------------
  1528.     # 生成购买窗口
  1529.     @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
  1530.     @buy_window.active = false
  1531.     @buy_window.visible = false
  1532.     @buy_window.help_window = @help_window
  1533.     # 生成卖出窗口
  1534.     @sell_window = Window_ShopSell.new
  1535.     @sell_window.active = false
  1536.     @sell_window.visible = false
  1537.     @sell_window.help_window = @help_window
  1538.     # 生成数量输入窗口
  1539.     @number_window = Window_ShopNumber.new
  1540.     @number_window.active = false
  1541.     @number_window.visible = false
  1542.     # 生成状态窗口
  1543.     @status_window = Window_ShopStatus.new
  1544.     @status_window.visible = false
  1545.     # 执行过渡
  1546.     Graphics.transition
  1547.     # 主循环
  1548.     loop do
  1549.       # 刷新游戏画面
  1550.       Graphics.update
  1551.       # 刷新输入信息
  1552.       Input.update
  1553.       # 刷新画面
  1554.       update
  1555.       # 如果画面切换的话就中断循环
  1556.       if $scene != self
  1557.         break
  1558.       end
  1559.     end
  1560.     # 准备过渡
  1561.     Graphics.freeze
  1562.     # 释放窗口
  1563.     @help_window.dispose
  1564.     @command_window.dispose
  1565.     @gold_window.dispose
  1566.     @dummy_window.dispose
  1567.     @buy_window.dispose
  1568.     @sell_window.dispose
  1569.     @number_window.dispose
  1570.     @status_window.dispose
  1571.   end
  1572.   #--------------------------------------------------------------------------
  1573.   # ● 刷新画面
  1574.   #--------------------------------------------------------------------------
  1575. # --------------------
  1576. # 衝突可能
  1577.   def update
  1578.     # 刷新窗口
  1579.     @help_window.update
  1580.     @command_window.update
  1581.     @gold_window.update
  1582.     @dummy_window.update
  1583.     @buy_window.update
  1584.     @sell_window.update
  1585.     @number_window.update
  1586.     @status_window.update
  1587.     # 指令窗口激活的情况下: 调用 update_command
  1588.     if @command_window.active
  1589. # -------------------
  1590. # 修改開始
  1591.       @help_window.visible=false#★★★★★★★★★★★★★★★★
  1592. # 修改終了
  1593. # -------------------
  1594.       update_command
  1595.       return
  1596.     end
  1597.     # 购买窗口激活的情况下: 调用 update_buy
  1598.     if @buy_window.active
  1599. # -------------------
  1600. # 修改開始
  1601.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  1602.       if @buy_window.item==nil#★★★★★★★★★★★★★★★★
  1603.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  1604.       end #★★★★★★★★★★★★★★★★     
  1605. # 修改終了
  1606. # -------------------
  1607.       update_buy
  1608.       return
  1609.     end
  1610.     # 卖出窗口激活的情况下: 调用 update_sell
  1611.     if @sell_window.active
  1612. # -------------------
  1613. # 修改開始
  1614.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  1615.       if @sell_window.item==nil#★★★★★★★★★★★★★★★★
  1616.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  1617.       end #★★★★★★★★★★★★★★★★
  1618. # 修改終了
  1619. # -------------------      
  1620.       update_sell
  1621.       return
  1622.     end
  1623.     # 个数输入窗口激活的情况下: 调用 update_number
  1624.     if @number_window.active
  1625. # -------------------
  1626. # 修改開始
  1627.       @help_window.visible=false#★★★★★★★★★★★★★★★★
  1628. # 修改終了
  1629. # -------------------
  1630.       update_number
  1631.       return
  1632.     end
  1633.   end
  1634. end


  1635. ‘‘──eu国猪于2012-7-21 12:22补充以下内容:

  1636. #==============================================================================
  1637. # 禾西製作 / Created by Quarcy
  1638. #==============================================================================
  1639. class Window_Help < Window_Base
  1640.   attr_reader :materia
  1641.   #--------------------------------------------------------------------------
  1642.   # ● 定義不顯示的屬性與狀態
  1643.   #--------------------------------------------------------------------------
  1644.   def unshown
  1645.     @unshow_elements = [17, 18]
  1646.     @unshow_states = []
  1647.   end
  1648.   #--------------------------------------------------------------------------
  1649.   # ● 初始化對象
  1650.   #--------------------------------------------------------------------------
  1651.   def initialize
  1652.     super(0, 0, 640, 64)
  1653.     self.opacity = 150
  1654.     self.z=150
  1655.     self.visible = false
  1656.   end
  1657.   #--------------------------------------------------------------------------
  1658.   # ● 設置文本
  1659.   #     data  : 窗口顯示的字符串/物品資料
  1660.   #     align : 對齊方式 (0..左對齊、1..中間對齊、2..右對齊)
  1661.   #--------------------------------------------------------------------------
  1662.   def set_text(data, align=0)
  1663.     #------------------------------------------------------------------------
  1664.     # ● 當資料爲文字時候
  1665.     #------------------------------------------------------------------------
  1666.     # 如果文本或對齊方式至少一方与上次的不同
  1667.     if data != @text or align != @align
  1668.       if data.is_a?(String)
  1669.         # 再描繪文本
  1670.         self.width = 640
  1671.         self.height = 64
  1672.         self.x=0
  1673.         self.y=0
  1674.         self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  1675.         self.contents.clear
  1676.         self.contents.font.color = normal_color
  1677.         self.contents.font.size = 20
  1678.         self.contents.draw_text(4, 0, self.width - 40, 32, data, align)
  1679.         @text = data
  1680.         @align = align
  1681.         @actor = nil
  1682.         self.visible = true
  1683.       end
  1684.     end
  1685.     return if data.is_a?(String)
  1686.     #------------------------------------------------------------------------
  1687.     # ● 當沒有資料時候
  1688.     #------------------------------------------------------------------------
  1689.     if data.nil?
  1690.       self.visible=false
  1691.     else
  1692.       self.visible=true
  1693.     end
  1694.     #------------------------------------------------------------------------
  1695.     # ● 當資料爲物品/技能時候
  1696.     #------------------------------------------------------------------------
  1697.     if data != nil && @data != data
  1698.       self.width = 210
  1699.       self.height = 430
  1700.       self.x=0
  1701.       self.y=200
  1702.       unshown
  1703.       non_auto_update(data)
  1704.     else
  1705.       return
  1706.     end
  1707.   end
  1708.   #--------------------------------------------------------------------------
  1709.   # ● 更新帮助窗口
  1710.   #--------------------------------------------------------------------------
  1711.   def non_auto_update(data=@data)
  1712.     @data = data
  1713.     case @data
  1714.     when RPG::Item
  1715.       set_item_text(@data)
  1716.     when RPG::Weapon
  1717.       set_equipment_text(@data)
  1718.     when RPG::Armor
  1719.       set_equipment_text(@data)
  1720.     when RPG::Skill
  1721.       set_skill_text(@data)
  1722.     end
  1723.   end
  1724.   #--------------------------------------------------------------------------
  1725.   # ● 裝備帮助窗口
  1726.   #--------------------------------------------------------------------------
  1727.   def set_equipment_text(equipment)
  1728.     #------------------------------------------------------------------------
  1729.     # ● 取得基本質料
  1730.     #------------------------------------------------------------------------
  1731.     # 取得屬性、附加狀態、解除狀態之副本
  1732.     case equipment
  1733.     when RPG::Weapon
  1734.       element_set = equipment.element_set.clone
  1735.       plus_state_set = equipment.plus_state_set.clone
  1736.       minus_state_set = equipment.minus_state_set.clone
  1737.       #----------------------#
  1738.       # 過濾不顯示的狀態描述 #
  1739.       #----------------------#
  1740.       plus_state_set -= @unshow_states
  1741.       minus_state_set -= @unshow_states
  1742.     when RPG::Armor
  1743.       element_set = equipment.guard_element_set.clone
  1744.       guard_state_set = equipment.guard_state_set.clone
  1745.       #----------------------#
  1746.       # 過濾不顯示的狀態描述 #
  1747.       #----------------------#
  1748.       auto_state_id = equipment.auto_state_id
  1749.       guard_state_set -= @unshow_states
  1750.     end
  1751.     #----------------------#
  1752.     # 過濾不顯示的屬性描述 #
  1753.     #----------------------#
  1754.     element_set -= @unshow_elements
  1755.     #--------------#
  1756.     # 取得說明文字 #
  1757.     #--------------#
  1758.     description = equipment.description.clone
  1759.     # 初始化數據設定
  1760.     x = 0
  1761.     y = 0
  1762.     h = 0
  1763.     phrase = {}
  1764.    
  1765.     # 基本文字設定
  1766.     phrase["price"] = "价格:"
  1767.     phrase["elements"] = "属性:"
  1768.     phrase["minus_states"] = "解除状态:"
  1769.     phrase["plus_states"] = "附加状态:"
  1770.     phrase["guard_elements"] = "防御属性"
  1771.     phrase["guard_states"] = "防御状态"
  1772.     phrase["auto_state"] = "自动状态"

  1773.     # 基本數據設定
  1774. =begin
  1775.     name_size = 名字文字大小
  1776.     size = 描述文字大小
  1777.     word = 每行的描述文字數
  1778.     move = 全體描述偏移幅度
  1779. =end
  1780.     name_size = 18
  1781.     size = 14
  1782.     word = 12
  1783.     move = 80
  1784.     #------------------------------------------------------------------------
  1785.     # ● 確定背景圖片的高度
  1786.     #------------------------------------------------------------------------
  1787.     h += (description.size/3/word)
  1788.     h += 1 if (description.size/3%word) > 0
  1789.     h += 1 if equipment.is_a?(RPG::Weapon)
  1790.     now_h = h
  1791.     h += 1
  1792.     h += 1 unless equipment.pdef.zero?
  1793.     h += 1 unless equipment.mdef.zero?
  1794.     h += 1 if element_set.size > 0
  1795.     h += 1 if element_set.size >= 5
  1796.     case equipment
  1797.     when RPG::Weapon
  1798.       h += 1 unless minus_state_set.empty?
  1799.       h += minus_state_set.size
  1800.       h += 1 unless plus_state_set.empty?
  1801.       h += plus_state_set.size
  1802.     when RPG::Armor
  1803.       h += 1 unless guard_state_set.empty?
  1804.       h += guard_state_set.size
  1805.       h += 1 unless auto_state_id.zero?
  1806.     end
  1807.     h += 1
  1808.     h += 1 unless equipment.str_plus.zero?
  1809.     h += 1 unless equipment.dex_plus.zero?
  1810.     h += 1 unless equipment.agi_plus.zero?
  1811.     h += 1 unless equipment.int_plus.zero?
  1812.     h += materia_height_plus(equipment) unless self.materia.nil?
  1813.     #------------------------------------------------------------------------
  1814.     # ● 圖片顯示保證高度
  1815.     #------------------------------------------------------------------------
  1816.     h = 6 + now_h if (h - now_h) < 6
  1817.     #------------------------------------------------------------------------
  1818.     # ● 換算高度
  1819.     #------------------------------------------------------------------------
  1820.     self.height = h * size + name_size + 32
  1821.     #------------------------------------------------------------------------
  1822.     # ● 生成背景
  1823.     #------------------------------------------------------------------------
  1824.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  1825.     self.contents.clear
  1826.     #------------------------------------------------------------------------
  1827.     # ● 名字描繪
  1828.     #------------------------------------------------------------------------
  1829.     text = equipment.name
  1830.     self.contents.font.color = draw_name_color(equipment)
  1831.     self.contents.font.size = name_size
  1832.     if text.nil?
  1833.       self.visible = false
  1834.     else
  1835.       self.visible = true
  1836.       self.contents.draw_text(0, 0, text.size*7, name_size, text, 0)
  1837.     end
  1838.     #------------------------------------------------------------------------
  1839.     # ● 說明描繪
  1840.     #------------------------------------------------------------------------
  1841.     x = 0
  1842.     y += 1
  1843.     while ((text = description.slice!(/./m)) != nil)
  1844.       self.contents.font.color = normal_color
  1845.       self.contents.font.size = size
  1846.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  1847.       x+=1
  1848.       if x == word
  1849.         x=0
  1850.         y+=1   
  1851.       end
  1852.     end
  1853.     #------------------------------------------------------------------------
  1854.     # ● 圖標描繪
  1855.     #------------------------------------------------------------------------
  1856.     bitmap = RPG::Cache.icon(equipment.icon_name)
  1857.     opacity = self.contents.font.color == normal_color ? 255 : 128
  1858.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  1859.   
  1860.     #------------------------------------------------------------------------
  1861.     # ● 攻擊力描繪(武器)
  1862.     #------------------------------------------------------------------------
  1863.     if equipment.is_a?(RPG::Weapon)
  1864.       x = 0
  1865.       y += 1
  1866.       text = $data_system.words.atk+":"+equipment.atk.to_s
  1867.       self.contents.font.color = normal_color
  1868.       self.contents.font.size = size
  1869.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1870.     end
  1871.     #------------------------------------------------------------------------
  1872.     # ● 價格描繪
  1873.     #------------------------------------------------------------------------
  1874.     x = 0
  1875.     y += 1
  1876.     text = phrase["price"] + equipment.price.to_s
  1877.     self.contents.font.color = normal_color
  1878.     self.contents.font.size = size
  1879.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1880.     #------------------------------------------------------------------------
  1881.     # ● 物理防禦
  1882.     #------------------------------------------------------------------------
  1883.     unless equipment.pdef.zero?
  1884.       x = 0
  1885.       y += 1
  1886.       text = $data_system.words.pdef+":"+equipment.pdef.to_s
  1887.       self.contents.font.color = normal_color
  1888.       self.contents.font.size = size
  1889.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1890.     end
  1891.     #------------------------------------------------------------------------
  1892.     # ● 魔法防禦
  1893.     #------------------------------------------------------------------------
  1894.     unless equipment.mdef.zero?
  1895.       x = 0
  1896.       y += 1
  1897.       text=$data_system.words.mdef+":"+equipment.mdef.to_s
  1898.       self.contents.font.color = normal_color
  1899.       self.contents.font.size = size
  1900.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1901.     end
  1902.     #------------------------------------------------------------------------
  1903.     # ● 屬性
  1904.     #------------------------------------------------------------------------
  1905.     if element_set.size > 0
  1906.       x = 0
  1907.       y += 1
  1908.       text = phrase["elements"]
  1909.       for i in 0...element_set.size
  1910.         break if i > 4
  1911.         text += $data_system.elements[element_set[i]]
  1912.       end
  1913.       self.contents.font.color = normal_color
  1914.       self.contents.font.size = size
  1915.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1916.     end
  1917.     if element_set.size >= 5
  1918.       x = (phrase["elements"].size)*5-4
  1919.       y += 1
  1920.       text = ""
  1921.       for i in 4...element_set.size
  1922.         text += $data_system.elements[element_set[i]]
  1923.       end
  1924.       self.contents.font.color = normal_color
  1925.       self.contents.font.size = size
  1926.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1927.     end
  1928.     #------------------------------------------------------------------------
  1929.     # ● 描述分流 武器/防具
  1930.     #------------------------------------------------------------------------
  1931.     case equipment
  1932.     when RPG::Weapon
  1933.       #------------------------------------------------------------------------
  1934.       # ● 解除狀態(武器)
  1935.       #------------------------------------------------------------------------
  1936.       unless minus_state_set.empty?
  1937.         x = 0
  1938.         y += 1
  1939.         text=phrase["minus_states"]
  1940.         text=phrase["guard_states"]
  1941.         self.contents.font.color = normal_color
  1942.         self.contents.font.size = size
  1943.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1944.         for i in 0...minus_state_set.size
  1945.           y += 1
  1946.           text = $data_states[minus_state_set[i]].name        
  1947.           self.contents.font.color = normal_color
  1948.           self.contents.font.size = size
  1949.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  1950.         end
  1951.       end
  1952.       #------------------------------------------------------------------------
  1953.       # ● 附加狀態(武器)
  1954.       #------------------------------------------------------------------------
  1955.       unless plus_state_set.empty?
  1956.         x = 0
  1957.         y += 1
  1958.         text = phrase["plus_states"]
  1959.         self.contents.font.color = normal_color
  1960.         self.contents.font.size = size
  1961.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1962.         for i in 0...plus_state_set.size
  1963.           y += 1
  1964.           text=$data_states[plus_state_set[i]].name        
  1965.           self.contents.font.color = normal_color
  1966.           self.contents.font.size = size
  1967.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  1968.         end  
  1969.       end
  1970.     when RPG::Armor
  1971.       #------------------------------------------------------------------------
  1972.       # ● 防禦狀態(防具)
  1973.       #------------------------------------------------------------------------
  1974.       unless guard_state_set.empty?
  1975.         x = 0
  1976.         y += 1
  1977.         text=phrase["guard_states"]
  1978.         self.contents.font.color = normal_color
  1979.         self.contents.font.size = size
  1980.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1981.         for i in 0...guard_state_set.size
  1982.           y += 1
  1983.           text = $data_states[guard_state_set[i]].name        
  1984.           self.contents.font.color = normal_color
  1985.           self.contents.font.size = size
  1986.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  1987.         end
  1988.       end
  1989.       #------------------------------------------------------------------------
  1990.       # ● 自動狀態(防具)
  1991.       #------------------------------------------------------------------------
  1992.       unless auto_state_id.zero?
  1993.         x = 0
  1994.         y += 1
  1995.         text = phrase["auto_state"] + $data_states[auto_state_id].name
  1996.         self.contents.font.color = normal_color
  1997.         self.contents.font.size = size
  1998.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  1999.       end
  2000.     end
  2001.     #------------------------------------------------------------------------
  2002.     # ● 空行
  2003.     #------------------------------------------------------------------------
  2004.     y+=1
  2005.     #------------------------------------------------------------------------
  2006.     # ● 力量
  2007.     #------------------------------------------------------------------------
  2008.     unless equipment.str_plus.zero?
  2009.       x = 0
  2010.       y += 1
  2011.       h += 1
  2012.       if equipment.str_plus > 0
  2013.         text=$data_system.words.str+" +"+ equipment.str_plus.to_s
  2014.       else
  2015.         text=$data_system.words.str+" -"+ (-equipment.str_plus).to_s
  2016.       end
  2017.       self.contents.font.color = normal_color
  2018.       self.contents.font.size = size
  2019.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)  <br




  2020. ‘‘──eu国猪于2012-8-6 17:06补充以下内容:

  2021. #==============================================================================
  2022. # 禾西製作 / Created by Quarcy
  2023. #==============================================================================
  2024. class Window_Help < Window_Base
  2025.   attr_reader :materia
  2026.   #--------------------------------------------------------------------------
  2027.   # ● 定義不顯示的屬性與狀態
  2028.   #--------------------------------------------------------------------------
  2029.   def unshown
  2030.     @unshow_elements = [17, 18]
  2031.     @unshow_states = []
  2032.   end
  2033.   #--------------------------------------------------------------------------
  2034.   # ● 初始化對象
  2035.   #--------------------------------------------------------------------------
  2036.   def initialize
  2037.     super(0, 0, 640, 64)
  2038.     self.opacity = 150
  2039.     self.z=150
  2040.     self.visible = false
  2041.   end
  2042.   #--------------------------------------------------------------------------
  2043.   # ● 設置文本
  2044.   #     data  : 窗口顯示的字符串/物品資料
  2045.   #     align : 對齊方式 (0..左對齊、1..中間對齊、2..右對齊)
  2046.   #--------------------------------------------------------------------------
  2047.   def set_text(data, align=0)
  2048.     #------------------------------------------------------------------------
  2049.     # ● 當資料爲文字時候
  2050.     #------------------------------------------------------------------------
  2051.     # 如果文本或對齊方式至少一方与上次的不同
  2052.     if data != @text or align != @align
  2053.       if data.is_a?(String)
  2054.         # 再描繪文本
  2055.         self.width = 640
  2056.         self.height = 64
  2057.         self.x=0
  2058.         self.y=0
  2059.         self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  2060.         self.contents.clear
  2061.         self.contents.font.color = normal_color
  2062.         self.contents.font.size = 20
  2063.         self.contents.draw_text(4, 0, self.width - 40, 32, data, align)
  2064.         @text = data
  2065.         @align = align
  2066.         @actor = nil
  2067.         self.visible = true
  2068.       end
  2069.     end
  2070.     return if data.is_a?(String)
  2071.     #------------------------------------------------------------------------
  2072.     # ● 當沒有資料時候
  2073.     #------------------------------------------------------------------------
  2074.     if data.nil?
  2075.       self.visible=false
  2076.     else
  2077.       self.visible=true
  2078.     end
  2079.     #------------------------------------------------------------------------
  2080.     # ● 當資料爲物品/技能時候
  2081.     #------------------------------------------------------------------------
  2082.     if data != nil && @data != data
  2083.       self.width = 210
  2084.       self.height = 430
  2085.       self.x=0
  2086.       self.y=200
  2087.       unshown
  2088.       non_auto_update(data)
  2089.     else
  2090.       return
  2091.     end
  2092.   end
  2093.   #--------------------------------------------------------------------------
  2094.   # ● 更新帮助窗口
  2095.   #--------------------------------------------------------------------------
  2096.   def non_auto_update(data=@data)
  2097.     @data = data
  2098.     case @data
  2099.     when RPG::Item
  2100.       set_item_text(@data)
  2101.     when RPG::Weapon
  2102.       set_equipment_text(@data)
  2103.     when RPG::Armor
  2104.       set_equipment_text(@data)
  2105.     when RPG::Skill
  2106.       set_skill_text(@data)
  2107.     end
  2108.   end
  2109.   #--------------------------------------------------------------------------
  2110.   # ● 裝備帮助窗口
  2111.   #--------------------------------------------------------------------------
  2112.   def set_equipment_text(equipment)
  2113.     #------------------------------------------------------------------------
  2114.     # ● 取得基本質料
  2115.     #------------------------------------------------------------------------
  2116.     # 取得屬性、附加狀態、解除狀態之副本
  2117.     case equipment
  2118.     when RPG::Weapon
  2119.       element_set = equipment.element_set.clone
  2120.       plus_state_set = equipment.plus_state_set.clone
  2121.       minus_state_set = equipment.minus_state_set.clone
  2122.       #----------------------#
  2123.       # 過濾不顯示的狀態描述 #
  2124.       #----------------------#
  2125.       plus_state_set -= @unshow_states
  2126.       minus_state_set -= @unshow_states
  2127.     when RPG::Armor
  2128.       element_set = equipment.guard_element_set.clone
  2129.       guard_state_set = equipment.guard_state_set.clone
  2130.       #----------------------#
  2131.       # 過濾不顯示的狀態描述 #
  2132.       #----------------------#
  2133.       auto_state_id = equipment.auto_state_id
  2134.       guard_state_set -= @unshow_states
  2135.     end
  2136.     #----------------------#
  2137.     # 過濾不顯示的屬性描述 #
  2138.     #----------------------#
  2139.     element_set -= @unshow_elements
  2140.     #--------------#
  2141.     # 取得說明文字 #
  2142.     #--------------#
  2143.     description = equipment.description.clone
  2144.     # 初始化數據設定
  2145.     x = 0
  2146.     y = 0
  2147.     h = 0
  2148.     phrase = {}
  2149.    
  2150.     # 基本文字設定
  2151.     phrase["price"] = "价格:"
  2152.     phrase["elements"] = "属性:"
  2153.     phrase["minus_states"] = "解除状态:"
  2154.     phrase["plus_states"] = "附加状态:"
  2155.     phrase["guard_elements"] = "防御属性"
  2156.     phrase["guard_states"] = "防御状态"
  2157.     phrase["auto_state"] = "自动状态"

  2158.     # 基本數據設定
  2159. =begin
  2160.     name_size = 名字文字大小
  2161.     size = 描述文字大小
  2162.     word = 每行的描述文字數
  2163.     move = 全體描述偏移幅度
  2164. =end
  2165.     name_size = 18
  2166.     size = 14
  2167.     word = 12
  2168.     move = 80
  2169.     #------------------------------------------------------------------------
  2170.     # ● 確定背景圖片的高度
  2171.     #------------------------------------------------------------------------
  2172.     h += (description.size/3/word)
  2173.     h += 1 if (description.size/3%word) > 0
  2174.     h += 1 if equipment.is_a?(RPG::Weapon)
  2175.     now_h = h
  2176.     h += 1
  2177.     h += 1 unless equipment.pdef.zero?
  2178.     h += 1 unless equipment.mdef.zero?
  2179.     h += 1 if element_set.size > 0
  2180.     h += 1 if element_set.size >= 5
  2181.     case equipment
  2182.     when RPG::Weapon
  2183.       h += 1 unless minus_state_set.empty?
  2184.       h += minus_state_set.size
  2185.       h += 1 unless plus_state_set.empty?
  2186.       h += plus_state_set.size
  2187.     when RPG::Armor
  2188.       h += 1 unless guard_state_set.empty?
  2189.       h += guard_state_set.size
  2190.       h += 1 unless auto_state_id.zero?
  2191.     end
  2192.     h += 1
  2193.     h += 1 unless equipment.str_plus.zero?
  2194.     h += 1 unless equipment.dex_plus.zero?
  2195.     h += 1 unless equipment.agi_plus.zero?
  2196.     h += 1 unless equipment.int_plus.zero?
  2197.     h += materia_height_plus(equipment) unless self.materia.nil?
  2198.     #------------------------------------------------------------------------
  2199.     # ● 圖片顯示保證高度
  2200.     #------------------------------------------------------------------------
  2201.     h = 6 + now_h if (h - now_h) < 6
  2202.     #------------------------------------------------------------------------
  2203.     # ● 換算高度
  2204.     #------------------------------------------------------------------------
  2205.     self.height = h * size + name_size + 32
  2206.     #------------------------------------------------------------------------
  2207.     # ● 生成背景
  2208.     #------------------------------------------------------------------------
  2209.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  2210.     self.contents.clear
  2211.     #------------------------------------------------------------------------
  2212.     # ● 名字描繪
  2213.     #------------------------------------------------------------------------
  2214.     text = equipment.name
  2215.     self.contents.font.color = draw_name_color(equipment)
  2216.     self.contents.font.size = name_size
  2217.     if text.nil?
  2218.       self.visible = false
  2219.     else
  2220.       self.visible = true
  2221.       self.contents.draw_text(0, 0, text.size*7, name_size, text, 0)
  2222.     end
  2223.     #------------------------------------------------------------------------
  2224.     # ● 說明描繪
  2225.     #------------------------------------------------------------------------
  2226.     x = 0
  2227.     y += 1
  2228.     while ((text = description.slice!(/./m)) != nil)
  2229.       self.contents.font.color = normal_color
  2230.       self.contents.font.size = size
  2231.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  2232.       x+=1
  2233.       if x == word
  2234.         x=0
  2235.         y+=1   
  2236.       end
  2237.     end
  2238.     #------------------------------------------------------------------------
  2239.     # ● 圖標描繪
  2240.     #------------------------------------------------------------------------
  2241.     bitmap = RPG::Cache.icon(equipment.icon_name)
  2242.     opacity = self.contents.font.color == normal_color ? 255 : 128
  2243.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  2244.   
  2245.     #------------------------------------------------------------------------
  2246.     # ● 攻擊力描繪(武器)
  2247.     #------------------------------------------------------------------------
  2248.     if equipment.is_a?(RPG::Weapon)
  2249.       x = 0
  2250.       y += 1
  2251.       text = $data_system.words.atk+":"+equipment.atk.to_s
  2252.       self.contents.font.color = normal_color
  2253.       self.contents.font.size = size
  2254.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2255.     end
  2256.     #------------------------------------------------------------------------
  2257.     # ● 價格描繪
  2258.     #------------------------------------------------------------------------
  2259.     x = 0
  2260.     y += 1
  2261.     text = phrase["price"] + equipment.price.to_s
  2262.     self.contents.font.color = normal_color
  2263.     self.contents.font.size = size
  2264.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2265.     #------------------------------------------------------------------------
  2266.     # ● 物理防禦
  2267.     #------------------------------------------------------------------------
  2268.     unless equipment.pdef.zero?
  2269.       x = 0
  2270.       y += 1
  2271.       text = $data_system.words.pdef+":"+equipment.pdef.to_s
  2272.       self.contents.font.color = normal_color
  2273.       self.contents.font.size = size
  2274.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2275.     end
  2276.     #------------------------------------------------------------------------
  2277.     # ● 魔法防禦
  2278.     #------------------------------------------------------------------------
  2279.     unless equipment.mdef.zero?
  2280.       x = 0
  2281.       y += 1
  2282.       text=$data_system.words.mdef+":"+equipment.mdef.to_s
  2283.       self.contents.font.color = normal_color
  2284.       self.contents.font.size = size
  2285.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2286.     end
  2287.     #------------------------------------------------------------------------
  2288.     # ● 屬性
  2289.     #------------------------------------------------------------------------
  2290.     if element_set.size > 0
  2291.       x = 0
  2292.       y += 1
  2293.       text = phrase["elements"]
  2294.       for i in 0...element_set.size
  2295.         break if i > 4
  2296.         text += $data_system.elements[element_set[i]]
  2297.       end
  2298.       self.contents.font.color = normal_color
  2299.       self.contents.font.size = size
  2300.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2301.     end
  2302.     if element_set.size >= 5
  2303.       x = (phrase["elements"].size)*5-4
  2304.       y += 1
  2305.       text = ""
  2306.       for i in 4...element_set.size
  2307.         text += $data_system.elements[element_set[i]]
  2308.       end
  2309.       self.contents.font.color = normal_color
  2310.       self.contents.font.size = size
  2311.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2312.     end
  2313.     #------------------------------------------------------------------------
  2314.     # ● 描述分流 武器/防具
  2315.     #------------------------------------------------------------------------
  2316.     case equipment
  2317.     when RPG::Weapon
  2318.       #------------------------------------------------------------------------
  2319.       # ● 解除狀態(武器)
  2320.       #------------------------------------------------------------------------
  2321.       unless minus_state_set.empty?
  2322.         x = 0
  2323.         y += 1
  2324.         text=phrase["minus_states"]
  2325.         text=phrase["guard_states"]
  2326.         self.contents.font.color = normal_color
  2327.         self.contents.font.size = size
  2328.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2329.         for i in 0...minus_state_set.size
  2330.           y += 1
  2331.           text = $data_states[minus_state_set[i]].name        
  2332.           self.contents.font.color = normal_color
  2333.           self.contents.font.size = size
  2334.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  2335.         end
  2336.       end
  2337.       #------------------------------------------------------------------------
  2338.       # ● 附加狀態(武器)
  2339.       #------------------------------------------------------------------------
  2340.       unless plus_state_set.empty?
  2341.         x = 0
  2342.         y += 1
  2343.         text = phrase["plus_states"]
  2344.         self.contents.font.color = normal_color
  2345.         self.contents.font.size = size
  2346.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2347.         for i in 0...plus_state_set.size
  2348.           y += 1
  2349.           text=$data_states[plus_state_set[i]].name        
  2350.           self.contents.font.color = normal_color
  2351.           self.contents.font.size = size
  2352.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  2353.         end  
  2354.       end
  2355.     when RPG::Armor
  2356.       #------------------------------------------------------------------------
  2357.       # ● 防禦狀態(防具)
  2358.       #------------------------------------------------------------------------
  2359.       unless guard_state_set.empty?
  2360.         x = 0
  2361.         y += 1
  2362.         text=phrase["guard_states"]
  2363.         self.contents.font.color = normal_color
  2364.         self.contents.font.size = size
  2365.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2366.         for i in 0...guard_state_set.size
  2367.           y += 1
  2368.           text = $data_states[guard_state_set[i]].name        
  2369.           self.contents.font.color = normal_color
  2370.           self.contents.font.size = size
  2371.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  2372.         end
  2373.       end
  2374.       #------------------------------------------------------------------------
  2375.       # ● 自動狀態(防具)
  2376.       #------------------------------------------------------------------------
  2377.       unless auto_state_id.zero?
  2378.         x = 0
  2379.         y += 1
  2380.         text = phrase["auto_state"] + $data_states[auto_state_id].name
  2381.         self.contents.font.color = normal_color
  2382.         self.contents.font.size = size
  2383.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2384.       end
  2385.     end
  2386.     #------------------------------------------------------------------------
  2387.     # ● 空行
  2388.     #------------------------------------------------------------------------
  2389.     y+=1
  2390.     #------------------------------------------------------------------------
  2391.     # ● 力量
  2392.     #------------------------------------------------------------------------
  2393.     unless equipment.str_plus.zero?
  2394.       x = 0
  2395.       y += 1
  2396.       h += 1
  2397.       if equipment.str_plus > 0
  2398.         text=$data_system.words.str+" +"+ equipment.str_plus.to_s
  2399.       else
  2400.         text=$data_system.words.str+" -"+ (-equipment.str_plus).to_s
  2401.       end
  2402.       self.contents.font.color = normal_color
  2403.       self.contents.font.size = size
  2404.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)  
  2405.     end
  2406.     #------------------------------------------------------------------------
  2407.     # ● 靈巧
  2408.     #------------------------------------------------------------------------
  2409.     unless equipment.dex_plus.zero?
  2410.       x = 0
  2411.       y += 1
  2412.       h += 1
  2413.       if equipment.dex_plus > 0
  2414.         text=$data_system.words.dex+" +"+ equipment.dex_plus.to_s
  2415.       else
  2416.         text=$data_system.words.dex+" -"+ (-equipment.dex_plus).to_s
  2417.       end
  2418.       self.contents.font.color = normal_color
  2419.       self.contents.font.size = size
  2420.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2421.     end
  2422.     #------------------------------------------------------------------------
  2423.     # ● 速度
  2424.     #------------------------------------------------------------------------
  2425.     unless equipment.agi_plus.zero?
  2426.       x = 0
  2427.       y += 1
  2428.       h += 1
  2429.       if equipment.agi_plus > 0
  2430.         text=$data_system.words.agi+" +"+ equipment.agi_plus.to_s
  2431.       else
  2432.         text=$data_system.words.agi+" -"+ (-equipment.agi_plus).to_s
  2433.       end
  2434.       self.contents.font.color = normal_color
  2435.       self.contents.font.size = size
  2436.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2437.     end
  2438.     #------------------------------------------------------------------------
  2439.     # ● 智力
  2440.     #------------------------------------------------------------------------
  2441.     unless equipment.int_plus.zero?
  2442.       x = 0
  2443.       y += 1
  2444.       h += 1
  2445.       if equipment.int_plus > 0
  2446.         text=$data_system.words.int+" +"+ equipment.int_plus.to_s
  2447.       else
  2448.         text=$data_system.words.int+" -"+ (-equipment.int_plus).to_s
  2449.       end
  2450.       self.contents.font.color = normal_color
  2451.       self.contents.font.size = size
  2452.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2453.     end
  2454.     #------------------------------------------------------------------------
  2455.     # ● 魔力石描繪
  2456.     #------------------------------------------------------------------------
  2457.     y += draw_materia(equipment, move, y, size) unless self.materia.nil?
  2458.   end
  2459.   #--------------------------------------------------------------------------
  2460.   # ● 物品幫助窗口
  2461.   #--------------------------------------------------------------------------
  2462.   def set_item_text(item)
  2463.     # 取得描述
  2464.     description = item.description.clone
  2465.     # 取得屬性、附加狀態、解除狀態之副本
  2466.     element_set = item.element_set.clone
  2467.     plus_state_set = item.plus_state_set.clone
  2468.     minus_state_set = item.minus_state_set.clone
  2469.     # 過濾不顯示的描述
  2470.     element_set -= @unshow_elements
  2471.     plus_state_set -= @unshow_states
  2472.     minus_state_set -= @unshow_states
  2473.     # 初始化數據設定
  2474.     x = 0
  2475.     y = 0
  2476.     h = 0
  2477.     phrase = {}
  2478.     scope ={}
  2479.     parameter_type = {}
  2480.    
  2481.     # 基本數據設定
  2482. =begin
  2483.     name_size = 名字文字大小
  2484.     size = 描述文字大小
  2485.     word = 每行的描述文字數
  2486.     move = 全體描述偏移幅度
  2487. =end
  2488.     name_size = 18
  2489.     size = 14
  2490.     word = 12
  2491.     move = 80
  2492.    
  2493.     # 基本文字設定
  2494.     phrase["scope"] = "范围:"
  2495.     phrase["price"] = "价格:"
  2496.     phrase["recover_hp_rate"] = "HP 回复率:"
  2497.     phrase["recover_hp"] = "HP 回复量:"
  2498.     phrase["recover_sp_rate"] = "SP 回复率:"
  2499.     phrase["recover_sp"] = "SP 回复量:"
  2500.     phrase["elements"] = "属性:"
  2501.     phrase["plus"] = "附加"
  2502.     phrase["minus"] = "解除"
  2503.     phrase["states"] = "状态"
  2504.     scope[0] = "特殊物品"
  2505.     scope[1] = "特殊物品"
  2506.     scope[2] = "敌单体"
  2507.     scope[3] = "敌全体"
  2508.     scope[4] = "己方单体"
  2509.     scope[5] = "己方全体"
  2510.     scope[6] = "己方昏死单体"
  2511.     scope[7] = "己方昏死全体"
  2512.     scope[8] = "使用者"

  2513.     parameter_type[1] = "MaxHP"
  2514.     parameter_type[2] = "MaxSP"
  2515.     parameter_type[3] = $data_system.words.str
  2516.     parameter_type[4] = $data_system.words.dex
  2517.     parameter_type[5] = $data_system.words.agi
  2518.     parameter_type[6] = $data_system.words.int
  2519.    
  2520.     #依顯示内容確定自身高
  2521.     h = (description.size/3/word)
  2522.     h +=1 if (description.size/3%word)> 0
  2523.     now_h = h
  2524.     h +=3  # 空行,效果範圍,價格
  2525.     h += 1 unless item.recover_hp_rate.zero?
  2526.     h += 1 unless item.recover_hp.zero?
  2527.     h += 1 unless item.recover_sp_rate.zero?
  2528.     h += 1 unless item.recover_sp.zero?
  2529.     h += 1 unless item.parameter_type.zero?
  2530.     h += 1 unless element_set[0].nil?
  2531.     h += 1 unless element_set[4].nil?
  2532.     h += (1+plus_state_set.size) unless plus_state_set.empty?
  2533.     h += (1+minus_state_set.size) unless minus_state_set.empty?
  2534.     #------------------------------------------------------------------------
  2535.     # ● 圖片顯示保證高度
  2536.     #------------------------------------------------------------------------
  2537.     h = 6 + now_h if (h - now_h) < 6
  2538.     #------------------------------------------------------------------------
  2539.     # ● 換算高度
  2540.     #------------------------------------------------------------------------
  2541.     self.height = h * size + name_size + 32
  2542.     #------------------------------------------------------------------------
  2543.     # ● 生成背景
  2544.     #------------------------------------------------------------------------
  2545.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  2546.     self.contents.clear
  2547.     #------------------------------------------------------------------------
  2548.     # ● 名字描繪
  2549.     #------------------------------------------------------------------------
  2550.     text = item.name
  2551.     self.contents.font.color = normal_color#顔色腳本
  2552.     self.contents.font.size = name_size
  2553.     if text.nil?
  2554.       self.visible = false
  2555.     else
  2556.       self.visible = true
  2557.       self.contents.draw_text(0,0, text.size*7, 20, text, 0)
  2558.     end
  2559.     #------------------------------------------------------------------------
  2560.     # ● 說明描繪
  2561.     #------------------------------------------------------------------------
  2562.     x = 0
  2563.     y += 1
  2564.     while ((text = description.slice!(/./m)) != nil)
  2565.       self.contents.font.color = normal_color
  2566.       self.contents.font.size = size
  2567.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  2568.       x+=1
  2569.       if x == word
  2570.         x = 0
  2571.         y += 1
  2572.       end
  2573.     end
  2574.     #------------------------------------------------------------------------
  2575.     # ● 圖標描繪
  2576.     #------------------------------------------------------------------------
  2577.     bitmap = RPG::Cache.icon(item.icon_name) unless item.icon_name.nil?
  2578.     opacity = self.contents.font.color == normal_color ? 255 : 128
  2579.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  2580.     #------------------------------------------------------------------------
  2581.     # ● 魔力石接口
  2582.     #------------------------------------------------------------------------
  2583.     unless self.materia.nil?
  2584.       return if is_materia?(item)
  2585.     end
  2586.     #------------------------------------------------------------------------
  2587.     # ● 效果範圍
  2588.     #------------------------------------------------------------------------
  2589.     text= phrase["scope"] + scope[item.scope]
  2590.     x = 0
  2591.     y += 1
  2592.     self.contents.font.color = normal_color
  2593.     self.contents.font.size = size
  2594.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2595.     #------------------------------------------------------------------------
  2596.     # ● 價格
  2597.     #------------------------------------------------------------------------
  2598.     x = 0
  2599.     y += 1      
  2600.     text = phrase["price"] + item.price.to_s
  2601.     self.contents.font.color = normal_color
  2602.     self.contents.font.size = size
  2603.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2604.    
  2605.     #------------------------------------------------------------------------
  2606.     # ● HP回復率
  2607.     #------------------------------------------------------------------------
  2608.     unless item.recover_hp_rate.zero?  
  2609.       x = 0
  2610.       y += 1
  2611.       text = phrase["recover_hp_rate"] + item.recover_hp_rate.to_s+"%"
  2612.       self.contents.font.color = normal_color
  2613.       self.contents.font.size = size
  2614.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  2615.     end
  2616.     #------------------------------------------------------------------------
  2617.     # ● HP回復量
  2618.     #------------------------------------------------------------------------
  2619.     unless item.recover_hp.zero?  
  2620.       x = 0
  2621.       y += 1      
  2622.       text = phrase["recover_hp"] + item.recover_hp.to_s
  2623.       self.contents.font.color = normal_color
  2624.       self.contents.font.size = size
  2625.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2626.     end
  2627.     #------------------------------------------------------------------------
  2628.     # ● SP回復率
  2629.     #------------------------------------------------------------------------
  2630.     unless item.recover_sp_rate.zero?
  2631.       x = 0
  2632.       y += 1      
  2633.       text = phrase["recover_sp_rate"] + item.recover_sp_rate.to_s+"%"
  2634.       self.contents.font.color = normal_color
  2635.       self.contents.font.size = size
  2636.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2637.     end
  2638.     #------------------------------------------------------------------------
  2639.     # ● SP回復量
  2640.     #------------------------------------------------------------------------
  2641.     unless item.recover_sp.zero?  
  2642.       x = 0
  2643.       y += 1      
  2644.       text = phrase["elements"] + item.recover_sp.to_s
  2645.       self.contents.font.color = normal_color
  2646.       self.contents.font.size = size
  2647.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2648.     end
  2649.     #------------------------------------------------------------------------
  2650.     # ● 能力值增加
  2651.     #------------------------------------------------------------------------
  2652.     unless item.parameter_type.zero?
  2653.       x = 0
  2654.       y += 1      
  2655.       text= parameter_type[item.parameter_type]+" +"+item.parameter_points.to_s

  2656.       self.contents.font.color = normal_color
  2657.       self.contents.font.size = size
  2658.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2659.     end
  2660.     #------------------------------------------------------------------------
  2661.     # ● 屬性
  2662.     #------------------------------------------------------------------------
  2663.     if element_set.size > 0
  2664.       x = 0
  2665.       y += 1
  2666.       text = phrase["elements"]
  2667.       for i in 0...element_set.size
  2668.         break if i > 4
  2669.         text += $data_system.elements[element_set[i]]
  2670.       end
  2671.       self.contents.font.color = normal_color
  2672.       self.contents.font.size = size
  2673.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2674.     end
  2675.     if element_set.size >= 5
  2676.       x = (phrase["elements"].size)*5-4
  2677.       y += 1
  2678.       text = ""
  2679.       for i in 4...element_set.size
  2680.         text += $data_system.elements[element_set[i]]
  2681.       end
  2682.       self.contents.font.color = normal_color
  2683.       self.contents.font.size = size
  2684.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2685.     end
  2686.     #------------------------------------------------------------------------
  2687.     # ● 狀態添加
  2688.     #------------------------------------------------------------------------
  2689.     unless plus_state_set.empty?
  2690.       text = phrase["plus"]
  2691.       x = 0
  2692.       y += 1
  2693.       self.contents.font.color = normal_color
  2694.       self.contents.font.size = size
  2695.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2696.       plus_state_set.each do |plus_state|
  2697.         y += 1
  2698.         text = $data_states[plus_state].name        
  2699.         self.contents.font.color = normal_color
  2700.         self.contents.font.size = size
  2701.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)      
  2702.       end  
  2703.     end
  2704.     #------------------------------------------------------------------------
  2705.     # ● 狀態解除
  2706.     #------------------------------------------------------------------------
  2707.     unless minus_state_set.empty?
  2708.       text = phrase["minus"]
  2709.       x = 0
  2710.       y += 1
  2711.       self.contents.font.color = normal_color
  2712.       self.contents.font.size = size
  2713.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  2714.       minus_state_set.each do |minus_state|
  2715.         y += 1
  2716.         text = $data_states[minus_state].name
  2717.         self.contents.font.color = normal_color
  2718.         self.contents.font.size = size
  2719.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)   
  2720.       end
  2721.     end
  2722.   end
  2723.   #--------------------------------------------------------------------------
  2724.   # ● 技能帮助窗口
  2725.   #--------------------------------------------------------------------------
  2726.   def set_skill_text(skill)
  2727.     # 取得描述
  2728.     description = skill.description.clone
  2729.     # 取得屬性、附加狀態、解除狀態之副本
  2730.     element_set = skill.element_set.clone
  2731.     plus_state_set = skill.plus_state_set.clone
  2732.     minus_state_set = skill.minus_state_set.clone
  2733.     # 過濾不顯示的描述
  2734.     element_set -= @unshow_elements
  2735.     plus_state_set -= @unshow_states
  2736.     minus_state_set -= @unshow_states
  2737.     # 初始化設定
  2738.     x = 0
  2739.     y = 0
  2740.     h = 0
  2741.     phrase = {}
  2742.     scope = {}
  2743.    
  2744.     # 基本數據設定
  2745. =begin
  2746.     name_size = 名字文字大小
  2747.     size = 描述文字大小
  2748.     word = 每行的描述文字數
  2749.     move = 全體描述偏移幅度
  2750. =end
  2751.     name_size = 18
  2752.     size = 14
  2753.     word = 12
  2754.     move = 80
  2755.    
  2756.     # 基本文字設定
  2757.     phrase["scope"] = "范围:"
  2758.     #
  2759.     phrase["power"] = "威力:"
  2760.     phrase["cost_sp"] = "消耗SP:"
  2761.     phrase["hit_rate"] = "命中率:"
  2762.     phrase["elements"] = "攻击属性"
  2763.     #
  2764.     phrase["plus"] = "附加"
  2765.     phrase["minus"] = "解除"
  2766.     phrase["states"] = "状态"
  2767.     scope[0] = "特殊技能"
  2768.     scope[1] = "敌单体"
  2769.     scope[2] = "敌全体"
  2770.     scope[3] = "我方单体"
  2771.     scope[4] = "我方全体"
  2772.     scope[5] = "我方昏死(单体)"
  2773.     scope[6] = "我方昏死(全体)"
  2774.     scope[7] = "自身"

  2775.    
  2776.     #由描叙确定高
  2777.     h =description.size/3/word
  2778.     h += 1 if (description.size%3/word) > 0
  2779.     h += 4  #空行,效果范围,消费SP,命中率
  2780.     h += 1 unless skill.power.zero?
  2781.     h += 1 unless element_set.empty?
  2782.     h += 1 unless element_set[4].nil?
  2783.     h += plus_state_set.size
  2784.     h += minus_state_set.size
  2785.     #------------------------------------------------------------------------
  2786.     # ● 換算高度
  2787.     #------------------------------------------------------------------------
  2788.     self.height=h * size + name_size + 32  
  2789.     self.contents = Bitmap.new(self.width - 32,self.height - 32)
  2790.     self.contents.clear
  2791.    
  2792.     #------------------------------------------------------------------------
  2793.     # ● 名字描述
  2794.     #------------------------------------------------------------------------
  2795.     text = skill.name
  2796.     self.contents.font.color = Color.new(255, 255, 128, 255)
  2797.     self.contents.font.size = name_size
  2798.     if text!=nil
  2799.       self.visible = true
  2800.       self.contents.draw_text(0,0, text.size*7, name_size, text, 0)
  2801.     else
  2802.       self.visible = false
  2803.     end
  2804.    
  2805.     #------------------------------------------------------------------------
  2806.     # ● 說明描述
  2807.     #------------------------------------------------------------------------
  2808.     x = 0
  2809.     y += 1
  2810.     text = description
  2811.     while ((text = description.slice!(/./m)) != nil)
  2812.       self.contents.font.color = normal_color
  2813.       self.contents.font.size = size
  2814.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  2815.       x+=1
  2816.       if x==word#每行10个字
  2817.         x = 0
  2818.         y += 1      
  2819.       end
  2820.     end
  2821.    
  2822.     #------------------------------------------------------------------------
  2823.     # ● 攻擊範圍
  2824.     #------------------------------------------------------------------------
  2825.     text = phrase["scope"] + scope[skill.scope]
  2826.     x = 0
  2827.     y += 1
  2828.     self.contents.font.color = normal_color
  2829.     self.contents.font.size = size
  2830.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2831.     #------------------------------------------------------------------------
  2832.     # ● 空一行
  2833.     #------------------------------------------------------------------------
  2834.     y += 1
  2835.     #------------------------------------------------------------------------
  2836.     # ● 威力描述
  2837.     #------------------------------------------------------------------------
  2838.     unless skill.power.zero?
  2839.       power = skill.power > 0 ? skill.power : -1 * skill.power
  2840.       text = phrase["power"] + power.to_s
  2841.       x = 0
  2842.       y += 1
  2843.       self.contents.font.color = normal_color
  2844.       self.contents.font.size = size  
  2845.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2846.     end  
  2847.     #------------------------------------------------------------------------
  2848.     # ● 消費SP描述
  2849.     #------------------------------------------------------------------------
  2850.     text = phrase["cost_sp"] + skill.sp_cost.to_s
  2851.     x = 0
  2852.     y += 1
  2853.     self.contents.font.color = normal_color
  2854.     self.contents.font.size = size   
  2855.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2856.     #------------------------------------------------------------------------
  2857.     # ● 命中率描述
  2858.     #------------------------------------------------------------------------
  2859.     text = phrase["hit_rate"] + skill.hit.to_s + "%"
  2860.     x = 0
  2861.     y += 1
  2862.     self.contents.font.color = normal_color
  2863.     self.contents.font.size = size
  2864.     self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2865.     #------------------------------------------------------------------------
  2866.     # ● 攻擊屬性
  2867.     #------------------------------------------------------------------------
  2868.     if element_set.size > 0
  2869.       text=phrase["elements"]
  2870.       for i in 0...element_set.size
  2871.         if i < 4
  2872.           text+=$data_system.elements[element_set[i]]
  2873.         else
  2874.           break
  2875.         end        
  2876.       end
  2877.       x = 0
  2878.       y += 1
  2879.       self.contents.font.color = normal_color
  2880.       self.contents.font.size = size
  2881.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2882.     end
  2883.     if element_set.size >= 5
  2884.       text=""
  2885.       for i in 4...element_set.size
  2886.         text+=$data_system.elements[element_set[i]]
  2887.       end
  2888.       x= (phrase["elements"].size)*3
  2889.       y += 1
  2890.       self.contents.font.color = normal_color
  2891.       self.contents.font.size = size
  2892.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2893.     end
  2894.     #------------------------------------------------------------------------
  2895.     # ● 狀態附加
  2896.     #------------------------------------------------------------------------
  2897.     unless plus_state_set.empty?
  2898.       text= phrase["plus"]
  2899.       x = 0
  2900.       y += 1
  2901.       self.contents.font.color = normal_color
  2902.       self.contents.font.size = size
  2903.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2904.       plus_state_set.each do |plus_state|
  2905.         y += 1
  2906.         text=$data_states[plus_state].name        
  2907.         self.contents.font.color = normal_color
  2908.         self.contents.font.size = size
  2909.         self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)        
  2910.       end  
  2911.     end
  2912.     #------------------------------------------------------------------------
  2913.     # ●狀態解除
  2914.     #------------------------------------------------------------------------
  2915.     unless minus_state_set.empty?
  2916.       text = phrase["minus"]
  2917.       x = 0
  2918.       y += 1
  2919.       self.contents.font.color = normal_color
  2920.       self.contents.font.size=size
  2921.       self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)
  2922.       minus_state_set.each do |minus_state|
  2923.         y += 1
  2924.         text=$data_states[minus_state].name        
  2925.         self.contents.font.color = normal_color
  2926.         self.contents.font.size=size
  2927.         self.contents.draw_text(x, y*size+5, text.size*6, size, text, 0)        
  2928.       end  
  2929.     end     
  2930.   end
  2931.   #--------------------------------------------------------------------------
  2932.   # ● 设置角色
  2933.   #     actor : 要显示状态的角色
  2934.   #--------------------------------------------------------------------------
  2935.   def set_actor(actor)
  2936.     if actor != @actor
  2937.       self.contents.clear
  2938.       draw_actor_name(actor, 4, 0)
  2939.       draw_actor_state(actor, 140, 0)
  2940.       draw_actor_hp(actor, 284, 0)
  2941.       draw_actor_sp(actor, 460, 0)
  2942.       @actor = actor
  2943.       @text = nil
  2944.       self.visible = true
  2945.     end
  2946.   end
  2947.   #--------------------------------------------------------------------------
  2948.   # ● 設置角色
  2949.   #     actor : 要顯示狀態之角色
  2950.   #--------------------------------------------------------------------------
  2951.   def set_actor(actor)
  2952.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  2953.     if actor != @actor
  2954.       self.contents.clear
  2955.       draw_actor_name(actor, 4, 0)
  2956.       draw_actor_state(actor, 140, 0)
  2957.       draw_actor_hp(actor, 284, 0)
  2958.       draw_actor_sp(actor, 460, 0)
  2959.       @actor = actor
  2960.       @text = nil
  2961.       self.visible = true
  2962.     end
  2963.   end
  2964.   #--------------------------------------------------------------------------
  2965.   # ● 設置敵人
  2966.   #     enemy : 要顯示名字與狀態之敵人
  2967.   #--------------------------------------------------------------------------
  2968.   def set_enemy(enemy)
  2969.     self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  2970.     text = enemy.name.sub(/\[Ff][([0-9]+)]/) {""}
  2971.     state_text = make_battler_state_text(enemy, 112, false)
  2972.     if state_text != ""
  2973.       text += "  " + state_text
  2974.     end
  2975.     set_text(text, 1)
  2976.     self.visible = true
  2977.   end
  2978.   #--------------------------------------------------------------------------
  2979.   # ● 校正帮助窗口位置
  2980.   #--------------------------------------------------------------------------
  2981.   def set_pos(x,y,width,oy,index,column_max)
  2982.     #光标坐标
  2983.     cursor_width = width / column_max - 32
  2984.     xx = index % column_max * (cursor_width + 32)
  2985.     yy = index / column_max * 32 - oy
  2986.     self.x=xx+x+150
  2987.     self.y=yy+y+30
  2988.     if self.x+self.width>640
  2989.       self.x=640-self.width
  2990.     end
  2991.     if self.y+self.height>480
  2992.       self.y=480-self.height
  2993.     end  
  2994.   end
  2995.   #------------------------------------------------------------------------
  2996.   # ● 裝備名字顔色變化 接口
  2997.   #------------------------------------------------------------------------
  2998.   def draw_name_color(equipment)
  2999.     return normal_color
  3000.   end
  3001.   #------------------------------------------------------------------------
  3002.   # ● 自身身份確認
  3003.   #------------------------------------------------------------------------
  3004.   def original_help?
  3005.     return false
  3006.   end
  3007. end

  3008. #------------------------------------------------------------------------------



  3009. #------------------------------------------------------------------------------
  3010. #==============================================================================
  3011. # ■ Window_Item
  3012. #------------------------------------------------------------------------------
  3013. #  物品画面、战斗画面、显示浏览物品的窗口。
  3014. #==============================================================================

  3015. class Window_Item < Window_Selectable
  3016.   #--------------------------------------------------------------------------
  3017.   # ● 初始化对像
  3018.   #--------------------------------------------------------------------------
  3019.   def initialize
  3020.     super(0, 64-64, 640, 416+64)
  3021.     @column_max = 2
  3022.     refresh
  3023.     self.index = 0
  3024.     # 战斗中的情况下将窗口移至中央并将其半透明化
  3025.     if $game_temp.in_battle
  3026.       self.y = 64
  3027.       self.height = 256
  3028.       self.back_opacity = 160
  3029.     end
  3030.   end
  3031.   #--------------------------------------------------------------------------
  3032.   # ● 刷新帮助文本
  3033.   #--------------------------------------------------------------------------
  3034.   def update_help
  3035.     @help_window.set_text(item)
  3036.     #校正帮助窗口位置
  3037.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  3038.   end
  3039. end
  3040. #------------------------------------------------------------------------------



  3041. #------------------------------------------------------------------------------
  3042. #==============================================================================
  3043. # ■ Window_Skill
  3044. #------------------------------------------------------------------------------
  3045. #  特技画面、战斗画面、显示可以使用的特技浏览的窗口。
  3046. #==============================================================================

  3047. class Window_Skill < Window_Selectable
  3048.   #--------------------------------------------------------------------------
  3049.   # ● 初始化对像
  3050.   #     actor : 角色
  3051.   #--------------------------------------------------------------------------
  3052.   def initialize(actor)
  3053.     super(0, 128, 640, 352)
  3054.     @actor = actor
  3055.     @column_max = 2
  3056.    
  3057.     refresh
  3058.     self.index = 0
  3059.     # 战斗中的情况下将窗口移至中央并将其半透明化
  3060.     if $game_temp.in_battle
  3061.       self.y = 64
  3062.       self.height = 256
  3063.       self.back_opacity = 160
  3064.     end
  3065.   end
  3066.   #--------------------------------------------------------------------------
  3067.   # ● 刷新帮助文本
  3068.   #--------------------------------------------------------------------------

  3069.   def update_help
  3070.     @help_window.set_text(skill)
  3071.     #校正帮助窗口位置
  3072.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  3073.   end
  3074. end
  3075. #------------------------------------------------------------------------------



  3076. #------------------------------------------------------------------------------
  3077. #==============================================================================
  3078. # ■ Window_SkillStatus
  3079. #------------------------------------------------------------------------------
  3080. #  显示特技画面、特技使用者的窗口。
  3081. #==============================================================================

  3082. class Window_SkillStatus < Window_Base
  3083.   #--------------------------------------------------------------------------
  3084.   # ● 初始化对像
  3085.   #     actor : 角色
  3086.   #--------------------------------------------------------------------------
  3087.   def initialize(actor)
  3088. # -------------------
  3089. # 修改開始
  3090.     super(0, 64-64, 640, 64+64)#★★★★★★★★★★★★★★★★★★★★
  3091. # 修改終了
  3092. # -------------------
  3093.     self.contents = Bitmap.new(width - 32, height - 32)
  3094.     @actor = actor
  3095.     refresh
  3096.   end
  3097. end
  3098. #------------------------------------------------------------------------------



  3099. #------------------------------------------------------------------------------
  3100. #==============================================================================
  3101. # ■ Window_EquipLeft
  3102. #------------------------------------------------------------------------------
  3103. #  装备画面的、显示角色能力值变化的窗口。
  3104. #==============================================================================
  3105. class Window_EquipLeft < Window_Base
  3106.   #--------------------------------------------------------------------------
  3107.   # ● 初始化对像
  3108.   #     actor : 角色
  3109.   #--------------------------------------------------------------------------
  3110.   def initialize(actor)
  3111. # -------------------
  3112. # 修改開始
  3113.     super(0, 64-64, 272, 416+64)#★★★★★★★★★★★★★★★★★★★★
  3114. # 修改終了
  3115. # -------------------
  3116.     self.contents = Bitmap.new(width - 32, height - 32)
  3117.     @actor = actor
  3118.     refresh
  3119.   end
  3120. end
  3121. #------------------------------------------------------------------------------



  3122. #------------------------------------------------------------------------------
  3123. #==============================================================================
  3124. # ■ Window_EquipRight
  3125. #------------------------------------------------------------------------------
  3126. #  装备画面、显示角色现在装备的物品的窗口。
  3127. #==============================================================================

  3128. class Window_EquipRight < Window_Selectable
  3129.   #--------------------------------------------------------------------------
  3130.   # ● 初始化对像
  3131.   #     actor : 角色
  3132.   #--------------------------------------------------------------------------
  3133.   def initialize(actor)
  3134. # -------------------
  3135. # 修改開始
  3136.     super(272, 64-64, 368, 256+64)#★★★★★★★★★★★★★★★★★★★★
  3137. # 修改終了
  3138. # -------------------
  3139.     self.contents = Bitmap.new(width - 32, height - 32)
  3140.     @actor = actor
  3141.     refresh
  3142.     self.index = 0
  3143.   end
  3144.   #--------------------------------------------------------------------------
  3145.   # ● 刷新帮助文本
  3146.   #--------------------------------------------------------------------------

  3147.   def update_help
  3148.     @help_window.set_text(item)
  3149.     #校正帮助窗口位置
  3150.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  3151.   end
  3152. end
  3153. #------------------------------------------------------------------------------



  3154. #------------------------------------------------------------------------------
  3155. #==============================================================================
  3156. # ■ Window_EquipItem
  3157. #------------------------------------------------------------------------------
  3158. #  装备画面、显示浏览变更装备的候补物品的窗口。
  3159. #==============================================================================

  3160. class Window_EquipItem < Window_Selectable
  3161.   #--------------------------------------------------------------------------
  3162.   # ● 初始化对像
  3163.   #     actor      : 角色
  3164.   #     equip_type : 装备部位 (0~3)
  3165.   #--------------------------------------------------------------------------
  3166.   def initialize(actor, equip_type)
  3167. # -------------------
  3168. # 修改開始
  3169.     super(272, 320, 368, 160)#★★★★★★★★★★★★★★★★★★★★
  3170. # 修改終了
  3171. # -------------------
  3172.     @actor = actor
  3173.     @equip_type = equip_type
  3174.     @column_max = 1
  3175.    
  3176.     refresh
  3177.     self.active = false
  3178.     self.index = -1
  3179.   end
  3180.   def update_help
  3181.     @help_window.set_text(item)
  3182.     #校正帮助窗口位置
  3183.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  3184.   end
  3185. end
  3186. #------------------------------------------------------------------------------



  3187. #------------------------------------------------------------------------------
  3188. #==============================================================================
  3189. # ■ Window_ShopCommand
  3190. #------------------------------------------------------------------------------
  3191. #  商店画面、选择要做的事的窗口
  3192. #==============================================================================

  3193. class Window_ShopCommand < Window_Selectable
  3194.   #--------------------------------------------------------------------------
  3195.   # ● 初始化对像
  3196.   #--------------------------------------------------------------------------
  3197.   def initialize
  3198. # -------------------
  3199. # 修改開始
  3200.     super(0, 64-64, 480, 64)#★★★★★★★★★★★★★★★★★
  3201. # 修改終了
  3202. # -------------------
  3203.     self.contents = Bitmap.new(width - 32, height - 32)
  3204.     @item_max = 3
  3205.     @column_max = 3
  3206.     @commands = ["买", "卖", "取消"]
  3207.     refresh
  3208.     self.index = 0
  3209.   end
  3210. end
  3211. #------------------------------------------------------------------------------



  3212. #------------------------------------------------------------------------------
  3213. #========================================================================================================================
  3214. # ■ Window_ShopBuy
  3215. #------------------------------------------------------------------------------
  3216. #  商店画面、浏览显示可以购买的商品的窗口。
  3217. #==============================================================================

  3218. class Window_ShopBuy < Window_Selectable
  3219.   #--------------------------------------------------------------------------
  3220.   # ● 初始化对像
  3221.   #     shop_goods : 商品
  3222.   #--------------------------------------------------------------------------
  3223.   def initialize(shop_goods)
  3224. # -------------------
  3225. # 修改開始
  3226.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  3227. # 修改終了
  3228. # -------------------
  3229.     @shop_goods = shop_goods
  3230.    
  3231.     refresh
  3232.     self.index = 0
  3233.   end
  3234.   #--------------------------------------------------------------------------
  3235.   # ● 刷新帮助文本
  3236.   #--------------------------------------------------------------------------

  3237.   def update_help
  3238.     @help_window.set_text(item)
  3239.     #校正帮助窗口位置
  3240.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  3241.   end
  3242. end
  3243. #------------------------------------------------------------------------------



  3244. #------------------------------------------------------------------------------
  3245. #==============================================================================
  3246. # ■ Window_ShopSell
  3247. #------------------------------------------------------------------------------
  3248. #  商店画面、浏览显示可以卖掉的商品的窗口。
  3249. #==============================================================================

  3250. class Window_ShopSell < Window_Selectable
  3251.   #--------------------------------------------------------------------------
  3252.   # ● 初始化对像
  3253.   #--------------------------------------------------------------------------
  3254.   def initialize
  3255. # -------------------
  3256. # 修改開始
  3257.     super(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★★★★
  3258. # 修改終了
  3259. # -------------------
  3260.     @column_max = 2
  3261.    
  3262.     refresh
  3263.     self.index = 0
  3264.   end
  3265.   #--------------------------------------------------------------------------
  3266.   # ● 刷新帮助文本
  3267.   #--------------------------------------------------------------------------

  3268.   def update_help
  3269.     @help_window.set_text(item)
  3270.     #校正帮助窗口位置
  3271.     @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
  3272.   end
  3273. end
  3274. #------------------------------------------------------------------------------



  3275. #------------------------------------------------------------------------------
  3276. #==============================================================================
  3277. # ■ Window_ShopNumber
  3278. #------------------------------------------------------------------------------
  3279. #  商店画面、输入买卖数量的窗口。
  3280. #==============================================================================
  3281. class Window_ShopNumber < Window_Base
  3282.   #--------------------------------------------------------------------------
  3283.   # ● 初始化对像
  3284.   #--------------------------------------------------------------------------
  3285.   def initialize
  3286. # -------------------
  3287. # 修改開始
  3288.     super(0, 128-64, 368, 352+64)#★★★★★★★★★★★★★★★★
  3289. # 修改終了
  3290. # -------------------
  3291.     self.contents = Bitmap.new(width - 32, height - 32)
  3292.     @item = nil
  3293.     @max = 1
  3294.     @price = 0
  3295.     @number = 1
  3296.   end
  3297. end
  3298. #------------------------------------------------------------------------------



  3299. #------------------------------------------------------------------------------
  3300. #==============================================================================
  3301. # ■ Window_ShopStatus
  3302. #------------------------------------------------------------------------------
  3303. #  商店画面、显示物品所持数与角色装备的窗口。
  3304. #==============================================================================

  3305. class Window_ShopStatus < Window_Base
  3306.   #--------------------------------------------------------------------------
  3307.   # ● 初始化对像
  3308.   #--------------------------------------------------------------------------
  3309.   def initialize
  3310. # -------------------
  3311. # 修改開始
  3312.     super(368, 128-64, 272, 352+64)#★★★★★★★★★★★★
  3313. # 修改終了
  3314. # -------------------
  3315.     self.contents = Bitmap.new(width - 32, height - 32)
  3316.     @item = nil
  3317.     refresh
  3318.   end
  3319. end
  3320. #------------------------------------------------------------------------------



  3321. #------------------------------------------------------------------------------
  3322. #==============================================================================
  3323. # ■ Scene_Equip
  3324. #------------------------------------------------------------------------------
  3325. #  处理装备画面的类。
  3326. #==============================================================================

  3327. class Scene_Equip
  3328.   #--------------------------------------------------------------------------
  3329.   # ● 刷新画面 (右侧窗口被激活的情况下)
  3330.   #--------------------------------------------------------------------------
  3331.   def update_right
  3332. # -------------------
  3333. # 修改開始
  3334.     if @right_window.item==nil
  3335.         @help_window.visible=false
  3336.     else
  3337.         @help_window.visible=true
  3338.     end
  3339. # 修改終了
  3340. # -------------------
  3341.     # 按下 B 键的情况下
  3342.     if Input.trigger?(Input::B)
  3343.       # 演奏取消 SE
  3344.       $game_system.se_play($data_system.cancel_se)
  3345.       # 切换到菜单画面
  3346.       $scene = Scene_Menu.new(2)
  3347.       return
  3348.     end
  3349.     # 按下 C 键的情况下
  3350.     if Input.trigger?(Input::C)
  3351.       # 固定装备的情况下
  3352.       if @actor.equip_fix?(@right_window.index)
  3353.         # 演奏冻结 SE
  3354.         $game_system.se_play($data_system.buzzer_se)
  3355.         return
  3356.       end
  3357.       # 演奏确定 SE
  3358.       $game_system.se_play($data_system.decision_se)
  3359.       # 激活物品窗口
  3360.       @right_window.active = false
  3361.       @item_window.active = true
  3362.       @item_window.index = 0
  3363.       return
  3364.     end
  3365.     # 按下 R 键的情况下
  3366.     if Input.trigger?(Input::R)
  3367.       # 演奏光标 SE
  3368.       $game_system.se_play($data_system.cursor_se)
  3369.       # 移至下一位角色
  3370.       @actor_index += 1
  3371.       @actor_index %= $game_party.actors.size
  3372.       # 切换到别的装备画面
  3373.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  3374.       return
  3375.     end
  3376.     # 按下 L 键的情况下
  3377.     if Input.trigger?(Input::L)
  3378.       # 演奏光标 SE
  3379.       $game_system.se_play($data_system.cursor_se)
  3380.       # 移至上一位角色
  3381.       @actor_index += $game_party.actors.size - 1
  3382.       @actor_index %= $game_party.actors.size
  3383.       # 切换到别的装备画面
  3384.       $scene = Scene_Equip.new(@actor_index, @right_window.index)
  3385.       return
  3386.     end
  3387.   end
  3388.   #--------------------------------------------------------------------------
  3389.   # ● 刷新画面 (物品窗口被激活的情况下)
  3390.   #--------------------------------------------------------------------------
  3391.   def update_item
  3392. # -------------------
  3393. # 修改開始
  3394.     if @item_window.item==nil
  3395.         @help_window.visible=false
  3396.     else
  3397.         @help_window.visible=true
  3398.     end
  3399. # 修改終了
  3400. # -------------------
  3401.     # 按下 B 键的情况下
  3402.     if Input.trigger?(Input::B)
  3403.       # 演奏取消 SE
  3404.       $game_system.se_play($data_system.cancel_se)
  3405.       # 激活右侧窗口
  3406.       @right_window.active = true
  3407.       @item_window.active = false
  3408.       @item_window.index = -1
  3409.       return
  3410.     end
  3411.     # 按下 C 键的情况下
  3412.     if Input.trigger?(Input::C)
  3413.       # 演奏装备 SE
  3414.       $game_system.se_play($data_system.equip_se)
  3415.       # 获取物品窗口现在选择的装备数据
  3416.       item = @item_window.item
  3417.       # 变更装备
  3418.       @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  3419.       # 激活右侧窗口
  3420.       @right_window.active = true
  3421.       @item_window.active = false
  3422.       @item_window.index = -1
  3423.       # 再生成右侧窗口、物品窗口的内容
  3424.       @right_window.refresh
  3425.       @item_window.refresh
  3426.       return
  3427.     end
  3428.   end
  3429. end
  3430. #------------------------------------------------------------------------------



  3431. #------------------------------------------------------------------------------
  3432. #========================================================================================================================
  3433. # ■ Scene_Battle (分割定义 3)
  3434. #------------------------------------------------------------------------------
  3435. #  处理战斗画面的类。
  3436. #========================================================================================================================

  3437. class Scene_Battle
  3438.   #--------------------------------------------------------------------------
  3439.   # ● 刷新画面 (角色命令回合 : 选择特技)
  3440.   #--------------------------------------------------------------------------
  3441.   alias first_reupdate_phase3_skill_select update_phase3_skill_select
  3442.   def update_phase3_skill_select
  3443. # -------------------
  3444. # 修改開始
  3445.     @skill_window.help_window.visible = false#★★★★★★★★★★★★★
  3446. # 修改終了
  3447. # -------------------
  3448.     first_reupdate_phase3_skill_select
  3449.   end
  3450.   #--------------------------------------------------------------------------
  3451.   # ● 刷新画面 (角色命令回合 : 选择物品)
  3452.   #--------------------------------------------------------------------------
  3453.   alias first_reupdate_phase3_item_select update_phase3_item_select  
  3454.   def update_phase3_item_select
  3455. # -------------------
  3456. # 修改開始
  3457.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  3458. # 修改終了
  3459. # -------------------
  3460.     first_reupdate_phase3_item_select
  3461.   end
  3462.   #--------------------------------------------------------------------------
  3463.   # ● 开始选择特技
  3464.   #--------------------------------------------------------------------------
  3465.   def start_skill_select
  3466.     @skill_window = Window_Skill.new(@active_battler)
  3467.     @skill_window.help_window = Window_Help.new
  3468.     @actor_command_window.active = false
  3469.     @actor_command_window.visible = false
  3470.   end
  3471.   #--------------------------------------------------------------------------
  3472.   # ● 选择特技结束
  3473.   #--------------------------------------------------------------------------
  3474.   alias first_update_end_skill_select end_skill_select  
  3475.   def end_skill_select
  3476. # -------------------
  3477. # 修改開始
  3478.     @skill_window.help_window.visible = false#★★★★★★★★★★★★
  3479. # 修改終了
  3480. # -------------------
  3481.     first_update_end_skill_select
  3482.   end
  3483.   #--------------------------------------------------------------------------
  3484.   # ● 开始选择物品
  3485.   #--------------------------------------------------------------------------
  3486.   def start_item_select
  3487.     # 生成物品窗口
  3488.     @item_window = Window_Item.new
  3489.     # 关联帮助窗口
  3490. # -------------------
  3491. # 修改開始
  3492.     @item_window.help_window =  Window_Help.new#★★★★★★★★★★★★
  3493. # 修改終了
  3494. # -------------------
  3495.     # 无效化角色指令窗口
  3496.     @actor_command_window.active = false
  3497.     @actor_command_window.visible = false
  3498.   end
  3499.   #--------------------------------------------------------------------------
  3500.   # ● 结束选择物品
  3501.   #--------------------------------------------------------------------------
  3502.   alias first_update_end_item_select end_item_select
  3503.   def end_item_select
  3504. # -------------------
  3505. # 修改開始
  3506.     @item_window.help_window.visible = false#★★★★★★★★★★★★
  3507. # 修改終了
  3508. # -------------------
  3509.     first_update_end_item_select
  3510.   end
  3511. end
  3512. #------------------------------------------------------------------------------



  3513. #------------------------------------------------------------------------------
  3514. #==============================================================================
  3515. # ■ Scene_Shop
  3516. #------------------------------------------------------------------------------
  3517. #  处理商店画面的类。
  3518. #==============================================================================

  3519. class Scene_Shop
  3520.   #--------------------------------------------------------------------------
  3521.   # ● 主处理
  3522.   #--------------------------------------------------------------------------
  3523. # --------------------
  3524. # 衝突可能
  3525.   def main
  3526.     # 生成帮助窗口
  3527. # -------------------
  3528. # 修改開始
  3529.     @help_window = Window_Help.new#★★★★★★★★★★★★★★★★
  3530. # 修改終了
  3531. # -------------------
  3532.     # 生成指令窗口
  3533.     @command_window = Window_ShopCommand.new
  3534.     # 生成金钱窗口
  3535.     @gold_window = Window_Gold.new
  3536.     @gold_window.x = 480
  3537. # -------------------
  3538. # 修改開始
  3539.     @gold_window.y = 64-64#★★★★★★★★★★★★★
  3540. # 修改終了
  3541. # -------------------
  3542.     # 生成时间窗口
  3543. # -------------------
  3544. # 修改開始
  3545.     @dummy_window = Window_Base.new(0, 128-64, 640, 352+64)#★★★★★★★★★★★★★
  3546. # 修改終了
  3547. # -------------------
  3548.     # 生成购买窗口
  3549.     @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
  3550.     @buy_window.active = false
  3551.     @buy_window.visible = false
  3552.     @buy_window.help_window = @help_window
  3553.     # 生成卖出窗口
  3554.     @sell_window = Window_ShopSell.new
  3555.     @sell_window.active = false
  3556.     @sell_window.visible = false
  3557.     @sell_window.help_window = @help_window
  3558.     # 生成数量输入窗口
  3559.     @number_window = Window_ShopNumber.new
  3560.     @number_window.active = false
  3561.     @number_window.visible = false
  3562.     # 生成状态窗口
  3563.     @status_window = Window_ShopStatus.new
  3564.     @status_window.visible = false
  3565.     # 执行过渡
  3566.     Graphics.transition
  3567.     # 主循环
  3568.     loop do
  3569.       # 刷新游戏画面
  3570.       Graphics.update
  3571.       # 刷新输入信息
  3572.       Input.update
  3573.       # 刷新画面
  3574.       update
  3575.       # 如果画面切换的话就中断循环
  3576.       if $scene != self
  3577.         break
  3578.       end
  3579.     end
  3580.     # 准备过渡
  3581.     Graphics.freeze
  3582.     # 释放窗口
  3583.     @help_window.dispose
  3584.     @command_window.dispose
  3585.     @gold_window.dispose
  3586.     @dummy_window.dispose
  3587.     @buy_window.dispose
  3588.     @sell_window.dispose
  3589.     @number_window.dispose
  3590.     @status_window.dispose
  3591.   end
  3592.   #--------------------------------------------------------------------------
  3593.   # ● 刷新画面
  3594.   #--------------------------------------------------------------------------
  3595. # --------------------
  3596. # 衝突可能
  3597.   def update
  3598.     # 刷新窗口
  3599.     @help_window.update
  3600.     @command_window.update
  3601.     @gold_window.update
  3602.     @dummy_window.update
  3603.     @buy_window.update
  3604.     @sell_window.update
  3605.     @number_window.update
  3606.     @status_window.update
  3607.     # 指令窗口激活的情况下: 调用 update_command
  3608.     if @command_window.active
  3609. # -------------------
  3610. # 修改開始
  3611.       @help_window.visible=false#★★★★★★★★★★★★★★★★
  3612. # 修改終了
  3613. # -------------------
  3614.       update_command
  3615.       return
  3616.     end
  3617.     # 购买窗口激活的情况下: 调用 update_buy
  3618.     if @buy_window.active
  3619. # -------------------
  3620. # 修改開始
  3621.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  3622.       if @buy_window.item==nil#★★★★★★★★★★★★★★★★
  3623.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  3624.       end #★★★★★★★★★★★★★★★★     
  3625. # 修改終了
  3626. # -------------------
  3627.       update_buy
  3628.       return
  3629.     end
  3630.     # 卖出窗口激活的情况下: 调用 update_sell
  3631.     if @sell_window.active
  3632. # -------------------
  3633. # 修改開始
  3634.       @help_window.visible=true#★★★★★★★★★★★★★★★★
  3635.       if @sell_window.item==nil#★★★★★★★★★★★★★★★★
  3636.         @help_window.visible=false#★★★★★★★★★★★★★★★★
  3637.       end #★★★★★★★★★★★★★★★★
  3638. # 修改終了
  3639. # -------------------      
  3640.       update_sell
  3641.       return
  3642.     end
  3643.     # 个数输入窗口激活的情况下: 调用 update_number
  3644.     if @number_window.active
  3645. # -------------------
  3646. # 修改開始
  3647.       @help_window.visible=false#★★★★★★★★★★★★★★★★
  3648. # 修改終了
  3649. # -------------------
  3650.       update_number
  3651.       return
  3652.     end
  3653.   end
  3654. end


  3655. ‘‘──eu国猪于2012-7-21 12:22补充以下内容:

  3656. #==============================================================================
  3657. # 禾西製作 / Created by Quarcy
  3658. #==============================================================================
  3659. class Window_Help < Window_Base
  3660.   attr_reader :materia
  3661.   #--------------------------------------------------------------------------
  3662.   # ● 定義不顯示的屬性與狀態
  3663.   #--------------------------------------------------------------------------
  3664.   def unshown
  3665.     @unshow_elements = [17, 18]
  3666.     @unshow_states = []
  3667.   end
  3668.   #--------------------------------------------------------------------------
  3669.   # ● 初始化對象
  3670.   #--------------------------------------------------------------------------
  3671.   def initialize
  3672.     super(0, 0, 640, 64)
  3673.     self.opacity = 150
  3674.     self.z=150
  3675.     self.visible = false
  3676.   end
  3677.   #--------------------------------------------------------------------------
  3678.   # ● 設置文本
  3679.   #     data  : 窗口顯示的字符串/物品資料
  3680.   #     align : 對齊方式 (0..左對齊、1..中間對齊、2..右對齊)
  3681.   #--------------------------------------------------------------------------
  3682.   def set_text(data, align=0)
  3683.     #------------------------------------------------------------------------
  3684.     # ● 當資料爲文字時候
  3685.     #------------------------------------------------------------------------
  3686.     # 如果文本或對齊方式至少一方与上次的不同
  3687.     if data != @text or align != @align
  3688.       if data.is_a?(String)
  3689.         # 再描繪文本
  3690.         self.width = 640
  3691.         self.height = 64
  3692.         self.x=0
  3693.         self.y=0
  3694.         self.contents = Bitmap.new(width - 32, height - 32) if self.contents.nil?
  3695.         self.contents.clear
  3696.         self.contents.font.color = normal_color
  3697.         self.contents.font.size = 20
  3698.         self.contents.draw_text(4, 0, self.width - 40, 32, data, align)
  3699.         @text = data
  3700.         @align = align
  3701.         @actor = nil
  3702.         self.visible = true
  3703.       end
  3704.     end
  3705.     return if data.is_a?(String)
  3706.     #------------------------------------------------------------------------
  3707.     # ● 當沒有資料時候
  3708.     #------------------------------------------------------------------------
  3709.     if data.nil?
  3710.       self.visible=false
  3711.     else
  3712.       self.visible=true
  3713.     end
  3714.     #------------------------------------------------------------------------
  3715.     # ● 當資料爲物品/技能時候
  3716.     #------------------------------------------------------------------------
  3717.     if data != nil && @data != data
  3718.       self.width = 210
  3719.       self.height = 430
  3720.       self.x=0
  3721.       self.y=200
  3722.       unshown
  3723.       non_auto_update(data)
  3724.     else
  3725.       return
  3726.     end
  3727.   end
  3728.   #--------------------------------------------------------------------------
  3729.   # ● 更新帮助窗口
  3730.   #--------------------------------------------------------------------------
  3731.   def non_auto_update(data=@data)
  3732.     @data = data
  3733.     case @data
  3734.     when RPG::Item
  3735.       set_item_text(@data)
  3736.     when RPG::Weapon
  3737.       set_equipment_text(@data)
  3738.     when RPG::Armor
  3739.       set_equipment_text(@data)
  3740.     when RPG::Skill
  3741.       set_skill_text(@data)
  3742.     end
  3743.   end
  3744.   #--------------------------------------------------------------------------
  3745.   # ● 裝備帮助窗口
  3746.   #--------------------------------------------------------------------------
  3747.   def set_equipment_text(equipment)
  3748.     #------------------------------------------------------------------------
  3749.     # ● 取得基本質料
  3750.     #------------------------------------------------------------------------
  3751.     # 取得屬性、附加狀態、解除狀態之副本
  3752.     case equipment
  3753.     when RPG::Weapon
  3754.       element_set = equipment.element_set.clone
  3755.       plus_state_set = equipment.plus_state_set.clone
  3756.       minus_state_set = equipment.minus_state_set.clone
  3757.       #----------------------#
  3758.       # 過濾不顯示的狀態描述 #
  3759.       #----------------------#
  3760.       plus_state_set -= @unshow_states
  3761.       minus_state_set -= @unshow_states
  3762.     when RPG::Armor
  3763.       element_set = equipment.guard_element_set.clone
  3764.       guard_state_set = equipment.guard_state_set.clone
  3765.       #----------------------#
  3766.       # 過濾不顯示的狀態描述 #
  3767.       #----------------------#
  3768.       auto_state_id = equipment.auto_state_id
  3769.       guard_state_set -= @unshow_states
  3770.     end
  3771.     #----------------------#
  3772.     # 過濾不顯示的屬性描述 #
  3773.     #----------------------#
  3774.     element_set -= @unshow_elements
  3775.     #--------------#
  3776.     # 取得說明文字 #
  3777.     #--------------#
  3778.     description = equipment.description.clone
  3779.     # 初始化數據設定
  3780.     x = 0
  3781.     y = 0
  3782.     h = 0
  3783.     phrase = {}
  3784.    
  3785.     # 基本文字設定
  3786.     phrase["price"] = "价格:"
  3787.     phrase["elements"] = "属性:"
  3788.     phrase["minus_states"] = "解除状态:"
  3789.     phrase["plus_states"] = "附加状态:"
  3790.     phrase["guard_elements"] = "防御属性"
  3791.     phrase["guard_states"] = "防御状态"
  3792.     phrase["auto_state"] = "自动状态"

  3793.     # 基本數據設定
  3794. =begin
  3795.     name_size = 名字文字大小
  3796.     size = 描述文字大小
  3797.     word = 每行的描述文字數
  3798.     move = 全體描述偏移幅度
  3799. =end
  3800.     name_size = 18
  3801.     size = 14
  3802.     word = 12
  3803.     move = 80
  3804.     #------------------------------------------------------------------------
  3805.     # ● 確定背景圖片的高度
  3806.     #------------------------------------------------------------------------
  3807.     h += (description.size/3/word)
  3808.     h += 1 if (description.size/3%word) > 0
  3809.     h += 1 if equipment.is_a?(RPG::Weapon)
  3810.     now_h = h
  3811.     h += 1
  3812.     h += 1 unless equipment.pdef.zero?
  3813.     h += 1 unless equipment.mdef.zero?
  3814.     h += 1 if element_set.size > 0
  3815.     h += 1 if element_set.size >= 5
  3816.     case equipment
  3817.     when RPG::Weapon
  3818.       h += 1 unless minus_state_set.empty?
  3819.       h += minus_state_set.size
  3820.       h += 1 unless plus_state_set.empty?
  3821.       h += plus_state_set.size
  3822.     when RPG::Armor
  3823.       h += 1 unless guard_state_set.empty?
  3824.       h += guard_state_set.size
  3825.       h += 1 unless auto_state_id.zero?
  3826.     end
  3827.     h += 1
  3828.     h += 1 unless equipment.str_plus.zero?
  3829.     h += 1 unless equipment.dex_plus.zero?
  3830.     h += 1 unless equipment.agi_plus.zero?
  3831.     h += 1 unless equipment.int_plus.zero?
  3832.     h += materia_height_plus(equipment) unless self.materia.nil?
  3833.     #------------------------------------------------------------------------
  3834.     # ● 圖片顯示保證高度
  3835.     #------------------------------------------------------------------------
  3836.     h = 6 + now_h if (h - now_h) < 6
  3837.     #------------------------------------------------------------------------
  3838.     # ● 換算高度
  3839.     #------------------------------------------------------------------------
  3840.     self.height = h * size + name_size + 32
  3841.     #------------------------------------------------------------------------
  3842.     # ● 生成背景
  3843.     #------------------------------------------------------------------------
  3844.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  3845.     self.contents.clear
  3846.     #------------------------------------------------------------------------
  3847.     # ● 名字描繪
  3848.     #------------------------------------------------------------------------
  3849.     text = equipment.name
  3850.     self.contents.font.color = draw_name_color(equipment)
  3851.     self.contents.font.size = name_size
  3852.     if text.nil?
  3853.       self.visible = false
  3854.     else
  3855.       self.visible = true
  3856.       self.contents.draw_text(0, 0, text.size*7, name_size, text, 0)
  3857.     end
  3858.     #------------------------------------------------------------------------
  3859.     # ● 說明描繪
  3860.     #------------------------------------------------------------------------
  3861.     x = 0
  3862.     y += 1
  3863.     while ((text = description.slice!(/./m)) != nil)
  3864.       self.contents.font.color = normal_color
  3865.       self.contents.font.size = size
  3866.       self.contents.draw_text(x*size, y*size+5, size, size, text, 0)
  3867.       x+=1
  3868.       if x == word
  3869.         x=0
  3870.         y+=1   
  3871.       end
  3872.     end
  3873.     #------------------------------------------------------------------------
  3874.     # ● 圖標描繪
  3875.     #------------------------------------------------------------------------
  3876.     bitmap = RPG::Cache.icon(equipment.icon_name)
  3877.     opacity = self.contents.font.color == normal_color ? 255 : 128
  3878.     self.contents.blt(0 ,y*size + 20, bitmap, Rect.new(0, 0, 95, 100), 225)
  3879.   
  3880.     #------------------------------------------------------------------------
  3881.     # ● 攻擊力描繪(武器)
  3882.     #------------------------------------------------------------------------
  3883.     if equipment.is_a?(RPG::Weapon)
  3884.       x = 0
  3885.       y += 1
  3886.       text = $data_system.words.atk+":"+equipment.atk.to_s
  3887.       self.contents.font.color = normal_color
  3888.       self.contents.font.size = size
  3889.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  3890.     end
  3891.     #------------------------------------------------------------------------
  3892.     # ● 價格描繪
  3893.     #------------------------------------------------------------------------
  3894.     x = 0
  3895.     y += 1
  3896.     text = phrase["price"] + equipment.price.to_s
  3897.     self.contents.font.color = normal_color
  3898.     self.contents.font.size = size
  3899.     self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  3900.     #------------------------------------------------------------------------
  3901.     # ● 物理防禦
  3902.     #------------------------------------------------------------------------
  3903.     unless equipment.pdef.zero?
  3904.       x = 0
  3905.       y += 1
  3906.       text = $data_system.words.pdef+":"+equipment.pdef.to_s
  3907.       self.contents.font.color = normal_color
  3908.       self.contents.font.size = size
  3909.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  3910.     end
  3911.     #------------------------------------------------------------------------
  3912.     # ● 魔法防禦
  3913.     #------------------------------------------------------------------------
  3914.     unless equipment.mdef.zero?
  3915.       x = 0
  3916.       y += 1
  3917.       text=$data_system.words.mdef+":"+equipment.mdef.to_s
  3918.       self.contents.font.color = normal_color
  3919.       self.contents.font.size = size
  3920.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  3921.     end
  3922.     #------------------------------------------------------------------------
  3923.     # ● 屬性
  3924.     #------------------------------------------------------------------------
  3925.     if element_set.size > 0
  3926.       x = 0
  3927.       y += 1
  3928.       text = phrase["elements"]
  3929.       for i in 0...element_set.size
  3930.         break if i > 4
  3931.         text += $data_system.elements[element_set[i]]
  3932.       end
  3933.       self.contents.font.color = normal_color
  3934.       self.contents.font.size = size
  3935.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  3936.     end
  3937.     if element_set.size >= 5
  3938.       x = (phrase["elements"].size)*5-4
  3939.       y += 1
  3940.       text = ""
  3941.       for i in 4...element_set.size
  3942.         text += $data_system.elements[element_set[i]]
  3943.       end
  3944.       self.contents.font.color = normal_color
  3945.       self.contents.font.size = size
  3946.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  3947.     end
  3948.     #------------------------------------------------------------------------
  3949.     # ● 描述分流 武器/防具
  3950.     #------------------------------------------------------------------------
  3951.     case equipment
  3952.     when RPG::Weapon
  3953.       #------------------------------------------------------------------------
  3954.       # ● 解除狀態(武器)
  3955.       #------------------------------------------------------------------------
  3956.       unless minus_state_set.empty?
  3957.         x = 0
  3958.         y += 1
  3959.         text=phrase["minus_states"]
  3960.         text=phrase["guard_states"]
  3961.         self.contents.font.color = normal_color
  3962.         self.contents.font.size = size
  3963.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  3964.         for i in 0...minus_state_set.size
  3965.           y += 1
  3966.           text = $data_states[minus_state_set[i]].name        
  3967.           self.contents.font.color = normal_color
  3968.           self.contents.font.size = size
  3969.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  3970.         end
  3971.       end
  3972.       #------------------------------------------------------------------------
  3973.       # ● 附加狀態(武器)
  3974.       #------------------------------------------------------------------------
  3975.       unless plus_state_set.empty?
  3976.         x = 0
  3977.         y += 1
  3978.         text = phrase["plus_states"]
  3979.         self.contents.font.color = normal_color
  3980.         self.contents.font.size = size
  3981.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  3982.         for i in 0...plus_state_set.size
  3983.           y += 1
  3984.           text=$data_states[plus_state_set[i]].name        
  3985.           self.contents.font.color = normal_color
  3986.           self.contents.font.size = size
  3987.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  3988.         end  
  3989.       end
  3990.     when RPG::Armor
  3991.       #------------------------------------------------------------------------
  3992.       # ● 防禦狀態(防具)
  3993.       #------------------------------------------------------------------------
  3994.       unless guard_state_set.empty?
  3995.         x = 0
  3996.         y += 1
  3997.         text=phrase["guard_states"]
  3998.         self.contents.font.color = normal_color
  3999.         self.contents.font.size = size
  4000.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  4001.         for i in 0...guard_state_set.size
  4002.           y += 1
  4003.           text = $data_states[guard_state_set[i]].name        
  4004.           self.contents.font.color = normal_color
  4005.           self.contents.font.size = size
  4006.           self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)        
  4007.         end
  4008.       end
  4009.       #------------------------------------------------------------------------
  4010.       # ● 自動狀態(防具)
  4011.       #------------------------------------------------------------------------
  4012.       unless auto_state_id.zero?
  4013.         x = 0
  4014.         y += 1
  4015.         text = phrase["auto_state"] + $data_states[auto_state_id].name
  4016.         self.contents.font.color = normal_color
  4017.         self.contents.font.size = size
  4018.         self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)
  4019.       end
  4020.     end
  4021.     #------------------------------------------------------------------------
  4022.     # ● 空行
  4023.     #------------------------------------------------------------------------
  4024.     y+=1
  4025.     #------------------------------------------------------------------------
  4026.     # ● 力量
  4027.     #------------------------------------------------------------------------
  4028.     unless equipment.str_plus.zero?
  4029.       x = 0
  4030.       y += 1
  4031.       h += 1
  4032.       if equipment.str_plus > 0
  4033.         text=$data_system.words.str+" +"+ equipment.str_plus.to_s
  4034.       else
  4035.         text=$data_system.words.str+" -"+ (-equipment.str_plus).to_s
  4036.       end
  4037.       self.contents.font.color = normal_color
  4038.       self.contents.font.size = size
  4039.       self.contents.draw_text(x+move, y*size+5, text.size*6, size, text, 0)  <br


  4040. ’’
复制代码
每天5小时制作游戏,5小时测试,把游戏都玩透了。晕,不知说了什么。。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-21 20:38

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表