赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 1689 |
最后登录 | 2019-11-8 |
在线时间 | 231 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 75
- 在线时间
- 231 小时
- 注册时间
- 2014-10-5
- 帖子
- 296
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
RT
我想修改一下这个脚本,不知道在哪里下手,
需要的效果我大概画了一下,下面附上图片javascript:;
原本是选择角色当前技能类型,然后可以消耗SP提升技能
我想要修改成不需要选择当前技能类型,直接跳过,不需要这个选择
然后吧SP的显示,单独拿出来放在一个小窗口里面
技能选择的地方不需要显示文字,只是需要图标,显示三排技能,然后原来的说明窗口不变
大神的帖子链接 https://rpg.blue/forum.php?mod=viewthread&tid=373928
下面是窗口部分脚本
#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 += "<已精通>" 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 [url=home.php?mod=space&uid=260100]@skill[/url] = 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
#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 += "<已精通>" 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
[url=home.php?mod=space&uid=260100]@skill[/url] = 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
|
|