From 52bac73894ad0fe20d7aec907bbd7f07e83ca477 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 4 Oct 2017 23:03:58 -0400 Subject: Added generic met message for Pokémon from Orre MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- app/jobs/pokeviewer/extract_save_data_job.rb | 4 +++- app/models/pokeviewer/pokemon.rb | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'app') 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 r.ot_number = param["otId"] r.ot_gender = param["otGender"] - if param["metLevel"] == 0 + if param["orre"] + r.met_type = :orre + elsif param["metLevel"] == 0 r.met_type = :hatched r.location_id = param["metLocation"] 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 if: Proc.new { |a| a.met_type == :normal } validates :met_type, presence: true - enumerize :met_type, in: [:normal, :hatched, :npc_trade, :fateful_encounter] + enumerize :met_type, + in: [:normal, :hatched, :npc_trade, :fateful_encounter, :orre] belongs_to :location, optional: true validates :location, presence: true, @@ -153,6 +154,8 @@ module Pokeviewer "Met in a trade." elsif met_type == :fateful_encounter "Obtained in a fateful encounter at Lv. #{met_level}." + elsif met_type == :orre + "Met in a trade." end end -- cgit 1.4.1