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

Project1

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

[已经解决] 关于两个脚本的冲突求解决方案

[复制链接]

Lv2.观梦者

梦石
0
星屑
385
在线时间
100 小时
注册时间
2009-2-3
帖子
318
跳转到指定楼层
1
发表于 2014-2-3 20:34:59 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 wxx45600 于 2014-2-3 21:28 编辑

在VA中的战斗显示脸图和装备介绍增强之间的问题。。就是无法兼容。。
不知道有没有大神能帮忙解决

代码:
装备增强:

RUBY 代码复制
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ 装备说明增强 By wyongcan
  4. #==============================================================================
  5. module Equipplus
  6.   CODE ={
  7.     11 => "属性抗性",
  8.     12 => "弱化抗性",
  9.     13 => "状态抗性",
  10.     14 => "状态免疫",
  11.     21 => "普通能力",
  12.     22 => "添加能力",
  13.     23 => "特殊能力",
  14.     31 => "攻击附带属性",
  15.     32 => "攻击附带状态",
  16.     33 => "修正攻击速度",
  17.     34 => "添加攻击次数",
  18.     41 => "添加技能类型",
  19.     42 => "禁用技能类型",
  20.     43 => "添加技能",
  21.     44 => "禁用技能",
  22.     51 => "可装备武器类型",
  23.     52 => "可装备护甲类型",
  24.     53 => "固定装备",
  25.     54 => "禁用装备",
  26.     55 => "装备风格",
  27.     61 => "添加行动次数",
  28.     62 => "特殊标志",
  29.     63 => "消失效果",
  30.     64 => "队伍能力"}
  31.   #特殊标志
  32.   FLAG ={
  33.                 0 => "自动战斗",
  34.                 1 => "擅长防御",
  35.                 2 => "保护弱者",
  36.                 3 => "特技专注"}
  37.   #普通能力
  38.         PARAM ={
  39.                 0 => "最大HP",
  40.                 1 => "最大MP",
  41.                 2 => "物理攻击",
  42.                 3 => "物理防御",
  43.                 4 => "魔法攻击",
  44.                 5 => "魔法防御",
  45.                 6 => "敏 捷 值",
  46.                 7 => "幸 运 值"}
  47.   #添加能力
  48.         XPARAM ={
  49.                 0 => "物理命中几率:",
  50.                 1 => "物理闪避几率:",
  51.                 2 => "必杀几率:",
  52.                 3 => "必杀闪避几率:",
  53.                 4 => "魔法闪避几率:",
  54.                 5 => "魔法反射几率:",
  55.                 6 => "物理反击几率:",
  56.                 7 => "体力值再生速度:",
  57.                 8 => "魔力值再生速度:",
  58.                 9 => "特技值再生速度:"}
  59.   #特殊能力
  60.         SPARAM ={
  61.                 0 => "受到攻击的几率",
  62.                 1 => "防御效果比率",
  63.                 2 => "恢复效果比率",
  64.                 3 => "药理知识",
  65.                 4 => "MP消费率",
  66.                 5 => "TP消耗率",
  67.                 6 => "物理伤害加成",
  68.                 7 => "魔法伤害加成",
  69.                 8 => "地形伤害加成",
  70.                 9 => "经验获得加成"}
  71.         @队伍能力 ={
  72.                 0 => "遇敌几率减半",
  73.                 1 => "随机遇敌无效",
  74.                 2 => "敌人偷袭无效",
  75.                 3 => "先制攻击几率上升",
  76.                 4 => "获得金钱数量双倍",
  77.                 5 => "物品掉落几率双倍"}
  78.   def self.equiphelpready
  79.     @状态 = {}
  80.     @武器类型 = {}
  81.     @防具类型 = {}
  82.     @属性 = {}
  83.     $data_states.each{|x| @状态[x.id] = x.name if x != nil}
  84.     elements = $data_system.elements
  85.     weapon_types = $data_system.weapon_types
  86.     armor_types = $data_system.armor_types
  87.     elements.each_with_index{|x,y| @属性[y] = x if x != ""}
  88.     weapon_types.each_with_index{|x,y| @武器类型[y] = x if x != ""}
  89.     armor_types.each_with_index{|x,y| @防具类型[y] = x if x != ""}
  90.   end
  91.   def self.getequiphelp(equip)
  92.     help = ""
  93.     param = []
  94.     equip.params.each_with_index{|x,y| param.push([PARAM[y],x])}
  95.     param = param.select{|x| x[1] != 0}
  96.     param.each{|x| help += x[0] + ":" + x[1].to_int.to_s + "\n"}
  97.     features = equip.features
  98.     features.select{|x| x.code == 55}.each{|x| help += CODE[x.code] + ":双持武器" + "\n"}
  99.     features.select{|x| x.code == 11}.each{|x| help += CODE[x.code] + ":" + @属性[x.data_id] + "*" + x.value.to_s + "\n"}
  100.     features.select{|x| x.code == 12}.each{|x| help += CODE[x.code] + ":" + PARAM[x.data_id] + "*" + x.value.to_s + "\n"}
  101.     features.select{|x| x.code == 13}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "*" + x.value.to_s + "\n"}
  102.     features.select{|x| x.code == 14}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "\n"}
  103.     features.select{|x| x.code == 31}.each{|x| help += CODE[x.code] + ":" + @属性[x.data_id] + "\n"}
  104.     features.select{|x| x.code == 32}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "+" + x.value.to_s + "\n"}
  105.     features.select{|x| x.code == 33}.each{|x| help += CODE[x.code] + ":" + x.value.to_s + "\n"}
  106.     features.select{|x| x.code == 34}.each{|x| help += CODE[x.code] + ":" + x.value.to_s + "\n"}
  107.     features.select{|x| x.code == 41}.each{|x| help += CODE[x.code] + ":" + (x.data_id == 1 ? "特技" : "魔法")  + "\n"}
  108.     features.select{|x| x.code == 42}.each{|x| help += CODE[x.code] + ":" + (x.data_id == 1 ? "特技" : "魔法")  + "\n"}
  109.     features.select{|x| x.code == 43}.each{|x| help += CODE[x.code] + ":" + $data_skills[x.data_id].name  + "\n"}
  110.     features.select{|x| x.code == 44}.each{|x| help += CODE[x.code] + ":" + $data_skills[x.data_id].name  + "\n"}
  111.     features.select{|x| x.code == 51}.each{|x| help += CODE[x.code] + ":" + @武器类型[x.data_id]  + "\n"}
  112.     features.select{|x| x.code == 52}.each{|x| help += CODE[x.code] + ":" + @防具类型[x.data_id]  + "\n"}
  113.     features.select{|x| x.code == 61}.each{|x| help += CODE[x.code] + ":" + x.value.to_s  + "\n"}
  114.     features.select{|x| x.code == 62}.each{|x| help += CODE[x.code] + ":" + FLAG[x.data_id]  + "\n"}
  115.     features.select{|x| x.code == 64}.each{|x| help += CODE[x.code] + ":" + @队伍能力[x.data_id]  + "\n"}
  116.     featuresparam = []
  117.     featuresparam.push features.select{|x| x.code == 21}
  118.     featuresparam.push features.select{|x| x.code == 22}
  119.     featuresparam.push features.select{|x| x.code == 23}
  120.     featuresparam[0].each{|x| help += PARAM[x.data_id] + "*" + x.value.to_s + "\n"}
  121.     featuresparam[1].each{|x| help += XPARAM[x.data_id] + x.value.to_s + "\n"}
  122.     featuresparam[2].each{|x| help += SPARAM[x.data_id] + "*" + x.value.to_s + "\n"}
  123.     help
  124.   end
  125.   def self.getline(text,maxtext)
  126.     xtext = []
  127.     line = 0
  128.     text.each_line{|x| xtext.push x.sub(/\n/){}}
  129.     xtext.each{|x| x.size % maxtext != 0 ? line += x.size / maxtext + 1 : line += x.size / maxtext}
  130.     line
  131.   end
  132. end
  133. #==============================================================================
  134. # ■ Window_Help
  135. #------------------------------------------------------------------------------
  136. #  显示特技和物品等的说明、以及角色状态的窗口
  137. #==============================================================================
  138.  
  139. class Window_Help2 < Window_Base
  140.   #--------------------------------------------------------------------------
  141.   # ● 初始化对象
  142.   #--------------------------------------------------------------------------
  143.   def initialize(line_number = 0)
  144.     super(0, 0, 210, 0)
  145.     self.z = 150
  146.     contents.font.size = 14
  147.     hide
  148.   end
  149.   #--------------------------------------------------------------------------
  150.   # ● 设置内容
  151.   #--------------------------------------------------------------------------
  152.   def set_text(text)
  153.       @text = text
  154.       refresh
  155.   end
  156.   #--------------------------------------------------------------------------
  157.   # ● 清除
  158.   #--------------------------------------------------------------------------
  159.   def clear
  160.     set_text("")
  161.   end
  162.   #--------------------------------------------------------------------------
  163.   # ● 更新帮助位置
  164.   #--------------------------------------------------------------------------
  165.   def uppos(index,rect,window)
  166.     self.height = fitting_height2(Equipplus.getline(@xtext,13))
  167.     create_contents
  168.     contents.font.size = 14
  169.     rect.x -= window.ox
  170.     rect.y -= window.oy
  171.     ax = rect.x + rect.width + 10
  172.     ax = rect.x - self.width + 10 if ax + self.width > window.width + 10
  173.     ax += window.x
  174.     ax = 0 if ax < 0
  175.     ay = rect.y + rect.height
  176.     ay = rect.y - self.height if ay + self.height > window.height
  177.     ay += window.y
  178.     ay = 0 if ay < 0
  179.     self.x = ax
  180.     self.y = ay
  181.     set_text(@xtext)
  182.     show
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ● 设置物品
  186.   #     item : 技能、物品等
  187.   #--------------------------------------------------------------------------
  188.   def set_item(item)
  189.     if item == nil
  190.       set_text("")
  191.       return
  192.     end
  193.     @xtext = ""
  194.     @xtext = "名称:" + item.name + "\n"
  195.     @xtext += "介绍:" + item.description + "\n"
  196.     @xtext += "价格:" + item.price.to_s + "\n" if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Item)
  197.     @xtext += Equipplus.getequiphelp(item) if item.is_a?(RPG::EquipItem)
  198.     @xtext = @xtext[0,@text.size - 2] if @xtext[@xtext.size - 2,2] == "\n"
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # ● 刷新
  202.   #--------------------------------------------------------------------------
  203.   def refresh
  204.     contents.clear
  205.     hide if @text == ""
  206.     draw_text_ex(4, 0, @text,width,40,false)
  207.   end
  208. end
  209. class Window_Base < Window
  210.   #--------------------------------------------------------------------------
  211.   # ● 计算窗口显示指定行数时的应用高度2*************************
  212.   #--------------------------------------------------------------------------
  213.   def fitting_height2(line_number)
  214.     line_number * contents.font.size + standard_padding * 2
  215.   end
  216. #~ draw_text_ex的增强,使其可以自动换行  原作者:叶子 修改:wyongcan
  217.   #--------------------------------------------------------------------------
  218.   # ● 绘制带有控制符的文本内容
  219.   #   如果传递了width参数的话,会自动换行
  220.   #--------------------------------------------------------------------------
  221.   def draw_text_ex(x, y, text, width = nil,textwidth = nil,normalfont = true)
  222.     reset_font_settings if normalfont == true
  223.     text = convert_escape_characters(text)
  224.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  225.     if width != nil
  226.       pos[:height] = contents.font.size
  227.       pos[:width] = width
  228.       pos[:textwidth] = textwidth
  229.     end
  230.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  231.   end
  232.   #--------------------------------------------------------------------------
  233.   # ● 文字的处理
  234.   #     c    : 文字
  235.   #     text : 绘制处理中的字符串缓存(字符串可能会被修改)
  236.   #     pos  : 绘制位置 {:x, :y, :new_x, :height}
  237.   #--------------------------------------------------------------------------
  238.   def process_character(c, text, pos)
  239.     case c
  240.     when "\r"   # 回车
  241.       return
  242.     when "\n"   # 换行
  243.       process_new_line(text, pos)
  244.     when "\f"   # 翻页
  245.       process_new_page(text, pos)
  246.     when "\e"   # 控制符
  247.       process_escape_character(obtain_escape_code(text), text, pos)
  248.     else        # 普通文字
  249.       pos[:textwidth] == nil ? text_width = text_size(c).width : text_width = pos[:textwidth]
  250.       if pos[:width] != nil && pos[:x] - pos[:new_x] + text_width > pos[:width]
  251.         process_new_line(text, pos)
  252.       end
  253.       process_normal_character(c, pos)
  254.     end
  255.   end
  256. end
  257.  
  258. class Window_ItemList < Window_Selectable
  259.   #--------------------------------------------------------------------------
  260.   # ● 更新帮助内容
  261.   #--------------------------------------------------------------------------
  262.   def update_help
  263.     @help_window.set_item(item)
  264.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
  265.   end
  266. end
  267.  
  268. class Window_SkillList < Window_Selectable
  269.   #--------------------------------------------------------------------------
  270.   # ● 更新帮助内容
  271.   #--------------------------------------------------------------------------
  272.   def update_help
  273.     @help_window.set_item(item)
  274.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
  275.   end
  276. end
  277.  
  278. class Window_ShopBuy < Window_Selectable
  279.   #--------------------------------------------------------------------------
  280.   # ● 更新帮助内容
  281.   #--------------------------------------------------------------------------
  282.   def update_help
  283.     @help_window.set_item(item) if @help_window
  284.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil && @help_window
  285.     @status_window.item = item if @status_window
  286.   end
  287. end
  288.  
  289. class Window_EquipSlot < Window_Selectable
  290.   #--------------------------------------------------------------------------
  291.   # ● 更新帮助内容
  292.   #--------------------------------------------------------------------------
  293.   def update_help
  294.     super
  295.     @help_window.set_item(item) if @help_window
  296.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil && @help_window
  297.     @status_window.set_temp_actor(nil) if @status_window
  298.   end
  299. end
  300.  
  301. class Scene_Shop < Scene_MenuBase
  302.         alias on_sell_ok_old on_sell_ok
  303.         def on_sell_ok
  304.                 on_sell_ok_old
  305.                 @help_window.hide
  306.         end
  307.         alias on_buy_ok_old on_buy_ok
  308.         def on_buy_ok
  309.                 on_buy_ok_old
  310.                 @help_window.hide
  311.         end
  312.         alias on_number_ok_old on_number_ok
  313.         def on_number_ok
  314.                 on_number_ok_old
  315.     @help_window.refresh
  316.                 @help_window.show
  317.         end
  318.         alias on_number_cancel_old on_number_cancel
  319.         def on_number_cancel
  320.                 on_number_cancel_old
  321.     @help_window.refresh
  322.                 @help_window.show
  323.         end
  324. end
  325.  
  326. class Scene_Title < Scene_Base
  327.   alias start_old start
  328.   def start
  329.     start_old
  330.     Equipplus.equiphelpready
  331.   end
  332. end
  333.  
  334. class Scene_ItemBase < Scene_MenuBase
  335.         alias old_on_actor_cancel on_actor_cancel
  336.   def on_actor_cancel
  337.     old_on_actor_cancel
  338.         @help_window.refresh
  339.   end
  340.         alias old_on_actor_ok on_actor_ok
  341.   def on_actor_ok
  342.     old_on_actor_ok
  343.         @help_window.refresh
  344.   end
  345. end
  346.  
  347. class Window_Base < Window
  348.         alias old_process_new_line process_new_line
  349.         def process_new_line(text, pos)
  350.     old_process_new_line(text, pos)
  351.                 pos[:height] = contents.font.size if pos[:width] != nil
  352.         end
  353. end
  354.  
  355. class Scene_MenuBase < Scene_Base
  356.   def create_help_window
  357.     @help_window = Window_Help2.new
  358.     @help_window.viewport = @viewport
  359.   end
  360. end
  361.  
  362. class Scene_Battle < Scene_Base
  363.   def create_help_window
  364.     @help_window = Window_Help2.new
  365.     @help_window.visible = false
  366.   end
  367. end




战斗脸图:
RUBY 代码复制
  1. $脸图战斗 = true
  2. $imported = {} if $imported.nil?
  3. module YEA
  4.   module BATTLE
  5.     SKIP_PARTY_COMMAND = true
  6.     BATTLESTATUS_NAME_FONT_SIZE = 20
  7.     BATTLESTATUS_TEXT_FONT_SIZE = 16
  8.     BATTLESTATUS_NO_ACTION_ICON = 185
  9.     BATTLESTATUS_HPGAUGE_Y_PLUS = 11
  10.     BATTLESTATUS_CENTER_FACES   = false
  11.     HELP_TEXT_ALL_FOES        = "全体敌人"
  12.     HELP_TEXT_ONE_RANDOM_FOE  = "单个敌人"
  13.     HELP_TEXT_MANY_RANDOM_FOE = "%d个随机敌人"
  14.     HELP_TEXT_ALL_ALLIES      = "全体队友"
  15.     HELP_TEXT_ALL_DEAD_ALLIES = "全体死亡队友"
  16.     HELP_TEXT_ONE_RANDOM_ALLY = "单个随机队友"
  17.     HELP_TEXT_RANDOM_ALLIES   = "%d个随机队友"
  18.   end
  19. end
  20. class Game_Battler
  21.   def can_collapse?
  22.     return false unless dead?
  23.     unless actor?
  24.       return false unless sprite.battler_visible
  25.       array = [:collapse, :boss_collapse, :instant_collapse]
  26.       return false if array.include?(sprite.effect_type)
  27.     end
  28.     return true
  29.   end
  30.   def draw_mp?
  31.     return true
  32.   end
  33.   def draw_tp?
  34.     return $data_system.opt_display_tp
  35.   end
  36. end
  37. module Icon
  38.   def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
  39. end
  40. class Game_Temp
  41.   attr_accessor :battle_aid
  42.   attr_accessor :evaluating
  43. end
  44. class Game_Action
  45.   alias evaluate_item_with_target_abe evaluate_item_with_target
  46.   def evaluate_item_with_target(target)
  47.     $game_temp.evaluating = true
  48.     result = evaluate_item_with_target_abe(target)
  49.     $game_temp.evaluating = false
  50.     return result
  51.   end
  52. end
  53. class Game_Actor < Game_Battler
  54.   def draw_mp?
  55.     return true unless draw_tp?
  56.     for skill in skills
  57.       next unless added_skill_types.include?(skill.stype_id)
  58.       return true if skill.mp_cost > 0
  59.     end
  60.     return false
  61.   end
  62.   def draw_tp?
  63.     return false unless $data_system.opt_display_tp
  64.     for skill in skills
  65.       next unless added_skill_types.include?(skill.stype_id)
  66.       return true if skill.tp_cost > 0
  67.     end
  68.     return false
  69.   end
  70. end
  71. class Window_BattleStatus < Window_Selectable
  72.   def initialize
  73.     super(0, 0, window_width, window_height)
  74.     self.openness = 0
  75.     @party = $game_party.battle_members.clone
  76.   end
  77.   def col_max; return $game_party.max_battle_members; end
  78.   def battle_members; return $game_party.battle_members; end
  79.   def actor; return battle_members[@index]; end
  80.   def update
  81.     super
  82.     return if @party == $game_party.battle_members
  83.     @party = $game_party.battle_members.clone
  84.     refresh
  85.   end
  86.   def draw_item(index)
  87.     return if index.nil?
  88.     clear_item(index)
  89.     actor = battle_members[index]
  90.     rect = item_rect(index)
  91.     return if actor.nil?
  92.     draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?)
  93.     draw_actor_name(actor, rect.x, rect.y, rect.width-8)
  94.     draw_actor_action(actor, rect.x, rect.y)
  95.     draw_actor_icons(actor, rect.x, line_height*1, rect.width)
  96.     gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS
  97.     contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE
  98.     draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4)
  99.     if draw_tp?(actor) && draw_mp?(actor)
  100.       dw = rect.width/2-2
  101.       dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE
  102.       draw_actor_tp(actor, rect.x+2, line_height*3, dw)
  103.       dw = rect.width - rect.width/2 - 2
  104.       draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw)
  105.     elsif draw_tp?(actor) && !draw_mp?(actor)
  106.       draw_actor_tp(actor, rect.x+2, line_height*3, rect.width-4)
  107.     else
  108.       draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4)
  109.     end
  110.   end
  111.   def item_rect(index)
  112.     rect = Rect.new
  113.     rect.width = contents.width / $game_party.max_battle_members
  114.     rect.height = contents.height
  115.     rect.x = index * rect.width
  116.     if YEA::BATTLE::BATTLESTATUS_CENTER_FACES
  117.       rect.x += (contents.width - $game_party.members.size * rect.width) / 2
  118.     end
  119.     rect.y = 0
  120.     return rect
  121.   end
  122.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  123.     bitmap = Cache.face(face_name)
  124.     fx = [(96 - item_rect(0).width + 1) / 2, 0].max
  125.     fy = face_index / 4 * 96 + 2
  126.     fw = [item_rect(0).width - 4, 92].min
  127.     rect = Rect.new(fx, fy, fw, 92)
  128.     rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92)
  129.     contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha)
  130.     bitmap.dispose
  131.   end
  132.   def draw_actor_name(actor, dx, dy, dw = 112)
  133.     reset_font_settings
  134.     contents.font.size = YEA::BATTLE::BATTLESTATUS_NAME_FONT_SIZE
  135.     change_color(hp_color(actor))
  136.     draw_text(dx+24, dy, dw-24, line_height, actor.name)
  137.   end
  138.   def draw_actor_action(actor, dx, dy)
  139.     draw_icon(action_icon(actor), dx, dy)
  140.   end
  141.   def action_icon(actor)
  142.     return Icon.no_action if actor.current_action.nil?
  143.     return Icon.no_action if actor.current_action.item.nil?
  144.     return actor.current_action.item.icon_index
  145.   end
  146.   def draw_tp?(actor)
  147.     return actor.draw_tp?
  148.   end
  149.   def draw_mp?(actor)
  150.     return actor.draw_mp?
  151.   end
  152.   def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2)
  153.     change_color(color1)
  154.     draw_text(dx, dy, dw, line_height, current.to_s, 2)
  155.   end
  156.   def draw_actor_hp(actor, dx, dy, width = 124)
  157.     draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  158.     change_color(system_color)
  159.     cy = (Font.default_size - contents.font.size) / 2 + 1
  160.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a)
  161.     draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp,
  162.       hp_color(actor), normal_color)
  163.     end
  164.   def draw_actor_mp(actor, dx, dy, width = 124)
  165.     draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  166.     change_color(system_color)
  167.     cy = (Font.default_size - contents.font.size) / 2 + 1
  168.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a)
  169.     draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp,
  170.       mp_color(actor), normal_color)
  171.     end
  172.   def draw_actor_tp(actor, dx, dy, width = 124)
  173.     draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  174.     change_color(system_color)
  175.     cy = (Font.default_size - contents.font.size) / 2 + 1
  176.     draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a)
  177.     change_color(tp_color(actor))
  178.     draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2)
  179.   end
  180. end
  181. class Window_BattleActor < Window_BattleStatus
  182.   def show
  183.     create_flags
  184.     super
  185.   end
  186.   def create_flags
  187.     set_select_flag(:any)
  188.     select(0)
  189.     return if $game_temp.battle_aid.nil?
  190.     if $game_temp.battle_aid.need_selection?
  191.       select(0)
  192.       set_select_flag(:dead) if $game_temp.battle_aid.for_dead_friend?
  193.     elsif $game_temp.battle_aid.for_user?
  194.       battler = BattleManager.actor
  195.       id = battler.nil? ? 0 : $game_party.battle_members.index(battler)
  196.       select(id)
  197.       set_select_flag(:user)
  198.     elsif $game_temp.battle_aid.for_all?
  199.       select(0)
  200.       set_select_flag(:all)
  201.       set_select_flag(:all_dead) if $game_temp.battle_aid.for_dead_friend?
  202.     elsif $game_temp.battle_aid.for_random?
  203.       select(0)
  204.       set_select_flag(:random) if $game_temp.battle_aid.for_random?
  205.     end
  206.   end
  207.   def set_select_flag(flag)
  208.     @select_flag = flag
  209.     case @select_flag
  210.     when :all, :all_dead, :random
  211.       @cursor_all = true
  212.     else
  213.       @cursor_all = false
  214.     end
  215.   end
  216.   def update_cursor
  217.     if @cursor_all
  218.       cursor_rect.set(0, 0, contents.width, contents.height)
  219.       self.top_row = 0
  220.     elsif [url=home.php?mod=space&uid=370741]@Index[/url] < 0
  221.       cursor_rect.empty
  222.     else
  223.       ensure_cursor_visible
  224.       cursor_rect.set(item_rect(@index))
  225.     end
  226.   end
  227.   def cursor_movable?
  228.     return false if @select_flag == :user
  229.     return super
  230.   end
  231.   def current_item_enabled?
  232.     return true if $game_temp.battle_aid.nil?
  233.     if $game_temp.battle_aid.need_selection?
  234.       member = $game_party.battle_members[@index]
  235.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  236.     elsif $game_temp.battle_aid.for_dead_friend?
  237.       for member in $game_party.battle_members
  238.         return true if member.dead?
  239.       end
  240.       return false
  241.     end
  242.     return true
  243.   end
  244. end
  245. class Window_BattleStatusAid < Window_BattleStatus
  246.   attr_accessor :status_window
  247.   def initialize
  248.     super
  249.     self.visible = false
  250.     self.openness = 255
  251.   end
  252.   def window_width; return 128; end
  253.   def show
  254.     super
  255.     refresh
  256.   end
  257.   def refresh
  258.     contents.clear
  259.     return if @status_window.nil?
  260.     draw_item(@status_window.index)
  261.   end
  262.   def item_rect(index)
  263.     return Rect.new(0, 0, contents.width, contents.height)
  264.   end
  265. end
  266. class Window_BattleEnemy < Window_Selectable
  267.   def initialize(info_viewport)
  268.     super(0, Graphics.height, window_width, fitting_height(1))
  269.     refresh
  270.     self.visible = false
  271.     @info_viewport = info_viewport
  272.   end
  273.   def col_max; return item_max; end
  274.   def show
  275.     create_flags
  276.     super
  277.   end
  278.   def create_flags
  279.     set_select_flag(:any)
  280.     select(0)
  281.     return if $game_temp.battle_aid.nil?
  282.     if $game_temp.battle_aid.need_selection?
  283.       select(0)
  284.     elsif $game_temp.battle_aid.for_all?
  285.       select(0)
  286.       set_select_flag(:all)
  287.     elsif $game_temp.battle_aid.for_random?
  288.       select(0)
  289.       set_select_flag(:random)
  290.     end
  291.   end
  292.   def set_select_flag(flag)
  293.     @select_flag = flag
  294.     case @select_flag
  295.     when :all, :random
  296.       @cursor_all = true
  297.     else
  298.       @cursor_all = false
  299.     end
  300.   end
  301.   def select_all?
  302.     return true if @select_flag == :all
  303.     return true if @select_flag == :random
  304.     return false
  305.   end
  306.   def update_cursor
  307.     if @cursor_all
  308.       cursor_rect.set(0, 0, contents.width, contents.height)
  309.       self.top_row = 0
  310.     elsif [url=home.php?mod=space&uid=370741]@Index[/url] < 0
  311.       cursor_rect.empty
  312.     else
  313.       ensure_cursor_visible
  314.       cursor_rect.set(item_rect(@index))
  315.     end
  316.   end
  317.   def cursor_movable?
  318.     return false if @select_flag == :user
  319.     return super
  320.   end
  321.   def current_item_enabled?
  322.     return true if $game_temp.battle_aid.nil?
  323.     if $game_temp.battle_aid.need_selection?
  324.       member = $game_party.battle_members[@index]
  325.       return member.dead? if $game_temp.battle_aid.for_dead_friend?
  326.     elsif $game_temp.battle_aid.for_dead_friend?
  327.       for member in $game_party.battle_members
  328.         return true if member.dead?
  329.       end
  330.       return false
  331.     end
  332.     return true
  333.   end
  334.   def enemy; @data[index]; end
  335.   def refresh
  336.     make_item_list
  337.     create_contents
  338.     draw_all_items
  339.   end
  340.   def make_item_list
  341.     @data = $game_troop.alive_members
  342.     @data.sort! { |a,b| a.screen_x <=> b.screen_x }
  343.   end
  344.   def draw_item(index); return; end
  345.   def update
  346.     super
  347.     return unless active
  348.     enemy.sprite_effect_type = :whiten
  349.     return unless select_all?
  350.     for enemy in $game_troop.alive_members
  351.       enemy.sprite_effect_type = :whiten
  352.     end
  353.   end
  354. end
  355. class Window_BattleHelp < Window_Help
  356.   attr_accessor :actor_window
  357.   attr_accessor :enemy_window
  358.   def update
  359.     super
  360.     if !self.visible and @text != ""
  361.       @text = ""
  362.       return refresh
  363.     end
  364.     update_battler_name
  365.   end
  366.   def update_battler_name
  367.     return unless @actor_window.active || @enemy_window.active
  368.     if @actor_window.active
  369.       battler = $game_party.battle_members[@actor_window.index]
  370.     elsif @enemy_window.active
  371.       battler = @enemy_window.enemy
  372.     end
  373.     if special_display?
  374.       refresh_special_case(battler)
  375.     else
  376.       refresh_battler_name(battler) if battler_name(battler) != @text
  377.     end
  378.   end
  379.   def battler_name(battler)
  380.     text = battler.name.clone
  381.     return text
  382.   end
  383.   def refresh_battler_name(battler)
  384.     contents.clear
  385.     reset_font_settings
  386.     change_color(normal_color)
  387.     @text = battler_name(battler)
  388.     icons = battler.state_icons + battler.buff_icons
  389.     dy = icons.size <= 0 ? line_height / 2 : 0
  390.     draw_text(0, dy, contents.width, line_height, @text, 1)
  391.     dx = (contents.width - (icons.size * 24)) / 2
  392.     draw_actor_icons(battler, dx, line_height, contents.width)
  393.   end
  394.   def special_display?
  395.     return false if $game_temp.battle_aid.nil?
  396.     return false if $game_temp.battle_aid.for_user?
  397.     return !$game_temp.battle_aid.need_selection?
  398.   end
  399.   def refresh_special_case(battler)
  400.     if $game_temp.battle_aid.for_opponent?
  401.       if $game_temp.battle_aid.for_all?
  402.         text = YEA::BATTLE::HELP_TEXT_ALL_FOES
  403.       else
  404.         case $game_temp.battle_aid.number_of_targets
  405.         when 1
  406.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_FOE
  407.         else
  408.           number = $game_temp.battle_aid.number_of_targets
  409.           text = sprintf(YEA::BATTLE::HELP_TEXT_MANY_RANDOM_FOE, number)
  410.         end
  411.       end
  412.     else
  413.       if $game_temp.battle_aid.for_dead_friend?
  414.         text = YEA::BATTLE::HELP_TEXT_ALL_DEAD_ALLIES
  415.       elsif $game_temp.battle_aid.for_random?
  416.         case $game_temp.battle_aid.number_of_targets
  417.         when 1
  418.           text = YEA::BATTLE::HELP_TEXT_ONE_RANDOM_ALLY
  419.         else
  420.           number = $game_temp.battle_aid.number_of_targets
  421.           text = sprintf(YEA::BATTLE::HELP_TEXT_RANDOM_ALLIES, number)
  422.         end
  423.       else
  424.         text = YEA::BATTLE::HELP_TEXT_ALL_ALLIES
  425.       end
  426.     end
  427.     return if text == @text
  428.     @text = text
  429.     contents.clear
  430.     reset_font_settings
  431.     draw_text(0, 0, contents.width, line_height*2, @text, 1)
  432.   end
  433. end
  434. class Window_SkillList < Window_Selectable
  435.   def spacing
  436.     return 8 if $game_party.in_battle
  437.     return super
  438.   end
  439. end
  440. class Window_ItemList < Window_Selectable
  441.   def spacing
  442.     return 8 if $game_party.in_battle
  443.     return super
  444.   end
  445. end
  446. class Scene_Battle < Scene_Base
  447.   attr_accessor :enemy_window
  448.   attr_accessor :info_viewport
  449.   attr_accessor :spriteset
  450.   attr_accessor :status_window
  451.   attr_accessor :status_aid_window
  452.   attr_accessor :subject
  453.   alias scene_battle_create_all_windows_abe create_all_windows
  454.   def create_all_windows
  455.     scene_battle_create_all_windows_abe
  456.     create_battle_status_aid_window
  457.     set_help_window
  458.   end
  459.   alias scene_battle_create_info_viewport_abe create_info_viewport
  460.   def create_info_viewport
  461.     scene_battle_create_info_viewport_abe
  462.     @status_window.refresh
  463.   end
  464.   def create_battle_status_aid_window
  465.     @status_aid_window = Window_BattleStatusAid.new
  466.     @status_aid_window.status_window = @status_window
  467.     @status_aid_window.x = Graphics.width - @status_aid_window.width
  468.     @status_aid_window.y = Graphics.height - @status_aid_window.height
  469.   end
  470.   def create_help_window
  471.     @help_window = Window_BattleHelp.new
  472.     @help_window.hide
  473.   end
  474.   def set_help_window
  475.     @help_window.actor_window = @actor_window
  476.     @help_window.enemy_window = @enemy_window
  477.   end
  478.   alias scene_battle_create_skill_window_abe create_skill_window
  479.   def create_skill_window
  480.     scene_battle_create_skill_window_abe
  481.     @skill_window.height = @info_viewport.rect.height
  482.     @skill_window.width = Graphics.width - @actor_command_window.width
  483.     @skill_window.y = Graphics.height - @skill_window.height
  484.   end
  485.   alias scene_battle_create_item_window_abe create_item_window
  486.   def create_item_window
  487.     scene_battle_create_item_window_abe
  488.     @item_window.height = @skill_window.height
  489.     @item_window.width = @skill_window.width
  490.     @item_window.y = Graphics.height - @item_window.height
  491.   end
  492.   alias scene_battle_next_command_abe next_command
  493.   def next_command
  494.     @status_window.show
  495.     redraw_current_status
  496.     @actor_command_window.show
  497.     @status_aid_window.hide
  498.     scene_battle_next_command_abe
  499.   end
  500.   alias scene_battle_prior_command_abe prior_command
  501.   def prior_command
  502.     redraw_current_status
  503.     scene_battle_prior_command_abe
  504.   end
  505.   def redraw_current_status
  506.     return if @status_window.index < 0
  507.     @status_window.draw_item(@status_window.index)
  508.   end
  509.   alias scene_battle_command_attack_abe command_attack
  510.   def command_attack
  511.     $game_temp.battle_aid = $data_skills[BattleManager.actor.attack_skill_id]
  512.     scene_battle_command_attack_abe
  513.   end
  514.   alias scene_battle_command_skill_abe command_skill
  515.   def command_skill
  516.     scene_battle_command_skill_abe
  517.     @status_window.hide
  518.     @actor_command_window.hide
  519.     @status_aid_window.show
  520.   end
  521.   alias scene_battle_command_item_abe command_item
  522.   def command_item
  523.     scene_battle_command_item_abe
  524.     @status_window.hide
  525.     @actor_command_window.hide
  526.     @status_aid_window.show
  527.   end
  528.   def on_skill_ok
  529.     [url=home.php?mod=space&uid=260100]@skill[/url] = @skill_window.item
  530.     $game_temp.battle_aid = @skill
  531.     BattleManager.actor.input.set_skill(@skill.id)
  532.     BattleManager.actor.last_skill.object = @skill
  533.     if @skill.for_opponent?
  534.       select_enemy_selection
  535.     elsif @skill.for_friend?
  536.       select_actor_selection
  537.     else
  538.       @skill_window.hide
  539.       next_command
  540.       $game_temp.battle_aid = nil
  541.     end
  542.   end
  543.   alias scene_battle_on_skill_cancel_abe on_skill_cancel
  544.   def on_skill_cancel
  545.     scene_battle_on_skill_cancel_abe
  546.     @status_window.show
  547.     @actor_command_window.show
  548.     @status_aid_window.hide
  549.   end
  550.   def on_item_ok
  551.     @item = @item_window.item
  552.     $game_temp.battle_aid = @item
  553.     BattleManager.actor.input.set_item(@item.id)
  554.     if @item.for_opponent?
  555.       select_enemy_selection
  556.     elsif @item.for_friend?
  557.       select_actor_selection
  558.     else
  559.       @item_window.hide
  560.       next_command
  561.       $game_temp.battle_aid = nil
  562.     end
  563.     $game_party.last_item.object = @item
  564.   end
  565.   alias scene_battle_on_item_cancel_abe on_item_cancel
  566.   def on_item_cancel
  567.     scene_battle_on_item_cancel_abe
  568.     @status_window.show
  569.     @actor_command_window.show
  570.     @status_aid_window.hide
  571.   end
  572.   alias scene_battle_select_actor_selection_abe select_actor_selection
  573.   def select_actor_selection
  574.     @status_aid_window.refresh
  575.     scene_battle_select_actor_selection_abe
  576.     @status_window.hide
  577.     @skill_window.hide
  578.     @item_window.hide
  579.     @help_window.show
  580.   end
  581.   alias scene_battle_on_actor_ok_abe on_actor_ok
  582.   def on_actor_ok
  583.     $game_temp.battle_aid = nil
  584.     scene_battle_on_actor_ok_abe
  585.     @status_window.show
  586.     if $imported["YEA-BattleCommandList"] && !@confirm_command_window.nil?
  587.       @actor_command_window.visible = !@confirm_command_window.visible
  588.     else
  589.       @actor_command_window.show
  590.     end
  591.     @status_aid_window.hide
  592.   end
  593.   alias scene_battle_on_actor_cancel_abe on_actor_cancel
  594.   def on_actor_cancel
  595.     BattleManager.actor.input.clear
  596.     @status_aid_window.refresh
  597.     $game_temp.battle_aid = nil
  598.     scene_battle_on_actor_cancel_abe
  599.     case @actor_command_window.current_symbol
  600.     when :skill
  601.       @skill_window.show
  602.     when :item
  603.       @item_window.show
  604.     end
  605.   end
  606.   alias scene_battle_select_enemy_selection_abe select_enemy_selection
  607.   def select_enemy_selection
  608.     @status_aid_window.refresh
  609.     scene_battle_select_enemy_selection_abe
  610.     @help_window.show
  611.   end
  612.   alias scene_battle_on_enemy_ok_abe on_enemy_ok
  613.   def on_enemy_ok
  614.     $game_temp.battle_aid = nil
  615.     scene_battle_on_enemy_ok_abe
  616.   end
  617.   alias scene_battle_on_enemy_cancel_abe on_enemy_cancel
  618.   def on_enemy_cancel
  619.     BattleManager.actor.input.clear
  620.     @status_aid_window.refresh
  621.     $game_temp.battle_aid = nil
  622.     scene_battle_on_enemy_cancel_abe
  623.     if @skill_window.visible || @item_window.visible
  624.       @help_window.show
  625.     else
  626.       @help_window.hide
  627.     end
  628.   end
  629.   def end_battle_conditions?
  630.     return true if $game_party.members.empty?
  631.     return true if $game_party.all_dead?
  632.     return true if $game_troop.all_dead?
  633.     return true if BattleManager.aborting?
  634.     return false
  635.   end
  636.   def refresh_status
  637.     #如果你是程序员,请顺手帮忙优化下这里,谢谢。
  638.     @status_window.refresh
  639.     for i in $game_party.battle_members
  640.       @status_window.draw_item($game_party.battle_members.index(i))
  641.     end
  642.   end
  643. end



  
感谢还有你,Project1

Lv4.逐梦者 (版主)

百合控

梦石
0
星屑
6438
在线时间
1274 小时
注册时间
2013-8-21
帖子
3657

开拓者

2
发表于 2014-2-3 20:41:17 | 只看该作者
本帖最后由 余烬之中 于 2014-2-3 20:52 编辑

有详细的出错过程吗 = =!
===========================
把两个脚本顺序调换一下试试

点评

如果脸图在前的话,在战斗中打开物品就会报错。 反过来是一战斗就会报错  发表于 2014-2-3 21:00
萌新瑟瑟发抖
看到我请叫我去干活
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
385
在线时间
100 小时
注册时间
2009-2-3
帖子
318
3
 楼主| 发表于 2014-2-3 20:46:04 | 只看该作者
余烬之中 发表于 2014-2-3 20:41
有详细的出错过程吗 = =!

---------------------------
Project1
---------------------------
脚本“├─装备帮助增强─┤”第 264 行:发生 NoMethodError 。

undefined method `uppos' for #<Window_BattleHelp:0x7ce77f8>
---------------------------
确定   
---------------------------

点评

见2L 如果还是不行就补充一点信息(比如说怎么出错的{战斗后 战斗中 打开游戏 进入地图 ...})  发表于 2014-2-3 20:53
感谢还有你,Project1
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
385
在线时间
100 小时
注册时间
2009-2-3
帖子
318
4
 楼主| 发表于 2014-2-3 20:58:25 | 只看该作者
余烬之中 发表于 2014-2-3 20:41
有详细的出错过程吗 = =!
===========================
把两个脚本顺序调换一下试试 ...

---------------------------
匪匪の史诗 beta
---------------------------
脚本“战斗脸图”第 475 行:发生 NoMethodError 。

undefined method `actor_window=' for #<Window_Help2:0x7cdbb9c>
---------------------------
确定   
---------------------------
一打开战斗就会出现该错误
在普通状态下不会发生错误,仅仅在战斗中
感谢还有你,Project1
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (版主)

百合控

梦石
0
星屑
6438
在线时间
1274 小时
注册时间
2013-8-21
帖子
3657

开拓者

5
发表于 2014-2-3 21:11:38 | 只看该作者
wxx45600 发表于 2014-2-3 20:58
---------------------------
匪匪の史诗 beta
---------------------------

首先 确保【装备增强】在上面
然后 在【装备增强】中:
1.找个地方右键

2.如图所示 全部替换

最后 运行游戏 再试一遍

点评

已经可以了! 非常感谢(´・ω・`) 如果还有问题我追问吧!  发表于 2014-2-3 21:27

评分

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

查看全部评分

萌新瑟瑟发抖
看到我请叫我去干活
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-27 21:06

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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