summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-05-25 20:44:53 -0400
committerDavid Gay <david@davidgay.org>2021-05-25 20:48:00 -0400
commit3f079ef8a7d46d5a4864836dbbd9e37b900c0a59 (patch)
tree612089e06320cdbba5bdd5ff99b10826a1ee4519 /app/controllers
parent7c191c15e3a16c5c4c53f6d83c89fe6d1219b6e5 (diff)
Award title for mining a yellow beryl
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/game_controller.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/game_controller.rb b/app/controllers/game_controller.rb
index 4b96b49..8c1acaf 100644
--- a/app/controllers/game_controller.rb
+++ b/app/controllers/game_controller.rb
@@ -57,6 +57,13 @@ class GameController < ApplicationController
if table_roll >= score
give_item_with_xp(table_entry, quantity)
+
+ table_entry[:titles]&.each do |title_data|
+ title = Title.find_by_gid(title_data[:gid])
+ if current_char.award_title(title)
+ @results.push({ type: "title", title: title })
+ end
+ end
break
end
end