Project1
标题:
装备栏的状态显示问题
[打印本页]
作者:
yxidws
时间:
2015-6-30 21:36
标题:
装备栏的状态显示问题
如何显示命中率,回避率等等呢?
作者:
yl51379
时间:
2015-7-1 09:18
你如果使用 图书馆中的 升级自由加点脚本 就可以在加点页面中看到这些属性
如果不想用到加点的功能 也可以参考这个脚本中的 所有属性显示的设置方法
这里是传送门
https://rpg.blue/thread-295517-1-1.html
作者:
黄濑凉太
时间:
2015-7-1 10:15
#==============================================================================
# ■ Window_EquipStatus
#------------------------------------------------------------------------------
# 装备画面中,显示角色能力值变化的窗口。
#==============================================================================
class Window_EquipStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, window_width, window_height)
@actor = nil
@temp_actor = nil
refresh
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
return 208
end
#--------------------------------------------------------------------------
# ● 获取窗口的高度
#--------------------------------------------------------------------------
def window_height
fitting_height(visible_line_number)
end
#--------------------------------------------------------------------------
# ● 获取显示行数
#--------------------------------------------------------------------------
def visible_line_number
return 12
end
#--------------------------------------------------------------------------
# ● 设置角色
#--------------------------------------------------------------------------
def actor=(actor)
return if @actor == actor
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_actor_name(@actor, 4, 0) if @actor
8.times {|i| draw_item(0, line_height * (1 + i), i) }
draw_xparam_name(x + 4, y)
draw_current_xparam(x + 94, y) if @actor
draw_right_arrow_2(x + 126, y)
draw_new_xparam(x + 150, y) if @temp_actor
end
#--------------------------------------------------------------------------
# ● 设置更换装备后的临时角色
#--------------------------------------------------------------------------
def set_temp_actor(temp_actor)
return if @temp_actor == temp_actor
@temp_actor = temp_actor
refresh
end
#--------------------------------------------------------------------------
# ● 绘制项目
#--------------------------------------------------------------------------
def draw_item(x, y, param_id)
draw_param_name(x + 4, y, param_id)
draw_current_param(x + 94, y, param_id) if @actor
draw_right_arrow(x + 126, y)
draw_new_param(x + 150, y, param_id) if @temp_actor
end
#--------------------------------------------------------------------------
# ● 绘制能力值的名字
#--------------------------------------------------------------------------
def draw_param_name(x, y, param_id)
change_color(system_color)
draw_text(x, y, 80, line_height, Vocab::param(param_id))
end
#--------------------------------------------------------------------------
# ● 绘制当前能力值
#--------------------------------------------------------------------------
def draw_current_param(x, y, param_id)
change_color(normal_color)
draw_text(x, y, 32, line_height, @actor.param(param_id), 2)
end
#--------------------------------------------------------------------------
# ● 绘制右方向箭头
#--------------------------------------------------------------------------
def draw_right_arrow(x, y)
change_color(system_color)
draw_text(x, y, 22, line_height, "→", 1)
end
#--------------------------------------------------------------------------
# ● 绘制更换装备后的能力值
#--------------------------------------------------------------------------
def draw_new_param(x, y, param_id)
new_value = @temp_actor.param(param_id)
change_color(param_change_color(new_value - @actor.param(param_id)))
draw_text(x, y, 32, line_height, new_value, 2)
end
#--------------------------------------------------------------------------
# ● 绘制额外能力值的名字
#--------------------------------------------------------------------------
def draw_xparam_name(x, y)
change_color(system_color)
draw_text(x, y + line_height * 6, 80, line_height, "命中率")
draw_text(x, y + line_height * 7 , 80, line_height, "回避率")
draw_text(x, y + line_height * 8 , 80, line_height, "必杀率")
end
#--------------------------------------------------------------------------
# ● 绘制额外当前能力值
#--------------------------------------------------------------------------
def draw_current_xparam(x, y)
change_color(normal_color)
hit = @actor.xparam(0) * 100
eva = @actor.xparam(1) * 100
cri = @actor.xparam(2) * 100
draw_text(x, y + line_height * 6, 32, line_height, hit.round)
draw_text(x, y + line_height * 7, 32, line_height, eva.round)
draw_text(x, y + line_height * 8, 32, line_height, cri.round)
end
#--------------------------------------------------------------------------
# ● 绘制额外右方向箭头
#--------------------------------------------------------------------------
def draw_right_arrow_2(x, y)
change_color(system_color)
draw_text(x, y + line_height * 6, 22, line_height, "→", 1)
draw_text(x, y + line_height * 7, 22, line_height, "→", 1)
draw_text(x, y + line_height * 8, 22, line_height, "→", 1)
end
#--------------------------------------------------------------------------
# ● 绘制更换装备后的额外能力值
#--------------------------------------------------------------------------
def draw_new_xparam(x, y)
new_hit = @temp_actor.xparam(0) * 100
change_color(param_change_color(new_hit - @actor.xparam(0)*100))
draw_text(x, y+ line_height * 6, 32, line_height, new_hit.round, 2)
new_eva = @temp_actor.xparam(1) * 100
change_color(param_change_color(new_eva - @actor.xparam(1)*100))
draw_text(x, y+ line_height * 7, 32, line_height, new_eva.round, 2)
new_cri = @temp_actor.xparam(2) * 100
change_color(param_change_color(new_cri - @actor.xparam(2)*100))
draw_text(x, y+ line_height * 8, 32, line_height, new_cri.round, 2)
end
end
复制代码
坐标窗口大小什么的自己改吧
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1