about summary refs log tree commit diff stats
path: root/app/models
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-09-27 20:07:58 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-09-27 20:07:58 -0400
commitd18a7da044b8fdb4ded49e05865b3dc743c4fb58 (patch)
treed82c290e5badbe76a09e1a3e05267dfcf5599abd /app/models
parent3e4e4583fb751fb47013580ce86e2cc3a0e8353b (diff)
downloadpokeviewer-d18a7da044b8fdb4ded49e05865b3dc743c4fb58.tar.gz
pokeviewer-d18a7da044b8fdb4ded49e05865b3dc743c4fb58.tar.bz2
pokeviewer-d18a7da044b8fdb4ded49e05865b3dc743c4fb58.zip
Continued working on design, added moves
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.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/pokeviewer/pokemon.rb32
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