#encoding:utf-8 #=========================================================================== # RMVA 豪华型技能加点|技能被动效果: v1.05 # By希忆 66rpg.com # 转载或修改请保留此类信息 #=========================================================================== # 所有和窗体有关的修改 # # 大概没问题吧 #=========================================================================== class Window_BattleSkill < Window_SkillList def include?(item) item && !item.passive && item.stype_id == @stype_id && @actor.has_skill?(item) end end class Window_SkillList < Window_Selectable def include?(item) item && item.stype_id == @stype_id && @actor.has_skill?(item) end def draw_item_name(item, x, y, enabled = true, width = 172) return unless item draw_icon(item.icon_index, x, y, enabled) change_color(normal_color, enabled) draw_text(x + 24, y, width, line_height, item.name + "|Lv." + @actor.skill_level(item.id).to_s) end end class Window_AllSkill < Window_Selectable def initialize(x, y, width, height) super @actor = nil @stype_id = 0 @data = [] end def actor=(actor) return if @actor == actor @actor = actor refresh self.oy = 0 end def stype_id=(stype_id) return if @stype_id == stype_id @stype_id = stype_id refresh self.oy = 0 end def col_max return 1 end def item_max @data ? @data.size : 1 end def item @data && index >= 0 ? @data[index] : nil end def current_item_enabled? enable?(@data[index]) end def include?(item) item && item.stype_id == @stype_id end def enable?(item) item != nil && @actor != nil && @actor.skill_can_levelup?(item) end def make_item_list @data = @actor ? @actor.skills.select {|skill| include?(skill) } : [] end def select_last select(@data.index(@actor.last_skill.object) || 0) end def draw_item(index) skill = @data[index] if skill rect = item_rect(index) rect.width -= 4 draw_skill_name(skill, rect.x, rect.y, enable?(skill)) draw_skill_level(rect, skill) end end def draw_skill_name(skill, x, y, enabled = true, width = 172) return unless skill draw_icon(skill.icon_index, x, y, enabled) change_color(normal_color, enabled) text = skill.name text += "<MAX>" if @actor.skill_max_learn?(skill) draw_text(x + 24, y, width, line_height, text) end def draw_skill_level(rect, skill) draw_text(rect, @actor.skill_basic_level(skill.id).to_s, 2) change_color(system_color, enable?(skill)) draw_text(rect, "Lv. ", 2) end def update_help @help_window.set_item(item) end def refresh make_item_list create_contents draw_all_items end end class Window_Base < Window #~ draw_text_ex的增强,使其可以自动换行 原作者:叶子 修改:wyongcan #-------------------------------------------------------------------------- # ● 绘制带有控制符的文本内容 # 如果传递了width参数的话,会自动换行 #-------------------------------------------------------------------------- def draw_text_ex(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_SkillStatus < Window_Base def initialize(x, y) super(x, y, window_width, fitting_height(4)) @actor = nil end def window_width Graphics.width - 160 end def actor=(actor) return if @actor == actor @actor = actor refresh end def draw_actor_sp(actor,x,y) change_color(system_color) draw_text(x, y, 200, line_height, "SP:") change_color(normal_color) draw_text(x+48, y, 200, line_height, actor.sp) end def refresh contents.clear return unless @actor draw_actor_face(@actor, 0, 0) draw_actor_simple_status(@actor, 108, line_height / 2) draw_actor_sp(@actor,108,64) end end class Window_AddHelp < Window_Base def initialize(x, y, width, height) super @skill = nil @actor = nil refresh end def set_item(skill) return if @skill == skill @skill = skill refresh end def actor=(actor) return if @actor == actor @actor = actor refresh end def line_width Graphics.width/2-standard_padding*2 end def draw_skill_name(skill,x,y) draw_icon(skill.icon_index, x, y) change_color(normal_color) draw_text(x+24, y, line_width, line_height, skill.name) if skill.passive draw_text(x, y, line_width, line_height, "被动技能",2) else change_color(mp_cost_color) draw_text(x, y, line_width, line_height, "MP "+@actor.skill_mp_cost(skill).to_s,2) end end def draw_skill_level(skill,x,y) change_color(system_color) draw_text(x, y, line_width, line_height,"Level ") text =@actor.skill_basic_level(skill.id).to_s + "/"+skill.max_learn.to_s change_color(normal_color) draw_text(x+60, y, line_width-60, line_height,text) draw_text(x, y, line_width, line_height,"升级所需SP: "+skill.sp_cost.to_s,2) end def draw_next_level(skill,x,y) if skill.link_skill != 0 change_color(knockout_color) draw_text(x, y, line_width, line_height,"绑定技能:"+$data_skills[skill.link_skill].name) return end lvl = @actor.skill_next_level(skill) if !lvl change_color(system_color) draw_text(x, y, line_width, line_height,"已精通。") else if @actor.level >= @actor.skill_next_level(skill) change_color(normal_color) else change_color(crisis_color) end #draw_text(x, y, line_width, line_height,"需要等级: "+lvl.to_s) end end def draw_former_skill(skill,x,y) line = 0 skill.former.each do |former| if former[0] != 0 txt = "需要: " + $data_skills[former[0]].name + "|Lv.#{former[1]}" @actor.skill_basic_level(former[0]) >= former[1] ? change_color(system_color) : change_color(crisis_color) draw_text(x, y+line*line_height, line_width, line_height,txt) line += 1 end end line end def refresh contents.clear return if @skill == nil or @actor == nil draw_skill_name(@skill,0,0) draw_skill_level(@skill,0,line_height) draw_next_level(@skill,0,line_height*2) n = draw_former_skill(@skill,0,line_height*3) draw_text_ex(0, line_height*(3+n), @skill.description, line_width) end end #============================================================================== # ■ Window_AddCommand #------------------------------------------------------------------------------ # #============================================================================== class Window_AddCommand < Window_Command def initialize super(100, 120) self.visible = false self.active = false @index = 0 end #-------------------------------------------------------------------------- # ● コマンドリストの作成 #-------------------------------------------------------------------------- def make_command_list add_command("提升一级", :add1) add_command("提升满", :addf) add_command("取消", :cancel) end #-------------------------------------------------------------------------- # ● 決定ボタンが押されたときの処理 #-------------------------------------------------------------------------- def process_ok Input.update call_ok_handler end #-------------------------------------------------------------------------- # ● 按下取消键时的处理 #-------------------------------------------------------------------------- def process_cancel Input.update call_cancel_handler end #-------------------------------------------------------------------------- # ● 启用窗口 #-------------------------------------------------------------------------- def activate temp = self.y + self.height - Graphics.height if temp > 0 self.y -= Graphics.height - self.height end self.active = true self end end
QQ截图333320190418195633.jpg (18.14 KB, 下载次数: 24)
1.52 MB, 下载次数: 91
draw_text(x + 24, y, width, line_height, item.name + "|Lv." + @actor.skill_level(item.id).to_s)
skill_level = [1, @actor.skill_level(item.id)].max draw_text(x + 24, y, width, line_height, item.name + "|Lv." + skill_level.to_s)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |