diff options
Diffstat (limited to 'app/controllers/games')
-rw-r--r-- | app/controllers/games/ptu/encounters_controller.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/games/ptu/encounters_controller.rb b/app/controllers/games/ptu/encounters_controller.rb new file mode 100644 index 0000000..a7da852 --- /dev/null +++ b/app/controllers/games/ptu/encounters_controller.rb @@ -0,0 +1,13 @@ +class Games::Ptu::EncountersController < ApplicationController + def index + @pokemons = PtuPokemon.all + if params[:commit] + @results = [] + pokemon = PtuPokemon.find(params[:pokemon]) + params[:count].to_i.times do + level = rand(params[:min_level].to_i..params[:max_level].to_i) + @results.push(pokemon.random_stat_hash(level: level)) + end + end + end +end |