赞 | 0 |
VIP | 13 |
好人卡 | 7 |
积分 | 7 |
经验 | 32831 |
最后登录 | 2023-12-15 |
在线时间 | 530 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 723
- 在线时间
- 530 小时
- 注册时间
- 2010-6-9
- 帖子
- 840
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
经过论坛几位大神的指点,已经改善了很多,在此先由衷表示感谢,感谢指点。
以为将印象中的heightmax从412修正为416能解决问题,回来测试的时候似乎并未解决最下端问题,脚本及图片附上:请再次指点。
#encoding:utf-8 #============================================================================== # ■ Window_Status #------------------------------------------------------------------------------ # 状态画面中,显示角色基本信息的窗口。 #============================================================================== class Window_Status < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize(actor) super(0, 0, 544, 416) @actor = actor refresh activate self.opacity=0 @data = [] end def standard_padding return 0 end #-------------------------------------------------------------------------- # ● 设置角色 #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor refresh end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh contents.clear draw_block1 (0) draw_skill end #-------------------------------------------------------------------------- # ● 绘制区域 1 #-------------------------------------------------------------------------- def draw_block1(y) #~ draw_window_backg draw_backg #~ draw_actor_name(@actor, 4, y) #~ draw_actor_class(@actor, 128, y) draw_basic_info(136, y) draw_parameters(32, y) draw_xparameters draw_sparameters #~ draw_equipments(288, y) #~ draw_description(4, y) end #-------------------------------------------------------------------------- # ● 绘制水平线 #-------------------------------------------------------------------------- def draw_horz_line(y) line_y = y + line_height / 2 - 1 contents.fill_rect(0, line_y, contents_width, 2, line_color) end #-------------------------------------------------------------------------- # ● 获取水平线的颜色 #-------------------------------------------------------------------------- def line_color color = normal_color color.alpha = 48 color end #-------------------------------------------------------------------------- # ● 绘制基本信息 #-------------------------------------------------------------------------- def draw_basic_info(x, y) w=28 rct_w=32 rct_h=24 y_z=160 x_z=0 #~ draw_actor_icons(@actor, x, y + line_height * 1)绘制状态图标 contents.font.size=16 #~ draw_actor_hp(@actor, 160, 200,width= 100) #~ draw_actor_mp(@actor, 160, 224,width= 100) draw_icon(6, x_z , y_z , enabled = true) draw_icon(3, x_z+w , y_z , enabled = true) draw_icon(4, x_z+w*2 , y_z, enabled = true) draw_icon(8, x_z+w*3 , y_z, enabled = true) draw_icon(5, x_z+w*4 , y_z, enabled = true) draw_icon(10, x_z+w*5 , y_z, enabled = true) draw_text(x_z+4 ,y_z+w-8 ,rct_w,rct_h,@actor.m5_20150228_skill_point["火"]) draw_text(x_z+w+4 ,y_z+w-8 ,rct_w,rct_h,@actor.m5_20150228_skill_point["水"]) draw_text(x_z+w*2+4 ,y_z+w-8,rct_w,rct_h,@actor.m5_20150228_skill_point["光"]) draw_text(x_z+w*3+4 ,y_z+w-8,rct_w,rct_h,@actor.m5_20150228_skill_point["风"]) draw_text(x_z+w*4+4 ,y_z+w-8,rct_w,rct_h,@actor.m5_20150228_skill_point["地"]) draw_text(x_z+w*5+4 ,y_z+w-8,rct_w,rct_h,@actor.m5_20150228_skill_point["混沌"]) draw_text(x_z+4 ,y_z+w+4 ,rct_w,rct_h,@actor.m5_20150228_skill_point_use["火"]) draw_text(x_z+w+4 ,y_z+w+4 ,rct_w,rct_h,@actor.m5_20150228_skill_point_use["水"]) draw_text(x_z+w*2+4 ,y_z+w+4,rct_w,rct_h,@actor.m5_20150228_skill_point_use["光"]) draw_text(x_z+w*3+4 ,y_z+w+4,rct_w,rct_h,@actor.m5_20150228_skill_point_use["风"]) draw_text(x_z+w*4+4 ,y_z+w+4,rct_w,rct_h,@actor.m5_20150228_skill_point_use["地"]) draw_text(x_z+w*5+4 ,y_z+w+4,rct_w,rct_h,@actor.m5_20150228_skill_point_use["混沌"]) end #-------------------------------------------------------------------------- # ● 绘制技能 #-------------------------------------------------------------------------- def draw_skill dx = 170; dy = 40 contents.font.size=16 for skill in @actor.skills next if skill.nil? next unless @actor.added_skill_types.include?(skill.stype_id) draw_item_name(skill, dx, dy) #~ dx = dx == contents.width / 2 + 16 ? 0 : contents.width / 2 + 16 dy += line_height #if dx == 0 return if dy + line_height > contents.height end end #-------------------------------------------------------------------------- # ● 绘制普通能力值 #def mhp; param(0); end # 最大HP Maximum Hit Point #def mmp; param(1); end # 最大MP Maximum Magic Point #def atk; param(2); end # 物理攻击 ATtacK power #def def; param(3); end # 物理防御 DEFense power #def mat; param(4); end # 魔法攻击 Magic ATtack power #def mdf; param(5); end # 魔法防御 Magic DeFense power #def agi; param(6); end # 敏 捷 值 AGIlity #def luk; param(7); end # 幸 运 值 LUcK #-------------------------------------------------------------------------- def draw_parameters(x, y) contents.font.size=18 w=24 rct_w=32 rct_h=24 y_z=210 x_z=0 #~ draw_icon(15, x_z , y_z, enabled = true) #~ draw_icon(16, x_z , y_z+w, enabled = true) #~ draw_icon(17, x_z , y_z+w*2, enabled = true) #~ draw_icon(18, x_z , y_z+w*3, enabled = true) #~ draw_icon(19, x_z+70 , y_z, enabled = true) #~ draw_icon(10, x_z+70 , y_z+w, enabled = true) #~ draw_icon(21, x_z+70 , y_z+w*2, enabled = true) #~ draw_icon(21, x_z+70 , y_z+w*3, enabled = true) draw_actor_param(@actor, x_z, y_z , 0) draw_actor_param(@actor, x_z, y_z + w * 1, 1) draw_actor_param(@actor, x_z, y_z + w * 2, 2) draw_actor_param(@actor, x_z, y_z + w * 3, 3) draw_actor_param(@actor, 74, y_z , 4) draw_actor_param(@actor, 74, y_z + w * 1, 5) draw_actor_param(@actor, 74, y_z + w * 2, 6) draw_actor_param(@actor, 74, y_z + w * 3, 7) end #-------------------------------------------------------------------------- # ● 绘制X能力值 #-------------------------------------------------------------------------- def draw_xparameters x=140 l=18 y=Graphics.height-l*10 contents.font.size=16 draw_actor_xparam(@actor, x, y+l*1,0 , "物理命中") draw_actor_xparam(@actor, x, y+l*2,1 , "物理闪避") draw_actor_xparam(@actor, x, y+l*3,2 , "会心一击") draw_actor_xparam(@actor, x, y+l*4,3 , "抗会心一击") #~ draw_actor_xparam(@actor, x, y+l*5,4 , "技能闪避") #~ draw_actor_xparam(@actor, x, y+l*6,5 , "技能反射") draw_actor_xparam(@actor, x, y+l*5,6 , "反击") draw_actor_xparam(@actor, x, y+l*6,7 , "生命再生") draw_actor_xparam(@actor, x, y+l*7,8 , "士气再生") #~ draw_actor_xparam(@actor, x, y+l*10,9 , "怒气增长") end #-------------------------------------------------------------------------- # ● 绘制S能力值 #-------------------------------------------------------------------------- def draw_sparameters x=0 l=18 y=Graphics.height-l*7 contents.font.size=16 draw_actor_sparam(@actor, x, y+l*1, 1,"防御修正") draw_actor_sparam(@actor, x, y+l*2, 2,"恢复修正") draw_actor_sparam(@actor, x, y+l*3, 3,"治疗修正") #~ draw_actor_sparam(@actor, x, y+l*4, 4,"MP消费率") #~ draw_actor_sparam(@actor, x, y+l*5, 5,"TP消耗率") draw_actor_sparam(@actor, x, y+l*4, 6,"物抗修正") #~ draw_actor_sparam(@actor, x, y+l*7, 7,"魔法伤害加成") #~ draw_actor_sparam(@actor, x, y+l*8, 8,"地形伤害加成") #~ draw_actor_sparam(@actor, x, y+l*9, 9,"经验获得加成") end #-------------------------------------------------------------------------- # ● 绘制人物背景 #-------------------------------------------------------------------------- def draw_backg actor=@actor actor_bg(actor.id) end def actor_bg(file_name) bitmap = Cache.picture("/Actor#{file_name}_Status") src_rect = Rect.new(0,0,544,416) contents.blt(0, 0, bitmap, src_rect,255) end #-------------------------------------------------------------------------- # ● 绘制窗口背景 #-------------------------------------------------------------------------- #~ def draw_window_backg #~ windowbg = Cache.picture("/windowbg") #~ src_rect = Rect.new(0,0,windowbg.width ,windowbg.height) #~ contents.blt(0, 0, windowbg, src_rect,125) #~ end end
#encoding:utf-8
#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
# 状态画面中,显示角色基本信息的窗口。
#==============================================================================
class Window_Status < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 0, 544, 416)
@actor = actor
refresh
activate
self.opacity=0
@data = []
end
def standard_padding
return 0
end
#--------------------------------------------------------------------------
# ● 设置角色
#--------------------------------------------------------------------------
def actor=(actor)
return if @actor == actor
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_block1 (0)
draw_skill
end
#--------------------------------------------------------------------------
# ● 绘制区域 1
#--------------------------------------------------------------------------
def draw_block1(y)
#~ draw_window_backg
draw_backg
#~ draw_actor_name(@actor, 4, y)
#~ draw_actor_class(@actor, 128, y)
draw_basic_info(136, y)
draw_parameters(32, y)
draw_xparameters
draw_sparameters
#~ draw_equipments(288, y)
#~ draw_description(4, y)
end
#--------------------------------------------------------------------------
# ● 绘制水平线
#--------------------------------------------------------------------------
def draw_horz_line(y)
line_y = y + line_height / 2 - 1
contents.fill_rect(0, line_y, contents_width, 2, line_color)
end
#--------------------------------------------------------------------------
# ● 获取水平线的颜色
#--------------------------------------------------------------------------
def line_color
color = normal_color
color.alpha = 48
color
end
#--------------------------------------------------------------------------
# ● 绘制基本信息
#--------------------------------------------------------------------------
def draw_basic_info(x, y)
w=28
rct_w=32
rct_h=24
y_z=160
x_z=0
#~ draw_actor_icons(@actor, x, y + line_height * 1)绘制状态图标
contents.font.size=16
#~ draw_actor_hp(@actor, 160, 200,width= 100)
#~ draw_actor_mp(@actor, 160, 224,width= 100)
draw_icon(6, x_z , y_z , enabled = true)
draw_icon(3, x_z+w , y_z , enabled = true)
draw_icon(4, x_z+w*2 , y_z, enabled = true)
draw_icon(8, x_z+w*3 , y_z, enabled = true)
draw_icon(5, x_z+w*4 , y_z, enabled = true)
draw_icon(10, x_z+w*5 , y_z, enabled = true)
draw_text(x_z+4 ,y_z+w-8 ,rct_w,rct_h,@actor.m5_20150228_skill_point["火"])
draw_text(x_z+w+4 ,y_z+w-8 ,rct_w,rct_h,@actor.m5_20150228_skill_point["水"])
draw_text(x_z+w*2+4 ,y_z+w-8,rct_w,rct_h,@actor.m5_20150228_skill_point["光"])
draw_text(x_z+w*3+4 ,y_z+w-8,rct_w,rct_h,@actor.m5_20150228_skill_point["风"])
draw_text(x_z+w*4+4 ,y_z+w-8,rct_w,rct_h,@actor.m5_20150228_skill_point["地"])
draw_text(x_z+w*5+4 ,y_z+w-8,rct_w,rct_h,@actor.m5_20150228_skill_point["混沌"])
draw_text(x_z+4 ,y_z+w+4 ,rct_w,rct_h,@actor.m5_20150228_skill_point_use["火"])
draw_text(x_z+w+4 ,y_z+w+4 ,rct_w,rct_h,@actor.m5_20150228_skill_point_use["水"])
draw_text(x_z+w*2+4 ,y_z+w+4,rct_w,rct_h,@actor.m5_20150228_skill_point_use["光"])
draw_text(x_z+w*3+4 ,y_z+w+4,rct_w,rct_h,@actor.m5_20150228_skill_point_use["风"])
draw_text(x_z+w*4+4 ,y_z+w+4,rct_w,rct_h,@actor.m5_20150228_skill_point_use["地"])
draw_text(x_z+w*5+4 ,y_z+w+4,rct_w,rct_h,@actor.m5_20150228_skill_point_use["混沌"])
end
#--------------------------------------------------------------------------
# ● 绘制技能
#--------------------------------------------------------------------------
def draw_skill
dx = 170; dy = 40
contents.font.size=16
for skill in @actor.skills
next if skill.nil?
next unless @actor.added_skill_types.include?(skill.stype_id)
draw_item_name(skill, dx, dy)
#~ dx = dx == contents.width / 2 + 16 ? 0 : contents.width / 2 + 16
dy += line_height #if dx == 0
return if dy + line_height > contents.height
end
end
#--------------------------------------------------------------------------
# ● 绘制普通能力值
#def mhp; param(0); end # 最大HP Maximum Hit Point
#def mmp; param(1); end # 最大MP Maximum Magic Point
#def atk; param(2); end # 物理攻击 ATtacK power
#def def; param(3); end # 物理防御 DEFense power
#def mat; param(4); end # 魔法攻击 Magic ATtack power
#def mdf; param(5); end # 魔法防御 Magic DeFense power
#def agi; param(6); end # 敏 捷 值 AGIlity
#def luk; param(7); end # 幸 运 值 LUcK
#--------------------------------------------------------------------------
def draw_parameters(x, y)
contents.font.size=18
w=24
rct_w=32
rct_h=24
y_z=210
x_z=0
#~ draw_icon(15, x_z , y_z, enabled = true)
#~ draw_icon(16, x_z , y_z+w, enabled = true)
#~ draw_icon(17, x_z , y_z+w*2, enabled = true)
#~ draw_icon(18, x_z , y_z+w*3, enabled = true)
#~ draw_icon(19, x_z+70 , y_z, enabled = true)
#~ draw_icon(10, x_z+70 , y_z+w, enabled = true)
#~ draw_icon(21, x_z+70 , y_z+w*2, enabled = true)
#~ draw_icon(21, x_z+70 , y_z+w*3, enabled = true)
draw_actor_param(@actor, x_z, y_z , 0)
draw_actor_param(@actor, x_z, y_z + w * 1, 1)
draw_actor_param(@actor, x_z, y_z + w * 2, 2)
draw_actor_param(@actor, x_z, y_z + w * 3, 3)
draw_actor_param(@actor, 74, y_z , 4)
draw_actor_param(@actor, 74, y_z + w * 1, 5)
draw_actor_param(@actor, 74, y_z + w * 2, 6)
draw_actor_param(@actor, 74, y_z + w * 3, 7)
end
#--------------------------------------------------------------------------
# ● 绘制X能力值
#--------------------------------------------------------------------------
def draw_xparameters
x=140
l=18
y=Graphics.height-l*10
contents.font.size=16
draw_actor_xparam(@actor, x, y+l*1,0 , "物理命中")
draw_actor_xparam(@actor, x, y+l*2,1 , "物理闪避")
draw_actor_xparam(@actor, x, y+l*3,2 , "会心一击")
draw_actor_xparam(@actor, x, y+l*4,3 , "抗会心一击")
#~ draw_actor_xparam(@actor, x, y+l*5,4 , "技能闪避")
#~ draw_actor_xparam(@actor, x, y+l*6,5 , "技能反射")
draw_actor_xparam(@actor, x, y+l*5,6 , "反击")
draw_actor_xparam(@actor, x, y+l*6,7 , "生命再生")
draw_actor_xparam(@actor, x, y+l*7,8 , "士气再生")
#~ draw_actor_xparam(@actor, x, y+l*10,9 , "怒气增长")
end
#--------------------------------------------------------------------------
# ● 绘制S能力值
#--------------------------------------------------------------------------
def draw_sparameters
x=0
l=18
y=Graphics.height-l*7
contents.font.size=16
draw_actor_sparam(@actor, x, y+l*1, 1,"防御修正")
draw_actor_sparam(@actor, x, y+l*2, 2,"恢复修正")
draw_actor_sparam(@actor, x, y+l*3, 3,"治疗修正")
#~ draw_actor_sparam(@actor, x, y+l*4, 4,"MP消费率")
#~ draw_actor_sparam(@actor, x, y+l*5, 5,"TP消耗率")
draw_actor_sparam(@actor, x, y+l*4, 6,"物抗修正")
#~ draw_actor_sparam(@actor, x, y+l*7, 7,"魔法伤害加成")
#~ draw_actor_sparam(@actor, x, y+l*8, 8,"地形伤害加成")
#~ draw_actor_sparam(@actor, x, y+l*9, 9,"经验获得加成")
end
#--------------------------------------------------------------------------
# ● 绘制人物背景
#--------------------------------------------------------------------------
def draw_backg
actor=@actor
actor_bg(actor.id)
end
def actor_bg(file_name)
bitmap = Cache.picture("/Actor#{file_name}_Status")
src_rect = Rect.new(0,0,544,416)
contents.blt(0, 0, bitmap, src_rect,255)
end
#--------------------------------------------------------------------------
# ● 绘制窗口背景
#--------------------------------------------------------------------------
#~ def draw_window_backg
#~ windowbg = Cache.picture("/windowbg")
#~ src_rect = Rect.new(0,0,windowbg.width ,windowbg.height)
#~ contents.blt(0, 0, windowbg, src_rect,125)
#~ end
end
|
|