赞 | 0 |
VIP | 16 |
好人卡 | 0 |
积分 | 1 |
经验 | 12245 |
最后登录 | 2023-5-31 |
在线时间 | 275 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 70
- 在线时间
- 275 小时
- 注册时间
- 2008-10-22
- 帖子
- 205
|
KKME系统和组合装备脚本冲突...把组合装备脚本放上面所有武器都能无限次合成,而且装备说明里仍有控制合成次数的文字
把组合装备脚本放下面,其他正常,装备界面打不开......
另:我用了跟随光标移动的详尽帮助脚本,也贴上了 而且组合装备脚本和攻击力随机也冲突.....本人脚本盲,被KKME系统、组合装备脚本、详尽帮助、装备耐久度之间的冲突弄得彻底无语了,谁帮我整合下,1V酬谢
- #==============================================================================
- # ■ Window_Equip_Left
- #------------------------------------------------------------------------------
- # 装备画面的、显示角色能力值变化的窗口。
- #==============================================================================
- class Window_Equip_Left < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(30, 20, 180, 362)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.font.size = 20
- @actor = actor
- @color1 = normal_color
- @color2 = normal_color
- @color3 = normal_color
- @color4 = normal_color
- @color5 = normal_color
- refresh
- end
- def set_actor(actor)
- @actor = actor
- refresh
- end
- def set_parameters_color(color1 = normal_color,color2 = normal_color,color3 = normal_color,color4 = normal_color,color5 = normal_color)
- @color1 = color1
- @color2 = color2
- @color3 = color3
- @color4 = color4
- @color5 = color5
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- ####################
- upordown_x = 156
- equipopacity_u = 0
- equipopacity_d = 0
- c = 20
- cc = 60
- ####################
- draw_actor_graphic(@actor, 108, 60)#####################
- draw_actor_name(@actor, 0, 0)
- draw_actor_parameter(@actor, 0, 64, 0)
- draw_actor_parameter(@actor, 0, 76 + c, 1)
- draw_actor_parameter(@actor, 0, 88 + 2*c, 2)
- draw_actor_level_new(@actor, 0, 32, @color1)
- draw_actor_parameter(@actor, 0, 112 + 3*c, 3, @color2)
- draw_actor_parameter(@actor, 0, 124 + 4*c, 4, @color3)
- draw_actor_parameter(@actor, 0, 136 + 5*c, 5, @color4)
- draw_actor_parameter(@actor, 0, 148 + 6*c, 6, @color5)
- # 攻击力
- if @new_atk != nil
- if actor_parameter(@actor,0) > @new_atk
- equipopacity_u = 0
- equipopacity_d = 255
- e_atk = actor_parameter(@actor,0) - @new_atk
- cx = contents.text_size(e_atk.to_s).width
- equip_color = down_color
- elsif actor_parameter(@actor,0) < @new_atk
- equipopacity_u = 255
- equipopacity_d = 0
- e_atk = @new_atk - actor_parameter(@actor,0)
- cx = contents.text_size(e_atk.to_s).width
- equip_color = up_color
- else
- equipopacity_u = 0
- equipopacity_d = 0
- end
- bitmap = RPG::Cache.icon("66RPG_up.png")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(68+c, 70, bitmap, src_rect,equipopacity_u)
- bitmap = RPG::Cache.icon("66RPG_down.png")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(68+c, 70, bitmap, src_rect,equipopacity_d)
- if @new_atk != actor_parameter(@actor,0)
- self.contents.font.color = equip_color
- self.contents.draw_text(68+c+12, 64, 36, 32, e_atk.to_s, 2)
- end
- end
- # 物理防御
- if @new_pdef != nil
- if actor_parameter(@actor,1) > @new_pdef
- equipopacity_u = 0
- equipopacity_d = 255
- e_pdef = actor_parameter(@actor,1) - @new_pdef
- cx = contents.text_size(e_pdef.to_s).width
- equip_color = down_color
- elsif actor_parameter(@actor,1) < @new_pdef
- equipopacity_u = 255
- equipopacity_d = 0
- e_pdef = @new_pdef - actor_parameter(@actor,1)
- cx = contents.text_size(e_pdef.to_s).width
- equip_color = up_color
- else
- equipopacity_u = 0
- equipopacity_d = 0
- end
- bitmap = RPG::Cache.icon("66RPG_up.png")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(68+c,82+c, bitmap, src_rect,equipopacity_u)
- bitmap = RPG::Cache.icon("66RPG_down.png")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(68+c, 82+c, bitmap, src_rect,equipopacity_d)
- if actor_parameter(@actor,1) != @new_pdef
- self.contents.font.color = equip_color
- self.contents.draw_text(68+c+12, 76+c, 36, 32, e_pdef.to_s, 2)
- end
- end
- # 魔法防御
- if @new_mdef != nil
- if actor_parameter(@actor,2) > @new_mdef
- equipopacity_u = 0
- equipopacity_d = 255
- e_mdef = actor_parameter(@actor,2) - @new_mdef
- cx = contents.text_size(e_mdef.to_s).width
- equip_color = down_color
- elsif actor_parameter(@actor,2) < @new_mdef
- equipopacity_u = 255
- equipopacity_d = 0
- e_mdef = @new_mdef - actor_parameter(@actor,2)
- cx = contents.text_size(e_mdef.to_s).width
- equip_color = up_color
- else
- equipopacity_u = 0
- equipopacity_d = 0
- end
- bitmap = RPG::Cache.icon("66RPG_up.png")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(68+c, 94 + 2*c, bitmap, src_rect,equipopacity_u)
- bitmap = RPG::Cache.icon("66RPG_down.png")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(68+c, 94 + 2*c, bitmap, src_rect,equipopacity_d)
- if actor_parameter(@actor,2) != @new_mdef
- self.contents.font.color = equip_color
- self.contents.draw_text(68+c+12, 88 + 2*c, 36, 32, e_mdef.to_s, 2)
- end
- end
- # 力量
- if @new_str != nil
- if actor_parameter(@actor,3) > @new_str
- equipopacity_u = 0
- equipopacity_d = 255
- e_str = actor_parameter(@actor,3) - @new_str
- cx = contents.text_size(e_str.to_s).width
- equip_color = down_color
- elsif actor_parameter(@actor,3) < @new_str
- equipopacity_u = 255
- equipopacity_d = 0
- e_str = @new_str - actor_parameter(@actor,3)
- cx = contents.text_size(e_str.to_s).width
- equip_color = up_color
- else
- equipopacity_u = 0
- equipopacity_d = 0
- end
- bitmap = RPG::Cache.icon("66RPG_up.png")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(68+c, 118 + 3*c, bitmap, src_rect,equipopacity_u)
- bitmap = RPG::Cache.icon("66RPG_down.png")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(68+c, 118 + 3*c, bitmap, src_rect,equipopacity_d)
- if actor_parameter(@actor,3) != @new_str
- self.contents.font.color = equip_color
- self.contents.draw_text(68+c+12, 112 + 3*c, 36, 32, e_str.to_s, 2)
- end
- end
- # 灵巧
- if @new_dex != nil
- if actor_parameter(@actor,4) > @new_dex
- equipopacity_u = 0
- equipopacity_d = 255
- e_dex = actor_parameter(@actor,4) - @new_dex
- cx = contents.text_size(e_dex.to_s).width
- equip_color = down_color
- elsif actor_parameter(@actor,4) < @new_dex
- equipopacity_u = 255
- equipopacity_d = 0
- e_dex = @new_dex - actor_parameter(@actor,4)
- cx = contents.text_size(e_dex.to_s).width
- equip_color = up_color
- else
- equipopacity_u = 0
- equipopacity_d = 0
- end
- bitmap = RPG::Cache.icon("66RPG_up.png")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(68+c, 130+4*c, bitmap, src_rect,equipopacity_u)
- bitmap = RPG::Cache.icon("66RPG_down.png")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(68+c, 130+4*c, bitmap, src_rect,equipopacity_d)
- if actor_parameter(@actor,4) != @new_dex
- self.contents.font.color = equip_color
- self.contents.draw_text(68+c+12, 124+4*c, 36, 32, e_dex.to_s, 2)
- end
- end
- # 速度
- if @new_agi != nil
- if actor_parameter(@actor,5) > @new_agi
- equipopacity_u = 0
- equipopacity_d = 255
- e_agi = actor_parameter(@actor,5) - @new_agi
- cx = contents.text_size(e_agi.to_s).width
- equip_color = down_color
- elsif actor_parameter(@actor,5) < @new_agi
- equipopacity_u = 255
- equipopacity_d = 0
- e_agi = @new_agi - actor_parameter(@actor,5)
- cx = contents.text_size(e_agi.to_s).width
- equip_color = up_color
- else
- equipopacity_u = 0
- equipopacity_d = 0
- end
- bitmap = RPG::Cache.icon("66RPG_up.png")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(68+c, 142+5*c, bitmap, src_rect,equipopacity_u)
- bitmap = RPG::Cache.icon("66RPG_down.png")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(68+c, 142+5*c, bitmap, src_rect,equipopacity_d)
- if actor_parameter(@actor,5) != @new_agi
- self.contents.font.color = equip_color
- self.contents.draw_text(68+c+12, 136+5*c, 36, 32, e_agi.to_s, 2)
- end
- end
- # 魔力
- if @new_int != nil
- if actor_parameter(@actor,6) > @new_int
- equipopacity_u = 0
- equipopacity_d = 255
- e_int = actor_parameter(@actor,6) - @new_int
- cx = contents.text_size(e_int.to_s).width
- equip_color = down_color
- elsif actor_parameter(@actor,6) < @new_int
- equipopacity_u = 255
- equipopacity_d = 0
- e_int = @new_int - actor_parameter(@actor,6)
- cx = contents.text_size(e_int.to_s).width
- equip_color = up_color
- else
- equipopacity_u = 0
- equipopacity_d = 0
- end
- bitmap = RPG::Cache.icon("66RPG_up.png")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(68+c, 156+6*c, bitmap, src_rect,equipopacity_u)
- bitmap = RPG::Cache.icon("66RPG_down.png")
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(68+c, 156+6*c, bitmap, src_rect,equipopacity_d)
- if actor_parameter(@actor,6) != @new_int
- self.contents.font.color = equip_color
- self.contents.draw_text(68+c+12, 148+6*c, 36, 32, e_int.to_s, 2)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 变更装备后的能力值设置
- # new_atk : 变更装备后的攻击力
- # new_pdef : 变更装备后的物理防御
- # new_mdef : 变更装备后的魔法防御
- #--------------------------------------------------------------------------
- def set_new_parameters(new_atk, new_pdef, new_mdef,new_str,new_dex,new_agi,new_int)
- if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or @new_str != new_str or @new_dex != new_dex or @new_agi != new_agi or @new_int != new_int
- @new_atk = new_atk
- @new_pdef = new_pdef
- @new_mdef = new_mdef
- @new_str = new_str
- @new_dex = new_dex
- @new_agi = new_agi
- @new_int = new_int
- refresh
- end
- end
- end
复制代码
KKME系统里的和组合装备脚本冲突的,58~61行
- # 组合装备脚本 Written by SLICK
- module RPG
- class Weapon
- attr_accessor :combine
- def description
- return @description.split(/u/)[0].to_s
- end
- def combine
- ccc = @description.split(/u/)[1].to_i
- return ccc = nil ? 0 : ccc
- end
- end
- class Armor
- attr_accessor :combine
- def description
- return @description.split(/u/)[0].to_s
- end
- def combine
- ccc = @description.split(/u/)[1].to_i
- return ccc = nil ? 0 : ccc
- end
- end
- end
- class Scene_Title
- alias etech_main main
- def main
- etech_main
- $data_weapons[1000] = $data_weapons[0]
- $data_armors[1000] = $data_armors[0]
- end
- end
- class Scene_Save < Scene_File
- #--------------------------------------------------------------------------
- # ● 写入存档数据
- # file : 写入用文件对像 (已经打开)
- #--------------------------------------------------------------------------
- def write_save_data(file)
- # 生成描绘存档文件用的角色图形
- characters = []
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- characters.push([actor.character_name, actor.character_hue])
- end
- # 写入描绘存档文件用的角色数据
- Marshal.dump(characters, file)
- # 写入测量游戏时间用画面计数
- Marshal.dump(Graphics.frame_count, file)
- # 增加 1 次存档次数
- $game_system.save_count += 1
- # 保存魔法编号
- # (将编辑器保存的值以随机值替换)
- $game_system.magic_number = $data_system.magic_number
- # 写入各种游戏对像
- Marshal.dump($game_system, file)
- Marshal.dump($game_switches, file)
- Marshal.dump($game_variables, file)
- Marshal.dump($game_self_switches, file)
- Marshal.dump($game_screen, file)
- Marshal.dump($game_actors, file)
- Marshal.dump($game_party, file)
- Marshal.dump($game_troop, file)
- Marshal.dump($game_map, file)
- Marshal.dump($game_player, file)
- Marshal.dump($data_weapons.size, file)
- for iii in 1000...$data_weapons.size
- Marshal.dump($data_weapons[iii], file)
- end
- Marshal.dump($data_armors.size, file)
- for iii in 1000...$data_armors.size
- Marshal.dump($data_armors[iii], file)
- end
- end
- end
- class Scene_Load < Scene_File
- #--------------------------------------------------------------------------
- # ● 读取存档数据
- # file : 读取用文件对像 (已经打开)
- #--------------------------------------------------------------------------
- def read_save_data(file)
- # 读取描绘存档文件用的角色数据
- characters = Marshal.load(file)
- # 读取测量游戏时间用画面计数
- Graphics.frame_count = Marshal.load(file)
- # 读取各种游戏对像
- $game_system = Marshal.load(file)
- $game_switches = Marshal.load(file)
- $game_variables = Marshal.load(file)
- $game_self_switches = Marshal.load(file)
- $game_screen = Marshal.load(file)
- $game_actors = Marshal.load(file)
- $game_party = Marshal.load(file)
- $game_troop = Marshal.load(file)
- $game_map = Marshal.load(file)
- $game_player = Marshal.load(file)
- $data_weapons = []
- $data_armors = []
- $data_weapons = load_data("Data/Weapons.rxdata")
- $data_armors = load_data("Data/Armors.rxdata")
- iii = Marshal.load(file)
- for jjj in 1000...iii
- $data_weapons[jjj]= Marshal.load(file)
- end
- iii = Marshal.load(file)
- for jjj in 1000...iii
- $data_armors[jjj] = Marshal.load(file)
- end
- # 魔法编号与保存时有差异的情况下
- # (加入编辑器的编辑过的数据)
- if $game_system.magic_number != $data_system.magic_number
- # 重新装载地图
- $game_map.setup($game_map.map_id)
- $game_player.center($game_player.x, $game_player.y)
- end
- # 刷新同伴成员
- $game_party.refresh
- end
- end
- #==============================================================================
- # ■ Scene_Combine
- #------------------------------------------------------------------------------
- # 处理合成画面的类。
- #==============================================================================
- class Scene_Combine
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor_index : 角色索引
- # equip_index : 装备索引
- #--------------------------------------------------------------------------
- def initialize(actor_index = 0)
- @actor_index = actor_index
- end
- def main
- @help_window = Window_Help.new
- @name_window = Window_NNName.new($game_party.actors[@actor_index])
- @combine_window = Window_Material.new
- @combine_window.help_window = @help_window
- @equip_window = Window_CombineRight.new($game_party.actors[@actor_index])
- @equip_window.help_window = @help_window
- @ccconfirm_window = Window_CCConfirm.new
- @combine_window.visible = true
- @combine_window.active = false
- @equip_window.visible = true
- @equip_window.active = true
- @ccconfirm_window.visible = false
- @ccconfirm_window.active = false
- # 执行过度
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果画面切换就中断循环
- if $scene != self
- break
- end
- end
- # 装备过渡
- Graphics.freeze
- # 释放窗口
- @help_window.dispose
- @combine_window.dispose
- @equip_window.dispose
- @name_window.dispose
- @ccconfirm_window.dispose
- end
- def update
- @help_window.update
- @combine_window.update
- @equip_window.update
- @ccconfirm_window.update
- if @combine_window.active
- update_combine
- return
- end
- if @equip_window.active
- update_equip
- return
- end
- if @ccconfirm_window.active
- update_ccconfirm
- return
- end
- end
- def update_ccconfirm
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- @epro_window.dispose
- @ccconfirm_window.active = false
- @ccconfirm_window.visible = false
- @equip_window.active = true
- return
- end
- if Input.trigger?(Input::C)
- case @ccconfirm_window.index
- when 0
- $game_system.se_play($data_system.decision_se)
- iiitem = @combine_window.item
- case @equip_window.index
- when 0
- make_new_equip($data_weapons[$game_party.actors[@actor_index].weapon_id], iiitem)
- when 1
- make_new_equip($data_armors[$game_party.actors[@actor_index].armor1_id], iiitem)
- when 2
- make_new_equip($data_armors[$game_party.actors[@actor_index].armor2_id], iiitem)
- when 3
- make_new_equip($data_armors[$game_party.actors[@actor_index].armor3_id], iiitem)
- when 4
- make_new_equip($data_armors[$game_party.actors[@actor_index].armor4_id], iiitem)
- end
- when 1
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- @epro_window.dispose
- @ccconfirm_window.active = false
- @ccconfirm_window.visible = false
- @equip_window.active = true
- end
- return
- end
- if Input.trigger?(Input::UP)
- $game_system.se_play($data_system.cursor_se)
- @ccconfirm_window.index = 0
- return
- end
- if Input.trigger?(Input::DOWN)
- $game_system.se_play($data_system.cursor_se)
- @ccconfirm_window.index = 1
- return
- end
- end
- def make_new_equip(combine1, combine2)
- $game_switches[49] = true
- result = rand(100).to_i
- if result >= $game_variables[50]
- $game_party.actors[@actor_index].equip(@equip_window.index, 0, 1)
- $game_variables[49] = 1
- else
- if @equip_window.index == 0
- iii = $data_weapons.size
- kkk = $game_party.actors[@actor_index].weapon_id
- $data_weapons[iii] = $data_weapons[kkk].clone
- $data_weapons[iii].id = iii
- if $new_extra != nil
- $data_weapons[iii].name = ($new_extra + "-" + $data_weapons[kkk].name)
- end
- if $new_element_plus != nil
- $data_weapons[iii].name = ($new_element_plus + "-" + $data_weapons[kkk].name)
- end
- $data_weapons[iii].description = ($data_weapons[kkk].description + "u" + [$data_weapons[kkk].combine - 1].to_s)
- $data_weapons[iii].atk = $data_weapons[kkk].atk + ($atk_plus2 * (80 + rand(41)) / 100).to_i
- $data_weapons[iii].pdef = $data_weapons[kkk].pdef + ($pdef_plus2 * (80 + rand(41)) / 100).to_i
- $data_weapons[iii].mdef = $data_weapons[kkk].mdef + ($mdef_plus2 * (80 + rand(41)) / 100).to_i
- $data_weapons[iii].str_plus = $data_weapons[kkk].str_plus + ($str_plus2 * (80 + rand(41)) / 100).to_i
- $data_weapons[iii].dex_plus = $data_weapons[kkk].dex_plus + ($dex_plus2 * (80 + rand(41)) / 100).to_i
- $data_weapons[iii].agi_plus = $data_weapons[kkk].agi_plus + ($agi_plus2 * (80 + rand(41)) / 100).to_i
- $data_weapons[iii].int_plus = $data_weapons[kkk].int_plus + ($int_plus2 * (80 + rand(41)) / 100).to_i
- $data_weapons[iii].element_set = $element_plus2
- $game_party.gain_weapon(iii, 1)
- for jjj in 1...$data_classes.size
- if $data_classes[jjj].weapon_set.include?(kkk)
- $data_classes[jjj].weapon_set.push(iii)
- end
- end
- else
- iii = $data_armors.size
- case @equip_window.index
- when 1
- kkk = $game_party.actors[@actor_index].armor1_id
- when 2
- kkk = $game_party.actors[@actor_index].armor2_id
- when 3
- kkk = $game_party.actors[@actor_index].armor3_id
- when 4
- kkk = $game_party.actors[@actor_index].armor4_id
- end
- $data_armors[iii] = $data_armors[kkk].clone
- $data_armors[iii].id = iii
- if $new_extra != nil
- $data_armors[iii].name = ($new_extra + "-" + $data_armors[kkk].name)
- end
- if $new_element_plus != nil
- $data_armors[iii].name = ($new_element_plus + "-" + $data_armors[kkk].name)
- end
- $data_armors[iii].description = ($data_armors[kkk].description + "u" + [$data_armors[kkk].combine - 1].to_s)
- $data_armors[iii].eva = $data_armors[kkk].eva + ($eva_plus2 * (80 + rand(41)) / 100).to_i
- $data_armors[iii].pdef = $data_armors[kkk].pdef + ($pdef_plus2 * (80 + rand(41)) / 100).to_i
- $data_armors[iii].mdef = $data_armors[kkk].mdef + ($mdef_plus2 * (80 + rand(41)) / 100).to_i
- $data_armors[iii].str_plus = $data_armors[kkk].str_plus + ($str_plus2 * (80 + rand(41)) / 100).to_i
- $data_armors[iii].dex_plus = $data_armors[kkk].dex_plus + ($dex_plus2 * (80 + rand(41)) / 100).to_i
- $data_armors[iii].agi_plus = $data_armors[kkk].agi_plus + ($agi_plus2 * (80 + rand(41)) / 100).to_i
- $data_armors[iii].int_plus = $data_armors[kkk].int_plus + ($int_plus2 * (80 + rand(41)) / 100).to_i
- $data_armors[iii].guard_element_set = $element_plus2
- $game_party.gain_armor(iii, 1)
- for jjj in 1...$data_classes.size
- if $data_classes[jjj].armor_set.include?(kkk)
- $data_classes[jjj].armor_set.push(iii)
- end
- end
- end
- $game_party.actors[@actor_index].equip(@equip_window.index, iii, 1)
- $game_variables[49] = 0
- end
- $game_party.lose_item(combine2.id, 1)
- @epro_window.dispose
- $scene = Scene_Map.new
- end
- def update_combine
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- @combine_window.active = false
- @equip_window.active = true
- return
- end
- if Input.trigger?(Input::C)
- $game_system.se_play($data_system.decision_se)
- @combine_window.active = false
- @combine2 = @combine_window.item
- @epro_window = Window_EPro.new(@combine1, @combine2)
- @epro_window.visible = true
- @epro_window.active = false
- @ccconfirm_window.active = true
- @ccconfirm_window.visible = true
- end
- end
- def update_equip
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到菜单画面
- $game_switches[49] = true
- $game_variables[49] = 2
- $scene = Scene_Map.new
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- case @equip_window.index
- when 0
- @combine1 = $data_weapons[$game_party.actors[@actor_index].weapon_id]
- when 1
- @combine1 = $data_armors[$game_party.actors[@actor_index].armor1_id]
- when 2
- @combine1 = $data_armors[$game_party.actors[@actor_index].armor2_id]
- when 3
- @combine1 = $data_armors[$game_party.actors[@actor_index].armor3_id]
- when 4
- @combine1 = $data_armors[$game_party.actors[@actor_index].armor4_id]
- end
- $game_system.se_play($data_system.decision_se)
- if @combine1 == nil
- return
- end
- if @combine1.combine <= 0
- return
- end
- @combine_window.active = true
- @equip_window.active = false
- return
- end
- # 按下 R 键的情况下
- if Input.trigger?(Input::R)
- # 演奏光标 SE
- $game_system.se_play($data_system.cursor_se)
- # 移至下一位角色
- @actor_index += 1
- @actor_index %= $game_party.actors.size
- # 切换到别的装备画面
- $scene = Scene_Combine.new(@actor_index)
- return
- end
- # 按下 L 键的情况下
- if Input.trigger?(Input::L)
- # 演奏光标 SE
- $game_system.se_play($data_system.cursor_se)
- # 移至上一位角色
- @actor_index += $game_party.actors.size - 1
- @actor_index %= $game_party.actors.size
- # 切换到别的装备画面
- $scene = Scene_Combine.new(@actor_index)
- return
- end
- end
- end
- #==============================================================================
- # ■ Window_Material
- #------------------------------------------------------------------------------
- # 材料窗口。
- #==============================================================================
- class Window_Material < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 64, 320, 416)
- @column_max = 1
- refresh
- self.index = 0
- # 战斗中的情况下将窗口移至中央并将其半透明化
- if $game_temp.in_battle
- self.y = 64
- self.height = 256
- self.back_opacity = 160
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取物品
- #--------------------------------------------------------------------------
- def item
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- if self.contents != nil
- self.contents.dispose
- self.contents = nil
- end
- @data = []
- # 添加报务
- for i in 1...$data_items.size
- if $game_party.item_number(i) > 0
- if $data_items[i].element_set.include?(31)
- @data.push($data_items[i])
- end
- end
- end
- # 如果项目数不是 0 就生成位图、重新描绘全部项目
- @item_max = @data.size
- if @item_max > 0
- self.contents = Bitmap.new(width - 32, row_max * 32)
- for i in 0...@item_max
- draw_item(i)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目编号
- #--------------------------------------------------------------------------
- def draw_item(index)
- item = @data[index]
- case item
- when RPG::Item
- number = $game_party.item_number(item.id)
- when RPG::Weapon
- number = $game_party.weapon_number(item.id)
- when RPG::Armor
- number = $game_party.armor_number(item.id)
- end
- self.contents.font.color = normal_color
- x = 4
- y = index * 32
- rect = Rect.new(x, y, self.width / @column_max - 32, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- bitmap = RPG::Cache.icon(item.icon_name)
- opacity = self.contents.font.color == normal_color ? 255 : 128
- self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
- self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
- self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
- self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- #@help_window.set_text(self.item == nil ? "" : self.item.description)
- @help_window.set_text(item)
- #校正帮助窗口位置
- @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
- end
- end
- #==============================================================================
- # ■ Window_EquipRight
- #------------------------------------------------------------------------------
- # 装备画面、显示角色现在装备的物品的窗口。
- #==============================================================================
- class Window_NNName < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(320, 64, 320, 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.draw_text(4, 0, 256, 32, actor.name, 0)
- end
- end
- class Window_CombineRight < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(320, 128, 320, 352)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # ● 获取物品
- #--------------------------------------------------------------------------
- def item
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @data = []
- @data.push($data_weapons[@actor.weapon_id])
- @data.push($data_armors[@actor.armor1_id])
- @data.push($data_armors[@actor.armor2_id])
- @data.push($data_armors[@actor.armor3_id])
- @data.push($data_armors[@actor.armor4_id])
- @item_max = @data.size
- self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
- self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
- self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
- self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
- self.contents.draw_text(4, 32 * 4, 92, 32, $data_system.words.armor4)
- draw_item_name(@data[0], 92, 32 * 0)
- draw_item_name(@data[1], 92, 32 * 1)
- draw_item_name(@data[2], 92, 32 * 2)
- draw_item_name(@data[3], 92, 32 * 3)
- draw_item_name(@data[4], 92, 32 * 4)
- end
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- if self.item != nil
- ssstring = self.item.description
- case self.index
- when 0
- ssstring += " 还可以组合" + $data_weapons[@actor.weapon_id].combine.to_s + "次"
- when 1
- ssstring += " 还可以组合" + $data_armors[@actor.armor1_id].combine.to_s + "次"
- when 2
- ssstring += " 还可以组合" + $data_armors[@actor.armor2_id].combine.to_s + "次"
- when 3
- ssstring += " 还可以组合" + $data_armors[@actor.armor3_id].combine.to_s + "次"
- when 4
- ssstring += " 还可以组合" + $data_armors[@actor.armor4_id].combine.to_s + "次"
- end
- end
- #@help_window.set_text(self.item == nil ? "" : ssstring)
- @help_window.set_text(item)
- #校正帮助窗口位置
- @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
- end
- end
- #==============================================================================
- # ■ Window_EPro
- #------------------------------------------------------------------------------
- # 装备合成界面中的组装前后比较窗口。
- #==============================================================================
- class Window_EPro < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #
- #--------------------------------------------------------------------------
- def initialize(combine1, combine2)
- super(0, 0, 384, 480)
- self.contents = Bitmap.new(width - 32, height - 32)
- @combine1 = combine1
- @combine2 = combine2
- refresh
- self.z = 300
- end
- def refresh
- self.contents.clear
- if @combine1.is_a?(RPG::Weapon)
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 192, 32, "欲组装的武器:", 0)
- self.contents.font.color = normal_color
- self.contents.draw_text(164, 0, 192, 32, @combine1.name.to_s, 0)
- self.contents.font.color = system_color
- self.contents.draw_text(128, 32, 80, 32, "组装前", 0)
- self.contents.draw_text(256, 32, 80, 32, "组装后", 0)
- self.contents.draw_text(4, 64, 80, 32, "攻击力", 0)
- self.contents.draw_text(4, 96, 80, 32, "物理防", 0)
- self.contents.draw_text(4, 128, 80, 32, "魔法防", 0)
- self.contents.draw_text(4, 160, 80, 32, "加力量", 0)
- self.contents.draw_text(4, 192, 80, 32, "加灵巧", 0)
- self.contents.draw_text(4, 224, 80, 32, "加速度", 0)
- self.contents.draw_text(4, 256, 80, 32, "加魔力", 0)
- self.contents.draw_text(4, 288, 80, 32, "属性", 0)
- self.contents.font.color = normal_color
- self.contents.draw_text(128, 64, 80, 32, @combine1.atk.to_s, 0)
- self.contents.draw_text(128, 96, 80, 32, @combine1.pdef.to_s, 0)
- self.contents.draw_text(128, 128, 80, 32, @combine1.mdef.to_s, 0)
- self.contents.draw_text(128, 160, 80, 32, @combine1.str_plus.to_s, 0)
- self.contents.draw_text(128, 192, 80, 32, @combine1.dex_plus.to_s, 0)
- self.contents.draw_text(128, 224, 80, 32, @combine1.agi_plus.to_s, 0)
- self.contents.draw_text(128, 256, 80, 32, @combine1.int_plus.to_s, 0)
- $str_plus2 = 0
- $dex_plus2 = 0
- $agi_plus2 = 0
- $int_plus2 = 0
- $atk_plus2 = 0
- $new_extra = nil
- case @combine2.parameter_type
- when 1
- $atk_plus2 = @combine2.parameter_points
- $new_extra = "锐"
- when 3
- $str_plus2 = @combine2.parameter_points
- $new_extra = "劲"
- when 4
- $dex_plus2 = @combine2.parameter_points
- $new_extra = "敏"
- when 5
- $agi_plus2 = @combine2.parameter_points
- $new_extra = "疾"
- when 6
- $int_plus2 = @combine2.parameter_points
- $new_extra = "灵"
- end
- if $new_extra == nil and @combine2.pdef_f != 0
- $new_extra = "坚"
- end
- if $new_extra == nil and @combine2.mdef_f != 0
- $new_extra = "圣"
- end
- $pdef_plus2 = @combine2.pdef_f
- $mdef_plus2 = @combine2.mdef_f
- self.contents.draw_text(256, 64, 80, 32, $atk_plus2.to_s, 0)
- self.contents.draw_text(256, 96, 80, 32, $pdef_plus2.to_s, 0)
- self.contents.draw_text(256, 128, 80, 32, $mdef_plus2.to_s, 0)
- self.contents.draw_text(256, 160, 80, 32, $str_plus2.to_s, 0)
- self.contents.draw_text(256, 192, 80, 32, $dex_plus2.to_s, 0)
- self.contents.draw_text(256, 224, 80, 32, $agi_plus2.to_s, 0)
- self.contents.draw_text(256, 256, 80, 32, $int_plus2.to_s, 0)
- jjj = 288
- for iii in 1..16
- if @combine1.element_set.include?(iii)
- self.contents.draw_text(128, jjj, 80, 32, $data_system.elements[iii], 0)
- jjj += 32
- end
- end
- $element_plus2 = []
- $new_element_plus = nil
- for iii in 1..16
- if @combine1.element_set.include?(iii)
- $element_plus2.push(iii)
- end
- if @combine2.element_set.include?(iii)
- if $new_element_plus == nil
- $new_element_plus = $data_system.elements[iii].to_s
- end
- $element_plus2.push(iii)
- end
- end
- jjj = 288
- for iii in 1..16
- if $element_plus2.include?(iii)
- self.contents.draw_text(256, jjj, 80, 32, $data_system.elements[iii], 0)
- jjj += 32
- end
- end
- else
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 192, 32, "欲组装的防具:", 0)
- self.contents.font.color = normal_color
- self.contents.draw_text(164, 0, 192, 32, @combine1.name.to_s, 0)
- self.contents.font.color = system_color
- self.contents.draw_text(128, 32, 80, 32, "组装前", 0)
- self.contents.draw_text(256, 32, 80, 32, "组装后", 0)
- self.contents.draw_text(4, 64, 80, 32, "物理防", 0)
- self.contents.draw_text(4, 96, 80, 32, "魔法防", 0)
- self.contents.draw_text(4, 128, 80, 32, "加回避", 0)
- self.contents.draw_text(4, 160, 80, 32, "加力量", 0)
- self.contents.draw_text(4, 192, 80, 32, "加灵巧", 0)
- self.contents.draw_text(4, 224, 80, 32, "加速度", 0)
- self.contents.draw_text(4, 256, 80, 32, "加魔力", 0)
- self.contents.draw_text(4, 288, 80, 32, "属性防御", 0)
- self.contents.font.color = normal_color
- self.contents.draw_text(128, 64, 80, 32, @combine1.pdef.to_s, 0)
- self.contents.draw_text(128, 96, 80, 32, @combine1.mdef.to_s, 0)
- self.contents.draw_text(128, 128, 80, 32, @combine1.eva.to_s, 0)
- self.contents.draw_text(128, 160, 80, 32, @combine1.str_plus.to_s, 0)
- self.contents.draw_text(128, 192, 80, 32, @combine1.dex_plus.to_s, 0)
- self.contents.draw_text(128, 224, 80, 32, @combine1.agi_plus.to_s, 0)
- self.contents.draw_text(128, 256, 80, 32, @combine1.int_plus.to_s, 0)
- $str_plus2 = 0
- $dex_plus2 = 0
- $agi_plus2 = 0
- $int_plus2 = 0
- $eva_plus2 = 0
- $new_extra = nil
- case @combine2.parameter_type
- when 1
- $new_extra = "刚"
- $eva_plus2 = @combine2.parameter_points
- when 3
- $new_extra = "劲"
- $str_plus2 = @combine2.parameter_points
- when 4
- $new_extra = "敏"
- $dex_plus2 = @combine2.parameter_points
- when 5
- $new_extra = "疾"
- $agi_plus2 = @combine2.parameter_points
- when 6
- $new_extra = "灵"
- $int_plus2 = @combine2.parameter_points
- end
- if $new_extra == nil and @combine2.pdef_f != 0
- $new_extra = "坚"
- end
- if $new_extra == nil and @combine2.mdef_f != 0
- $new_extra = "圣"
- end
- $pdef_plus2 = @combine2.pdef_f
- $mdef_plus2 = @combine2.mdef_f
- self.contents.draw_text(256, 64, 80, 32, $pdef_plus2.to_s, 0)
- self.contents.draw_text(256, 96, 80, 32, $mdef_plus2.to_s, 0)
- self.contents.draw_text(256, 128, 80, 32, $eva_plus2.to_s, 0)
- self.contents.draw_text(256, 160, 80, 32, $str_plus2.to_s, 0)
- self.contents.draw_text(256, 192, 80, 32, $dex_plus2.to_s, 0)
- self.contents.draw_text(256, 224, 80, 32, $agi_plus2.to_s, 0)
- self.contents.draw_text(256, 256, 80, 32, $int_plus2.to_s, 0)
- jjj = 288
- for iii in 1..16
- if @combine1.guard_element_set.include?(iii)
- self.contents.draw_text(128, jjj, 80, 32, $data_system.elements[iii], 0)
- jjj += 32
- end
- end
- $element_plus2 = []
- $new_element_plus = nil
- for iii in 1..16
- if @combine1.guard_element_set.include?(iii)
- $element_plus2.push(iii)
- end
- if @combine2.element_set.include?(iii)
- if $new_element_plus == nil
- $new_element_plus = $data_system.elements[iii].to_s
- end
- $element_plus2.push(iii)
- end
- end
- jjj = 288
- for iii in 1..16
- if $element_plus2.include?(iii)
- self.contents.draw_text(256, jjj, 80, 32, $data_system.elements[iii], 0)
- jjj += 32
- end
- end
- end
- self.contents.draw_text(224, 64, 80, 32, "+", 0)
- self.contents.draw_text(224, 96, 80, 32, "+", 0)
- self.contents.draw_text(224, 128, 80, 32, "+", 0)
- self.contents.draw_text(224, 160, 80, 32, "+", 0)
- self.contents.draw_text(224, 192, 80, 32, "+", 0)
- self.contents.draw_text(224, 224, 80, 32, "+", 0)
- self.contents.draw_text(224, 256, 80, 32, "+", 0)
- self.contents.draw_text(224, 288, 80, 32, "+", 0)
- self.contents.draw_text(0, 384, 352, 32, "数值的增加只能表示大概,实际组成", 0)
- self.contents.draw_text(0, 416, 352, 32, "会上下浮动20%,确定要组合吗?", 0)
- end
- def update
- refresh
- end
- end
- class Window_CCConfirm < Window_Selectable
- def initialize
- super(384, 384, 128, 96)
- self.contents = Bitmap.new(width - 32, height - 32)
- refresh
- @column_max = 1
- @item_max = 2
- self.index = 0
- self.z = 300
- end
- def refresh
- self.contents.clear
- self.contents.draw_text(0, 0, 64, 32, "好的", 0)
- self.contents.draw_text(0, 32, 64, 32, "不好", 0)
- end
- def update
- refresh
- end
- end
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● 变更装备
- # equip_type : 装备类型
- # id : 武器 or 防具 ID (0 为解除装备)
- #--------------------------------------------------------------------------
- def equip(equip_type, id, loseit = 0)
- case equip_type
- when 0 # 武器
- if id == 0 or $game_party.weapon_number(id) > 0
- if loseit == 0
- $game_party.gain_weapon(@weapon_id, 1)
- end
- @weapon_id = id
- $game_party.lose_weapon(id, 1)
- end
- when 1 # 盾
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor1_id], $data_armors[id])
- if loseit == 0
- $game_party.gain_armor(@armor1_id, 1)
- end
- @armor1_id = id
- $game_party.lose_armor(id, 1)
- end
- when 2 # 头
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor2_id], $data_armors[id])
- if loseit == 0
- $game_party.gain_armor(@armor2_id, 1)
- end
- @armor2_id = id
- $game_party.lose_armor(id, 1)
- end
- when 3 # 身体
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor3_id], $data_armors[id])
- if loseit == 0
- $game_party.gain_armor(@armor3_id, 1)
- end
- @armor3_id = id
- $game_party.lose_armor(id, 1)
- end
- when 4 # 装饰品
- if id == 0 or $game_party.armor_number(id) > 0
- update_auto_state($data_armors[@armor4_id], $data_armors[id])
- if loseit == 0
- $game_party.gain_armor(@armor4_id, 1)
- end
- @armor4_id = id
- $game_party.lose_armor(id, 1)
- end
- end
- end
- end
- #==============================================================================
- # ■ Window_EquipLeft
- #------------------------------------------------------------------------------
- # 装备画面的、显示角色能力值变化的窗口。
- #==============================================================================
- class Window_EquipLeft < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 64, 272, 416)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_actor_name(@actor, 4, 0)
- draw_actor_level(@actor, 4, 32)
- draw_actor_parameter(@actor, 4, 64, 0)
- draw_actor_parameter(@actor, 4, 96, 1)
- draw_actor_parameter(@actor, 4, 128, 2)
- draw_actor_parameter(@actor, 4, 160, 7)
- draw_actor_parameter(@actor, 4, 192, 3)
- draw_actor_parameter(@actor, 4, 224, 4)
- draw_actor_parameter(@actor, 4, 256, 5)
- draw_actor_parameter(@actor, 4, 288, 6)
- if @new_atk != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 64, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
- end
- if @new_pdef != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 96, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
- end
- if @new_mdef != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 128, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
- end
- if @new_eva != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 160, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 160, 36, 32, @new_eva.to_s, 2)
- end
- if @new_str != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 192, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
- end
- if @new_dex != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 224, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
- end
- if @new_agi != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 256, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
- end
- if @new_int != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 288, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 变更装备后的能力值设置
- # new_atk : 变更装备后的攻击力
- # new_pdef : 变更装备后的物理防御
- # new_mdef : 变更装备后的魔法防御
- #--------------------------------------------------------------------------
- def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
- if @new_atk != new_atk or
- @new_pdef != new_pdef or
- @new_mdef != new_mdef or
- @new_eva != new_eva or
- @new_str != new_str or
- @new_dex != new_dex or
- @new_agi != new_agi or
- @new_int != new_int
- @new_atk = new_atk
- @new_pdef = new_pdef
- @new_mdef = new_mdef
- @new_eva = new_eva
- @new_str = new_str
- @new_dex = new_dex
- @new_agi = new_agi
- @new_int = new_int
- refresh
- end
- end
- end
- #==============================================================================
- # ■ Window_EquipItem
- #------------------------------------------------------------------------------
- # 装备画面、显示浏览变更装备的候补物品的窗口。
- #==============================================================================
- class Window_EquipItem < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- # equip_type : 装备部位 (0~3)
- #--------------------------------------------------------------------------
- def initialize(actor, equip_type)
- super(272, 256, 368, 224)
- @actor = actor
- @equip_type = equip_type
- @column_max = 1
- refresh
- self.active = false
- self.index = -1
- end
- #--------------------------------------------------------------------------
- # ● 获取物品
- #--------------------------------------------------------------------------
- def item
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- if self.contents != nil
- self.contents.dispose
- self.contents = nil
- end
- @data = []
- # 添加可以装备的武器
- if @equip_type == 0
- weapon_set = $data_classes[@actor.class_id].weapon_set
- for i in 1...$data_weapons.size
- if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
- @data.push($data_weapons[i])
- end
- end
- end
- # 添加可以装备的防具
- if @equip_type != 0
- armor_set = $data_classes[@actor.class_id].armor_set
- for i in 1...$data_armors.size
- if $game_party.armor_number(i) > 0 and armor_set.include?(i)
- if $data_armors[i].kind == @equip_type-1
- @data.push($data_armors[i])
- end
- end
- end
- end
- # 添加空白
- @data.push(nil)
- # 生成位图、描绘全部项目
- @item_max = @data.size
- self.contents = Bitmap.new(width - 32, row_max * 32)
- for i in 0...@item_max-1
- draw_item(i)
- end
- end
- #--------------------------------------------------------------------------
- # ● 项目的描绘
- # index : 项目符号
- #--------------------------------------------------------------------------
- def draw_item(index)
- item = @data[index]
- x = 4
- y = index * 32
- case item
- when RPG::Weapon
- number = $game_party.weapon_number(item.id)
- when RPG::Armor
- number = $game_party.armor_number(item.id)
- end
- bitmap = RPG::Cache.icon(item.icon_name)
- self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
- self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
- self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_text(item)
- # @help_window.set_text(self.item == nil ? "" : self.item.description)
- #校正帮助窗口位置
- @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
- end
- end
- class Scene_Equip
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- # 设置物品窗口的可视状态
- @item_window1.visible = (@right_window.index == 0)
- @item_window2.visible = (@right_window.index == 1)
- @item_window3.visible = (@right_window.index == 2)
- @item_window4.visible = (@right_window.index == 3)
- @item_window5.visible = (@right_window.index == 4)
- # 获取当前装备中的物品
- item1 = @right_window.item
- # 设置当前的物品窗口到 @item_window
- case @right_window.index
- when 0
- @item_window = @item_window1
- when 1
- @item_window = @item_window2
- when 2
- @item_window = @item_window3
- when 3
- @item_window = @item_window4
- when 4
- @item_window = @item_window5
- end
- # 右窗口被激活的情况下
- if @right_window.active
- # 删除变更装备后的能力
- @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil)
- end
- # 物品窗口被激活的情况下
- if @item_window.active
- # 获取现在选中的物品
- item2 = @item_window.item
- # 变更装备
- last_hp = @actor.hp
- last_sp = @actor.sp
- @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
- # 获取变更装备后的能力值
- new_atk = @actor.atk
- new_pdef = @actor.pdef
- new_mdef = @actor.mdef
- new_eva = @actor.eva
- new_str = @actor.str
- new_dex = @actor.dex
- new_agi = @actor.agi
- new_int = @actor.int
- # 返回到装备
- @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
- @actor.hp = last_hp
- @actor.sp = last_sp
- # 描画左窗口
- @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
- end
- end
- end
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● 描绘能力值
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # type : 能力值种类 (0~6)
- #--------------------------------------------------------------------------
- def draw_actor_parameter(actor, x, y, type)
- case type
- when 0
- parameter_name = $data_system.words.atk
- parameter_value = actor.atk
- when 1
- parameter_name = $data_system.words.pdef
- parameter_value = actor.pdef
- when 2
- parameter_name = $data_system.words.mdef
- parameter_value = actor.mdef
- when 3
- parameter_name = $data_system.words.str
- parameter_value = actor.str
- when 4
- parameter_name = $data_system.words.dex
- parameter_value = actor.dex
- when 5
- parameter_name = $data_system.words.agi
- parameter_value = actor.agi
- when 6
- parameter_name = $data_system.words.int
- parameter_value = actor.int
- when 7
- parameter_name = $data_system.words.int
- parameter_value = actor.eva
- end
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 120, 32, parameter_name)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
- end
- end
复制代码
组合装备脚本
- #==============================================================================
- # ■ Window_Help
- #------------------------------------------------------------------------------
- # 特技及物品的说明、角色的状态显示的窗口。
- # 若要更改属性,请搜索element_set={1=>"火",2=>"冰",3=>"光",4=>"暗"} 改成对应属性即可
- #==============================================================================
- UNSHOW_STATE=[1,2,3,4,5]#记录不显示的状态数组
- UNSHOW_ELEMENT=[1,2,3,4,5]#记录不显示的属性数组
- class Window_Help < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(150,200, 180, 480)
- self.opacity = 150
- self.z = 150
- self.visible = false
- self.contents = Bitmap.new(width - 32, height - 32)
- description=""
- @item=nil
- @armor=nil
- @weapon=nil
- end
- #--------------------------------------------------------------------------
- # ● 设置文本
- # text : 窗口显示的字符串
- # align : 对齐方式 (0..左对齐、1..中间对齐、2..右对齐)
- #--------------------------------------------------------------------------
- def set_text(data, align=nil)
- # 如果文本和对齐方式的至少一方与上次的不同
- if align != nil
- # 再描绘窗口和文本
- self.width = 640
- self.height = 64
- self.x=0
- self.y=0
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.clear
- self.contents.font.color = normal_color
- self.contents.font.size = 20
- self.contents.draw_text(4, 0, self.width - 48, 32, data, align)
- self.visible = true
- return
- end
- if data == nil
- self.visible = false
- @data = nil
- end
- if data != nil && @data != data
- @data=data
- self.visible = true
- self.width = 180
- self.height = 200
- self.x=180
- self.y=430
- self.contents = Bitmap.new(width - 32, height - 32)
- case @data
- when RPG::Item
- set_item_text(@data)
- when RPG::Weapon
- set_weapon_text(@data)
- when RPG::Armor
- set_armor_text(@data)
- when RPG::Skill
- set_skill_text(@data)
- end
- else
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 设置敌人
- # enemy : 要显示名字和状态的敌人
- #--------------------------------------------------------------------------
- def set_enemy(enemy)
- text = enemy.name
- state_text = make_battler_state_text(enemy, 0, false)
- if state_text != ""
- text += " " + state_text
- end
- set_text(text, 1)
- @data=nil
- end
- #--------------------------------------------------------------------------
- # ● 设置角色
- # actor : 要显示状态的角色
- #--------------------------------------------------------------------------
- def set_actor(actor)
- if actor != @actor
- self.width = 640
- self.height = 64
- self.x=0
- self.y=0
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.clear
- self.contents.font.size=20
- self.contents.font.color = normal_color
- draw_actor_name(actor, 4, 0)
- draw_actor_state(actor, 140, 0)
- draw_actor_hp(actor, 284, 0)
- draw_actor_sp(actor, 460, 0)
- @actor = actor
- @text = nil
- self.visible = true
- end
- end
- #--------------------------------------------------------------------------
- # ● 校正帮助窗口位置
- #--------------------------------------------------------------------------
- def set_pos(x,y,width,oy,index,column_max)
- #光标坐标
- cursor_width = width / column_max - 32
- xx = index % column_max * (cursor_width + 32)
- yy = index / column_max * 32 - oy
- self.x=xx+x+150
- self.y=yy+y+30
- if self.x+self.width>640
- self.x=640-self.width
- end
- if self.y+self.height>480
- self.y=480-self.height
- end
- end
- end
- class Window_Help < Window_Base
- #--------------------------------------------------------------------------
- # ● 物品帮助窗口
- #--------------------------------------------------------------------------
- def set_item_text(item)
- @item=item
- description=""
- [email protected]
- x=0
- y=0
- # 取得屬性、附加狀態、解除狀態之副本
- element_set = @item.element_set.clone
- plus_state_set = @item.plus_state_set.clone
- minus_state_set = @item.minus_state_set.clone
- # 過濾不顯示的描述
- element_set -= UNSHOW_ELEMENT
- plus_state_set -= UNSHOW_STATE
- minus_state_set -= UNSHOW_STATE
- height=1 #依要显示的内容确定高
- #由描叙确定高
- height+=description.size/3/10
- if description.size%10!=0
- height+=1
- end
- height+=3 #空行,效果范围,价格
- if @item.recover_hp_rate!=0 #HP 回复率。
- height+=1
- end
- if @item.recover_hp!=0 #HP 回复量。
- height+=1
- end
- if @item.recover_sp_rate!=0 #SP 回复率。
- height+=1
- end
- if @item.recover_sp!=0 #SP 回复量。
- height+=1
- end
- if @item.parameter_type!=0 #增加能力值
- height+=1
- end
- if element_set.empty?!=true #属性。为属性 ID 的数组
- height+=1
- end
- if plus_state_set.empty?!=true #附加状态。为状态 ID 的数组
- height+=plus_state_set.size
- end
- if minus_state_set.empty?!=true #解除状态。为状态 ID 的数组
- height+=minus_state_set.size
- end
- self.height=height*15+40+15
- self.contents = Bitmap.new(self.width - 32,self.height - 32)
- self.contents.clear
- #描绘名字
- [email protected]
- self.contents.font.color =text_color(3)
- self.contents.font.size=18
- if text!=nil
- self.visible = true
- self.contents.draw_text(0,0, @item.name.size*7, 20, text, 0)
- else
- self.visible = false
- end
- x=0
- y+=1
- text=description
- #描绘描叙
- while ((text = description.slice!(/./m)) != nil)
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x*15, y*15+5, 14, 14, text, 0)
- x+=1
- if x==10#每行10个字
- x=0
- y+=1
- end
- end
- #由特技属性确定高
- #效果范围
- scope = {0=>"特殊物品",1=>"敌单体",2=>"敌全体",3=>"己方单体",4=>"己方全体",5=>"己方昏死单体",6=>"己方昏死全体",7=>"使用者"}#HASH表
- text="范围:"+scope[@item.scope]
- x=0
- y+=2 #空一行
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- #价格
- x=0
- y+=1
- text="价格:"[email protected]_s
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- #HP 回复率
- if @item.recover_hp_rate!=0
- x=0
- y+=1
- text="回复气血:"[email protected]_hp_rate.to_s+"%"
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- #HP回复量
- if @item.recover_hp!=0
- x=0
- y+=1
- text="回复气血:"[email protected]_hp.to_s
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- #SP 回复率
- if @item.recover_sp_rate!=0
- x=0
- y+=1
- text="回复魔法:"[email protected]_sp_rate.to_s+"%"
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- #SP 回复量
- if @item.recover_sp!=0
- x=0
- y+=1
- text="回复魔法:"[email protected]_sp.to_s
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- #增加能力值
- if @item.parameter_type!=0
- parameter_type={1=>"最大气血",2=>"最大魔法",3=>$data_system.words.str,4=>$data_system.words.dex,5=>$data_system.words.agi,6=>$data_system.words.int}
- x=0
- y+=1
- if @item.parameter_points>0
- text="增加:"+parameter_type[@item.parameter_type]+" +"[email protected]_points.to_s
- else
- text="减少:"+parameter_type[@item.parameter_type][email protected]_points.to_s
- end
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- #物品属性
- if element_set.empty?!=true #属性。为属性 ID 的数组
- text="属性:"
- for i in 0...element_set.size
- text+=$data_system.elements[element_set[i]]+" "
- end
- x=0
- y+=1
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- #附加状态
- if plus_state_set.empty?!=true #附加状态。为状态 ID 的数组
- text="附加状态:"
- x=0
- y+=1
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- y-=1
- x+=text.size*5
- for i in 0...plus_state_set.size
- y+=1
- text=$data_states[plus_state_set[i]].name
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- end
- #解除状态
- if minus_state_set.empty?!=true #解除状态。为状态 ID 的数组
- text="解除状态:"
- x=0
- y+=1
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- y-=1
- x+=text.size*5
- for i in 0...minus_state_set.size
- y+=1
- text=$data_states[minus_state_set[i]].name
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- end
- end
- end
- class Window_Help < Window_Base
- #--------------------------------------------------------------------------
- # ● 武器帮助窗口
- #--------------------------------------------------------------------------
- def set_weapon_text(weapon)
- @weapon=weapon
- description=""
- [email protected]
- # 取得屬性、附加狀態、解除狀態之副本
- element_set = @weapon.element_set.clone
- plus_state_set = @weapon.plus_state_set.clone
- minus_state_set = @weapon.minus_state_set.clone
- # 過濾不顯示的描述
- element_set -= UNSHOW_ELEMENT
- plus_state_set -= UNSHOW_STATE
- minus_state_set -= UNSHOW_STATE
- x=0
- y=0
- height=1 #依要显示的内容确定高
- #由描叙确定高
- height+=description.size/3/10
- if description.size%10!=0
- height+=1
- end
- height+=4 #2个空行,攻击,价格
- if @weapon.pdef!=0 #物理防御
- height+=1
- end
- if @weapon.mdef!=0 #魔法防御
- height+=1
- end
- if @weapon.str_plus!=0 #力量
- height+=1
- end
- if @weapon.dex_plus!=0#体质
- height+=1
- end
- if @weapon.agi_plus!=0#敏捷
- height+=1
- end
- if @weapon.int_plus!=0 #智力
- height+=1
- end
- if element_set.empty?!=true #属性。为属性 ID 的数组
- height+=1
- end
- if plus_state_set.empty?!=true #附加状态。为状态 ID 的数组
- height+=plus_state_set.size
- end
- if minus_state_set.empty?!=true #解除状态。为状态 ID 的数组
- height+=minus_state_set.size
- end
- self.height=height*15+40+15
- self.contents = Bitmap.new(self.width - 32,self.height - 32)
- self.contents.clear
- #描绘名字
- [email protected]
- self.contents.font.color = text_color(1)#颜色脚本
- self.contents.font.size=18
- if text!=nil
- self.visible = true
- self.contents.draw_text(0,0, @weapon.name.size*7, 20, text, 0)
- else
- self.visible = false
- end
- x=0
- y+=1
- text=description
- #描绘描叙
- while ((text = description.slice!(/./m)) != nil)
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x*15, y*15+5, 14, 14, text, 0)
- x+=1
- if x==10#每行10个字
- x=0
- y+=1
- end
- end
- #由特技属性确定高
- #攻击
- x=0
- y+=2 #空行
- text="攻击:"[email protected]_s
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- #价格
- x=0
- y+=1
- text="价格:"[email protected]_s
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- =begin #耐久度
- #dur_set = @weapon.dur_set
- dur = @weapon.dur
- text = "耐久度: #{dur}"
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x-1, y*15+20, text.size*6, 14, text, 0)
- =end
- if @weapon.pdef!=0 #物理防御
- x=0
- y+=1
- text="物理防御:"[email protected]_s
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- if @weapon.mdef!=0 #魔法防御
- x=0
- y+=1
- text="魔法防御:"[email protected]_s
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- #武器属性
- if element_set.empty? != true #属性。为属性 ID 的数组
- text="属性:"
- for i in 0...element_set.size
- text+=$data_system.elements[element_set[i]]+" "
- end
- x=0
- y+=1
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- #附加状态
- if plus_state_set.empty? != true #附加状态。为状态 ID 的数组
- text="附加状态:"
- x=0
- y+=1
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- y-=1
- x+=text.size*5
- for i in 0...plus_state_set.size
- y+=1
- text=$data_states[plus_state_set[i]].name
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- end
- #解除状态
- if minus_state_set.empty? != true #解除状态。为状态 ID 的数组
- text="解除状态:"
- x=0
- y+=1
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- y-=1
- x+=text.size*5
- for i in 0...minus_state_set.size
- y+=1
- text=$data_states[minus_state_set[i]].name
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- end
- y+=1 #空行
- if @weapon.str_plus!=0 #力量
- x=0
- y+=1
- if @weapon.str_plus > 0
- text=$data_system.words.str+" + "[email protected]_plus.to_s
- else
- [email protected]_plus
- text=$data_system.words.str+" - "+str_minus.to_s
- end
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- if @weapon.dex_plus!=0#体质
- x=0
- y+=1
- if @weapon.dex_plus > 0
- text=$data_system.words.dex+" + "[email protected]_plus.to_s
- else
- [email protected]_plus
- text=$data_system.words.dex+" - "+dex_minus.to_s
- end
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- if @weapon.agi_plus!=0#敏捷
- x=0
- y+=1
- if @weapon.agi_plus > 0
- text=$data_system.words.agi+" + "[email protected]_plus.to_s
- else
- [email protected]_plus
- text=$data_system.words.agi+" - "+agi_minus.to_s
- end
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- if @weapon.int_plus!=0 #智力
- x=0
- y+=1
- if @weapon.int_plus > 0
- text=$data_system.words.int+" + "[email protected]_plus.to_s
- else
- [email protected]_plus
- text=$data_system.words.int+" - "+int_minus.to_s
- end
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- end
- end
- class Window_Help < Window_Base
- #--------------------------------------------------------------------------
- # ● 防具帮助窗口
- #--------------------------------------------------------------------------
- def set_armor_text(armor)
- @armor=armor
- description=""
- [email protected]
- # 取得屬性、附加狀態、解除狀態之副本
- element_set = @armor.guard_element_set.clone
- guard_state_set = @armor.guard_state_set.clone
- # 過濾不顯示的描述
- element_set -= UNSHOW_ELEMENT
- guard_state_set -= UNSHOW_STATE
- x=0
- y=0
- height=1 #依要显示的内容确定高
- #由描叙确定高
- height+=description.size/3/10
- if description.size%10 !=0
- height+=1
- end
- height+=2 #2个空行,价格
- if @armor.pdef !=0 #物理防御
- height+=1
- end
- if @armor.mdef !=0 #魔法防御
- height+=1
- end
- if @armor.str_plus !=0 #力量
- height+=1
- end
- if @armor.dex_plus !=0#体质
- height+=1
- end
- if @armor.agi_plus !=0#敏捷
- height+=1
- end
- if @armor.int_plus !=0 #智力
- height+=1
- end
- if element_set.empty? != true #属性防御。为属性 ID 的数组
- height+=1
- end
- if guard_state_set.empty? != true #状态防御。为状态 ID 的数组
- height+=guard_state_set.size
- end
- self.height=height*16+70
- self.contents = Bitmap.new(self.width - 32,self.height - 32)
- self.contents.clear
- #描绘名字
- [email protected]
- self.contents.font.color = text_color(1)#颜色脚本
- self.contents.font.size=18
- if text!=nil
- self.visible = true
- self.contents.draw_text(0,0, @armor.name.size*7, 20, text, 0)
- else
- self.visible = false
- end
- x=0
- y+=1
- text=description
- #描绘描叙
- while ((text = description.slice!(/./m)) != nil)
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x*15, y*15+5, 14, 14, text, 0)
- x+=1
- if x==10#每行10个字
- x=0
- y+=1
- end
- end
- #由特技属性确定高
- #价格
- x=0
- y+=2#空行
- text="价格:"[email protected]_s
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- x=0
- y+=1
- =begin #耐久度
- #dur_set = @weapon.dur_set
- dur = @weapon.dur
- text = "耐久度: #{dur}"
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x-1, y*15+35, text.size*6, 14, text, 0)
- =end
- if @armor.pdef!=0 #物理防御
- text="物理防御:"[email protected]_s
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- x=0
- y+=1
- end
- if @armor.mdef!=0 #魔法防御
- text="魔法防御:"[email protected]_s
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- x=0
- y+=1
- end
- #属性防御
- if element_set.empty? !=true #属性。为属性 ID 的数组
- text="属性防御:"
- for i in 0...element_set.size
- text+=$data_system.elements[element_set[i]]+" "
- end
- x=0
- y+=1
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- #状态防御
- if guard_state_set.empty?!=true #附加状态。为状态 ID 的数组
- text="状态防御:"
- x=0
- y+=1
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- y-=1
- x+=text.size*5
- for i in 0...guard_state_set.size
- y+=1
- text=$data_states[guard_state_set[i]].name
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- end
- # y+=1 #空行
- if @armor.str_plus!=0 #力量
- x=0
- y+=1
- if @armor.str_plus > 0
- text=$data_system.words.str+" + "[email protected]_plus.to_s
- else
- [email protected]_plus
- text=$data_system.words.str+" - "+str_minus.to_s
- end
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- if @armor.dex_plus!=0#体质
- x=0
- y+=1
- if @armor.dex_plus > 0
- text=$data_system.words.dex+" + "[email protected]_plus.to_s
- else
- [email protected]_plus
- text=$data_system.words.dex+" - "+dex_minus.to_s
- end
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- if @armor.agi_plus!=0#敏捷
- x=0
- y+=1
- if @armor.agi_plus > 0
- text=$data_system.words.agi+" + "[email protected]_plus.to_s
- else
- [email protected]_plus
- text=$data_system.words.agi+" - "+agi_minus.to_s
- end
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- if @armor.int_plus!=0 #智力
- x=0
- y+=1
- if @armor.int_plus > 0
- text=$data_system.words.int+" + "[email protected]_plus.to_s
- else
- [email protected]_plus
- text=$data_system.words.int+" - "+int_minus.to_s
- end
- self.contents.font.color = text_color(6)#颜色脚本
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- end
- end
- class Window_Help < Window_Base
- #--------------------------------------------------------------------------
- # ● 技能帮助窗口
- #--------------------------------------------------------------------------
- def set_skill_text(skill)
- @skill=skill
- description=""
- [email protected]
- # 取得屬性、附加狀態、解除狀態之副本
- element_set = @skill.element_set.clone
- plus_state_set = @skill.plus_state_set.clone
- minus_state_set = @skill.minus_state_set.clone
- # 過濾不顯示的描述
- element_set -= UNSHOW_ELEMENT
- plus_state_set -= UNSHOW_STATE
- minus_state_set -= UNSHOW_STATE
- x=0
- y=0
- height=1 #依要显示的内容确定高
- #由描叙确定高
- height+=description.size/3/10
- if description.size%10!=0
- height+=1
- end
- height+=4 #空行,效果范围,消费SP,命中率
- if @skill.power!=0 #威力,威力为0,则可能为状态魔法
- height+=1
- end
- if element_set.empty?!=true #属性。为属性 ID 的数组
- height+=1
- end
- if plus_state_set.empty?!=true #附加状态。为状态 ID 的数组
- height+=plus_state_set.size
- end
- if minus_state_set.empty?!=true #解除状态。为状态 ID 的数组
- height+=minus_state_set.size
- end
- self.height=height*15+40+15
- self.contents = Bitmap.new(self.width - 32,self.height - 32)
- self.contents.clear
- #描绘名字
- [email protected]
- self.contents.font.color =text_color(6)
- self.contents.font.size=18
- if text!=nil
- self.visible = true
- self.contents.draw_text(0,0, @skill.name.size*7, 20, text, 0)
- else
- self.visible = false
- end
- x=0
- y+=1
- text=description
- #描绘描叙
- while ((text = description.slice!(/./m)) != nil)
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x*15, y*15+5, 14, 14, text, 0)
- x+=1
- text
- if x==10#每行10个字
- x=0
- y+=1
- end
- end
- #由特技属性确定高
- #效果范围
- scope = {0=>"特殊技能",1=>"敌单体",2=>"敌全体",3=>"己方单体",4=>"己方全体",5=>"己方昏死单体",6=>"己方昏死全体",7=>"使用者"}#HASH表
- text="范围:"+scope[@skill.scope]
- x=0
- y+=2 #空一行
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- #威力
- if @skill.power!=0
- x=0
- y+=1
- [email protected] > 0 ? @skill.power : -1* @skill.power
- text="威力:"+c.to_s
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- #描绘消费SP
- x=0
- y+=1
- text="消耗SP:"[email protected]_cost.to_s
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- #命中率
- x=0
- y+=1
- text="命中率:"[email protected]_s+"%"
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- #攻击属性
- if element_set.empty? != true #属性。为属性 ID 的数组
- text="属性:"
- for i in 0...element_set.size
- text+=$data_system.elements[element_set[i]]+" "
- end
- x=0
- y+=1
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- #附加状态
- if plus_state_set.empty? != true #附加状态。为状态 ID 的数组
- text="附加状态:"
- x=0
- y+=1
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- y-=1
- x+=text.size*5
- for i in 0...plus_state_set.size
- y+=1
- text=$data_states[plus_state_set[i]].name
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- end
- #解除状态
- if minus_state_set.empty? != true #解除状态。为状态 ID 的数组
- text="解除状态:"
- x=0
- y+=1
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- y-=1
- x+=text.size*5
- for i in 0...minus_state_set.size
- y+=1
- text=$data_states[minus_state_set[i]].name
- self.contents.font.color = normal_color
- self.contents.font.size=14
- self.contents.draw_text(x, y*15+5, text.size*6, 14, text, 0)
- end
- end
- end
- end
- class Window_Item < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- # @help_window.set_text(self.item == nil ? "" : self.item.description)
- @help_window.set_text(item)
- #校正帮助窗口位置
- @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
- end
- end
- class Window_Skill < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- # @help_window.set_text(self.skill == nil ? "" : self.skill.description)
- @help_window.set_text(skill)
- #校正帮助窗口位置
- @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
- end
- end
- class Window_EquipRight < Window_Selectable
- def update_help
- # @help_window.set_text(self.item == nil ? "" : self.item.description)
- @help_window.set_text(item)
- #校正帮助窗口位置
- @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
- end
- end
- class Window_EquipItem < Window_Selectable
- def update_help
- # @help_window.set_text(self.item == nil ? "" : self.item.description)
- @help_window.set_text(item)
- #校正帮助窗口位置
- @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
- end
- end
- class Window_ShopBuy < Window_Selectable
- def update_help
- @help_window.set_text(item)
- #校正帮助窗口位置
- @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
- end
- end
- class Window_ShopSell < Window_Selectable
- def update_help
- @help_window.set_text(item)
- #校正帮助窗口位置
- @help_window.set_pos(self.x,self.y,self.width,self.oy,self.index,@column_max)
- end
- end
复制代码
帮助脚本
耐久度传送门:http://rpg.blue/forum.php?mod=viewthread&tid=78776&highlight=%E8%80%90%E4%B9%85%E5%BA%A6
|
|