about summary refs log tree commit diff stats
path: root/app/models
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-10-13 10:01:44 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-10-13 10:01:44 -0400
commit44a0c2e75ef577e6e847cbeb940ea936904c9d72 (patch)
tree2682fe4e131f567c2ff7e2c6f229a3fe9e6d0e6c /app/models
parent5eab020d3db17c08050e751c155f266dd0a87c4d (diff)
downloadpokeviewer-44a0c2e75ef577e6e847cbeb940ea936904c9d72.tar.gz
pokeviewer-44a0c2e75ef577e6e847cbeb940ea936904c9d72.tar.bz2
pokeviewer-44a0c2e75ef577e6e847cbeb940ea936904c9d72.zip
Redesigned Pokémon show page
The new design is heavily inspired by the status screen from Diamond &
Pearl. It's not entirely done yet, with notable missing features
including sheen and gender. However, it would also be nice to show a
star for shiny Pokémon, Pokérus status, possibly a mention as to what
game the Pokémon is currently in, and descriptive hover bubbles for
moves. It is also notable that currently, as ribbons are located all the
way to the right, their hover bubbles usually go off screen.

The list of Pokémon page has not been redesigned, and the main layout is
still bare.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/pokeviewer/pokemon.rb22
-rw-r--r--app/models/pokeviewer/revision.rb16
2 files changed, 16 insertions, 22 deletions
diff --git a/app/models/pokeviewer/pokemon.rb b/app/models/pokeviewer/pokemon.rb index 1b690f5..ab516fb 100644 --- a/app/models/pokeviewer/pokemon.rb +++ b/app/models/pokeviewer/pokemon.rb
@@ -142,28 +142,6 @@ module Pokeviewer
142 ot_number.to_s.rjust(5, '0') 142 ot_number.to_s.rjust(5, '0')
143 end 143 end
144 144
145 def display_met
146 if met_type == :normal
147 if outsider?
148 "Apparently met in #{location.name} at Lv. #{met_level}."
149 else
150 "Met in #{location.name} at Lv. #{met_level}."
151 end
152 elsif met_type == :hatched
153 if outsider?
154 "Apparently hatched in #{location.name} at Lv. 5."
155 else
156 "Hatched in #{location.name} at Lv. 5."
157 end
158 elsif met_type == :npc_trade
159 "Met in a trade."
160 elsif met_type == :fateful_encounter
161 "Obtained in a fateful encounter at Lv. #{met_level}."
162 elsif met_type == :orre
163 "Met in a trade."
164 end
165 end
166
167 def nature_benefits?(stat) 145 def nature_benefits?(stat)
168 if stat == :attack 146 if stat == :attack
169 [:lonely, :brave, :adamant, :naughty].include? nature.intern 147 [:lonely, :brave, :adamant, :naughty].include? nature.intern
diff --git a/app/models/pokeviewer/revision.rb b/app/models/pokeviewer/revision.rb index b77bb1f..2626ae3 100644 --- a/app/models/pokeviewer/revision.rb +++ b/app/models/pokeviewer/revision.rb
@@ -140,6 +140,22 @@ module Pokeviewer
140 less_than_or_equal_to: 4, 140 less_than_or_equal_to: 4,
141 only_integer: true} 141 only_integer: true}
142 142
143 def move_1_pp
144 move_1.pp * (5 + move_1_pp_bonuses) / 5
145 end
146
147 def move_2_pp
148 move_2.pp * (5 + move_2_pp_bonuses) / 5
149 end
150
151 def move_3_pp
152 move_3.pp * (5 + move_3_pp_bonuses) / 5
153 end
154
155 def move_4_pp
156 move_4.pp * (5 + move_4_pp_bonuses) / 5
157 end
158
143 def ribbons 159 def ribbons
144 result = [] 160 result = []
145 161