Added classes GameData::Environment and GameData::BattleTerrain

This commit is contained in:
Maruno17
2021-02-21 18:37:26 +00:00
parent c16311326c
commit 63e640c79b
23 changed files with 368 additions and 258 deletions

View File

@@ -0,0 +1,56 @@
# These are in-battle terrain effects caused by moves like Electric Terrain.
module GameData
class BattleTerrain
attr_reader :id
attr_reader :real_name
attr_reader :animation
DATA = {}
extend ClassMethodsSymbols
include InstanceMethods
def self.load; end
def self.save; end
def initialize(hash)
@id = hash[:id]
@real_name = hash[:name] || "Unnamed"
@animation = hash[:animation]
end
# @return [String] the translated name of this battle terrain
def name
return _INTL(@real_name)
end
end
end
GameData::BattleTerrain.register({
:id => :None,
:name => _INTL("None")
})
GameData::BattleTerrain.register({
:id => :Electric,
:name => _INTL("Electric"),
:animation => "ElectricTerrain"
})
GameData::BattleTerrain.register({
:id => :Grassy,
:name => _INTL("Grassy"),
:animation => "GrassyTerrain"
})
GameData::BattleTerrain.register({
:id => :Misty,
:name => _INTL("Misty"),
:animation => "MistyTerrain"
})
GameData::BattleTerrain.register({
:id => :Psychic,
:name => _INTL("Psychic"),
:animation => "PsychicTerrain"
})