Added Flags property to types, abilities, species and map metadata. Added LocationFlag evolution method.

This commit is contained in:
Maruno17
2021-09-02 19:01:16 +01:00
parent cfbefceb00
commit 86cbcad382
39 changed files with 1200 additions and 1183 deletions

View File

@@ -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