$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