mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 22:24:58 +00:00
Added Flags property to types, abilities, species and map metadata. Added LocationFlag evolution method.
This commit is contained in:
@@ -3,6 +3,7 @@ module GameData
|
||||
attr_reader :id
|
||||
attr_reader :real_name
|
||||
attr_reader :real_description
|
||||
attr_reader :flags
|
||||
|
||||
DATA = {}
|
||||
DATA_FILENAME = "abilities.dat"
|
||||
@@ -12,13 +13,15 @@ module GameData
|
||||
|
||||
SCHEMA = {
|
||||
"Name" => [:name, "s"],
|
||||
"Description" => [:description, "q"]
|
||||
"Description" => [:description, "q"],
|
||||
"Flags" => [:flags, "*s"]
|
||||
}
|
||||
|
||||
def initialize(hash)
|
||||
@id = hash[:id]
|
||||
@real_name = hash[:name] || "Unnamed"
|
||||
@real_description = hash[:description] || "???"
|
||||
@flags = hash[:flags] || []
|
||||
end
|
||||
|
||||
# @return [String] the translated name of this ability
|
||||
@@ -30,5 +33,9 @@ module GameData
|
||||
def description
|
||||
return pbGetMessageFromHash(MessageTypes::AbilityDescs, @real_description)
|
||||
end
|
||||
|
||||
def has_flag?(flag)
|
||||
return @flags.any? { |f| f.downcase == flag.downcase }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user