mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Added class GameData::BattleWeather
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
module GameData
|
||||
class BattleWeather
|
||||
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 weather
|
||||
def name
|
||||
return _INTL(@real_name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
GameData::BattleWeather.register({
|
||||
:id => :None,
|
||||
:name => _INTL("None")
|
||||
})
|
||||
|
||||
GameData::BattleWeather.register({
|
||||
:id => :Sun,
|
||||
:name => _INTL("Sun"),
|
||||
:animation => "Sun"
|
||||
})
|
||||
|
||||
GameData::BattleWeather.register({
|
||||
:id => :Rain,
|
||||
:name => _INTL("Rain"),
|
||||
:animation => "Rain"
|
||||
})
|
||||
|
||||
GameData::BattleWeather.register({
|
||||
:id => :Sandstorm,
|
||||
:name => _INTL("Sandstorm"),
|
||||
:animation => "Sandstorm"
|
||||
})
|
||||
|
||||
GameData::BattleWeather.register({
|
||||
:id => :Hail,
|
||||
:name => _INTL("Hail"),
|
||||
:animation => "Hail"
|
||||
})
|
||||
|
||||
GameData::BattleWeather.register({
|
||||
:id => :HarshSun,
|
||||
:name => _INTL("Harsh Sun"),
|
||||
:animation => "HarshSun"
|
||||
})
|
||||
|
||||
GameData::BattleWeather.register({
|
||||
:id => :HeavyRain,
|
||||
:name => _INTL("Heavy Rain"),
|
||||
:animation => "HeavyRain"
|
||||
})
|
||||
|
||||
GameData::BattleWeather.register({
|
||||
:id => :StrongWinds,
|
||||
:name => _INTL("Strong Winds"),
|
||||
:animation => "StrongWinds"
|
||||
})
|
||||
|
||||
GameData::BattleWeather.register({
|
||||
:id => :ShadowSky,
|
||||
:name => _INTL("Shadow Sky"),
|
||||
:animation => "ShadowSky"
|
||||
})
|
||||
@@ -1,32 +0,0 @@
|
||||
begin
|
||||
module PBWeather
|
||||
None = 0
|
||||
Sun = 1
|
||||
Rain = 2
|
||||
Sandstorm = 3
|
||||
Hail = 4
|
||||
HarshSun = 5
|
||||
HeavyRain = 6
|
||||
StrongWinds = 7
|
||||
ShadowSky = 8
|
||||
|
||||
def self.animationName(weather)
|
||||
case weather
|
||||
when Sun then return "Sun"
|
||||
when Rain then return "Rain"
|
||||
when Sandstorm then return "Sandstorm"
|
||||
when Hail then return "Hail"
|
||||
when HarshSun then return "HarshSun"
|
||||
when HeavyRain then return "HeavyRain"
|
||||
when StrongWinds then return "StrongWinds"
|
||||
when ShadowSky then return "ShadowSky"
|
||||
end
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
rescue Exception
|
||||
if $!.is_a?(SystemExit) || "#{$!.class}"=="Reset"
|
||||
raise $!
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user