赞 | 1 |
VIP | 5 |
好人卡 | 4 |
积分 | 1 |
经验 | 23670 |
最后登录 | 2014-11-20 |
在线时间 | 378 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 378 小时
- 注册时间
- 2013-10-14
- 帖子
- 215
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 batfjtn 于 2014-7-14 11:11 编辑
#============================================================================== # ■ ShockSystem #------------------------------------------------------------------------------ # 常量设置 #============================================================================== module ShockSystem # 人物称号设置 NickNames = { # 称号名称 :name => ["预言之子","预言之孙子","国家炼金术师","海贼王","一米六","铠之巨人","忍术之神","七武海","八武海"], # 称号描述 :description => ["预言的儿子", "预言之子的儿子", "也被称为军队的走狗", "拥有世上一切财富、声望和权利的标志", "人类最强兵器", "不详", "就是会很多忍术lo-、", "王下七武海之一", "没八武海这个称号", ], # 称号颜色 :color => [Color.new(255,128,128), Color.new(64,64,255), Color.new(255,0,0), Color.new(176,176,176), Color.new(128,128,255), Color.new(255,0,255), Color.new(128,255,128), Color.new(255,255,128), Color.new(128,128,128)], # 图标(ID) :icon => [14,12,501,523,387,121,143,523,99], # 震慑力(范围为 -100~100 ) :shock => [20,2,15,70,50,15,60,30,-50], # 震慑抵抗力(范围为 -100~100 ) :shock_def => [50,100,15,100,30,25,100,60,-10] } # 敌人/角色震慑力标志 ShockPointFlag = "SP" # 敌人/角色震慑抵抗力标志 ShockDefFlag = "SD" # 角色初始称号标志 InitNickname = "IN" end #============================================================================== # ■ #------------------------------------------------------------------------------ # 内部定义 #============================================================================== class RPG::BaseItem def shock_point if /\[#{ShockSystem::ShockPointFlag} (\d+)\]/ =~ @note return $1.to_i elsif /\[#{ShockSystem::ShockPointFlag} (\d+)\]/ =~ @note return -($1.to_i) else return 0 end end def shock_def if /\[#{ShockSystem::ShockDefFlag} (\d+)\]/ =~ @note return $1.to_i elsif /\[#{ShockSystem::ShockDefFlag} -(\d+)\]/ =~ @note return -($1.to_i) else return 0 end end end class RPG::Actor < RPG::BaseItem def nickname if /\[#{ShockSystem::InitNickname} (\d+)\]/ =~ @note return $1.to_i else return -1 end end end
#==============================================================================
# ■ ShockSystem
#------------------------------------------------------------------------------
# 常量设置
#==============================================================================
module ShockSystem
# 人物称号设置
NickNames = {
# 称号名称
:name => ["预言之子","预言之孙子","国家炼金术师","海贼王","一米六","铠之巨人","忍术之神","七武海","八武海"],
# 称号描述
:description => ["预言的儿子",
"预言之子的儿子",
"也被称为军队的走狗",
"拥有世上一切财富、声望和权利的标志",
"人类最强兵器",
"不详",
"就是会很多忍术lo-、",
"王下七武海之一",
"没八武海这个称号",
],
# 称号颜色
:color => [Color.new(255,128,128),
Color.new(64,64,255),
Color.new(255,0,0),
Color.new(176,176,176),
Color.new(128,128,255),
Color.new(255,0,255),
Color.new(128,255,128),
Color.new(255,255,128),
Color.new(128,128,128)],
# 图标(ID)
:icon => [14,12,501,523,387,121,143,523,99],
# 震慑力(范围为 -100~100 )
:shock => [20,2,15,70,50,15,60,30,-50],
# 震慑抵抗力(范围为 -100~100 )
:shock_def => [50,100,15,100,30,25,100,60,-10]
}
# 敌人/角色震慑力标志
ShockPointFlag = "SP"
# 敌人/角色震慑抵抗力标志
ShockDefFlag = "SD"
# 角色初始称号标志
InitNickname = "IN"
end
#==============================================================================
# ■
#------------------------------------------------------------------------------
# 内部定义
#==============================================================================
class RPG::BaseItem
def shock_point
if /\[#{ShockSystem::ShockPointFlag} (\d+)\]/ =~ @note
return $1.to_i
elsif /\[#{ShockSystem::ShockPointFlag} (\d+)\]/ =~ @note
return -($1.to_i)
else
return 0
end
end
def shock_def
if /\[#{ShockSystem::ShockDefFlag} (\d+)\]/ =~ @note
return $1.to_i
elsif /\[#{ShockSystem::ShockDefFlag} -(\d+)\]/ =~ @note
return -($1.to_i)
else
return 0
end
end
end
class RPG::Actor < RPG::BaseItem
def nickname
if /\[#{ShockSystem::InitNickname} (\d+)\]/ =~ @note
return $1.to_i
else
return -1
end
end
end
这一段是VA里面的代码~~!!
如果是正确的
能不能解释下if /\[#{ShockSystem::InitNickname} (\d+)\]/ =~ @note这段这么多的符号是什么意思啊? |
|