Project1
标题: 获取随机属性装备权重该怎么写 [打印本页]
作者: shinliwei 时间: 2013-6-14 00:39
标题: 获取随机属性装备权重该怎么写
本帖最后由 shinliwei 于 2013-6-15 21:14 编辑
http://rpg.blue/forum.php?mod=vi ... id%3D368&page=1
下载了这位大神的脚本,是根据强化等级显示物品颜色的。而我期望是根据装备的前缀来显示物品颜色。
@paramsplus = [
[30,"猛虎",[[2,10],[6,10]]], #攻击+10、敏捷+10
[30,"野熊",[[2,10],[0,50]]], #攻击+10、最大HP+50
[30,"野猪",[[3,10],[0,50]]], #防御+10、最大HP+50
[30,"灵猴",[[6,10],[3,10]]], #敏捷+10、防御+10
[30,"雄鹰",[[6,10],[4,10]]], #敏捷+10、精神+10
[30,"夜枭",[[4,10],[3,10]]], #精神+10、防御+10
[30,"孤狼",[[6,10],[5,10]]], #敏捷+10、魔御+10
[30,"巨鲸",[[4,10],[5,10]]], #精神+10、魔御+10
[30,"巨猿",[[2,10],[4,10]]], #攻击+10、精神+10
[30,"猎鹰",[[2,10],[5,10]]], #攻击+10、魔御+10
[90,"士兵",[[3,20],[5,20],[0,100]]], #防御+20、魔御+20、最大HP+100
[90,"强盗",[[2,20],[6,20],[0,100]]], #攻击+20、敏捷+20、最大HP+100
[90,"刺客",[[2,20],[6,20],[7,20]]], #攻击+20、敏捷+20、幸运+20
[90,"射手",[[2,20],[3,20],[6,20]]], #攻击+20、防御+20、敏捷+20
[90,"巫师",[[4,20],[5,20],[0,100]]], #精神+20、魔御+20、最大HP+100
[90,"先知",[[4,20],[6,20],[7,20]]], #精神+20、魔御+20、幸运+20
[90,"勇士",[[2,20],[3,20],[5,20]]], #攻击+20、防御+20、幸运+20
[90,"祭司",[[4,20],[5,20],[3,20]]], #精神+20、魔御+20、防御+20
[90,"导师",[[4,20],[7,20],[0,100]]], #精神+20、幸运+20、最大HP+100
[90,"僧侣",[[3,20],[6,20],[0,100]]], #防御+20、敏捷+20、最大HP+100
]
@paramsplus = [
[30,"猛虎",[[2,10],[6,10]]], #攻击+10、敏捷+10
[30,"野熊",[[2,10],[0,50]]], #攻击+10、最大HP+50
[30,"野猪",[[3,10],[0,50]]], #防御+10、最大HP+50
[30,"灵猴",[[6,10],[3,10]]], #敏捷+10、防御+10
[30,"雄鹰",[[6,10],[4,10]]], #敏捷+10、精神+10
[30,"夜枭",[[4,10],[3,10]]], #精神+10、防御+10
[30,"孤狼",[[6,10],[5,10]]], #敏捷+10、魔御+10
[30,"巨鲸",[[4,10],[5,10]]], #精神+10、魔御+10
[30,"巨猿",[[2,10],[4,10]]], #攻击+10、精神+10
[30,"猎鹰",[[2,10],[5,10]]], #攻击+10、魔御+10
[90,"士兵",[[3,20],[5,20],[0,100]]], #防御+20、魔御+20、最大HP+100
[90,"强盗",[[2,20],[6,20],[0,100]]], #攻击+20、敏捷+20、最大HP+100
[90,"刺客",[[2,20],[6,20],[7,20]]], #攻击+20、敏捷+20、幸运+20
[90,"射手",[[2,20],[3,20],[6,20]]], #攻击+20、防御+20、敏捷+20
[90,"巫师",[[4,20],[5,20],[0,100]]], #精神+20、魔御+20、最大HP+100
[90,"先知",[[4,20],[6,20],[7,20]]], #精神+20、魔御+20、幸运+20
[90,"勇士",[[2,20],[3,20],[5,20]]], #攻击+20、防御+20、幸运+20
[90,"祭司",[[4,20],[5,20],[3,20]]], #精神+20、魔御+20、防御+20
[90,"导师",[[4,20],[7,20],[0,100]]], #精神+20、幸运+20、最大HP+100
[90,"僧侣",[[3,20],[6,20],[0,100]]], #防御+20、敏捷+20、最大HP+100
]
权重30的前缀名装备作为品质2 显示绿色
权重90的前缀名装备作为品质3 显示蓝色
颜色描绘脚本用的是这个
#==============================================================================
# [PS0]物品颜色描绘
# Window_Base_Itemcolor
#------------------------------------------------------------------------------
# 在物品、技能选项中显示物品品质并显示品质框和修改物品名颜色。
#==============================================================================
# [更新记录]
# - 2012.01.03 By 仲秋启明
# * 修改为VA定义
# - 2011.12.27 By 仲秋启明
# * 移植至RGSS3,遵循PS0协议;
# * 优化数据库备注中设定方法
# - 2011.08.22 By 冰舞蝶恋
# * 蓝本(实用·极简 -- 按品质,给物品描绘色彩边框)
# - 2010.08.06 By 仲秋启明
# * 蓝本(物品颜色描绘脚本(完整无冲突版))
#------------------------------------------------------------------------------
# [使用方法]
# - 替换原Window_Base中的draw_item_name定义或复制到Main之前
#==============================================================================
$_PS0 = {} if $_PS0 == nil
$_PS0["Window_Base_Itemcolor"] = 20111227
#==============================================================================
# [PS0] 通用配置模块
#==============================================================================
module PS0
module Window_Base_Itemcolor
Color1 = Color.new(255, 255, 255) # 普通品质的色彩(白,1)
Color2 = Color.new(128, 255, 128) # 优秀品质的色彩(绿,2)
Color3 = Color.new(128, 128, 255) # 精良品质的色彩(蓝,3)
Color4 = Color.new(255, 0, 255) # 史诗品质的色彩(紫,4)
Color5 = Color.new(255, 128, 0) # 传说品质的色彩(橙,5)
end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
def draw_item_name(item, x, y, enabled = true, width = 172)
if item != nil
n = item.note
a = n.split{/<(?:Quality|品质)\s*(.+)>/i}
c = a[1].to_i
if c <= 1
color = PS0::Window_Base_Itemcolor::Color1
elsif c == 2
color = PS0::Window_Base_Itemcolor::Color2
elsif c == 3
color = PS0::Window_Base_Itemcolor::Color3
elsif c == 4
color = PS0::Window_Base_Itemcolor::Color4
elsif c == 5
color = PS0::Window_Base_Itemcolor::Color5
else
color = Color.new(0, 0, 0, 0)
end
self.contents.fill_rect(x, y, 24, 1, color)
self.contents.fill_rect(x, y, 1, 24, color)
self.contents.fill_rect(x, y+23, 24, 1, color)
self.contents.fill_rect(x+23, y, 1, 24, color)
draw_icon(item.icon_index, x, y, enabled)
change_color(color, enabled)
draw_text(x + 24, y, width, line_height, item.name)
end
end
end
#==============================================================================
# [PS0] End of Script
#==============================================================================
#==============================================================================
# [PS0]物品颜色描绘
# Window_Base_Itemcolor
#------------------------------------------------------------------------------
# 在物品、技能选项中显示物品品质并显示品质框和修改物品名颜色。
#==============================================================================
# [更新记录]
# - 2012.01.03 By 仲秋启明
# * 修改为VA定义
# - 2011.12.27 By 仲秋启明
# * 移植至RGSS3,遵循PS0协议;
# * 优化数据库备注中设定方法
# - 2011.08.22 By 冰舞蝶恋
# * 蓝本(实用·极简 -- 按品质,给物品描绘色彩边框)
# - 2010.08.06 By 仲秋启明
# * 蓝本(物品颜色描绘脚本(完整无冲突版))
#------------------------------------------------------------------------------
# [使用方法]
# - 替换原Window_Base中的draw_item_name定义或复制到Main之前
#==============================================================================
$_PS0 = {} if $_PS0 == nil
$_PS0["Window_Base_Itemcolor"] = 20111227
#==============================================================================
# [PS0] 通用配置模块
#==============================================================================
module PS0
module Window_Base_Itemcolor
Color1 = Color.new(255, 255, 255) # 普通品质的色彩(白,1)
Color2 = Color.new(128, 255, 128) # 优秀品质的色彩(绿,2)
Color3 = Color.new(128, 128, 255) # 精良品质的色彩(蓝,3)
Color4 = Color.new(255, 0, 255) # 史诗品质的色彩(紫,4)
Color5 = Color.new(255, 128, 0) # 传说品质的色彩(橙,5)
end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
def draw_item_name(item, x, y, enabled = true, width = 172)
if item != nil
n = item.note
a = n.split{/<(?:Quality|品质)\s*(.+)>/i}
c = a[1].to_i
if c <= 1
color = PS0::Window_Base_Itemcolor::Color1
elsif c == 2
color = PS0::Window_Base_Itemcolor::Color2
elsif c == 3
color = PS0::Window_Base_Itemcolor::Color3
elsif c == 4
color = PS0::Window_Base_Itemcolor::Color4
elsif c == 5
color = PS0::Window_Base_Itemcolor::Color5
else
color = Color.new(0, 0, 0, 0)
end
self.contents.fill_rect(x, y, 24, 1, color)
self.contents.fill_rect(x, y, 1, 24, color)
self.contents.fill_rect(x, y+23, 24, 1, color)
self.contents.fill_rect(x+23, y, 1, 24, color)
draw_icon(item.icon_index, x, y, enabled)
change_color(color, enabled)
draw_text(x + 24, y, width, line_height, item.name)
end
end
end
#==============================================================================
# [PS0] End of Script
#==============================================================================
再额外问一个问题,就是装备随机属性的几率在哪改
作者: shinliwei 时间: 2013-6-15 17:08
哪位大神指点一下啊,装备么我觉得自然还是要天生就分出品质,不是按照强化等级的区分出品质的,
按照随机属性前缀的权重来区分品质比较合适。
作者: shinliwei 时间: 2013-6-15 21:00
本帖最后由 shinliwei 于 2013-6-16 00:20 编辑
我觉得应该在物品颜色描绘脚本里添加关于装备前缀权重的数据。因为我装备前缀的权重分别的设的是30与90,我想可以把权重÷30 就是1和 3
这样1+1=2就是权重30的,1+3=4就是权重90的了,可是这句脚本我实在是写不出来,谁指点一下啊。
class Window_Base < Window
def draw_item_name(item, x, y, enabled = true, width = 172)
if item != nil
n = item.note
a = n.split{/<(?:Quality|品质)\s*(.+)>/i}
这段脚本不会写 b=0+装备前缀的权重/30
c = a[1].to_i+b
if c <= 1
color = PS0::Window_Base_Itemcolor::Color1
elsif c == 2
color = PS0::Window_Base_Itemcolor::Color2
elsif c == 4
color = PS0::Window_Base_Itemcolor::Color3
elsif c == 5
color = PS0::Window_Base_Itemcolor::Color4
elsif c == 6
color = PS0::Window_Base_Itemcolor::Color5
else
color = Color.new(0, 0, 0, 0)
end
class Window_Base < Window
def draw_item_name(item, x, y, enabled = true, width = 172)
if item != nil
n = item.note
a = n.split{/<(?:Quality|品质)\s*(.+)>/i}
这段脚本不会写 b=0+装备前缀的权重/30
c = a[1].to_i+b
if c <= 1
color = PS0::Window_Base_Itemcolor::Color1
elsif c == 2
color = PS0::Window_Base_Itemcolor::Color2
elsif c == 4
color = PS0::Window_Base_Itemcolor::Color3
elsif c == 5
color = PS0::Window_Base_Itemcolor::Color4
elsif c == 6
color = PS0::Window_Base_Itemcolor::Color5
else
color = Color.new(0, 0, 0, 0)
end
谁能帮我把不会的那句写出来呢
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |