加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 沉滞的剑 于 2013-4-16 16:06 编辑
$perks = [] class Perk attr_accessor :index attr_accessor :name attr_accessor :note attr_accessor :fatherid attr_accessor :description ##============================================================================= def finding (tag) a = @note.index(tag) a = a + tag.size unless a == nil b = @note.index("!",a-1) unless a == nil c = @note[a..b-1].to_i unless a == nil or b == nil return c end def finding_s (tag) a = @note.index(tag) p a = a + tag.size unless a == nil p b = @note.index("!",a+1) unless a == nil p c = @note[a,b].to_s unless a = nil or b == nil return c end ##============================================================================= def initialize (index,name,note) @index = index @name = name p @note = note @fatherid = finding("<f>") @description = finding_s("<d>") end def self.setup for i in $data_skills if i != nil b = i.name a = i.id c = i.note $perks[a]= Perk.new(a,b,c) end end end end
$perks = []
class Perk
attr_accessor :index
attr_accessor :name
attr_accessor :note
attr_accessor :fatherid
attr_accessor :description
##=============================================================================
def finding (tag)
a = @note.index(tag)
a = a + tag.size unless a == nil
b = @note.index("!",a-1) unless a == nil
c = @note[a..b-1].to_i unless a == nil or b == nil
return c
end
def finding_s (tag)
a = @note.index(tag)
p a = a + tag.size unless a == nil
p b = @note.index("!",a+1) unless a == nil
p c = @note[a,b].to_s unless a = nil or b == nil
return c
end
##=============================================================================
def initialize (index,name,note)
@index = index
@name = name
p @note = note
@fatherid = finding("<f>")
@description = finding_s("<d>")
end
def self.setup
for i in $data_skills
if i != nil
b = i.name
a = i.id
c = i.note
$perks[a]= Perk.new(a,b,c)
end
end
end
end
|