summaryrefslogtreecommitdiff
path: root/app/controllers/game_controller.rb
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-05-26 18:49:28 -0400
committerDavid Gay <david@davidgay.org>2021-05-26 18:49:28 -0400
commit0b9b45d573cc4f836ba7a99de77e9da18e768f10 (patch)
tree5101a31e8f0e18d81ef46dc1dbd72991d96fd512 /app/controllers/game_controller.rb
parent2cf7eeb90ad8e677c6cbd793b76c39bc38e931b0 (diff)
Add a manatrawl activity, and allow for item drop quantity ranges
Diffstat (limited to 'app/controllers/game_controller.rb')
-rw-r--r--app/controllers/game_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/game_controller.rb b/app/controllers/game_controller.rb
index 8c1acaf..32ddd12 100644
--- a/app/controllers/game_controller.rb
+++ b/app/controllers/game_controller.rb
@@ -44,7 +44,9 @@ class GameController < ApplicationController
table_roll = rand
result[:table].sort_by { |t| -t[:score] }.each do |table_entry|
- quantity = table_entry[:quantity] || 1
+ min_quantity = table_entry[:min_quantity] || table_entry[:quantity] || 1
+ max_quantity = table_entry[:max_quantity] || table_entry[:quantity] || 1
+ quantity = rand(min_quantity..max_quantity)
score = table_entry[:score]
table_scaling = result[:table_scaling]