查看: 2979|回复: 2

[已经解决] 【结贴】未知脚本冲突

[复制链接]
梦石
0
星屑
1461
在线时间
815 小时
注册时间
2013-8-3
回帖
355
发表于 2017-5-22 18:17:07 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 小小西 于 2017-5-27 23:37 编辑

强化系统选择装备时物品属性介绍没有弹出,帮忙看看什么情况。{:2_253:}
物品属性介绍
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ 技能物品说明增强 蓝本:wyongcan
  4. # 修改 :VIPArcher
  5. #
  6. # 改动说明:
  7. # 改用新的帮助窗口和新定义draw_text_vip方法来增强兼容性
  8. # 更改初始化数据时机以支持跳过标题
  9. # 追加对普通物品和技能的说明内容
  10. # 修改了对帮助窗口行数的计算以支持控制符
  11. # 加上了各种颜色的设置,具体更高级的玩法自己领悟吧
  12. # 改成光标不动一段时间后才会出现帮助窗口
  13. #
  14. #  -- 本脚本来自 [url]https://rpg.blue[/url] 使用或转载请保留以上信息。
  15. #==============================================================================
  16. $VIPArcherScript ||= {};$VIPArcherScript[:help_ex] = 20141007
  17. $VIPArcherScript[:equip_limit] = false #是否使用了后知后觉的装备能力限制
  18. class << DataManager
  19.   alias_method :vip_load_database, :load_database
  20.   #--------------------------------------------------------------------------
  21.   # ● 读取数据库
  22.   #--------------------------------------------------------------------------
  23.   def load_database
  24.     vip_load_database
  25.     VIPArcher::Equipplus.equiphelpready
  26.   end
  27. end
  28. module VIPArcher;end
  29. module VIPArcher::Equipplus
  30.   TIME = 3 #帮助窗口自动出现的时间(单位帧
  31.   Font_Name = Font.default_name # 推荐"微软雅黑"
  32.   Font_Size = 18                # "微软雅黑"的话就20号字体
  33.   UP   = 24 #能力值提升颜色编号
  34.   DOWN = 25 #能力值下降颜色编号
  35.   VIP  = 14 #特殊能力颜色编号
  36.   MP   = 23
  37.   TP   = 29
  38.   CODE ={
  39.     11 => "属性抗性",
  40.     12 => "弱化抗性",
  41.     13 => "状态抗性",
  42.     14 => "状态免疫",
  43.     21 => "普通能力",
  44.     22 => "添加能力",
  45.     23 => "特殊能力",
  46.     31 => "附加属性",
  47.     32 => "附加状态",
  48.     33 => "攻击速度",
  49.     34 => "添加攻击次数",
  50.     41 => "添加技能类型",
  51.     42 => "禁用技能类型",
  52.     43 => "添加技能",
  53.     44 => "禁用技能",
  54.     51 => "可用武器",
  55.     52 => "可用护甲",
  56.     53 => "固定装备",
  57.     54 => "禁用装备",
  58.     55 => "装备风格",
  59.     61 => "添加行动次数",
  60.     62 => "特殊标志",
  61.     63 => "消失效果",
  62.     64 => "队伍"}
  63.   #特殊标志
  64.   FLAG ={
  65.     0 => "自动战斗",
  66.     1 => "擅长防御",
  67.     2 => "保护弱者",
  68.     3 => "特技专注"}
  69.   #技能效果范围
  70.   SCOPE ={
  71.     0 => "无",
  72.     1 => "单个敌人",
  73.     2 => "全体敌人",
  74.     3 => "一个随机敌人",
  75.     4 => "两个随机敌人",
  76.     5 => "三个随机敌人",
  77.     6 => "四个随机敌人",
  78.     7 => "单个队友",
  79.     8 => "全体队友",
  80.     9 => "单个队友(战斗不能)",
  81.     10 => "全体队友(战斗不能)",
  82.     11 => "使用者" }
  83.   #技能命中类型
  84.   HIT ={
  85.     0 => "必定命中",
  86.     1 => "物理攻击",
  87.     2 => "魔法攻击"}
  88.   #使用限制
  89.   OCCASION ={
  90.     0 => "随时可用",
  91.     1 => "仅战斗中",
  92.     2 => "仅菜单中",
  93.     3 => "不能使用"}
  94.   #添加能力
  95.   XPARAM ={
  96.     0 => "物理命中率:",
  97.     1 => "物理闪避率:",
  98.     2 => "必杀几率:",
  99.     3 => "必杀闪避率:",
  100.     4 => "魔法闪避率:",
  101.     5 => "魔法反射率:",
  102.     6 => "物理反击率:",
  103.     7 => "HP逐渐恢复:",
  104.     8 => "MP逐渐恢复:",
  105.     9 => "SP逐渐增加:"}
  106.   #特殊能力
  107.   SPARAM ={
  108.     0 => "受到攻击率",
  109.     1 => "防御效果",
  110.     2 => "魔法恢复",
  111.     3 => "道具恢复",
  112.     4 => "MP消耗率",
  113.     5 => "SP获得率",
  114.     6 => "物理伤害加成",
  115.     7 => "魔法伤害加成",
  116.     8 => "地形伤害加成",
  117.     9 => "经验获得加成"}
  118.   #装备风格  require 装备风格扩展脚本
  119.   SLOT_TYPE ={
  120.     0 => "普通",
  121.     1 => "双持武器",
  122.     2 => "索爷三刀流",
  123.     3 => "NPC",
  124.     4 => "233",
  125.     5 => "论坛@的BUG好烦啊"}
  126.   #队伍能力
  127.   PARTY_ABILITY ={
  128.     0 => "遇敌几率减半",
  129.     1 => "随机遇敌无效",
  130.     2 => "敌人偷袭无效",
  131.     3 => "先制攻击提高",
  132.     4 => "获得金钱加倍",
  133.     5 => "掉落几率加倍"}
  134.   #伤害类型
  135.   DAMAGE_TYPE = {
  136.     0 => "无",
  137.     1 => "属性伤害",
  138.     2 => "属性伤害",
  139.     3 => "HP值恢复",
  140.     4 => "MP值恢复",
  141.     5 => "HP值吸收",
  142.     6 => "MP值吸收"}
  143.   #普通能力
  144.   #这只是个示范,你也可以依照个人喜好对这些用语添加颜色控制符
  145.   @params ={
  146.     0 => "\\c[17]最大HP",
  147.     1 => "\\c[16]最大MP",
  148.     2 => "\\c[20]攻击",
  149.     3 => "\\c[21]防御",
  150.     4 => "\\c[30]智慧",
  151.     5 => "\\c[31]精神",
  152.     6 => "\\c[14]速度",
  153.     7 => "\\c[17]幸运"}
  154.   #我举例技能类型的原因就是因为它 短
  155.   @skill_types = { # 这个和下面equiphelpready里注释掉的做的是一样的事
  156.                    # 只是下面是读取数据库添加用语,这里是手动枚举
  157.     1 => "\\c[1]特技",
  158.     2 => "\\c[2]魔法",
  159.     3 => "\\c[3]必杀",
  160.     4 => "\\c[5]卖萌"}
  161.   #初始化数据,当然如果你要用上面那样的控制符改变颜色的话
  162.   #欢迎枚举格式就是上面这样用Hash,用ID做键把用语对应起来
  163.   def self.equiphelpready
  164.     params = $data_system.terms.params
  165.     elements = $data_system.elements
  166.     weapon_types = $data_system.weapon_types
  167.     armor_types = $data_system.armor_types
  168.     etypes = $data_system.terms.etypes
  169.     skill_types = $data_system.skill_types
  170.     @states       ||= {}
  171.     @params       ||= {}
  172.     @weapon_types ||= {}
  173.     @armor_types  ||= {}
  174.     @etypes       ||= {}
  175.     @skill_types  ||= {}
  176.     @elements     ||= {}
  177.     skill_types.each_with_index{|x,y| @skill_types[y] = x if !x.nil?} if @skill_types == {}
  178.     $data_states.each{|x| @states[x.id] = x.name if !x.nil?} if @states == {}
  179.     elements.each_with_index{|x,y| @elements[y] = x if !x.nil?} if @elements == {}
  180.     weapon_types.each_with_index{|x,y| @weapon_types[y] = x if !x.nil?} if @weapon_types == {}
  181.     armor_types.each_with_index{|x,y| @armor_types[y] = x if !x.nil?} if @armor_types == {}
  182.     etypes.each_with_index{|x,y| @etypes[y] = x} if @etypes == {}
  183.     params.each_with_index{|x,y| @params[y] = x} if @params == {}
  184.   end
  185.   #获取装备帮助内容
  186.   def self.getequiphelp(equip)
  187.     help = ""
  188.     param = []
  189.     help += "\\c[16]装备位置:#{Vocab::etype(equip.etype_id)}\\c[0]\n"
  190.     if $VIPArcherScript[:equip_limit] #装备能力限制
  191.       help += "\\c[16]等级需求:#{equip.level_limit}\n" if equip.level_limit > 0
  192.       param_limit = []
  193.       for i in 0..7
  194.         if equip.params_limit(i) != 0
  195.           help += "\\c[16]#{@params[i]}需求:#{equip.params_limit(i)}\\c[0]\n"
  196.         end
  197.       end
  198.     end
  199.     equip.params.each_with_index{|x,y| param.push([@params[y],x])}
  200.     param = param.select{|x| x[1] != 0}
  201.     param.each{|x| help += "\\c[#{x[1]>0? UP : DOWN}]#{x[0]}:\\c[#{x[1]>0? UP : DOWN}]#{"﹢"if x[1]>0}#{x[1].to_int.to_s}\\c[0]\n"}
  202.     features = equip.features
  203.     featuresparam = []
  204.     featuresparam.push features.select{|x| x.code == 21}
  205.     featuresparam.push features.select{|x| x.code == 22}
  206.     featuresparam.push features.select{|x| x.code == 23}
  207.     featuresparam[0].each{|x| help += "\\c[#{x.value<0?DOWN: UP}]#{@params[x.data_id]}#{x.value<0?"﹣":" * "}#{(x.value.abs*100).to_i}%\n"}
  208.     featuresparam[1].each{|x| help += "\\c[#{x.value<0?DOWN: UP}]#{XPARAM[x.data_id]}#{x.value<0?"﹣":" * "}#{(x.value.abs*100).to_i}%\n"}
  209.     featuresparam[2].each{|x| help += "\\c[#{x.value<0?DOWN: UP}]#{SPARAM[x.data_id]}#{x.value<0?"﹣":" * "}#{(x.value.abs*100).to_i}%\n"}
  210.     if $VIPArcherScript[:slot_type]
  211.       help += "\\c[#{VIP}]#{CODE[55]}:#{SLOT_TYPE[$1.to_i]}\\c[0]\n" if equip.note =~ /<slot_type\s*[:](.*)>/i
  212.     else
  213.       features.select{|x| x.code == 55}.each{|x| help += "\\c[#{VIP}]#{CODE[x.code]}:双持武器\\c[0]\n"}
  214.     end
  215.     features.select{|x| x.code == 11}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@elements[x.data_id]}*#{(x.value*100).to_i}%\\c[0]\n"}
  216.     features.select{|x| x.code == 12}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@params[x.data_id]}*#{(x.value*100).to_i}%\\c[0]\n"}
  217.     features.select{|x| x.code == 13}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@states[x.data_id]}*#{(x.value*100).to_i}%\\c[0]\n"}
  218.     features.select{|x| x.code == 14}.each{|x| help += "\\c[#{VIP}]#{CODE[x.code]}:#{@states[x.data_id]}\\c[0]\n"}
  219.     features.select{|x| x.code == 31}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@elements[x.data_id]}\\c[0]\n"}
  220.     features.select{|x| x.code == 32}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@states[x.data_id]}#{(x.value*100).to_i}%\\c[0]\n"}
  221.     features.select{|x| x.code == 33}.each{|x| help += "\\c[#{x.value>0? UP : DOWN}]#{CODE[x.code]}:#{x.value}\\c[0]\n"}
  222.     features.select{|x| x.code == 34}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{x.value}\\c[0]\n"}
  223.     features.select{|x| x.code == 41}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@skill_types[x.data_id]}\\c[0]\n"}
  224.     features.select{|x| x.code == 42}.each{|x| help += "\\c[#{DOWN}]#{CODE[x.code]}:#{@skill_types[x.data_id]}\\c[0]\n"}
  225.     features.select{|x| x.code == 43}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{$data_skills[x.data_id].name}\\c[0]\n"}
  226.     features.select{|x| x.code == 44}.each{|x| help += "\\c[#{DOWN}]#{CODE[x.code]}:#{$data_skills[x.data_id].name}\\c[0]\n"}
  227.     features.select{|x| x.code == 51}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@weapon_types[x.data_id]}\\c[0]\n"}
  228.     features.select{|x| x.code == 52}.each{|x| help += "\\c[#{UP}]#{CODE[x.code]}:#{@armor_types[x.data_id]}\\c[0]\n"}
  229.     features.select{|x| x.code == 53}.each{|x| help += "\\c[#{DOWN}]#{CODE[x.code]}:#{@etypes[x.data_id]}\\c[0]\n"}
  230.     features.select{|x| x.code == 54}.each{|x| help += "\\c[#{DOWN}]#{CODE[x.code]}:#{@etypes[x.data_id]}\\c[0]\n"}
  231.     features.select{|x| x.code == 61}.each{|x| help += "\\c[#{VIP}]#{CODE[x.code]}:#{x.value}\\c[0]\n"}
  232.     features.select{|x| x.code == 62}.each{|x| help += "\\c[#{VIP}]#{CODE[x.code]}:#{FLAG[x.data_id]}\\c[0]\n"}
  233.     features.select{|x| x.code == 64}.each{|x| help += "\\c[#{VIP}]#{CODE[x.code]}:#{PARTY_ABILITY[x.data_id]}\\c[0]\n"}
  234.     help
  235.   end
  236.   #获取技能帮助内容
  237.   def self.getskillhelp(skill)
  238.     help = ""
  239.     effects = skill.effects
  240.     damage  = skill.damage
  241.     r = [skill.required_wtype_id1,skill.required_wtype_id2]
  242.     help += "\\c[16]消耗:\\c[#{MP}]MP:#{skill.mp_cost.to_s} \\c[#{TP}]SP:#{skill.tp_cost.to_s}\\c[0]\n" if skill.mp_cost > 0 && skill.tp_cost > 0
  243.     help += "\\c[16]消耗:\\c[#{MP}]MP:#{skill.mp_cost.to_s}\\c[0]\n" if skill.mp_cost > 0 && skill.tp_cost <= 0
  244.     help += "\\c[16]消耗:\\c[#{TP}]SP:#{skill.tp_cost.to_s}\\c[0]\n" if skill.tp_cost > 0 && skill.mp_cost <= 0
  245.     help += "\\c[#{skill.speed<0?DOWN: UP}]速度修正:#{skill.speed}\\c[0]\n" if skill.speed != 0
  246.     help += "\\c[#{DOWN}]成功率:#{skill.success_rate}%\\c[0]\n" if skill.success_rate != 100
  247.     help += "\\c[16]类型:#{HIT[skill.hit_type]}\\c[0]\n"
  248.     help += "\\c[16]效果:#{@elements[damage.element_id]}#{DAMAGE_TYPE[damage.type]}\\c[0]\n" if damage.type != 0
  249.     effects.select{|x| x.code == 31}.each{|x| help += "\\c[#{UP}]强化:#{@params[x.data_id]} #{x.value1.to_i}回合\\c[0]\n"}
  250.     effects.select{|x| x.code == 32}.each{|x| help += "\\c[#{UP}]弱化:#{@params[x.data_id]} #{x.value1.to_i}回合\\c[0]\n"}
  251.     effects.select{|x| x.code == 33}.each{|x| help += "\\c[#{UP}]解除:强化#{@params[x.data_id]}\n"}
  252.     effects.select{|x| x.code == 34}.each{|x| help += "\\c[#{UP}]解除:弱化#{@params[x.data_id]}\n"}
  253.     effects.select{|x| x.code == 22}.each{|x| help += "\\c[#{UP}]解除:#{@states[x.data_id]} #{(x.value1*100).to_i}%\\c[0]\n"}
  254.     effects.select{|x| x.code == 41}.each{|x| help += "\\c[#{VIP}]特殊效果:撤退\n"}
  255.     effects.select{|x| x.code == 42}.each{|x| help += "\\c[#{UP}]提升:#{@params[x.data_id]}#{x.value1.to_i}点\\c[0]\n"}
  256.     effects.select{|x| x.code == 43}.each{|x| help += "\\c[#{VIP}]学会:#{$data_skills[x.data_id].name}\\c[0]\n"}
  257.     help += "\\c[16]场合:#{OCCASION[skill.occasion]}\n"
  258.     help += "\\c[#{DOWN}]限制:#{$data_system.weapon_types[r[0]] if r[0] != 0} #{$data_system.weapon_types[r[1]] if r[1] != 0}\\c[0]\n" if r != [0,0]
  259.     help
  260.   end
  261.   #获取道具帮助内容
  262.   def self.getitemhelp(item)
  263.     help = ""
  264.     effects = item.effects
  265.     damage  = item.damage
  266.     help += "\\c[16]类型:\\c[#{VIP}]#{"贵重物品  "if item.itype_id != 1}\\c[#{DOWN}]#{item.consumable ? "消耗品":"非消耗品"}\\c[0]\n"
  267.     help += "\\c[16]效果:#{@elements[damage.element_id]}#{DAMAGE_TYPE[damage.type]}\\c[0]\n" if damage.type != 0
  268.     effects.select{|x| x.code == 31}.each{|x| help += "\\c[#{UP}]强化:#{@params[x.data_id]} #{x.value1.to_i}回合\\c[0]\n"}
  269.     effects.select{|x| x.code == 32}.each{|x| help += "\\c[#{UP}]弱化:#{@params[x.data_id]} #{x.value1.to_i}回合\\c[0]\n"}
  270.     effects.select{|x| x.code == 33}.each{|x| help += "\\c[#{UP}]解除:强化#{@params[x.data_id]}\\c[0]\n"}
  271.     effects.select{|x| x.code == 34}.each{|x| help += "\\c[#{UP}]解除:弱化#{@params[x.data_id]}\\c[0]\n"}
  272.     effects.select{|x| x.code == 22}.each{|x| help += "\\c[#{UP}]解除:#{@states[x.data_id]} #{(x.value1*100).to_i}%\\c[0]\n"}
  273.     effects.select{|x| x.code == 41}.each{|x| help += "\\c[#{VIP}]特殊效果:撤退\n"}
  274.     effects.select{|x| x.code == 42}.each{|x| help += "\\c[#{VIP}]提升:#{@params[x.data_id]}#{x.value1.to_i}点\\c[0]\n"}
  275.     effects.select{|x| x.code == 43}.each{|x| help += "\\c[#{VIP}]学会:#{$data_skills[x.data_id].name}\\c[0]\n"}
  276.     help += "\\c[16]场合:#{OCCASION[item.occasion]}\\c[0]\n"
  277.     help
  278.   end
  279.   #计算行数(有些字体的汉字和[字母,数字,符号]的宽度不同,
  280.   #有可能会照成行数计算不对,尽量用宽度相同的字体吧)
  281.   def self.getline(text,maxtext)
  282.     text_new = ""
  283.     xtext = []
  284.     line = 0
  285.     text.each_line{|x| text_new += x.gsub(/\\\S\[\d+\]/i){}} #去掉控制符
  286.     text_new.each_line{|x| xtext.push x.gsub(/\n/){}}        #去掉换行符
  287.     xtext.each{|x| line += (x.size / (maxtext.to_f + 1).to_i) + 1}
  288.     line
  289.   end
  290. end

  291. #==============================================================================
  292. # ■ Window_Help_Ex
  293. #------------------------------------------------------------------------------
  294. #  加强显示特技和物品等的说明
  295. #==============================================================================

  296. class Window_Help_Ex < Window_Base
  297.   include VIPArcher::Equipplus
  298.   #--------------------------------------------------------------------------
  299.   # ● 初始化对象
  300.   #--------------------------------------------------------------------------
  301.   def initialize(line_number = 0)
  302.     super(0, 0, 210, 0)
  303.     self.z = 150
  304.     contents.font.size = 18
  305.     [url=home.php?mod=space&uid=134219]@Time[/url] = 0
  306.   end
  307.   #--------------------------------------------------------------------------
  308.   # ● 设置内容
  309.   #--------------------------------------------------------------------------
  310.   def set_text(text)
  311.     @text = text
  312.     refresh
  313.   end
  314.   #--------------------------------------------------------------------------
  315.   # ● 清除
  316.   #--------------------------------------------------------------------------
  317.   def clear
  318.     set_text("")
  319.   end
  320.   #--------------------------------------------------------------------------
  321.   # ● 更新帮助位置
  322.   #--------------------------------------------------------------------------
  323.   def uppos(index,rect,window)
  324.     self.height = fitting_height_vip(VIPArcher::Equipplus.getline(@xtext,13))
  325.     create_contents
  326.     contents.font.name = Font_Name
  327.     contents.font.size = Font_Size
  328.     rect.x -= window.ox
  329.     rect.y -= window.oy
  330.     ax = rect.x + rect.width + 10
  331.     ax = rect.x - self.width + 10 if ax + self.width > window.width + 10
  332.     ax += window.x
  333.     ax = 0 if ax < 0
  334.     ay = rect.y + rect.height
  335.     ay = rect.y - self.height if ay + self.height > window.height
  336.     ay += window.y
  337.     ay = 0 if ay < 0
  338.     self.x = ax
  339.     self.y = ay + 12
  340.     set_text(@xtext)
  341.     @time = TIME
  342.     self.show
  343.     self.openness = 0
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ● 设置物品
  347.   #     item : 技能、物品等
  348.   #--------------------------------------------------------------------------
  349.   def set_item(item)
  350.     if item == nil
  351.       set_text("")
  352.       return
  353.     end
  354.     @xtext = ""
  355.     if $VIPArcherScript[:itemcolor] # require 物品描绘颜色脚本
  356.       @xtext = "\\c[16]名称:\\c[#{VIPArcher::ItemColor::Color_Lv[item.color]}]" +
  357.       "#{item.name}  #{item.color if item.color != 0}#{"★" if item.color != 0}\\c[0]\n"
  358.     else
  359.       @xtext = "\\c[16]名称:\\c[0]#{item.name}\n"
  360.     end
  361.     if $VIPArcherScript[:load]      # require 队伍负重脚本
  362.       @xtext += "\\c[16]售价:#{item.price} 重量:#{item.load}\\c[0]\n"
  363.     else
  364.       @xtext += item.price == 0 ? "\\c[16]售价:\\c[14]无法出售\\c[0]\n":"\\c[16]售价:#{item.price}\\c[0]\n"
  365.     end if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Item)
  366.     @xtext += VIPArcher::Equipplus.getequiphelp(item) if item.is_a?(RPG::EquipItem)
  367.     @xtext += VIPArcher::Equipplus.getskillhelp(item) if item.is_a?(RPG::Skill)
  368.     @xtext += VIPArcher::Equipplus.getitemhelp(item) if item.is_a?(RPG::Item)
  369.     if $VIPArcherScript[:exdrop_rate]   # require 队伍掉率扩展
  370.       @xtext += "\\c[#{$2.to_i > 0 ? UP : DOWN}]#{$1}掉率: #{$2}%\\c[0]\n" if
  371.       item.note =~ /<(\W+)掉率:\s*([0-9+.-]+)%>/i
  372.     end if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Skill)
  373.     @xtext = @xtext[0,@text.size - 2] if @xtext[@xtext.size - 2,2] == "\n"
  374.   end
  375.   #--------------------------------------------------------------------------
  376.   # ● 刷新
  377.   #--------------------------------------------------------------------------
  378.   def refresh
  379.     contents.clear
  380.     self.hide if @text == ""
  381.     draw_text_vip(4, 0, @text,width,40,false)
  382.   end
  383.   #--------------------------------------------------------------------------
  384.   # ● 更新画面
  385.   #--------------------------------------------------------------------------
  386.   def update
  387.     super
  388.     @time -= 1 if @time > 0
  389.     self.open if @time == 0
  390.   end
  391. end
  392. class Window_Base < Window
  393.   #--------------------------------------------------------------------------
  394.   # ● 计算窗口显示指定行数时的应用高度2*************************
  395.   #--------------------------------------------------------------------------
  396.   def fitting_height_vip(line_number)
  397.     line_number * contents.font.size + standard_padding * 2
  398.   end
  399.   # draw_text_ex的增强,使其可以自动换行  原作者:叶子 修改:wyongcan
  400.   #--------------------------------------------------------------------------
  401.   # ● 绘制带有控制符的文本内容
  402.   #   如果传递了width参数的话,会自动换行
  403.   #--------------------------------------------------------------------------
  404.   def draw_text_vip(x, y, text, width = nil,textwidth = nil,normalfont = true)
  405.     reset_font_settings if normalfont == true
  406.     text = convert_escape_characters(text)
  407.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  408.     if width != nil
  409.       pos[:height] = contents.font.size
  410.       pos[:width] = width
  411.       pos[:textwidth] = textwidth
  412.     end
  413.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  414.   end
  415.   #--------------------------------------------------------------------------
  416.   # ● 绘制分割线
  417.   #--------------------------------------------------------------------------
  418.   def draw_split_line(y,color=Color.new(254,215,0))
  419.     @window.bitmap.draw_line(padding,y,@window.bitmap.width-padding,y,color)
  420.   end
  421.   #--------------------------------------------------------------------------
  422.   # ● 文字的处理
  423.   #     c    : 文字
  424.   #     text : 绘制处理中的字符串缓存(字符串可能会被修改)
  425.   #     pos  : 绘制位置 {:x, :y, :new_x, :height}
  426.   #--------------------------------------------------------------------------
  427.   def process_character(c, text, pos)
  428.     case c
  429.     when "\r"   # 回车
  430.       return
  431.     when "\n"   # 换行
  432.       process_new_line(text, pos)
  433.     when "\f"   # 翻页
  434.       process_new_page(text, pos)
  435.     when "\e"   # 控制符
  436.       process_escape_character(obtain_escape_code(text), text, pos)
  437.     else        # 普通文字
  438.       pos[:textwidth] == nil ? text_width = text_size(c).width : text_width = pos[:textwidth]
  439.       if pos[:width] != nil && pos[:x] - pos[:new_x] + text_width > pos[:width]
  440.         process_new_line(text, pos)
  441.       end
  442.       process_normal_character(c, pos)
  443.     end
  444.   end
  445.   #--------------------------------------------------------------------------
  446.   # ● 处理换行文字
  447.   #--------------------------------------------------------------------------
  448.   alias vip_20141007_process_new_line process_new_line
  449.   def process_new_line(text, pos)
  450.     vip_20141007_process_new_line(text, pos)
  451.     pos[:height] = contents.font.size if pos[:width] != nil
  452.   end
  453. end

  454. #==============================================================================
  455. # ■ 设置帮助增强窗口
  456. #==============================================================================
  457. class Window_Selectable < Window_Base
  458.   attr_reader   :help_ex_window
  459.   #--------------------------------------------------------------------------
  460.   # ● 调用帮助窗口的更新方法
  461.   #--------------------------------------------------------------------------
  462.   alias help_ex_call_update_help call_update_help
  463.   def call_update_help
  464.     help_ex_call_update_help
  465.     update_ex_help if active && @help_ex_window
  466.   end
  467.   #--------------------------------------------------------------------------
  468.   # ● 更新帮助内容
  469.   #--------------------------------------------------------------------------
  470.   def update_ex_help
  471.     @help_ex_window.set_item(item) if @help_ex_window
  472.     if index != -1 && item != nil
  473.       @help_ex_window.uppos(index,item_rect(index),self)
  474.     end
  475.   end
  476.   #--------------------------------------------------------------------------
  477.   # ● 设置帮助增强窗口
  478.   #--------------------------------------------------------------------------
  479.   def help_ex_window=(help_ex_window)
  480.     @help_ex_window = help_ex_window
  481.   end
  482. end
  483. #==============================================================================
  484. # ■ 在各场景处理帮助窗口
  485. #==============================================================================
  486. class Scene_Base
  487.   #--------------------------------------------------------------------------
  488.   # ● 生成帮助增强窗口
  489.   #--------------------------------------------------------------------------
  490.   def create_help_ex
  491.     @help_ex_window  = Window_Help_Ex.new
  492.     @help_ex_window .viewport = @viewport
  493.     @item_window.help_ex_window  = @help_ex_window if @item_window
  494.     @slot_window.help_ex_window  = @help_ex_window if @slot_window
  495.     @skill_window.help_ex_window = @help_ex_window if @skill_window
  496.     @buy_window.help_ex_window   = @help_ex_window if @buy_window
  497.     @sell_window.help_ex_window  = @help_ex_window if @sell_window
  498.   end
  499. end
  500. #道具栏
  501. class Scene_Item < Scene_ItemBase
  502.   #--------------------------------------------------------------------------
  503.   # ● 开始处理
  504.   #--------------------------------------------------------------------------
  505.   alias help_ex_start start
  506.   def start
  507.     help_ex_start
  508.     create_help_ex
  509.   end
  510.   #--------------------------------------------------------------------------
  511.   # ● 物品“取消”
  512.   #--------------------------------------------------------------------------
  513.   alias help_ex_on_item_cancel on_item_cancel
  514.   def on_item_cancel
  515.     help_ex_on_item_cancel
  516.     @help_ex_window.hide
  517.   end
  518. end
  519. #装备栏
  520. class Scene_Equip < Scene_MenuBase
  521.   #--------------------------------------------------------------------------
  522.   # ● 开始处理
  523.   #--------------------------------------------------------------------------
  524.   alias help_ex_start start
  525.   def start
  526.     help_ex_start
  527.     create_help_ex
  528.   end
  529.   #--------------------------------------------------------------------------
  530.   # ● 装备栏“取消”
  531.   #--------------------------------------------------------------------------
  532.   alias help_ex_on_slot_cancel on_slot_cancel
  533.   def on_slot_cancel
  534.     help_ex_on_slot_cancel
  535.     @help_ex_window.hide
  536.   end
  537. end
  538. #技能栏
  539. class Scene_Skill < Scene_ItemBase
  540.   #--------------------------------------------------------------------------
  541.   # ● 开始处理
  542.   #--------------------------------------------------------------------------
  543.   alias help_ex_start start
  544.   def start
  545.     help_ex_start
  546.     create_help_ex
  547.   end
  548.   #--------------------------------------------------------------------------
  549.   # ● 物品“确定”
  550.   #--------------------------------------------------------------------------
  551.   alias help_ex_on_item_ok on_item_ok
  552.   def on_item_ok
  553.     help_ex_on_item_ok
  554.     @help_ex_window.hide
  555.   end
  556.   #--------------------------------------------------------------------------
  557.   # ● 物品“取消”
  558.   #--------------------------------------------------------------------------
  559.   alias help_ex_on_item_cancel on_item_cancel
  560.   def on_item_cancel
  561.     help_ex_on_item_cancel
  562.     @help_ex_window.hide
  563.   end
  564. end
  565. #战斗界面
  566. class Scene_Battle < Scene_Base
  567.   #--------------------------------------------------------------------------
  568.   # ● 开始处理
  569.   #--------------------------------------------------------------------------
  570.   alias help_ex_start start
  571.   def start
  572.     help_ex_start
  573.     create_help_ex
  574.   end
  575.   #--------------------------------------------------------------------------
  576.   # ● 技能“确定”
  577.   #--------------------------------------------------------------------------
  578.   alias help_ex_on_skill_ok on_skill_ok
  579.   def on_skill_ok
  580.     help_ex_on_skill_ok
  581.     @help_ex_window.hide
  582.   end
  583.   #--------------------------------------------------------------------------
  584.   # ● 技能“取消”
  585.   #--------------------------------------------------------------------------
  586.   alias help_ex_on_skill_cancel on_skill_cancel
  587.   def on_skill_cancel
  588.     help_ex_on_skill_cancel
  589.     @help_ex_window.hide
  590.   end
  591.   #--------------------------------------------------------------------------
  592.   # ● 物品“确定”
  593.   #--------------------------------------------------------------------------
  594.   alias help_ex_on_item_ok on_item_ok
  595.   def on_item_ok
  596.     help_ex_on_item_ok
  597.     @help_ex_window.hide
  598.   end
  599.   #--------------------------------------------------------------------------
  600.   # ● 物品“取消”
  601.   #--------------------------------------------------------------------------
  602.   alias help_ex_on_item_cancel on_item_cancel
  603.   def on_item_cancel
  604.     help_ex_on_item_cancel
  605.     @help_ex_window.hide
  606.   end
  607. end
  608. #商店界面
  609. class Scene_Shop < Scene_MenuBase
  610.   #--------------------------------------------------------------------------
  611.   # ● 开始处理
  612.   #--------------------------------------------------------------------------
  613.   alias help_ex_start start
  614.   def start
  615.     help_ex_start
  616.     create_help_ex
  617.   end
  618.   #--------------------------------------------------------------------------
  619.   # ● 买入“确定”
  620.   #--------------------------------------------------------------------------
  621.   alias help_ex_on_buy_ok on_buy_ok
  622.   def on_buy_ok
  623.     help_ex_on_buy_ok
  624.     @help_ex_window.hide
  625.   end
  626.   #--------------------------------------------------------------------------
  627.   # ● 买入“取消”
  628.   #--------------------------------------------------------------------------
  629.   alias help_ex_on_buy_cancel on_buy_cancel
  630.   def on_buy_cancel
  631.     help_ex_on_buy_cancel
  632.     @help_ex_window.hide
  633.   end
  634.   #--------------------------------------------------------------------------
  635.   # ● 卖出“确定”
  636.   #--------------------------------------------------------------------------
  637.   alias help_ex_on_sell_ok on_sell_ok
  638.   def on_sell_ok
  639.     help_ex_on_sell_ok
  640.     @help_ex_window.hide
  641.   end
  642.   #--------------------------------------------------------------------------
  643.   # ● 卖出“取消”
  644.   #--------------------------------------------------------------------------
  645.   alias help_ex_on_sell_cancel on_sell_cancel
  646.   def on_sell_cancel
  647.     help_ex_on_sell_cancel
  648.     @help_ex_window.hide
  649.   end
  650.   end
复制代码

装备强化
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ 装备强化系统 By wyongcan
  4. #===========================================$game_party===================================
  5. module Equipplus
  6. #升到各级时装备颜色请在“颜色描绘”脚本中修改
  7. $maxlv = 10  #最高升到的级数
  8. $gailv = [100,90,80,70,60,50,40,30,20,10] #每级提升概率
  9. $gemlv = [[5,442],[10,443],[15,444],[20,445],[25,446],[30,447],[35,448],[40,449],[45,450],[50,451]] #使用宝石提高的几率  [提高几率,宝石ID]
  10. $uplv = [[2,437],[4,438],[6,439],[8,440],[10,441]] #强化所需要的强化石 [最大强化到的等级,强化石ID]
  11. $xxlv = [0,5,10,15,20,25,30,35,40,50] #每级强化后失败物品消失的几率
  12. $jjlv = [0,10,20,30,40,50,60,70,80,90] #每级强化后失败物品降级的几率
  13. $tsnl = [10,11,12,13,14,15,16,17,18,19] #每级强化提升能力的百分比
  14. $tswp = [221,452] # 意思是:如果有31号物品则失败后物品不消失,如果有32号物品则失败后物品不降级
  15. #武器强化后的计算公式为: 原攻击 * (1 + 提升能力百分比) + (0到当前强化级数随机) * 5 + 当前强化级数
  16. $gemlv.sort!
  17. $uplv.sort!
  18. $当前使用宝石id = 0
  19. $当前使用宝石加成率 = 0
  20. $强化哈希表 = {
  21. "最高等级" => $maxlv ,
  22. "每级概率" => $gailv ,
  23. "宝石效果" => $gemlv ,
  24. "消失几率" => $xxlv  ,
  25. "降级几率" => $jjlv  ,
  26. "提升能力" => $tsnl  ,
  27. "特殊物品" => $tswp  ,
  28. "强化材料" => $uplv  }
  29. def self.idlostitem(id,amount = 1)
  30.   $game_party.lose_item(idgetitem(id),amount)
  31. end

  32. def self.idlostequip(id,weapon = true,amount = 1)
  33.   weapon == true ? $game_party.lose_item($data_weapons[id],amount,true) : $game_party.lose_item($data_armors[id],amount,true)
  34. end

  35. def self.idgainequip(id,weapon = true,amount = 1)
  36.   weapon == true ? $game_party.gain_item($data_weapons[id],amount,true) : $game_party.gain_item($data_armors[id],amount,true)
  37. end

  38. def self.idgetitem(id)
  39.   $data_items[id]
  40. end

  41. def self.equipable?(id,weapon = true)
  42.   weapon == true ? weaponupisnil(id) : armorupisnil(id)
  43.   weapon == true ? equip = $data_weapons[id].dup : equip = $data_armors[id].dup
  44.   price = equip.price
  45.   @needmoney = price * equip.up
  46.   if @needmoney == 0
  47.     @needmoney = price / 2
  48.   end
  49. #循环取出需要的强化材料
  50.   temp = false
  51.   for i in $强化哈希表["强化材料"]
  52.     if equip.up < i[0]
  53.       @lostitem = idgetitem i[1]
  54.       $game_party.has_item?(idgetitem(i[1])) ? temp = true : temp = false
  55.       break
  56.     end
  57.   end
  58.   $game_party.gold >= @needmoney && temp == true ? true : false
  59. end

  60. def self.upweapon (id)
  61.   $message = ""
  62.   success = false
  63.   weaponupisnil(id)
  64.   weapon = $data_weapons[id].dup
  65.   gl = 0
  66.   fangb = false
  67.   fangj = false
  68.   return unless weapon.up < $强化哈希表["最高等级"] && weaponupable?(id)
  69.   loststh
  70.   $message += "本次强化,共消耗:" + Vocab::currency_unit + " " + @needmoney.to_s
  71.   $message += " " + @lostitem.name + "\n "
  72.   gl = $强化哈希表["每级概率"][weapon.up]
  73.   if $usegem == true
  74.     gl += $当前使用宝石加成率
  75.     idlostitem($当前使用宝石id)
  76.     $message += idgetitem($当前使用宝石id).name + " "
  77.   end
  78.   if $fangb == true
  79.     fangb = true
  80.     idlostitem $强化哈希表["特殊物品"][0]
  81.     $message += idgetitem($强化哈希表["特殊物品"][0]).name + " "
  82.   end
  83.   if $fangj == true
  84.     fangj = true
  85.     idlostitem $强化哈希表["特殊物品"][1]
  86.     $message += idgetitem($强化哈希表["特殊物品"][1]).name + " "
  87.   end
  88.   suiji = rand (100)
  89.   if suiji <= gl
  90.     success = true
  91.   end
  92.   $message += "\n强化结果:"
  93.   if success == true
  94.     $message += "强化成功"
  95.     idlostequip id
  96.     weapon.id = $data_weapons.size
  97.     params = weapon.params.dup
  98.     params[2] *= 1 + $强化哈希表["提升能力"][weapon.up] / 100
  99.     params[2] += rand(weapon.up) * 5 + weapon.up
  100.     params[2] += 1 if params[2] == weapon.params[2]
  101.     $message += " 攻击力提升:" + (params[2] - weapon.params[2]).to_int.to_s
  102.     weapon.up += 1
  103.     $data_weapons.insert $data_weapons.size,weapon
  104.     $data_weapons[$data_weapons.size-1].params = params
  105.     idgainequip weapon.id
  106.   else
  107.     $message += "强化失败"
  108.     suiji = rand (100)
  109.     if suiji <= $强化哈希表["消失几率"][weapon.up]
  110.       if fangb != true
  111.       $message += ",道具消失"
  112.       idlostequip id
  113.       else
  114.       $message += ",由于" + idgetitem($强化哈希表["特殊物品"][0]).name + "的作用,道具未消失"
  115.       end
  116.     else
  117.       suiji = rand (100)
  118.       if suiji <= $强化哈希表["降级几率"][weapon.up]
  119.         if fangj == false && weapon.up != 0
  120.           $message += ",道具降级"
  121.           params = weapon.params.dup
  122.           params[2] -= weapon.up + rand(weapon.up) * 5
  123.           params[2] /= 1 + $强化哈希表["提升能力"][weapon.up] / 100
  124.           weapon.params = params
  125.           weapon.up -= 1
  126.           $data_weapons[id] = weapon
  127.         else
  128.           $message += ",由于" + idgetitem($强化哈希表["特殊物品"][1]).name + "的作用,道具未降级"
  129.         end
  130.       end
  131.     end
  132.   end
  133.    $usegem = false
  134.    $fangb = false
  135.    $fangj = false
  136. end

  137. def self.weaponupisnil(id)
  138.    $data_weapons[id].up = 0 unless $data_weapons[id].up != nil
  139. end

  140. def self.weaponupable?(id)
  141.   equipable?(id)
  142. end

  143. def self.uparmor (id)
  144.   $message = ""
  145.   success = false
  146.   armorupisnil(id)
  147.   armor = $data_armors[id].dup
  148.   gl = 0
  149.   fangb = false
  150.   fangj = false
  151.   return unless armor.up < $强化哈希表["最高等级"] && armorupable?(id)
  152.   loststh
  153.   $message += "本次强化,共消耗:" + Vocab::currency_unit + " " + @needmoney.to_s
  154.   $message += " " + @lostitem.name + "\n "
  155.   gl = $强化哈希表["每级概率"][armor.up]
  156.   if $usegem == true
  157.     gl += $当前使用宝石加成率
  158.     idlostitem($当前使用宝石id)
  159.     $message += idgetitem($当前使用宝石id).name + " "
  160.   end
  161.   if $fangb == true
  162.     fangb = true
  163.     idlostitem $强化哈希表["特殊物品"][0]
  164.     $message += idgetitem($强化哈希表["特殊物品"][0]).name + " "
  165.   end
  166.   if $fangj == true
  167.     fangj = true
  168.     idlostitem $强化哈希表["特殊物品"][1]
  169.     $message += idgetitem($强化哈希表["特殊物品"][1]).name + " "
  170.   end
  171.   suiji = rand (100)
  172.   if suiji <= gl
  173.     success = true
  174.   end
  175.   $message += "\n强化结果:"
  176.   if success == true
  177.     $message += "强化成功"
  178.     idlostequip id,false
  179.     armor.id = $data_armors.size
  180.     params = armor.params.dup
  181.     params[3] *= 1 + $强化哈希表["提升能力"][armor.up] / 100
  182.     params[3] += rand(armor.up) * 5 + armor.up
  183.     params[3] += 1 if params[3] == armor.params[3]
  184.     $message += " 防御力提升:" + (params[3] - armor.params[3]).to_int.to_s
  185.     armor.up += 1
  186.     $data_armors.insert $data_armors.size,armor
  187.     $data_armors[$data_armors.size-1].params = params
  188.     idgainequip armor.id,false
  189.   else
  190.     $message += "强化失败"
  191.     suiji = rand (100)
  192.     if suiji <= $强化哈希表["消失几率"][armor.up]
  193.       if fangb != true
  194.       $message += ",道具消失"
  195.       idlostequip id,false
  196.       else
  197.       $message += ",由于" + idgetitem($强化哈希表["特殊物品"][0]).name + "的作用,道具未消失"
  198.       end
  199.     else
  200.       suiji = rand (100)
  201.       if suiji <= $强化哈希表["降级几率"][armor.up]
  202.         if fangj == false && armor.up != 0
  203.           $message += ",道具降级"
  204.           params = armor.params.dup
  205.           params[3] -= armor.up + rand(armor.up) * 5
  206.           params[3] /= 1 + $强化哈希表["提升能力"][armor.up] / 100
  207.           armor.params = params
  208.           armor.up -= 1
  209.           $data_armors[id] = armor
  210.         else
  211.           $message += ",由于" + idgetitem($强化哈希表["特殊物品"][1]).name + "的作用,道具未降级"
  212.         end
  213.       end
  214.     end
  215.   end
  216.    $usegem = false
  217.    $fangb = false
  218.    $fangj = false
  219. end

  220. def self.armorupisnil(id)
  221.    $data_armors[id].up = 0 unless $data_armors[id].up != nil
  222. end
  223. def self.armorupable?(id)
  224.   equipable?(id,false)
  225. end
  226. def self.loststh()
  227.    $game_party.lose_item(@lostitem,1)
  228.    $game_party.lose_gold(@needmoney)
  229. end
  230. def self.needmoney
  231.    @needmoney
  232. end
  233. def self.lostitem
  234.    @lostitem
  235. end
  236. end
  237. #==============================================================================
  238. # ■ Scene_Qiang
  239. #------------------------------------------------------------------------------
  240. #  强化画面
  241. #==============================================================================

  242. class Scene_Qiang < Scene_MenuBase
  243.   $wufang = true
  244.   $usegem = false
  245.   $fangb = false
  246.   $fangj = false
  247.   #--------------------------------------------------------------------------
  248.   # ● 开始处理
  249.   #--------------------------------------------------------------------------
  250.   def start
  251.     super
  252.     create_help_window
  253.     create_qianghelp_window
  254.     create_command_window
  255.     create_qiangxz_window
  256.     create_wu_window
  257.     create_fang_window
  258.     create_choosegem_window
  259.   end
  260.   #--------------------------------------------------------------------------
  261.   # ● 生成说明窗口
  262.   #--------------------------------------------------------------------------
  263.   def create_qianghelp_window
  264.     @qianghelp_window = Window_Qianghelp.new
  265.     @qianghelp_window.y = Graphics.height - @qianghelp_window.height
  266.     @qianghelp_window.viewport = @viewport
  267.     @qianghelp_window.hide
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # ● 生成选择宝石
  271.   #--------------------------------------------------------------------------
  272.   def create_choosegem_window
  273.     @choosegem_window = Window_Choosegem.new
  274.     @choosegem_window.y = Graphics.height - @choosegem_window.height
  275.     @choosegem_window.viewport = @viewport
  276.     @choosegem_window.z = 120
  277.   end
  278.   #--------------------------------------------------------------------------
  279.   # ● 生成选择窗口
  280.   #--------------------------------------------------------------------------
  281.   def create_qiangxz_window
  282.     @qiangxz_window = Window_Qiangxz.new
  283.     @qiangxz_window.y = @help_window.height + fitting_height(5) /2
  284.     @qiangxz_window.z = 110
  285.     @qiangxz_window.viewport = @viewport
  286.     @qiangxz_window.set_handler(:gem,    method(:qiangxz_gem))
  287.     @qiangxz_window.set_handler(:fangb,    method(:qiangxz_fangb))
  288.     @qiangxz_window.set_handler(:fangj,    method(:qiangxz_fangj))
  289.     @qiangxz_window.set_handler(:ok, method(:qiangxz_ok))
  290.     @qiangxz_window.set_handler(:cancel, method(:qiangxz_cancel))
  291.     @qiangxz_window.hide
  292.     @qiangxz_window.deactivate
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # ● 生成指令窗口
  296.   #--------------------------------------------------------------------------
  297.   def create_command_window
  298.     @command_window = Window_QiangCommand.new
  299.     @command_window.viewport = @viewport
  300.     @command_window.y = @help_window.height + fitting_height(3) /2
  301.     @command_window.set_handler(:qiangwu,    method(:qiangwu))
  302.     @command_window.set_handler(:qiangfang,   method(:qiangfang))
  303.     @command_window.set_handler(:cancel, method(:return_scene))
  304.   end
  305.   #--------------------------------------------------------------------------
  306.   # ● 生成武器强化窗口
  307.   #--------------------------------------------------------------------------
  308.   def create_wu_window
  309.     @wu_window = Window_Qiangwu.new(@qianghelp_window,@qiangxz_window)
  310.     @wu_window.viewport = @viewport
  311.     @wu_window.y += @help_window.height
  312.     @wu_window.hide
  313.     @wu_window.help_window= @help_window
  314.     @wu_window.set_handler(:cancel, method(:qiangwu_cancel))
  315.     @wu_window.set_handler(:ok,     method(:qiangwu_ok))
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # ● 生成防具强化窗口
  319.   #--------------------------------------------------------------------------
  320.   def create_fang_window
  321.     @fang_window = Window_Qiangfang.new(@qianghelp_window,@qiangxz_window)
  322.     @fang_window.viewport = @viewport
  323.     @fang_window.y += @help_window.height
  324.     @fang_window.hide
  325.     @fang_window.help_window= @help_window
  326.     @fang_window.set_handler(:cancel, method(:qiangfang_cancel))
  327.     @fang_window.set_handler(:ok,     method(:qiangfang_ok))
  328.   end
  329.   #--------------------------------------------------------------------------
  330.   # ● 计算窗口显示指定行数时的应用高度
  331.   #--------------------------------------------------------------------------
  332.   def fitting_height(line_number)
  333.     line_number * 24 + 12 * 2
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ● 显示强化武器
  337.   #--------------------------------------------------------------------------
  338.   def qiangwu
  339.     @command_window.hide
  340.     @help_window.show
  341.     @wu_window.show
  342.     @wu_window.start
  343.     @qianghelp_window.show
  344.     @wu_window.activate
  345.     $wufang = true
  346.     @command_window.deactivate
  347.   end
  348.   #--------------------------------------------------------------------------
  349.   # ● 显示强化防具
  350.   #--------------------------------------------------------------------------
  351.   def qiangfang
  352.     @command_window.hide
  353.     @help_window.show
  354.     @fang_window.show
  355.     @fang_window.start
  356.     @qianghelp_window.show
  357.     @fang_window.activate
  358.     $wufang = false
  359.     @command_window.deactivate
  360.   end
  361.   #--------------------------------------------------------------------------
  362.   # ● 取消强化武器
  363.   #--------------------------------------------------------------------------
  364.   def qiangwu_cancel
  365.     @command_window.show
  366.     @help_window.hide
  367.     @wu_window.hide
  368.     @qianghelp_window.hide
  369.     @command_window.activate
  370.     @qianghelp_window.set_text("")
  371.     @help_window.set_text("")
  372.   end
  373.   #--------------------------------------------------------------------------
  374.   # ● 取消强化防具
  375.   #--------------------------------------------------------------------------
  376.   def qiangfang_cancel
  377.     @command_window.show
  378.     @help_window.hide
  379.     @fang_window.hide
  380.     @qianghelp_window.hide
  381.     @command_window.activate
  382.     @qianghelp_window.set_text("")
  383.     @help_window.set_text("")
  384.   end
  385.   #--------------------------------------------------------------------------
  386.   # ● 确定强化武器
  387.   #--------------------------------------------------------------------------
  388.   def qiangwu_ok
  389.     @help_window.hide
  390.     @wu_window.qiangwu_ok
  391.     @qiangxz_window.show
  392.     @qiangxz_window.activate
  393.   end
  394.   #--------------------------------------------------------------------------
  395.   # ● 确定强化防具
  396.   #--------------------------------------------------------------------------
  397.   def qiangfang_ok
  398.     @help_window.hide
  399.     @fang_window.qiangfang_ok
  400.     @qiangxz_window.show
  401.     @qiangxz_window.activate
  402.   end
  403.   #--------------------------------------------------------------------------
  404.   # ● 获取卖出价格
  405.   #--------------------------------------------------------------------------
  406.   def selling_price
  407.     @item.price / 2
  408.   end
  409.   
  410.   def qiangxz_gem
  411.     @choosegem_window.start
  412.     @qiangxz_window.deactivate
  413.     @choosegem_window.qiangxz= @qiangxz_window
  414.     if $wufang == true
  415.       @choosegem_window.wufangwindow= @wu_window
  416.     else
  417.       @choosegem_window.wufangwindow= @fang_window
  418.     end
  419.   end
  420.   
  421.   def qiangxz_fangb
  422.     $fangb = !$fangb
  423.     if $wufang == true
  424.       @wu_window.update_help
  425.     else
  426.       @fang_window.update_help
  427.     end
  428.     @qiangxz_window.activate
  429.   end
  430.   
  431.   def qiangxz_fangj
  432.     $fangj = !$fangj
  433.     if $wufang == true
  434.       @wu_window.update_help
  435.     else
  436.       @fang_window.update_help
  437.     end
  438.     @qiangxz_window.activate
  439.   end
  440.   
  441.   def qiangxz_ok
  442.     if $wufang == true
  443.       Equipplus.upweapon(@wu_window.itemid)
  444.       qianging
  445.       @qianghelp_window.set_text($message)
  446.       @qiangxz_window.hide
  447.       Graphics.wait(60)
  448.       @wu_window.activate
  449.       @qiangxz_window.deactivate
  450.       @help_window.hide
  451.       $当前使用宝石加成率 = 0
  452.       $usegem = false
  453.       @fang_window.update_help
  454.       @wu_window.refresh
  455.       @command_window.deactivate
  456.     else
  457.       Equipplus.uparmor(@fang_window.itemid)
  458.       qianging
  459.       @qianghelp_window.set_text($message)
  460.       @qiangxz_window.hide
  461.       Graphics.wait(60)
  462.       @fang_window.activate
  463.       @qiangxz_window.deactivate
  464.       @help_window.hide
  465.       $当前使用宝石加成率 = 0
  466.       $usegem = false
  467.       @fang_window.update_help
  468.       @fang_window.refresh
  469.       @command_window.deactivate
  470.     end
  471.   end
  472.   
  473.   def qiangxz_cancel
  474.     @help_window.refresh
  475.                 @help_window.show
  476.     @wu_window.show
  477.     @qiangxz_window.hide
  478.     @qiangxz_window.deactivate
  479.     if $wufang == true
  480.       @wu_window.activate
  481.     else
  482.       @fang_window.activate
  483.     end
  484.     $当前使用宝石加成率 = 0
  485.     $usegem = false
  486.     @command_window.deactivate
  487.   end
  488.   
  489.   def qianging
  490.     i = 0
  491.     while i < 20
  492.       i += 1
  493.       text = "\n"
  494.       text += "★" * i + "☆" * (20 - i)
  495.       text = text + "\n强化中,请等待。"
  496.       @qianghelp_window.set_text(text)
  497.       Graphics.wait(6)
  498.     end
  499.   end
  500. end

  501. class RPG::EquipItem < RPG::BaseItem
  502.   alias old initialize
  503.   def initialize
  504.     old
  505.     @up = 0 #装备强化次数
  506.   end
  507.   attr_accessor :up
  508. end
  509. #==============================================================================
  510. # ■ Window_Qiangwu
  511. #------------------------------------------------------------------------------
  512. #  强化系统_武器强化窗口
  513. #==============================================================================

  514. class Window_Qiangwu < Window_ItemList
  515.   #--------------------------------------------------------------------------
  516.   # ● 初始化对象
  517.   #--------------------------------------------------------------------------
  518.   def initialize(qianghelp,xuanze)
  519.     super(0, 0, Graphics.width, fitting_height(5))
  520.     self.openness = 0
  521.     deactivate
  522.     @qianghelp = qianghelp
  523.     @xuanze = xuanze
  524.   end
  525.   #--------------------------------------------------------------------------
  526.   # ● 开始输入的处理
  527.   #--------------------------------------------------------------------------
  528.   def start
  529.     self.category = :weapon
  530.     refresh
  531.     select(0)
  532.     open
  533.     activate
  534.   end
  535.   #--------------------------------------------------------------------------
  536.   # ● 查询此物品是否可用
  537.   #--------------------------------------------------------------------------
  538.   def enable?(item)
  539.     return false unless item != nil
  540.     Equipplus.weaponupable?(item.id)
  541.   end
  542.   #--------------------------------------------------------------------------
  543.   # ● 确定强化武器
  544.   #--------------------------------------------------------------------------
  545.   def qiangwu_ok
  546.     result = item ? item.id : 0
  547.   end
  548.   #--------------------------------------------------------------------------
  549.   # ● 更新帮助内容
  550.   #--------------------------------------------------------------------------
  551.   def update_help
  552.     return unless item != nil
  553.     @help_window.set_item(item)
  554.     needmoney = 0
  555.     Equipplus.weaponupable?(item.id)
  556.     qitemname = Equipplus.lostitem.name
  557.     if item.up >= $强化哈希表["最高等级"]
  558.       qitemname = "无法继续升级"
  559.     end
  560.     temp = []
  561.     $usegem == true ? temp.push("使用") : temp.push("未使用")
  562.     temp.push($data_items[$强化哈希表["特殊物品"][0]].name)
  563.     $fangb == true ? temp.push("使用") : temp.push("未使用")
  564.     temp.push($data_items[$强化哈希表["特殊物品"][1]].name)
  565.     $fangj == true ? temp.push("使用") : temp.push("未使用")
  566.     cgl = ($强化哈希表["每级概率"][item.up] + $当前使用宝石加成率).to_s
  567.     if item.up == 0
  568.       min = item.params[2] + 1
  569.       max = min + 5
  570.     else
  571.       if item.up >= $强化哈希表["最高等级"]
  572.         min = item.params[2].to_int
  573.         max = min
  574.       else
  575.     min = (item.params[2] * (1 + $强化哈希表["提升能力"][item.up] / 100)).to_int + item.up
  576.     max = min + item.up * 5
  577.     end
  578.   end
  579.   Font.default_size = 18
  580.     text = "装备名称:" + item.name + "\n强化所需" + Vocab::currency_unit + ":" + Equipplus.needmoney.to_s
  581.     text += "\n当前强化等级:" + item.up.to_s + "\n强化需要:" +  qitemname
  582.     text += "\n道具:" + temp [0] + " " + temp[1] + ":" + temp[2]+ " " + temp[3] + ":" + temp[4]
  583.     text += "\n成功率:" + cgl + "% " + "\n强化后攻击力范围:" + min.to_s + "~" + max.to_s
  584.     @qianghelp.set_text(text)
  585.     Font.default_size = 24
  586.   end
  587.   #--------------------------------------------------------------------------
  588.   # ● 获取当前武器等级
  589.   #--------------------------------------------------------------------------
  590.   def getweaponup
  591.     Equipplus.weaponupisnil(item.id)
  592.     item.up
  593.   end
  594.   
  595.   def itemid
  596.     item.id
  597.   end
  598.   #--------------------------------------------------------------------------
  599.   # ● 选择项目
  600.   #--------------------------------------------------------------------------
  601.   def select(index)
  602.     self.index = index if index
  603.     update_help
  604.   end
  605. end
  606. #==============================================================================
  607. # ■ Window_Qiangfang
  608. #------------------------------------------------------------------------------
  609. #  强化系统_防具强化窗口
  610. #==============================================================================

  611. class Window_Qiangfang < Window_ItemList
  612.   #--------------------------------------------------------------------------
  613.   # ● 初始化对象
  614.   #--------------------------------------------------------------------------
  615.   def initialize(qianghelp,xuanze)
  616.     super(0, 0, Graphics.width, fitting_height(5))
  617.     self.openness = 0
  618.     deactivate
  619.     @qianghelp = qianghelp
  620.     @xuanze = xuanze
  621.   end
  622.   #--------------------------------------------------------------------------
  623.   # ● 开始输入的处理
  624.   #--------------------------------------------------------------------------
  625.   def start
  626.     self.category = :armor
  627.     refresh
  628.     select(0)
  629.     open
  630.     activate
  631.   end
  632.   #--------------------------------------------------------------------------
  633.   # ● 查询此物品是否可用
  634.   #--------------------------------------------------------------------------
  635.   def enable?(item)
  636.     return false unless item != nil
  637.     Equipplus.armorupable?(item.id)
  638.   end
  639.   #--------------------------------------------------------------------------
  640.   # ● 确定强化防具
  641.   #--------------------------------------------------------------------------
  642.   def qiangfang_ok
  643.     result = item ? item.id : 0
  644.   end
  645.   #--------------------------------------------------------------------------
  646.   # ● 更新帮助内容
  647.   #--------------------------------------------------------------------------
  648.   def update_help
  649.     return unless item != nil
  650.     @help_window.set_item(item)
  651.     needmoney = 0
  652.     Equipplus.armorupable?(item.id)
  653.     qitemname = Equipplus.lostitem.name
  654.     if item.up >= $强化哈希表["最高等级"]
  655.       qitemname = "无法继续升级"
  656.     end
  657.     temp = []
  658.     $usegem == true ? temp.push("使用") : temp.push("未使用")
  659.     temp.push($data_items[$强化哈希表["特殊物品"][0]].name)
  660.     $fangb == true ? temp.push("使用") : temp.push("未使用")
  661.     temp.push($data_items[$强化哈希表["特殊物品"][1]].name)
  662.     $fangj == true ? temp.push("使用") : temp.push("未使用")
  663.     cgl = ($强化哈希表["每级概率"][item.up] + $当前使用宝石加成率).to_s
  664.     if item.up == 0
  665.       min = item.params[3] + 1
  666.       max = min + 5
  667.     else
  668.       if item.up >= $强化哈希表["最高等级"]
  669.         min = item.params[3].to_int
  670.         max = min
  671.       else
  672.     min = (item.params[3] * (1 + $强化哈希表["提升能力"][item.up] / 100)).to_int + item.up
  673.     max = min + item.up * 5
  674.     end
  675.   end
  676.   Font.default_size = 18
  677.     text = "装备名称:" + item.name + "\n强化所需" + Vocab::currency_unit + ":" + Equipplus.needmoney.to_s
  678.     text += "\n当前强化等级:" + item.up.to_s + "\n强化需要:" +  qitemname
  679.     text += "\n道具:" + temp [0] + " " + temp[1] + ":" + temp[2]+ " " + temp[3] + ":" + temp[4]
  680.     text += "\n成功率:" + cgl + "% " + "\n强化后防御力范围:" + min.to_s + "~" + max.to_s
  681.     @qianghelp.set_text(text)
  682.     Font.default_size = 24
  683.   end
  684.   #--------------------------------------------------------------------------
  685.   # ● 获取当前防具等级
  686.   #--------------------------------------------------------------------------
  687.   def getarmorup
  688.     Equipplus.armorupisnil(item.id)
  689.     item.up
  690.   end
  691.   
  692.   def itemid
  693.     item.id
  694.   end
  695.   #--------------------------------------------------------------------------
  696.   # ● 选择项目
  697.   #--------------------------------------------------------------------------
  698.   def select(index)
  699.     self.index = index if index
  700.     update_help
  701.   end
  702. end
  703. #==============================================================================
  704. # ■ Window_QiangCommand
  705. #------------------------------------------------------------------------------
  706. #  强化系统中,处理命令选择的窗口。
  707. #==============================================================================

  708. class Window_QiangCommand < Window_Command
  709.   #--------------------------------------------------------------------------
  710.   # ● 初始化对象
  711.   #--------------------------------------------------------------------------
  712.   def initialize
  713.     super(0, 0)
  714.     update_placement
  715.     self.openness = 0
  716.     open
  717.   end
  718.   #--------------------------------------------------------------------------
  719.   # ● 获取窗口的宽度
  720.   #--------------------------------------------------------------------------
  721.   def window_width
  722.     return 160
  723.   end
  724.   #--------------------------------------------------------------------------
  725.   # ● 更新窗口的位置
  726.   #--------------------------------------------------------------------------
  727.   def update_placement
  728.     self.x = (Graphics.width - width) / 2
  729.     self.y = (Graphics.height - height) / 2
  730.   end
  731.   #--------------------------------------------------------------------------
  732.   # ● 生成指令列表
  733.   #--------------------------------------------------------------------------
  734.   def make_command_list
  735.     add_command("强化武器",    :qiangwu)
  736.     add_command("强化防具",    :qiangfang)
  737.     add_command(Vocab::ShopCancel, :cancel)
  738.   end
  739. end
  740. #==============================================================================
  741. # ■ Window_Qianghelp
  742. #------------------------------------------------------------------------------
  743. #  显示说明
  744. #==============================================================================

  745. class Window_Qianghelp < Window_Base
  746.   #--------------------------------------------------------------------------
  747.   # ● 初始化对象
  748.   #--------------------------------------------------------------------------
  749.   def initialize
  750.     super(0, 0, window_width, fitting_height(7) + 8)
  751.     refresh
  752.   end
  753.   #--------------------------------------------------------------------------
  754.   # ● 获取窗口的宽度
  755.   #--------------------------------------------------------------------------
  756.   def window_width
  757.     return 544
  758.   end

  759.   #--------------------------------------------------------------------------
  760.   # ● 获取持有金钱
  761.   #--------------------------------------------------------------------------
  762.   def value
  763.     $game_party.gold
  764.   end
  765.   #--------------------------------------------------------------------------
  766.   # ● 获取货币单位
  767.   #--------------------------------------------------------------------------
  768.   def currency_unit
  769.     Vocab::currency_unit
  770.   end
  771.   #--------------------------------------------------------------------------
  772.   # ● 设置内容
  773.   #--------------------------------------------------------------------------
  774.   def set_text(text)
  775.     if text != @text
  776.       @text = text
  777.       refresh
  778.     end
  779.   end
  780.   #--------------------------------------------------------------------------
  781.   # ● 清除
  782.   #--------------------------------------------------------------------------
  783.   def clear
  784.     set_text("")
  785.   end
  786.   #--------------------------------------------------------------------------
  787.   # ● 刷新
  788.   #--------------------------------------------------------------------------
  789.   def refresh
  790.     contents.clear
  791.     draw_text_ex(4, 0, @text)
  792.   end
  793. end
  794. #==============================================================================
  795. # ■ Window_Qiangxz
  796. #------------------------------------------------------------------------------
  797. #  强化系统中,选择强化方式的窗口。
  798. #==============================================================================

  799. class Window_Qiangxz < Window_Command
  800.   @havegem = false
  801.   @havefangb = false
  802.   @havefangj = false
  803.   #--------------------------------------------------------------------------
  804.   # ● 初始化对象
  805.   #--------------------------------------------------------------------------
  806.   def initialize
  807.     super(0, 0)
  808.     index = 0
  809.     update_placement
  810.     self.openness = 0
  811.     open
  812.   end
  813.   #--------------------------------------------------------------------------
  814.   # ● 获取窗口的宽度
  815.   #--------------------------------------------------------------------------
  816.   def window_width
  817.     return 180
  818.   end
  819.   #--------------------------------------------------------------------------
  820.   # ● 更新窗口的位置
  821.   #--------------------------------------------------------------------------
  822.   def update_placement
  823.     self.x = (Graphics.width - width) / 2
  824.     self.y = (Graphics.height - height) / 2
  825.   end
  826.   #--------------------------------------------------------------------------
  827.   # ● 检查可用
  828.   #--------------------------------------------------------------------------
  829.   def haveitem
  830.     @havegem = false
  831.     @havefangb = false
  832.     @havefangj = false
  833.     for i in $强化哈希表["宝石效果"]
  834.         if $game_party.has_item?($data_items[i[1]])
  835.         @havegem = true
  836.       end
  837.     end
  838.     @havefangb = $game_party.has_item?($data_items[$强化哈希表["特殊物品"][0]])
  839.     @havefangj = $game_party.has_item?($data_items[$强化哈希表["特殊物品"][1]])
  840.   end
  841.   #--------------------------------------------------------------------------
  842.   # ● 生成指令列表
  843.   #--------------------------------------------------------------------------
  844.   def make_command_list
  845.     haveitem
  846.     add_command("使用道具",     :gem, @havegem)
  847.     add_command(Equipplus.idgetitem($强化哈希表["特殊物品"][0]).name, :fangb, @havefangb)
  848.     add_command(Equipplus.idgetitem($强化哈希表["特殊物品"][1]).name, :fangj, @havefangj)
  849.     add_command("开始强化", :start)
  850.     add_command("取消强化", :cancel)
  851.   end
  852. end
  853. class Window_ItemList
  854.   #--------------------------------------------------------------------------
  855.   # ● 查询列表中是否含有此物品
  856.   #--------------------------------------------------------------------------
  857.   def include?(item)
  858.     case @category
  859.     when :item
  860.       item.is_a?(RPG::Item) && !item.key_item?
  861.     when :weapon
  862.       item.is_a?(RPG::Weapon)
  863.     when :armor
  864.       item.is_a?(RPG::Armor)
  865.     when :key_item
  866.       item.is_a?(RPG::Item) && item.key_item?
  867.     when :gem
  868.       itemid = item ? item.id : 0
  869.       itemid != 0 ? isgem(itemid) : false
  870.     else
  871.       false
  872.     end
  873.   end
  874.   
  875.   def isgem(itemid)
  876.     for i in $强化哈希表["宝石效果"]
  877.       return true if i[1] == itemid
  878.     end
  879.     false
  880.   end
  881. end
  882. #==============================================================================
  883. # ■ Window_Choosegem
  884. #------------------------------------------------------------------------------
  885. #  选择强化使用的宝石
  886. #==============================================================================

  887. class Window_Choosegem < Window_ItemList
  888.   #--------------------------------------------------------------------------
  889.   # ● 初始化对象
  890.   #--------------------------------------------------------------------------
  891.   def initialize()
  892.     super(0, 0, Graphics.width, fitting_height(2))
  893.     self.openness = 0
  894.     deactivate
  895.     @wufangwindow = nil
  896.     @qiangxz = nil
  897.     set_handler(:ok,     method(:on_ok))
  898.     set_handler(:cancel, method(:on_cancel))
  899.   end
  900.   
  901.   def wufangwindow=(wufangwindow)
  902.     @wufangwindow = wufangwindow
  903.   end
  904.   def qiangxz=(qiangxz)
  905.     @qiangxz = qiangxz
  906.   end
  907.   #--------------------------------------------------------------------------
  908.   # ● 开始输入的处理
  909.   #--------------------------------------------------------------------------
  910.   def start
  911.     self.category = :gem
  912.     self.y = (Graphics.height - height) / 2
  913.     refresh
  914.     select(0)
  915.     open
  916.     activate
  917.   end
  918.   #--------------------------------------------------------------------------
  919.   # ● 确定时的处理
  920.   #--------------------------------------------------------------------------
  921.   def on_ok
  922.     result = item ? item.id : 0
  923.     if result != 0
  924.      $usegem = true
  925.      $当前使用宝石id = result
  926.      for i in $强化哈希表["宝石效果"]
  927.        $当前使用宝石加成率 = i[0] if i[1] == $当前使用宝石id
  928.      end
  929.    else
  930.      $当前使用宝石加成率 = 0
  931.      $usegem = false
  932.     end
  933.     @wufangwindow.update_help
  934.     @qiangxz.activate
  935.     close
  936.   end
  937.   #--------------------------------------------------------------------------
  938.   # ● 查询此物品是否可用
  939.   #--------------------------------------------------------------------------
  940.   def enable?(item)
  941.     true
  942.   end
  943.   #--------------------------------------------------------------------------
  944.   # ● 取消时的处理
  945.   #--------------------------------------------------------------------------
  946.   def on_cancel
  947.     $当前使用宝石加成率 = 0
  948.     $usegem = false
  949.     @wufangwindow.update_help
  950.     @qiangxz.activate
  951.     close
  952.   end
  953. end
  954. #==============================================================================
  955. # ■ 强化系统DataManager
  956. #------------------------------------------------------------------------------
  957. #  将武器和防具数据保存入存档
  958. #==============================================================================
  959. module DataManager
  960.   #--------------------------------------------------------------------------
  961.   # ● 生成存档内容
  962.   #--------------------------------------------------------------------------
  963.   def self.make_save_contents
  964.     contents = {}
  965.     contents[:system]        = $game_system
  966.     contents[:timer]         = $game_timer
  967.     contents[:message]       = $game_message
  968.     contents[:switches]      = $game_switches
  969.     contents[:variables]     = $game_variables
  970.     contents[:self_switches] = $game_self_switches
  971.     contents[:actors]        = $game_actors
  972.     contents[:party]         = $game_party
  973.     contents[:troop]         = $game_troop
  974.     contents[:map]           = $game_map
  975.     contents[:player]        = $game_player
  976.     contents[:weapons]       = $data_weapons
  977.     contents[:armors]        = $data_armors
  978.     contents
  979.   end
  980.   #--------------------------------------------------------------------------
  981.   # ● 展开存档内容
  982.   #--------------------------------------------------------------------------
  983.   def self.extract_save_contents(contents)
  984.     $game_system        = contents[:system]
  985.     $game_timer         = contents[:timer]
  986.     $game_message       = contents[:message]
  987.     $game_switches      = contents[:switches]
  988.     $game_variables     = contents[:variables]
  989.     $game_self_switches = contents[:self_switches]
  990.     $game_actors        = contents[:actors]
  991.     $game_party         = contents[:party]
  992.     $game_troop         = contents[:troop]
  993.     $game_map           = contents[:map]
  994.     $game_player        = contents[:player]
  995.     $data_weapons       = contents[:weapons]
  996.     $data_armors        = contents[:armors]
  997.   end
  998. end
复制代码

【同人游戏】勇者斗恶龙TG
欢迎加入游戏测试群333599798
如有需私聊请加QQ:516425000
梦石
0
星屑
6375
在线时间
1473 小时
注册时间
2015-7-25
回帖
609

极短25参与开拓者

发表于 2017-5-22 21:39:12 | 显示全部楼层
作为插件脚本使用,放在这两个脚本的下方
  1. class Scene_Base
  2.   alias c create_help_ex
  3.   def create_help_ex
  4.     c
  5.     @wu_window.help_ex_window  = @help_ex_window if @wu_window
  6.     @fang_window.help_ex_window  = @help_ex_window if @fang_window
  7.   end
  8. end
  9. class Scene_Qiang < Scene_MenuBase
  10.   alias s start
  11.   def start
  12.     s
  13.     create_help_ex
  14.   end
  15.   alias qw qiangwu_cancel
  16.   def qiangwu_cancel
  17.     qw
  18.     @help_ex_window.hide
  19.   end
  20.   alias qf qiangfang_cancel
  21.   def qiangfang_cancel
  22.     qf
  23.     @help_ex_window.hide
  24.   end
  25.   alias qwo qiangwu_ok
  26.   def qiangwu_ok
  27.     qwo
  28.     @help_ex_window.hide
  29.   end
  30.   alias qfo qiangfang_ok
  31.   def qiangfang_ok
  32.     qfo
  33.     @help_ex_window.hide
  34.   end
  35. end
复制代码

点评

解决了,肉包还是像以往给力{:4_85:}  发表于 2017-5-22 23:38

评分

参与人数 1梦石 +1 收起 理由
RaidenInfinity + 1 认可答案

查看全部评分

笨肉包的游戏讨论群932812135 (实时更新) 喜欢的话欢迎加入~
目前的坑
??? #像素风OC游戏 准备中 短篇-约5小时
花城梦之心 #像素风OC游戏 系统开发+素材绘制中
【不可思议的迷宫】幽灵契约外传:歌莉娅 v0.4 游戏文件已更新
同时更新中~ (沉迷摸鱼中~更新速度较慢请见谅w)
这是属于笨肉包一个人的旅行~(这只肉包又在摸鱼!
旅途的最终目标~ ???(保密~
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部