From d18a7da044b8fdb4ded49e05865b3dc743c4fb58 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 27 Sep 2017 20:07:58 -0400 Subject: Continued working on design, added moves MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Still a very early design Also, for Pokémon that have Natures that don't benefit and hinder the same stat, there is now a + next to the stat that the Nature benefits, and a - next to the stat it hinders. --- app/models/pokeviewer/pokemon.rb | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'app/models') diff --git a/app/models/pokeviewer/pokemon.rb b/app/models/pokeviewer/pokemon.rb index 7a1d088..6c33406 100644 --- a/app/models/pokeviewer/pokemon.rb +++ b/app/models/pokeviewer/pokemon.rb @@ -137,6 +137,38 @@ module Pokeviewer end end + def nature_benefits?(stat) + if stat == :attack + [:lonely, :brave, :adamant, :naughty].include? nature.intern + elsif stat == :defense + [:bold, :relaxed, :impish, :lax].include? nature.intern + elsif stat == :speed + [:timid, :hasty, :jolly, :naive].include? nature.intern + elsif stat == :special_attack + [:modest, :mild, :quiet, :rash].include? nature.intern + elsif stat == :special_defense + [:calm, :gentle, :sassy, :careful].include? nature.intern + else + false + end + end + + def nature_hinders?(stat) + if stat == :attack + [:bold, :timid, :modest, :calm].include? nature.intern + elsif stat == :defense + [:lonely, :hasty, :mild, :gentle].include? nature.intern + elsif stat == :speed + [:brave, :relaxed, :quiet, :sassy].include? nature.intern + elsif stat == :special_attack + [:adamant, :impish, :jolly, :careful].include? nature.intern + elsif stat == :special_defense + [:naughty, :lax, :naive, :rash].include? nature.intern + else + false + end + end + private def set_uuid -- cgit 1.4.1