diff options
author | David Gay <david@davidgay.org> | 2021-04-07 22:20:14 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-04-07 22:20:14 -0400 |
commit | b1d335e65bfcd813c3565257f8c18f22cdac08dc (patch) | |
tree | 90746516cc5fda892345a38a60d66c8b4da19fe2 /app/views/games/ptu/encounters/index.html.erb | |
parent | 5fc450ebd4249efc15e41b1b152a214697f5f415 (diff) |
Hacked together Pokemon generator
Diffstat (limited to 'app/views/games/ptu/encounters/index.html.erb')
-rw-r--r-- | app/views/games/ptu/encounters/index.html.erb | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/app/views/games/ptu/encounters/index.html.erb b/app/views/games/ptu/encounters/index.html.erb new file mode 100644 index 0000000..4712a3c --- /dev/null +++ b/app/views/games/ptu/encounters/index.html.erb @@ -0,0 +1,55 @@ +<h1>Encounters</h1> + +<p>Use this page to generate random Pokemon for an encounter.</p> + +<%= form_with url: games_ptu_encounters_path, method: :get do |f| %> + <%= f.label :pokemon, "Pokemon" %> + <%= f.select :pokemon, @pokemons.map { |p| [p.name, p.id] } %> + + <%= f.label :count, "Count" %> + <%= f.number_field :count, required: true, min: 1, max: 100 %> + + <%= f.label :min_level, "Min Level" %> + <%= f.number_field :min_level, required: true, min: 1, max: 100 %> + + <%= f.label :max_level, "Max Level" %> + <%= f.number_field :max_level, required: true, min: 1, max: 100 %> + + <%= f.submit "Generate" %> +<% end %> + +<% if @results %> + <h2>Results</h2> + <table class="table-auto"> + <thead> + <tr> + <th>Pokemon</th> + <th>Level</th> + <th>Gender</th> + <th>Nature</th> + <th>HP</th> + <th>ATK</th> + <th>DEF</th> + <th>SPATK</th> + <th>SPDEF</th> + <th>SPEED</th> + </tr> + </thead> + <tbody> + <% @results.each do |result| %> + <tr> + <td><%= result[:name] %></td> + <td><%= result[:level] %></td> + <td><%= result[:gender] %></td> + <td><%= result[:nature] %></td> + <td><%= result[:stats][:hp] %></td> + <td><%= result[:stats][:atk] %></td> + <td><%= result[:stats][:def] %></td> + <td><%= result[:stats][:spatk] %></td> + <td><%= result[:stats][:spdef] %></td> + <td><%= result[:stats][:speed] %></td> + </tr> + <% end %> + </tbody> + </table> +<% end %> |