diff options
-rw-r--r-- | app/controllers/game_controller.rb | 4 | ||||
-rw-r--r-- | app/views/activities/_results.html.erb | 2 | ||||
-rw-r--r-- | data/activities.yml | 36 |
3 files changed, 40 insertions, 2 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] diff --git a/app/views/activities/_results.html.erb b/app/views/activities/_results.html.erb index 49de2d5..b7728fb 100644 --- a/app/views/activities/_results.html.erb +++ b/app/views/activities/_results.html.erb @@ -4,7 +4,7 @@ <% when "item" %> <p>You got <%= result[:quantity] %> <%= result[:item].name %> <% if result[:xp]&.any? %> - (<%= result[:xp].map { |award| "#{award[:amount]} xp #{award[:skill].name}" }.join(", ") %>) + (<%= result[:xp].map { |award| "#{award[:amount] * result[:quantity]} xp #{award[:skill].name}" }.join(", ") %>) <% end %> </p> <% when "hearth_amenity" %> diff --git a/data/activities.yml b/data/activities.yml index e7f657e..338da3c 100644 --- a/data/activities.yml +++ b/data/activities.yml @@ -374,3 +374,39 @@ reap_twil_woods: xp: - gid: "wealdreap" value: 50 +manatrawl_sor_well: + name: "Trawl Sor Well" + description: "Manatrawl within Sor Well." + location: "floret_region" + innate: true + whatnot: + duration: + base: 60 + minimum: 35 + scaling: + - type: "skill" + gid: "manatrawl" + scale_value: 2 + results: + - type: "item" + chance: 1 + table: + - gid: "arcane_dust" + score: 0 + max_quantity: 2 + xp: + - gid: "manatrawl" + value: 3 + - type: "item" + chance: 1 + table: + - gid: "shimmering_essence" + score: 0.934 + xp: + - gid: "manatrawl" + value: 30 + - gid: "wisp_of_the_current" + score: 0.996 + xp: + - gid: "manatrawl" + value: 50 |