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

Project1

 找回密码
 注册会员
搜索

请问 这个物品说明排版怎么调整,求好心人帮助。

查看数: 1546 | 评论数: 2 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2016-8-16 17:44

正文摘要:

我想把 “价格”这一项说明调整到最底部,请问该如何设置。 附上脚本,求大神帮助: #encoding:utf-8 #============================================================================== # ■ 技能物品说明增强 蓝 ...

回复

duzine 发表于 2016-8-17 21:21:02
修改完成了,我手上這個是該腳本的最新版
並且其中做過一些兼容調整,相信比樓主手上的還棒
不過因為我是台灣人,所以文字是萌萌噠的繁體中文

  1. #==============================================================================
  2. # ■ 技能物品说明增强 蓝本:wyongcan
  3. # 修改 :VIPArcher [email: [email protected]]
  4. #
  5. # 改动说明:
  6. # 改用新的帮助窗口和新定义draw_text_vip方法来增强兼容性
  7. # 更改初始化数据时机以支持跳过标题
  8. # 追加对普通物品和技能的说明内容
  9. # 修改了对帮助窗口行数的计算以支持控制符
  10. # 加上了各种颜色的设置,具体更高级的玩法自己领悟吧
  11. # 改成光标不动一段时间后才会出现帮助窗口
  12. # 2015.01.25 : 无聊的的修改(重写)[划掉]可以无视[划掉]
  13. #  -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。
  14. #==============================================================================
  15. $VIPArcherScript ||= {};$VIPArcherScript[:help_ex] = __FILE__ #20141007
  16. $VIPArcherScript[:equip_limit] = false #是否使用了后知后觉的装备能力限制
  17. module VIPArcher end
  18. #-------------------------------------------------------------------------------
  19. class << DataManager
  20.   alias_method :vip_load_database, :load_database
  21.   #--------------------------------------------------------------------------
  22.   # ● 读取数据库
  23.   #--------------------------------------------------------------------------
  24.   def load_database
  25.     vip_load_database ; VIPArcher::Help_Ex.init_ready
  26.   end
  27. end
  28. #==============================================================================
  29. # ★ 设定项目 - BEGIN Setting ★
  30. #==============================================================================
  31. module VIPArcher::Help_Ex
  32.   #--------------------------------------------------------------------------
  33.   # ● 常量设置
  34.   #--------------------------------------------------------------------------
  35.   TIME = 30 #帮助窗口自动出现的时间(单位帧
  36.   Font_Name = "微軟正黑體" # 推荐"微软雅黑"
  37.   Font_Size = 18                # "微软雅黑"的话就20号字体
  38.   UP   = 24 #能力值提升颜色编号
  39.   DOWN = 25 #能力值下降颜色编号
  40.   VIP  = 14 #特殊能力颜色编号
  41.   MP   = 23 #消耗MP的颜色编号
  42.   TP   = 29 #消耗TP的颜色编号
  43.   #--------------------------------------------------------------------------
  44.   # ● 用语设置
  45.   #--------------------------------------------------------------------------
  46.   CODE ={
  47.     11 => "屬性抗性",
  48.     12 => "弱化抗性",
  49.     13 => "狀態抗性",
  50.     14 => "狀態免疫",
  51.     21 => "普通能力",
  52.     22 => "添加能力",
  53.     23 => "特殊能力",
  54.     31 => "附帶屬性",
  55.     32 => "附帶狀態",
  56.     33 => "攻擊速度",
  57.     34 => "添加攻擊次數",
  58.     41 => "添加技能類型",
  59.     42 => "禁用技能類型",
  60.     43 => "添加技能",
  61.     44 => "禁用技能",
  62.     51 => "可裝備武器類型",
  63.     52 => "可裝備護甲類型",
  64.     53 => "固定裝備",
  65.     54 => "禁用裝備",
  66.     55 => "裝備風格",
  67.     61 => "添加行動次數",
  68.     62 => "特殊標誌",
  69.     63 => "消失效果",
  70.     64 => "隊伍能力"
  71.     }
  72.   #特殊标志
  73.   FLAG ={
  74.     0 => "自動戰鬥",
  75.     1 => "擅長防禦",
  76.     2 => "保護弱者",
  77.     3 => "特技專注"
  78.     }
  79.   #技能效果范围
  80.   SCOPE ={
  81.     0 => "無",
  82.     1 => "單個敵人",
  83.     2 => "全體敵人",
  84.     3 => "一個隨機敵人",
  85.     4 => "兩個隨機敵人",
  86.     5 => "三個隨機敵人",
  87.     6 => "四個隨機敵人",
  88.     7 => "單個隊友",
  89.     8 => "全體隊友",
  90.     9 => "單個隊友(戰鬥不能)",
  91.     10 => "全體隊友(戰鬥不能)",
  92.     11 => "消費者"
  93.     }
  94.   #技能命中类型
  95.   HIT ={
  96.     0 => "必定命中",
  97.     1 => "物理攻擊",
  98.     2 => "魔法攻擊"
  99.     }
  100.   #使用限制
  101.   OCCASION ={
  102.     0 => "隨時可用",
  103.     1 => "僅戰鬥中",
  104.     2 => "僅功能表中",
  105.     3 => "不能使用"
  106.     }
  107.   #添加能力
  108.   XPARAM ={
  109.     0 => "物理命中幾率:",
  110.     1 => "物理閃避幾率:",
  111.     2 => "必殺幾率:",
  112.     3 => "必殺閃避幾率:",
  113.     4 => "魔法閃避幾率:",
  114.     5 => "魔法反射幾率:",
  115.     6 => "物理反擊幾率:",
  116.     7 => "體力值再生速度:",
  117.     8 => "魔力值再生速度:",
  118.     9 => "特技值再生速度:"
  119.     }
  120.   #特殊能力
  121.   SPARAM ={
  122.     0 => "受到攻擊的幾率",
  123.     1 => "防禦效果比率",
  124.     2 => "恢復效果比率",
  125.     3 => "藥理知識",
  126.     4 => "MP消費率",
  127.     5 => "TP消耗率",
  128.     6 => "物理傷害加成",
  129.     7 => "魔法傷害加成",
  130.     8 => "地形傷害加成",
  131.     9 => "經驗獲得加成"
  132.     }
  133.   #装备风格  require 装备风格扩展脚本
  134.   SLOT_TYPE ={
  135.     0 => "普通",
  136.     1 => "雙持武器",
  137.     2 => "索爺三刀流",
  138.     3 => "NPC",
  139.     4 => "233",
  140.     5 => "論壇@的BUG好煩啊"
  141.     }
  142.   #队伍能力
  143.   PARTY_ABILITY ={
  144.     0 => "遇敵幾率減半",
  145.     1 => "隨機遇敵無效",
  146.     2 => "敵人偷襲無效",
  147.     3 => "先制攻擊幾率上升",
  148.     4 => "獲得金錢數量雙倍",
  149.     5 => "物品掉落幾率雙倍"
  150.     }
  151.   #伤害类型
  152.   DAMAGE_TYPE = {
  153.     0 => "無",
  154.     1 => "體力值傷害",
  155.     2 => "魔力值傷害",
  156.     3 => "體力值恢復",
  157.     4 => "魔力值恢復",
  158.     5 => "體力值吸收",
  159.     6 => "魔力值吸收"
  160.     }
  161.   #普通能力
  162.   #这只是个示范,你也可以依照个人喜好对这些用语添加颜色控制符
  163.   @params ={
  164.     0 => "\\c[17]最大HP",
  165.     1 => "\\c[16]最大MP",
  166.     2 => "\\c[20]物攻",
  167.     3 => "\\c[21]物防",
  168.     4 => "\\c[30]魔攻",
  169.     5 => "\\c[31]魔防",
  170.     6 => "\\c[14]敏捷",
  171.     7 => "\\c[17]幸運"
  172.     }
  173.   #我举例技能类型的原因就是因为它 短
  174.   @skill_types = { # 这个和下面equiphelpready里注释掉的做的是一样的事
  175.                    # 只是下面是读取数据库添加用语,这里是手动枚举
  176.     1 => "\\c[1]特技",
  177.     2 => "\\c[2]魔法",
  178.     3 => "\\c[3]必殺",
  179.     4 => "\\c[5]賣萌"
  180.     }
  181.   #初始化数据,当然如果你要用上面那样的控制符改变颜色的话
  182.   #欢迎枚举格式就是上面这样用Hash,用ID做键把用语对应起来
  183. end
  184. #==============================================================================
  185. # ☆ 设定完成 - END Setting ☆
  186. #==============================================================================
  187. module VIPArcher::Help_Ex
  188.   #--------------------------------------------------------------------------
  189.   # ● 读取数据库
  190.   #       初始化数据,当然如果你要用上面那样的控制符改变颜色的话
  191.   #       欢迎枚举,格式就是上面这样用Hash,用ID做键把用语对应起来
  192.   #--------------------------------------------------------------------------
  193.   def self.init_ready
  194.     init_variable
  195.     init_states
  196.     init_params
  197.     init_elements
  198.     init_weapon_types
  199.     init_armor_types
  200.     init_skill_types
  201.     init_etypes
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ● 初始化用语的实例变量
  205.   #--------------------------------------------------------------------------
  206.   def self.init_variable
  207.     @states       ||= {}
  208.     @params       ||= {}
  209.     @weapon_types ||= {}
  210.     @armor_types  ||= {}
  211.     @etypes       ||= {}
  212.     @skill_types  ||= {}
  213.     @elements     ||= {}
  214.   end
  215.   #--------------------------------------------------------------------------
  216.   # ● 读取状态名称
  217.   #--------------------------------------------------------------------------
  218.   def self.init_states
  219.     return unless @states.empty?
  220.     $data_states.each_with_index do |state,i|
  221.       @states[i] = state.name unless state.nil?
  222.     end
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # ● 读取能力用语
  226.   #--------------------------------------------------------------------------
  227.   def self.init_params
  228.     return unless @params.empty?
  229.     $data_system.terms.params.each_with_index do |param,i|
  230.       @params[i] = param
  231.     end
  232.   end
  233.   #--------------------------------------------------------------------------
  234.   # ● 读取属性名称用语
  235.   #--------------------------------------------------------------------------
  236.   def self.init_elements
  237.     return unless @elements.empty?
  238.     $data_system.elements.each_with_index do |element,i|
  239.       @elements[i] = element unless element.nil?
  240.     end
  241.   end
  242.   #--------------------------------------------------------------------------
  243.   # ● 读取武器类型用语
  244.   #--------------------------------------------------------------------------
  245.   def self.init_weapon_types
  246.     return unless @weapon_types.empty?
  247.     $data_system.weapon_types.each_with_index do |type,i|
  248.       @weapon_types[i] = type unless type.nil?
  249.     end
  250.   end
  251.   #--------------------------------------------------------------------------
  252.   # ● 读取防具类型用语
  253.   #--------------------------------------------------------------------------
  254.   def self.init_armor_types
  255.     return unless @armor_types.empty?
  256.     $data_system.armor_types.each_with_index do |type,i|
  257.       @armor_types[i] = type unless type.nil?
  258.     end
  259.   end
  260.   #--------------------------------------------------------------------------
  261.   # ● 读取技能类型用语
  262.   #--------------------------------------------------------------------------
  263.   def self.init_skill_types
  264.     return unless @skill_types.empty?
  265.     $data_system.skill_types.each_with_index do |type,i|
  266.       @skill_types[i] = type unless type.nil?
  267.     end
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # ● 读取装备位置用语
  271.   #--------------------------------------------------------------------------
  272.   def self.init_etypes
  273.     return unless @etypes.empty?
  274.     $data_system.terms.etypes.each_with_index do |type,i|
  275.       @etypes[i] = type unless type.nil?
  276.     end
  277.   end
  278.   #--------------------------------------------------------------------------
  279.   # ● 获取指定code的特性信息
  280.   #--------------------------------------------------------------------------
  281.   def self.select_features(item,code)
  282.     item.features.select {|f| f.code == code}.each {|index| yield index }
  283.   end
  284.   #--------------------------------------------------------------------------
  285.   # ● 获取指定code的使用效果信息
  286.   #--------------------------------------------------------------------------
  287.   def self.select_effects(item,code)
  288.     item.effects.select {|e| e.code == code}.each {|index| yield index }
  289.   end
  290.   #--------------------------------------------------------------------------
  291.   # ● 获取物品帮助说明
  292.   #--------------------------------------------------------------------------
  293.   def self.get_item_help(item)
  294.     name(item) + description(item) + skill_cost(item) + occasion(item) + skill_speed(item) + success_rate(item) + item_type(item) +
  295.     damage_scope(item) + buff_params(item) + atk_states(item) +
  296.     special_flag(item) + price(item)+ (item.is_a?(RPG::Skill)  ? required_wtype(item) : "")
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # ● 获取物品帮助说明
  300.   #--------------------------------------------------------------------------
  301.   def self.get_equip_help(equip)
  302.     name(equip) + description(equip)  + etype_id(equip) +
  303.     exdrop(equip) + equip_limit(equip) + equip_param(equip) + equip_slot(equip) +
  304.     features_param(equip) + features_rate(equip) + state_attack(equip) +
  305.     equip_skill(equip) + flag_ability(equip)+ price(equip)
  306.   end
  307.   #--------------------------------------------------------------------------
  308.   # ● 获取物品技能名字
  309.   #--------------------------------------------------------------------------
  310.   def self.name(item)
  311.     if $VIPArcherScript[:itemcolor] # require 物品描绘颜色脚本 by:VIPArcher
  312.       "\\c[16]名稱:\\c[#{VIPArcher::ItemColor::Color_Lv[item.color]}]" +
  313.       "#{item.name}  #{(item.color.to_s + "★") if item.color != 0}\\c[0]\n"
  314.     else
  315.       "\\c[16]名稱:\\c[0]#{item.name}\n"
  316.     end
  317.   end
  318.   #--------------------------------------------------------------------------
  319.   # ● 获取物品技能背景说明
  320.   #--------------------------------------------------------------------------
  321.   def self.description(item)
  322.     "\\c[16]介绍:\\c[0]#{item.description}\n"
  323.   end
  324.   #--------------------------------------------------------------------------
  325.   # ● 获取技能物品使用场合
  326.   #--------------------------------------------------------------------------
  327.   def self.occasion(item)
  328.     return "" if item.occasion == 0
  329.     "\\c[16]可用場合:#{OCCASION[item.occasion]}\\c[0]\n"
  330.   end
  331.   #--------------------------------------------------------------------------
  332.   # ● 获取物品价格信息
  333.   #--------------------------------------------------------------------------
  334.   def self.price(item)
  335.     return "" if item.is_a?(RPG::Skill)
  336.     price = item.price == 0 ? "\\c[14]無法出售\\c[0]" : item.price.to_s
  337.     if $VIPArcherScript[:load]      # require 队伍负重脚本
  338.       "\\c[16]售價:#{price} 重量:#{item.load}\\c[0]\n"
  339.     else
  340.       "\\c[16]售價:#{price}\\c[0]\n"
  341.     end
  342.   end
  343.   #--------------------------------------------------------------------------
  344.   # ● 获取掉率扩展信息
  345.   #--------------------------------------------------------------------------
  346.   def self.exdrop(equip)
  347.     return "" if equip.is_a?(RPG::Item)
  348.     return "" unless $VIPArcherScript[:exdrop_rate]   # require 队伍掉率扩展
  349.     equip.note =~ /<(\W+)掉率:\s*([0-9+.-]+)%>/i ?
  350.     "\\c[#{$2.to_i > 0 ? UP : DOWN}]#{$1}掉率: #{$2}%\\c[0]\n" : ""
  351.   end
  352.   #--------------------------------------------------------------------------
  353.   # ● 获取装备能力限制数据 require 装备能力限制 by 后知后觉
  354.   #--------------------------------------------------------------------------
  355.   def self.equip_limit(equip)
  356.     help = ""
  357.     return help unless $VIPArcherScript[:equip_limit] #装备能力限制
  358.     help += "\\c[16]等级需求:#{equip.level_limit}\n" if equip.level_limit > 0
  359.     0..7.each do |i|
  360.       if equip.params_limit(i) != 0
  361.         help += "\\c[16]#{@params[i]}需求:#{equip.params_limit(i)}\\c[0]\n"
  362.       end
  363.     end ; help
  364.   end
  365.   #--------------------------------------------------------------------------
  366.   # ● 获取装备能力附加值
  367.   #--------------------------------------------------------------------------
  368.   def self.equip_param(equip)
  369.     help = ""
  370.     equip.params.each_with_index do |param,i|
  371.       value_color = "\\c[#{param > 0 ? UP : DOWN}]"
  372.       value_string = "#{"+"if param > 0}#{param.to_int.to_s}\\c[0]\n"
  373.       help += "#{@params[i]}: #{value_color}#{value_string}" if param != 0
  374.     end ; help
  375.   end
  376.   #--------------------------------------------------------------------------
  377.   # ● 获取装备风格信息
  378.   #--------------------------------------------------------------------------
  379.   def self.equip_slot(equip)
  380.     if $VIPArcherScript[:slot_type] # require 装备风格扩展 by VIPArcher
  381.       equip.note =~ /<slot_type\s*[:](.*)>/i ?
  382.       "\\c[#{VIP}]#{CODE[55]}:#{SLOT_TYPE[$1.to_i]}\\c[0]\n" : ""
  383.     else
  384.       equip.features.any? {|f|f.code == 55} ?
  385.       "\\c[#{VIP}]#{CODE[55]}:雙持武器\\c[0]\n" : ""
  386.     end
  387.   end
  388.   #--------------------------------------------------------------------------
  389.   # ● 获取装备位置信息
  390.   #--------------------------------------------------------------------------
  391.   def self.etype_id(equip)
  392.     "\\c[16]裝備位置:\\c[0]#{Vocab::etype(equip.etype_id)}\\c[0]\n"
  393.   end
  394.   #--------------------------------------------------------------------------
  395.   # ● 获取技能装备限制
  396.   #--------------------------------------------------------------------------
  397.   def self.required_wtype(skill)
  398.     w_1 = $data_system.weapon_types[skill.required_wtype_id1]
  399.     w_2 = $data_system.weapon_types[skill.required_wtype_id2]
  400.     (w_1 + w_2).empty? ? "" : "\\c[#{DOWN}]武器限制:#{w_1} #{w_2}\\c[0]\n"
  401.   end
  402.   #--------------------------------------------------------------------------
  403.   # ● 获取技能消耗信息
  404.   #--------------------------------------------------------------------------
  405.   def self.skill_cost(skill)
  406.     return "" if skill.is_a?(RPG::Item)
  407.     mp = skill.mp_cost > 0 ? "\\c[#{MP}]MP:#{skill.mp_cost}\\c[0]\n" : ""
  408.     tp = skill.tp_cost > 0 ? "\\c[#{TP}]TP:#{skill.tp_cost}\\c[0]\n" : ""
  409.     (mp + tp).empty? ? "" : "\\c[16]消耗:#{mp} #{tp}"
  410.   end
  411.   #--------------------------------------------------------------------------
  412.   # ● 获取技能物品速度修正
  413.   #--------------------------------------------------------------------------
  414.   def self.skill_speed(skill)
  415.     return "" if skill.speed == 0
  416.     "\\c[#{skill.speed < 0 ? DOWN : UP}]速度修正:#{skill.speed}\\c[0]\n"
  417.   end
  418.   #--------------------------------------------------------------------------
  419.   # ● 获取技能物品成功率
  420.   #--------------------------------------------------------------------------
  421.   def self.success_rate(skill)
  422.     return "" if skill.success_rate == 100
  423.     "\\c[#{DOWN}]成功率:#{skill.success_rate}%\\c[0]\n"
  424.   end
  425.   #--------------------------------------------------------------------------
  426.   # ● 获取技能伤害类型或者物品类型
  427.   #--------------------------------------------------------------------------
  428.   def self.item_type(item)
  429.     if item.is_a?(RPG::Skill)
  430.       "\\c[16]傷害類型:#{HIT[item.hit_type]}\\c[0]\n"
  431.     elsif item.is_a?(RPG::Item)
  432.       "\\c[16]物品類型:\\c[#{VIP}]#{"贵重物品  " if item.itype_id != 1}" +
  433.       "\\c[#{DOWN}]#{item.consumable ? "消耗品" : "非消耗品"}\\c[0]\n"
  434.     else ; ""
  435.     end
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # ● 获取技能物品效果范围
  439.   #--------------------------------------------------------------------------
  440.   def self.damage_scope(item)
  441.     scope = item.scope == 0 ? "" : "\\c[16]範圍:#{SCOPE[item.scope]}\\c[0]\n"
  442.     type,id = DAMAGE_TYPE[item.damage.type],@elements[item.damage.element_id]
  443.     damage = item.damage.type == 0 ? "" : "\\c[16]效果:#{id}#{type}\\c[0]\n"
  444.     scope + damage
  445.   end
  446.   #--------------------------------------------------------------------------
  447.   # ● 获取技能物品强化弱化效果
  448.   #--------------------------------------------------------------------------
  449.   def self.buff_params(item)
  450.     help = ""
  451.     select_effects(item,31) do |e|
  452.       help += "\\c[#{UP}]强化:#{@params[e.data_id]} #{e.value1.to_i}回合\\c[0]\n"
  453.     end
  454.     select_effects(item,32) do |e|
  455.       help += "\\c[#{UP}]弱化:#{@params[e.data_id]} #{e.value1.to_i}回合\\c[0]\n"
  456.     end
  457.     select_effects(item,33) do |e|
  458.       help += "\\c[#{UP}]解除:强化#{@params[e.data_id]}\\c[0]\n"
  459.     end
  460.     select_effects(item,34) do |e|
  461.       help += "\\c[#{UP}]解除:弱化#{@params[e.data_id]}\\c[0]\n"
  462.     end ; help
  463.   end
  464.   #--------------------------------------------------------------------------
  465.   # ● 获取技能物品附加移除状态
  466.   #--------------------------------------------------------------------------
  467.   def self.atk_states(item)
  468.     help = ""
  469.     select_effects(item,21) do |e|
  470.       state = e.data_id == 0 ? "普通攻击" : @states[e.data_id]
  471.       help += "\\c[#{UP}]附加:#{state} #{(e.value1*100).to_i}%\\c[0]\n"
  472.     end
  473.     select_effects(item,22) do |e|
  474.       help += "\\c[#{UP}]解除:#{@states[e.data_id]} #{(e.value1 * 100).to_i}%\\c[0]\n"
  475.     end ; help
  476.   end
  477.   #--------------------------------------------------------------------------
  478.   # ● 获取技能物品特殊效果内容
  479.   #--------------------------------------------------------------------------
  480.   def self.special_flag(item)
  481.     help = ""
  482.     select_effects(item,41) {|e| help += "\\c[#{VIP}]特殊效果:撤退\\c[0]\n"}
  483.     select_effects(item,42) do |e|
  484.       help += "\\c[#{UP}]提升:#{@params[e.data_id]}#{e.value1.to_i}點\\c[0]\n"
  485.     end
  486.     select_effects(item,43) do |e|
  487.       help += "\\c[#{VIP}]學會:#{$data_skills[e.data_id].name}\\c[0]\n"
  488.     end ; help
  489.   end
  490.   #--------------------------------------------------------------------------
  491.   # ● 获取装备特性能力值
  492.   #--------------------------------------------------------------------------
  493.   def self.features_param(equip)
  494.     help = ""
  495.     equip.features.each do |f|
  496.       value = "#{f.value < 0 ? "﹣" : "﹢"}#{(f.value.abs*100).to_i}%\\c[0]"
  497.       params = case f.code
  498.       when 21 then @params[f.data_id]
  499.       when 22,23 then XPARAM[f.data_id]
  500.       else ; next ; end
  501.       help += "\\c[#{f.value < 0 ? DOWN : UP}]#{params}#{value}\n"
  502.     end ; help
  503.   end
  504.   #--------------------------------------------------------------------------
  505.   # ● 获取装备状态抗性
  506.   #--------------------------------------------------------------------------
  507.   def self.features_rate(equip)
  508.     help = ""
  509.     equip.features.each do |f|
  510.       name,value = "#{CODE[f.code]}:","#{(f.value*100).to_i}%\\c[0]"
  511.       params = case f.code
  512.       when 11 then @elements[f.data_id]
  513.       when 12 then @params[f.data_id]
  514.       when 13 then @states[f.data_id]
  515.       when 14
  516.         help += "\\c[#{VIP}]#{name}#{@states[f.data_id]}\\c[0]\n" ; next
  517.       else ; next ; end
  518.       help += "\\c[#{UP}]#{name}#{params}×#{value}\\c[0]\n"
  519.     end ; help
  520.   end
  521.   #--------------------------------------------------------------------------
  522.   # ● 获取装备附加状态攻击效果
  523.   #--------------------------------------------------------------------------
  524.   def self.state_attack(equip)
  525.     help = ""
  526.     equip.features.each do |f|
  527.       text = case f.code
  528.       when 31 then "#{@elements[f.data_id]}"
  529.       when 32 then "#{@states[f.data_id]}#{(f.value * 100).to_i}%"
  530.       when 34 then help += "\\c[#{UP}]#{CODE[f.code]}:#{f.value}\\c[0]\n" ; next
  531.       when 33 then color = f.value > 0 ? UP : DOWN
  532.         help += "\\c[#{color}]#{CODE[f.code]}:#{f.value}\\c[0]\n" ; next
  533.       else ; next ; end
  534.       help += "\\c[#{UP}]#{CODE[f.code]}:#{text}\\c[0]\n"
  535.     end ; help
  536.   end
  537.   #--------------------------------------------------------------------------
  538.   # ● 获取装备附加装备效果技能
  539.   #--------------------------------------------------------------------------
  540.   def self.equip_skill(equip)
  541.     help = ""
  542.     if $VIPArcherScript[:slot_type]       # require 装备风格扩展 by VIPArcher
  543.       equip.note.split(/[\r\n]+/).each do |line|
  544.         help += line =~ /<fix_equips\s*[:](\d+)>/i ?
  545.         "\\c[#{DOWN}]#{CODE[53]}:#{Vocab.etype($1.to_i)}\\c[0]\n" : ""
  546.         help += line =~ /<seal_equips\s*[:](\d+)>/i ?
  547.         "\\c[#{DOWN}]#{CODE[54]}:#{Vocab.etype($1.to_i)}\\c[0]\n" : ""
  548.       end
  549.     end
  550.     equip.features.each do |f|
  551.       text = case f.code
  552.       when 41,42 then "#{CODE[f.code]}:#{@skill_types[f.data_id]}"
  553.       when 43,44 then "#{CODE[f.code]}:#{$data_skills[f.data_id].name}"
  554.       when 51
  555.         help += "\\c[#{UP}]#{CODE[f.code]}:#{@weapon_types[f.data_id]}\\c[0]\n" ; next
  556.       when 52
  557.         help += "\\c[#{UP}]#{CODE[f.code]}:#{@armor_types[f.data_id]}\\c[0]\n" ; next
  558.       when 53,54
  559.         help += "\\c[#{DOWN}]#{CODE[f.code]}:#{@etypes[f.data_id]}\\c[0]\n" ; next
  560.       else ; next ; end
  561.       help += "\\c[#{f.code % 2 == 0 ? DOWN : UP}]#{text}\\c[0]\n"
  562.     end ; help
  563.   end
  564.   #--------------------------------------------------------------------------
  565.   # ● 获取装备标志和队伍能力
  566.   #--------------------------------------------------------------------------
  567.   def self.flag_ability(equip)
  568.     help = ""
  569.     equip.features.each do |f|
  570.       flag_party = case f.code
  571.       when 61
  572.         help += "\\c[#{VIP}]#{CODE[f.code]}:#{(f.value * 100).to_i}%\\c[0]\n" ; next
  573.       when 62 then FLAG[f.data_id]
  574.       when 64 then PARTY_ABILITY[f.data_id]
  575.       else ; next ; end
  576.       help += "\\c[#{VIP}]#{CODE[f.code]}:#{flag_party}\\c[0]\n"
  577.     end ; help
  578.   end
  579.   #--------------------------------------------------------------------------
  580.   # ● 计算行数  有些字体的汉字和[字母,数字,符号]的宽度不同,
  581.   #             有可能会照成行数计算不对,尽量用宽度相同的字体吧
  582.   #--------------------------------------------------------------------------
  583.   def self.get_line(text,max_size)
  584.     xtext,line,text_new = [],0,""
  585.     text.each_line{|x| text_new += x.gsub(/\\\S\[\d+\]/i){}} #去掉控制符
  586.     text_new.each_line{|x| xtext.push x.gsub(/\n/){}} #去掉换行符
  587.     xtext.each{|x| line += (x.size / (max_size.to_f + 1).to_i) + 1}
  588.     line
  589.   end
  590. end
  591. #==============================================================================
  592. # ■ Window_Help_Ex
  593. #------------------------------------------------------------------------------
  594. #  加强显示特技和物品等的说明
  595. #==============================================================================
  596. class Window_Help_Ex < Window_Help
  597.   include VIPArcher
  598.   #--------------------------------------------------------------------------
  599.   # ● 初始化对象
  600.   #--------------------------------------------------------------------------
  601.   def initialize(viewport)
  602.     super(0) ; self.viewport ,self.width ,self.height = viewport ,210 ,0
  603.     contents.font.size ,self.z ,[url=home.php?mod=space&uid=134219]@Time[/url] = 14 ,150 ,0
  604.   end
  605.   #--------------------------------------------------------------------------
  606.   # ● ***********计算窗口显示指定行数时的应用高度(适应字体大小)***********
  607.   #--------------------------------------------------------------------------
  608.   def fitting_height_vip(line_number)
  609.     line_number * contents.font.size + standard_padding * 2
  610.   end
  611.   #--------------------------------------------------------------------------
  612.   # ● 绘制带有控制符的文本内容
  613.   #   如果传递了width参数的话,会自动换行
  614.   #   draw_text_ex的增强,使其可以自动换行  原作者:叶子 修改:wyongcan
  615.   #--------------------------------------------------------------------------
  616.   def draw_text_ex(x, y, text, width = nil,text_width = nil,normalfont = true)
  617.     reset_font_settings if normalfont == true
  618.     text = convert_escape_characters(text)
  619.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  620.     unless width.nil?
  621.       pos[:height],pos[:width],pos[:text_width] = contents.font.size,width,text_width
  622.     end
  623.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  624.   end
  625.   #--------------------------------------------------------------------------
  626.   # ● 文字的处理
  627.   #     c    : 文字
  628.   #     text : 绘制处理中的字符串缓存(字符串可能会被修改)
  629.   #     pos  : 绘制位置 {:x, :y, :new_x, :height}
  630.   #--------------------------------------------------------------------------
  631.   def process_character(c, text, pos)
  632.     super(c, text, pos)
  633.     text_width = pos[:text_width].nil? ? text_size(c).width : pos[:text_width]
  634.     process_new_line(text, pos) if pos[:width] != nil &&
  635.     pos[:x] - pos[:new_x] + text_width > pos[:width]
  636.   end
  637.   #--------------------------------------------------------------------------
  638.   # ● 处理换行文字
  639.   #--------------------------------------------------------------------------
  640.   def process_new_line(text, pos)
  641.     super(text, pos)
  642.     pos[:height] = contents.font.size unless pos[:width].nil?
  643.   end
  644.   #--------------------------------------------------------------------------
  645.   # ● 设置内容
  646.   #--------------------------------------------------------------------------
  647.   def set_text(text)
  648.     @text = text if text != @text
  649.   end
  650.   #--------------------------------------------------------------------------
  651.   # ● 更新帮助位置
  652.   #--------------------------------------------------------------------------
  653.   def uppos(index,rect,window)
  654.     self.height = fitting_height_vip(Help_Ex.get_line(@text,13))
  655.     create_contents
  656.     contents.font.name,contents.font.size = Help_Ex::Font_Name,Help_Ex::Font_Size
  657.     rect.x -= window.ox ; rect.y -= window.oy
  658.     ax = rect.x + rect.width + 10
  659.     ax = rect.x - self.width + 10 if ax + self.width > window.width + 10
  660.     ax = 0 if ax < 0 ; ay = rect.y + rect.height
  661.     ay = rect.y - self.height if ay + self.height > window.height
  662.     ax += window.x ; ay += window.y
  663.     ay = 0 if ay < 0 ; self.show
  664.     self.x , self.y , self.openness, @time = ax , ay , 0 , Help_Ex::TIME
  665.     refresh
  666.   end
  667.   #--------------------------------------------------------------------------
  668.   # ● 设置物品
  669.   #     item : 技能、物品等
  670.   #--------------------------------------------------------------------------
  671.   def set_item(item)
  672.     return self.hide unless item ; text = ""
  673.     text += if item.is_a?(RPG::EquipItem) then Help_Ex.get_equip_help(item)
  674.     else ; Help_Ex.get_item_help(item) ; end
  675.     text = text[0,text.size - 2] if text[text.size - 2,2] == "\n"
  676.     set_text(text)
  677.   end
  678.   #--------------------------------------------------------------------------
  679.   # ● 刷新
  680.   #--------------------------------------------------------------------------
  681.   def refresh
  682.     contents.clear
  683.     self.hide if @text == ""
  684.     draw_text_ex(4, 0, @text,width,40,false)
  685.   end
  686.   #--------------------------------------------------------------------------
  687.   # ● 更新画面
  688.   #--------------------------------------------------------------------------
  689.   def update
  690.     super ; @time -= 1 if @time > 0 ; self.open if @time == 0
  691.   end
  692. end
  693. #==============================================================================
  694. # ■ 设置帮助增强窗口
  695. #==============================================================================
  696. class Window_Selectable < Window_Base
  697.   attr_reader   :help_ex_window
  698.   #--------------------------------------------------------------------------
  699.   # ● 调用帮助窗口的更新方法
  700.   #--------------------------------------------------------------------------
  701.   alias help_ex_call_update_help call_update_help
  702.   def call_update_help
  703.     help_ex_call_update_help ; update_ex_help if active && @help_ex_window
  704.   end
  705.   #--------------------------------------------------------------------------
  706.   # ● 更新帮助内容
  707.   #--------------------------------------------------------------------------
  708.   def update_ex_help
  709.     @help_ex_window.set_item(item) if @help_ex_window
  710.     @help_ex_window.uppos(index,item_rect(index),self) if index != -1 && item
  711.   end
  712.   #--------------------------------------------------------------------------
  713.   # ● 设置帮助增强窗口
  714.   #--------------------------------------------------------------------------
  715.   def help_ex_window=(help_ex_window)
  716.     @help_ex_window = help_ex_window
  717.   end
  718. end
  719. #==============================================================================
  720. # ■ 在各场景处理帮助窗口
  721. #==============================================================================
  722. class Scene_Base
  723.   #--------------------------------------------------------------------------
  724.   # ● 用來消除下方說明窗口用
  725.   #--------------------------------------------------------------------------
  726.   def clean
  727.     @help_ex_window.hide if @help_ex_window
  728.   end
  729.   #--------------------------------------------------------------------------
  730.   # ● 生成帮助增强窗口
  731.   #--------------------------------------------------------------------------
  732.   def create_help_ex
  733.     @help_ex_window  = Window_Help_Ex.new(@viewport)
  734.     @item_window.help_ex_window  = @help_ex_window if @item_window
  735.     @slot_window.help_ex_window  = @help_ex_window if @slot_window
  736.     @skill_window.help_ex_window = @help_ex_window if @skill_window
  737.     @buy_window.help_ex_window   = @help_ex_window if @buy_window
  738.     @sell_window.help_ex_window  = @help_ex_window if @sell_window
  739.   end
  740. end
  741. #道具栏
  742. class Scene_Item < Scene_ItemBase
  743.   #--------------------------------------------------------------------------
  744.   # ● 开始处理
  745.   #--------------------------------------------------------------------------
  746.   alias help_ex_start start
  747.   def start
  748.     help_ex_start ; create_help_ex
  749.   end
  750.   #--------------------------------------------------------------------------
  751.   # ● 物品“取消”
  752.   #--------------------------------------------------------------------------
  753.   alias help_ex_on_item_cancel on_item_cancel
  754.   def on_item_cancel
  755.     help_ex_on_item_cancel ; @help_ex_window.hide
  756.   end
  757. end
  758. #装备栏
  759. class Scene_Equip < Scene_MenuBase
  760.   #--------------------------------------------------------------------------
  761.   # ● 开始处理
  762.   #--------------------------------------------------------------------------
  763.   alias help_ex_start start
  764.   def start
  765.     help_ex_start ; create_help_ex
  766.   end
  767.   #--------------------------------------------------------------------------
  768.   # ● 装备栏“取消”
  769.   #--------------------------------------------------------------------------
  770.   alias help_ex_on_slot_cancel on_slot_cancel
  771.   def on_slot_cancel
  772.     help_ex_on_slot_cancel ; @help_ex_window.hide
  773.   end
  774. end
  775. #技能栏
  776. class Scene_Skill < Scene_ItemBase
  777.   #--------------------------------------------------------------------------
  778.   # ● 开始处理
  779.   #--------------------------------------------------------------------------
  780.   alias help_ex_start start
  781.   def start
  782.     help_ex_start ; create_help_ex
  783.   end
  784.   #--------------------------------------------------------------------------
  785.   # ● 物品“确定”
  786.   #--------------------------------------------------------------------------
  787.   alias help_ex_on_item_ok on_item_ok
  788.   def on_item_ok
  789.     help_ex_on_item_ok ; @help_ex_window.hide
  790.   end
  791.   #--------------------------------------------------------------------------
  792.   # ● 物品“取消”
  793.   #--------------------------------------------------------------------------
  794.   alias help_ex_on_item_cancel on_item_cancel
  795.   def on_item_cancel
  796.     help_ex_on_item_cancel ; @help_ex_window.hide
  797.   end
  798. end
  799. #战斗界面
  800. class Scene_Battle < Scene_Base
  801.   #--------------------------------------------------------------------------
  802.   # ● 开始处理
  803.   #--------------------------------------------------------------------------
  804.   alias help_ex_start start
  805.   def start
  806.     help_ex_start ; create_help_ex
  807.   end
  808.   #--------------------------------------------------------------------------
  809.   # ● 技能“确定”
  810.   #--------------------------------------------------------------------------
  811.   alias help_ex_on_skill_ok on_skill_ok
  812.   def on_skill_ok
  813.     help_ex_on_skill_ok ; @help_ex_window.hide
  814.   end
  815.   #--------------------------------------------------------------------------
  816.   # ● 技能“取消”
  817.   #--------------------------------------------------------------------------
  818.   alias help_ex_on_skill_cancel on_skill_cancel
  819.   def on_skill_cancel
  820.     help_ex_on_skill_cancel ; @help_ex_window.hide
  821.   end
  822.   #--------------------------------------------------------------------------
  823.   # ● 物品“确定”
  824.   #--------------------------------------------------------------------------
  825.   alias help_ex_on_item_ok on_item_ok
  826.   def on_item_ok
  827.     help_ex_on_item_ok ; @help_ex_window.hide
  828.   end
  829.   #--------------------------------------------------------------------------
  830.   # ● 物品“取消”
  831.   #--------------------------------------------------------------------------
  832.   alias help_ex_on_item_cancel on_item_cancel
  833.   def on_item_cancel
  834.     help_ex_on_item_cancel ; @help_ex_window.hide
  835.   end
  836. end
  837. #商店界面
  838. class Scene_Shop < Scene_MenuBase
  839.   #--------------------------------------------------------------------------
  840.   # ● 开始处理
  841.   #--------------------------------------------------------------------------
  842.   alias help_ex_start start
  843.   def start
  844.     help_ex_start ; create_help_ex
  845.   end
  846.   #--------------------------------------------------------------------------
  847.   # ● 买入“确定”
  848.   #--------------------------------------------------------------------------
  849.   alias help_ex_on_buy_ok on_buy_ok
  850.   def on_buy_ok
  851.     help_ex_on_buy_ok ; @help_ex_window.hide
  852.   end
  853.   #--------------------------------------------------------------------------
  854.   # ● 买入“取消”
  855.   #--------------------------------------------------------------------------
  856.   alias help_ex_on_buy_cancel on_buy_cancel
  857.   def on_buy_cancel
  858.     help_ex_on_buy_cancel ; @help_ex_window.hide
  859.   end
  860.   #--------------------------------------------------------------------------
  861.   # ● 卖出“确定”
  862.   #--------------------------------------------------------------------------
  863.   alias help_ex_on_sell_ok on_sell_ok
  864.   def on_sell_ok
  865.     help_ex_on_sell_ok ; @help_ex_window.hide
  866.   end
  867.   #--------------------------------------------------------------------------
  868.   # ● 卖出“取消”
  869.   #--------------------------------------------------------------------------
  870.   alias help_ex_on_sell_cancel on_sell_cancel
  871.   def on_sell_cancel
  872.     help_ex_on_sell_cancel ; @help_ex_window.hide
  873.   end
  874. end
  875. #==============================================================================
  876. # ★ 脚本顺序检查 ★
  877. #==============================================================================
  878. msgbox "物品描绘颜色脚本需置于物品帮助增强脚本之下" if $VIPArcherScript[:itemcolor] &&
  879.   $VIPArcherScript[:help_ex] > $VIPArcherScript[:itemcolor]
  880. msgbox "队伍掉率扩展脚本需置于物品帮助增强脚本之下" if $VIPArcherScript[:exdrop_rate] &&
  881.   $VIPArcherScript[:help_ex] > $VIPArcherScript[:exdrop_rate]
  882. msgbox "装备风格扩展脚本需置于物品帮助增强脚本之下" if $VIPArcherScript[:slot_type] &&
  883.   $VIPArcherScript[:help_ex] > $VIPArcherScript[:slot_type]
  884. msgbox "队伍负重脚本需置于物品帮助增强脚本之下" if $VIPArcherScript[:load] &&
  885.   $VIPArcherScript[:help_ex] > $VIPArcherScript[:load]
复制代码

点评

你的腳本也是因為這樣被加料所以導致錯誤,可以試試看  发表于 2016-8-20 13:35
似乎是66RPG本身的問題,代碼上傳後給你加點料....沒關係 ,603改成 contents.font.size ,self.z ,@time = 14 ,150 ,0  发表于 2016-8-20 13:34
谢谢啦,可是提示603行 报错了- -  发表于 2016-8-19 23:04
這裡就不幫忙改成簡體囉,當初簡轉繁超累人的- =  发表于 2016-8-17 21:22
duzine 发表于 2016-8-17 21:04:06
你這腳本有問題哦
310行多了奇怪的東西
還有去掉之後,394行又發生了錯誤
我來用我的版本試試看好了
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2025-7-19 18:38

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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