diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-10-04 23:03:58 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-10-04 23:03:58 -0400 |
commit | 52bac73894ad0fe20d7aec907bbd7f07e83ca477 (patch) | |
tree | d7a36c160c1b5ecf1d738c5cd60cf1f388ff5196 | |
parent | 353b170392892a1f9bdde74550112b5131c99fd2 (diff) | |
download | pokeviewer-52bac73894ad0fe20d7aec907bbd7f07e83ca477.tar.gz pokeviewer-52bac73894ad0fe20d7aec907bbd7f07e83ca477.tar.bz2 pokeviewer-52bac73894ad0fe20d7aec907bbd7f07e83ca477.zip |
Added generic met message for Pokémon from Orre
Pokémon from Orre now display "Met in a trade" instead of an entirely incorrect met location, because we're not currently equipped to display the proper met data for them (see hatkirby/gen3uploader#6).
-rw-r--r-- | app/jobs/pokeviewer/extract_save_data_job.rb | 4 | ||||
-rw-r--r-- | app/models/pokeviewer/pokemon.rb | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/app/jobs/pokeviewer/extract_save_data_job.rb b/app/jobs/pokeviewer/extract_save_data_job.rb index 14ba9a6..f94ce74 100644 --- a/app/jobs/pokeviewer/extract_save_data_job.rb +++ b/app/jobs/pokeviewer/extract_save_data_job.rb | |||
@@ -76,7 +76,9 @@ module Pokeviewer | |||
76 | r.ot_number = param["otId"] | 76 | r.ot_number = param["otId"] |
77 | r.ot_gender = param["otGender"] | 77 | r.ot_gender = param["otGender"] |
78 | 78 | ||
79 | if param["metLevel"] == 0 | 79 | if param["orre"] |
80 | r.met_type = :orre | ||
81 | elsif param["metLevel"] == 0 | ||
80 | r.met_type = :hatched | 82 | r.met_type = :hatched |
81 | r.location_id = param["metLocation"] | 83 | r.location_id = param["metLocation"] |
82 | elsif param["metLocation"] == 254 | 84 | elsif param["metLocation"] == 254 |
diff --git a/app/models/pokeviewer/pokemon.rb b/app/models/pokeviewer/pokemon.rb index 3818f58..18d1533 100644 --- a/app/models/pokeviewer/pokemon.rb +++ b/app/models/pokeviewer/pokemon.rb | |||
@@ -49,7 +49,8 @@ module Pokeviewer | |||
49 | if: Proc.new { |a| a.met_type == :normal } | 49 | if: Proc.new { |a| a.met_type == :normal } |
50 | 50 | ||
51 | validates :met_type, presence: true | 51 | validates :met_type, presence: true |
52 | enumerize :met_type, in: [:normal, :hatched, :npc_trade, :fateful_encounter] | 52 | enumerize :met_type, |
53 | in: [:normal, :hatched, :npc_trade, :fateful_encounter, :orre] | ||
53 | 54 | ||
54 | belongs_to :location, optional: true | 55 | belongs_to :location, optional: true |
55 | validates :location, presence: true, | 56 | validates :location, presence: true, |
@@ -153,6 +154,8 @@ module Pokeviewer | |||
153 | "Met in a trade." | 154 | "Met in a trade." |
154 | elsif met_type == :fateful_encounter | 155 | elsif met_type == :fateful_encounter |
155 | "Obtained in a fateful encounter at Lv. #{met_level}." | 156 | "Obtained in a fateful encounter at Lv. #{met_level}." |
157 | elsif met_type == :orre | ||
158 | "Met in a trade." | ||
156 | end | 159 | end |
157 | end | 160 | end |
158 | 161 | ||