diff options
Diffstat (limited to 'app/models')
| -rw-r--r-- | app/models/pokeviewer/pokemon.rb | 32 |
1 files changed, 32 insertions, 0 deletions
| 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 | |||
| 137 | end | 137 | end |
| 138 | end | 138 | end |
| 139 | 139 | ||
| 140 | def nature_benefits?(stat) | ||
| 141 | if stat == :attack | ||
| 142 | [:lonely, :brave, :adamant, :naughty].include? nature.intern | ||
| 143 | elsif stat == :defense | ||
| 144 | [:bold, :relaxed, :impish, :lax].include? nature.intern | ||
| 145 | elsif stat == :speed | ||
| 146 | [:timid, :hasty, :jolly, :naive].include? nature.intern | ||
| 147 | elsif stat == :special_attack | ||
| 148 | [:modest, :mild, :quiet, :rash].include? nature.intern | ||
| 149 | elsif stat == :special_defense | ||
| 150 | [:calm, :gentle, :sassy, :careful].include? nature.intern | ||
| 151 | else | ||
| 152 | false | ||
| 153 | end | ||
| 154 | end | ||
| 155 | |||
| 156 | def nature_hinders?(stat) | ||
| 157 | if stat == :attack | ||
| 158 | [:bold, :timid, :modest, :calm].include? nature.intern | ||
| 159 | elsif stat == :defense | ||
| 160 | [:lonely, :hasty, :mild, :gentle].include? nature.intern | ||
| 161 | elsif stat == :speed | ||
| 162 | [:brave, :relaxed, :quiet, :sassy].include? nature.intern | ||
| 163 | elsif stat == :special_attack | ||
| 164 | [:adamant, :impish, :jolly, :careful].include? nature.intern | ||
| 165 | elsif stat == :special_defense | ||
| 166 | [:naughty, :lax, :naive, :rash].include? nature.intern | ||
| 167 | else | ||
| 168 | false | ||
| 169 | end | ||
| 170 | end | ||
| 171 | |||
| 140 | private | 172 | private |
| 141 | 173 | ||
| 142 | def set_uuid | 174 | def set_uuid |
