summaryrefslogtreecommitdiff
path: root/app/controllers/games/ptu/encounters_controller.rb
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-04-07 22:20:14 -0400
committerDavid Gay <david@davidgay.org>2021-04-07 22:20:14 -0400
commitb1d335e65bfcd813c3565257f8c18f22cdac08dc (patch)
tree90746516cc5fda892345a38a60d66c8b4da19fe2 /app/controllers/games/ptu/encounters_controller.rb
parent5fc450ebd4249efc15e41b1b152a214697f5f415 (diff)
Hacked together Pokemon generator
Diffstat (limited to 'app/controllers/games/ptu/encounters_controller.rb')
-rw-r--r--app/controllers/games/ptu/encounters_controller.rb13
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