| 赞 | 2 |
| VIP | |
| 好人卡 | |
| 积分 | 43 |
| 经验 | |
| 最后登录 | 2026-7-22 |
| 在线时间 | 789 小时 |
- 梦石
- 0
- 星屑
- 4293
- 在线时间
- 789 小时
- 注册时间
- 2015-6-27
- 回帖
- 62

|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 maotouying 于 2017-8-11 18:23 编辑
这是没有装备说明增强脚本的情况,描述窗口显示在上面,而且光标移到没有状态的地方窗口也不会消失
这是有装备说明增强脚本的情况,窗口挡住状态了,并且如果光标移到没有状态的地方信息窗口就会消失,如果不重新再打开一次,信息窗口就不会出现
请问要怎么修改才能在不删除装备说明增强脚本的情况下,把信息窗口弄得像第一个图一样,并且光标移到没有状态的地方信息窗口不会消失呢?
这是状态信息脚本
- # ステ―ト詳細確認ウィンドウ
- #
- # 戦闘時、パーティコマンドに付与されているステートの詳細を確認するためのコマンド
- # を追加します。
-
- $imported_yana_scripts ||= {}
- $imported_yana_scripts["StateHelpWindow"] = true
-
- module StateHelp
- Buffs = {}
- States = []
-
- # 请按照下面的描写进行备注
-
- Buffs[[0,:up]] = "HP+25%,最高5级\n持续5回合"
- Buffs[[1,:up]] = "MP+25%,最高5级\n持续5回合"
- Buffs[[2,:up]] = "物攻+25%,最高5级\n持续5回合"
- Buffs[[3,:up]] = "物防+25%,最高5级\n持续5回合"
- Buffs[[4,:up]] = "魔攻+25%,最高5级\n持续5回合"
- Buffs[[5,:up]] = "魔防+25%,最高5级\n持续5回合"
- Buffs[[6,:up]] = "敏捷+25%,最高5级\n持续5回合"
- Buffs[[7,:up]] = "幸运+25%,最高5级\n持续5回合"
-
- Buffs[[0,:down]] = "HP-25%,最高5级\n持续5回合"
- Buffs[[1,:down]] = "MP-25%,最高5级\n持续5回合"
- Buffs[[2,:down]] = "物攻-25%,最高5级\n持续5回合"
- Buffs[[3,:down]] = "物防-25%,最高5级\n持续5回合"
- Buffs[[4,:down]] = "魔攻-25%,最高5级\n持续5回合"
- Buffs[[5,:down]] = "魔防-25%,最高5级\n持续5回合"
- Buffs[[6,:down]] = "敏捷-25%,最高5级\n持续5回合"
- Buffs[[7,:down]] = "幸运-25%,最高5级\n持续5回合"
-
- States[1] = "无法战斗:死亡。"
- States[2] = "毒:生命再生-10%\n永续。"
- States[3] = "致盲:物理命中率-60%\n2~4回合。"
- States[4] = "沉默:无法使用技能\n2~3回合。"
- States[5] = "混乱:会攻击双方人物\n2~4回合。"
- States[6] = "睡眠:无法使用法术技能受到伤害立刻解除\n3~5回合。"
- States[7] = "麻痹:无法行动,不会闪避任何伤害30%解除\n4~6回合。"
- States[8] = "眩晕:无法行动,20%解除\n1~2回合。"
- States[87] = "耶"
- end
- class Game_BattlerBase
- attr_reader :buffs
- end
-
- class Window_State < Window_Selectable
- def initialize(help_window)
- super(0,0,32,32)
- # self.x = [Graphics.width / 2 - self.width / 2,0].max
- # self.y = [Graphics.height / 2 - self.height / 2,help_window.height].max
- self.openness = 0
- @help_window = help_window
- refresh
- end
- def all_battle_members;($game_party.battle_members + $game_troop.members).select{|m| m.exist? };end
- def row_max;all_battle_members.size;end
- def col_max
- m = all_battle_members.max_by{|a| a.state_icons.size + a.buff_icons.size }
- [m.state_icons.size + m.buff_icons.size,1].max
- end
- def item_max;row_max*col_max;end
- def item_height; line_height + 2 ; end
- def item_width; line_height + 2 ; end
-
- def fitting_window
- self.height = item_height * row_max + standard_padding*2
- self.width = 144+(col_max*item_width) + standard_padding*2
- self.x = [Graphics.width / 2 - self.width / 2,0].max
- self.y = [Graphics.height / 2 - self.height / 2,help_window.height].max
- end
- def refresh
- fitting_window
- make_data
- create_contents
- all_battle_members.each_with_index{|a,i|
- draw_actor_name(a,0,i*item_height+1)
- draw_text(128,i*item_height+1,20,line_height,":")
- draw_icons(a, 144, i*item_height+1, contents.width - 144)
- }
- end
-
- def draw_icons(subject, x, y, width = 96)
- icons = (subject.state_icons + subject.buff_icons)[0, width / item_width]
- icons.each_with_index {|n, i| draw_icon(n, x + item_width * i, y) }
- end
-
- def item_rect(index)
- rect = Rect.new
- rect.width = item_width
- rect.height = item_height
- rect.x = index % col_max * item_width + 143
- rect.y = index / col_max * item_height
- rect
- end
-
- def update_help
- @help_window.set_text(description)
- end
-
- def make_data
- @data = all_battle_members.inject([]){|r,m|
- a = []
- a += m.states.select{|st| st.icon_index != 0 }
- bf = []
- m.buffs.each_with_index{|b,i| bf.push([i,b > 0 ? :up : :down]) if b != 0}
- a += bf
- a += Array.new(col_max - a.size){nil} if col_max > a.size
- r += a
- }
- end
-
- def description
- return "" unless @data[index]
- if @data[index].is_a?(Array)
- return StateHelp::Buffs[@data[index]]
- else
- return StateHelp::States[@data[index].id]
- end
- end
- def cursor_down(wrap = false)
- return if @data.compact.empty?
- loop do
- select((index + col_max) % item_max)
- break if @data[index]
- end
- end
- def cursor_up(wrap = false)
- return if @data.compact.empty?
- loop do
- select((index - col_max + item_max) % item_max)
- break if @data[index]
- end
- end
- def cursor_right(wrap = false)
- return if @data.compact.empty?
- loop do
- select((index + 1) % item_max)
- break if @data[index]
- end
- end
- def cursor_left(wrap = false)
- return if @data.compact.empty?
- loop do
- select((index - 1 + item_max) % item_max)
- break if @data[index]
- end
- end
- def smooth_select
- return select(0) if @data.compact.empty?
- @data.each_with_index{|d,i|
- if d
- select(i)
- return
- end
- }
- end
- end
-
- class Window_ActorCommand < Window_Command
- alias _ex_state_make_command_list make_command_list
- def make_command_list
- _ex_state_make_command_list
- add_command("状态", :state)
- end
- end
-
- class Scene_Battle < Scene_Base
- alias _ex_state_create_all_windows create_all_windows
- def create_all_windows
- _ex_state_create_all_windows
- create_state_window
- end
- alias _ex_state_create_actor_command_window create_actor_command_window
- def create_actor_command_window
- _ex_state_create_actor_command_window
- @actor_command_window.set_handler(:state, method(:command_state))
- end
-
- def create_state_window
- @state_window = Window_State.new(@help_window)
- @state_window.set_handler(:ok, method(:command_state_cancel))
- @state_window.set_handler(:cancel, method(:command_state_cancel))
- @state_window.unselect
- end
-
- def command_state
- @actor_command_window.deactivate
- @state_window.refresh
- @state_window.open.activate.smooth_select
- @help_window.show
- end
-
- def command_state_cancel
- @state_window.deactivate.close.unselect
- @actor_command_window.activate
- @help_window.hide
- end
- end
复制代码
这是装备说明增强脚本
- #encoding:utf-8
- #==============================================================================
- # ■ 装备说明增强 By wyongcan
- #==============================================================================
- module Equipplus
- CODE ={
- 11 => "属性抗性",
- 12 => "弱化抗性",
- 13 => "状态抗性",
- 14 => "状态免疫",
- 21 => "普通能力",
- 22 => "添加能力",
- 23 => "特殊能力",
- 31 => "攻击附带属性",
- 32 => "攻击附带状态",
- 33 => "修正攻击速度",
- 34 => "添加攻击次数",
- 41 => "添加技能类型",
- 42 => "禁用技能类型",
- 43 => "添加技能",
- 44 => "禁用技能",
- 51 => "可装备武器类型",
- 52 => "可装备护甲类型",
- 53 => "固定装备",
- 54 => "禁用装备",
- 55 => "装备风格",
- 61 => "添加行动次数",
- 62 => "特殊标志",
- 63 => "消失效果",
- 64 => "队伍能力"}
- #特殊标志
- FLAG ={
- 0 => "自动战斗",
- 1 => "擅长防御",
- 2 => "保护弱者",
- 3 => "特技专注"}
- #普通能力
- PARAM ={
- 0 => "最大HP",
- 1 => "最大MP",
- 2 => "物理攻击",
- 3 => "物理防御",
- 4 => "魔法攻击",
- 5 => "魔法防御",
- 6 => "速 度 值",
- 7 => "敏 捷 值"}
- #添加能力
- XPARAM ={
- 0 => "物理命中几率:",
- 1 => "物理闪避几率:",
- 2 => "必杀几率:",
- 3 => "必杀闪避几率:",
- 4 => "魔法闪避几率:",
- 5 => "魔法反射几率:",
- 6 => "物理反击几率:",
- 7 => "体力值再生速度:",
- 8 => "魔力值再生速度:",
- 9 => "特技值再生速度:"}
- #特殊能力
- SPARAM ={
- 0 => "受到攻击的几率",
- 1 => "防御效果比率",
- 2 => "恢复效果比率",
- 3 => "药理知识",
- 4 => "MP消费率",
- 5 => "TP消耗率",
- 6 => "物理伤害加成",
- 7 => "魔法伤害加成",
- 8 => "地形伤害加成",
- 9 => "经验获得加成"}
- @队伍能力 ={
- 0 => "遇敌几率减半",
- 1 => "随机遇敌无效",
- 2 => "敌人偷袭无效",
- 3 => "先制攻击几率上升",
- 4 => "获得金钱数量双倍",
- 5 => "物品掉落几率双倍"}
- def self.equiphelpready
- @状态 = {}
- @武器类型 = {}
- @防具类型 = {}
- @属性 = {}
- $data_states.each{|x| @状态[x.id] = x.name if x != nil}
- elements = $data_system.elements
- weapon_types = $data_system.weapon_types
- armor_types = $data_system.armor_types
- elements.each_with_index{|x,y| @属性[y] = x if x != ""}
- weapon_types.each_with_index{|x,y| @武器类型[y] = x if x != ""}
- armor_types.each_with_index{|x,y| @防具类型[y] = x if x != ""}
- end
- def self.getequiphelp(equip)
- help = ""
- param = []
- equip.params.each_with_index{|x,y| param.push([PARAM[y],x])}
- param = param.select{|x| x[1] != 0}
- param.each{|x| help += x[0] + ":" + x[1].to_int.to_s + "\n"}
- features = equip.features
- features.select{|x| x.code == 55}.each{|x| help += CODE[x.code] + ":双持武器" + "\n"}
- features.select{|x| x.code == 11}.each{|x| help += CODE[x.code] + ":" + @属性[x.data_id] + "*" + x.value.to_s + "\n"}
- features.select{|x| x.code == 12}.each{|x| help += CODE[x.code] + ":" + PARAM[x.data_id] + "*" + x.value.to_s + "\n"}
- features.select{|x| x.code == 13}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "*" + x.value.to_s + "\n"}
- features.select{|x| x.code == 14}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "\n"}
- features.select{|x| x.code == 31}.each{|x| help += CODE[x.code] + ":" + @属性[x.data_id] + "\n"}
- features.select{|x| x.code == 32}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "+" + x.value.to_s + "\n"}
- features.select{|x| x.code == 33}.each{|x| help += CODE[x.code] + ":" + x.value.to_s + "\n"}
- features.select{|x| x.code == 34}.each{|x| help += CODE[x.code] + ":" + x.value.to_s + "\n"}
- features.select{|x| x.code == 41}.each{|x| help += CODE[x.code] + ":" + (x.data_id == 1 ? "特技" : "魔法") + "\n"}
- features.select{|x| x.code == 42}.each{|x| help += CODE[x.code] + ":" + (x.data_id == 1 ? "特技" : "魔法") + "\n"}
- features.select{|x| x.code == 43}.each{|x| help += CODE[x.code] + ":" + $data_skills[x.data_id].name + "\n"}
- features.select{|x| x.code == 44}.each{|x| help += CODE[x.code] + ":" + $data_skills[x.data_id].name + "\n"}
- features.select{|x| x.code == 51}.each{|x| help += CODE[x.code] + ":" + @武器类型[x.data_id] + "\n"}
- features.select{|x| x.code == 52}.each{|x| help += CODE[x.code] + ":" + @防具类型[x.data_id] + "\n"}
- features.select{|x| x.code == 61}.each{|x| help += CODE[x.code] + ":" + x.value.to_s + "\n"}
- features.select{|x| x.code == 62}.each{|x| help += CODE[x.code] + ":" + FLAG[x.data_id] + "\n"}
- features.select{|x| x.code == 64}.each{|x| help += CODE[x.code] + ":" + @队伍能力[x.data_id] + "\n"}
- featuresparam = []
- featuresparam.push features.select{|x| x.code == 21}
- featuresparam.push features.select{|x| x.code == 22}
- featuresparam.push features.select{|x| x.code == 23}
- featuresparam[0].each{|x| help += PARAM[x.data_id] + "*" + x.value.to_s + "\n"}
- featuresparam[1].each{|x| help += XPARAM[x.data_id] + x.value.to_s + "\n"}
- featuresparam[2].each{|x| help += SPARAM[x.data_id] + "*" + x.value.to_s + "\n"}
- # ======== 改动部分 ========
- if equip.strongto > 0
- strong = nil
- if equip.is_a?(RPG::Weapon)
- strong = $data_weapons[equip.strongto]
- elsif equip.is_a?(RPG::Armor)
- strong = $data_armors[equip.strongto]
- end
- help += "可强化到 " + strong.name + "\n"
- end
- # ======== 改动部分 ========
- help
- end
- def self.getline(text,maxtext)
- xtext = []
- line = 0
- text.each_line{|x| xtext.push x.sub(/\n/){}}
- xtext.each{|x| x.size % maxtext != 0 ? line += x.size / maxtext + 1 : line += x.size / maxtext}
- line
- end
- end
- #==============================================================================
- # ■ Window_Help
- #------------------------------------------------------------------------------
- # 显示特技和物品等的说明、以及角色状态的窗口
- #==============================================================================
- class Window_Help2 < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize(line_number = 0)
- super(0, 0, 210, 0)
- self.z = 150
- contents.font.size = 14
- hide
- end
- #--------------------------------------------------------------------------
- # ● 设置内容
- #--------------------------------------------------------------------------
- def set_text(text)
- @text = text
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 清除
- #--------------------------------------------------------------------------
- def clear
- set_text("")
- end
- #--------------------------------------------------------------------------
- # ● 更新帮助位置
- #--------------------------------------------------------------------------
- def uppos(index,rect,window)
- self.height = fitting_height2(Equipplus.getline(@xtext,13))
- create_contents
- contents.font.size = 14
- rect.x -= window.ox
- rect.y -= window.oy
- ax = rect.x + rect.width + 10
- ax = rect.x - self.width + 10 if ax + self.width > window.width + 10
- ax += window.x
- ax = 0 if ax < 0
- ay = rect.y + rect.height
- ay = rect.y - self.height if ay + self.height > window.height
- ay += window.y
- ay = 0 if ay < 0
- self.x = ax
- self.y = ay
- set_text(@xtext)
- show
- end
- #--------------------------------------------------------------------------
- # ● 设置物品
- # item : 技能、物品等
- #--------------------------------------------------------------------------
- def set_item(item)
- if item == nil
- set_text("")
- return
- end
- @xtext = ""
- @xtext = "名称:" + item.name + "\n"
- @xtext += "介绍:" + item.description + "\n"
- # @xtext += "价格:" + item.price.to_s + "\n" if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Item)
- @xtext += Equipplus.getequiphelp(item) if item.is_a?(RPG::EquipItem)
- @xtext = @xtext[0,@text.size - 2] if @xtext[@xtext.size - 2,2] == "\n"
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- hide if @text == ""
- draw_text_ex2(4, 0, @text,width,40,false)
- end
- end
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● 计算窗口显示指定行数时的应用高度2*************************
- #--------------------------------------------------------------------------
- def fitting_height2(line_number)
- line_number * contents.font.size + standard_padding * 2
- end
- #~ draw_text_ex的增强,使其可以自动换行 原作者:叶子 修改:wyongcan
- #--------------------------------------------------------------------------
- # ● 绘制带有控制符的文本内容
- # 如果传递了width参数的话,会自动换行
- #--------------------------------------------------------------------------
- def draw_text_ex2(x, y, text, width = nil,textwidth = nil,normalfont = true)
- reset_font_settings if normalfont == true
- text = convert_escape_characters(text)
- pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
- if width != nil
- pos[:height] = contents.font.size
- pos[:width] = width
- pos[:textwidth] = textwidth
- end
- process_character(text.slice!(0, 1), text, pos) until text.empty?
- end
- #--------------------------------------------------------------------------
- # ● 文字的处理
- # c : 文字
- # text : 绘制处理中的字符串缓存(字符串可能会被修改)
- # pos : 绘制位置 {:x, :y, :new_x, :height}
- #--------------------------------------------------------------------------
- def process_character(c, text, pos)
- case c
- when "\r" # 回车
- return
- when "\n" # 换行
- process_new_line(text, pos)
- when "\f" # 翻页
- process_new_page(text, pos)
- when "\e" # 控制符
- process_escape_character(obtain_escape_code(text), text, pos)
- else # 普通文字
- pos[:textwidth] == nil ? text_width = text_size(c).width : text_width = pos[:textwidth]
- if pos[:width] != nil && pos[:x] - pos[:new_x] + text_width > pos[:width]
- process_new_line(text, pos)
- end
- process_normal_character(c, pos)
- end
- end
- end
- class Window_ItemList < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 更新帮助内容
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_item(item)
- @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
- end
- end
- class Window_SkillList < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 更新帮助内容
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_item(item)
- @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
- end
- end
- class Window_ShopBuy < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 更新帮助内容
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_item(item) if @help_window
- @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil && @help_window
- @status_window.item = item if @status_window
- end
- end
- class Window_EquipSlot < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 更新帮助内容
- #--------------------------------------------------------------------------
- def update_help
- super
- @help_window.set_item(item) if @help_window
- @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil && @help_window
- @status_window.set_temp_actor(nil) if @status_window
- end
- end
- class Scene_Shop < Scene_MenuBase
- alias on_sell_ok_old on_sell_ok
- def on_sell_ok
- on_sell_ok_old
- @help_window.hide
- end
- alias on_buy_ok_old on_buy_ok
- def on_buy_ok
- on_buy_ok_old
- @help_window.hide
- end
- alias on_number_ok_old on_number_ok
- def on_number_ok
- on_number_ok_old
- @help_window.refresh
- @help_window.show
- end
- alias on_number_cancel_old on_number_cancel
- def on_number_cancel
- on_number_cancel_old
- @help_window.refresh
- @help_window.show
- end
- end
- class Scene_Title < Scene_Base
- alias start_old start
- def start
- start_old
- Equipplus.equiphelpready
- end
- end
- class Scene_ItemBase < Scene_MenuBase
- alias old_on_actor_cancel on_actor_cancel
- def on_actor_cancel
- old_on_actor_cancel
- @help_window.refresh
- end
- alias old_on_actor_ok on_actor_ok
- def on_actor_ok
- old_on_actor_ok
- @help_window.refresh
- end
- end
- class Window_Base < Window
- alias old_process_new_line process_new_line
- def process_new_line(text, pos)
- old_process_new_line(text, pos)
- pos[:height] = contents.font.size if pos[:width] != nil
- end
- end
- class Scene_MenuBase < Scene_Base
- def create_help_window
- @help_window = Window_Help2.new
- @help_window.viewport = @viewport
- end
- end
- class Scene_Battle < Scene_Base
- def create_help_window
- @help_window = Window_Help2.new
- @help_window.visible = false
- end
- end
复制代码
请问该如何解决呢? |
|