summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-05-28 12:17:09 -0400
committerDavid Gay <david@davidgay.org>2021-05-28 12:20:12 -0400
commit26f80f3442ca14aac9a75130bc2c4dddc076a145 (patch)
tree7876e6383d95ad03b350ac5bc9085d38b3b719b9
parent512d014943b4990422de07421a29be00374157c9 (diff)
Add `retributor` title, awarded for killing a lesser trodgeathomp
-rw-r--r--app/controllers/game_controller.rb5
-rw-r--r--app/views/application/components/text/_title.html.erb2
-rw-r--r--data/monsters.yml2
-rw-r--r--data/titles.yml2
4 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/game_controller.rb b/app/controllers/game_controller.rb
index bf45973..3742824 100644
--- a/app/controllers/game_controller.rb
+++ b/app/controllers/game_controller.rb
@@ -199,6 +199,11 @@ class GameController < ApplicationController
@results.push({ type: "message", body: "You slew the #{mon.name}." })
mon.whatnot[:awards]&.each do |award_data|
case award_data[:type]
+ when "title"
+ title = Title.find_by_gid(award_data[:gid])
+ if current_char.award_title(title)
+ @results.push({ type: "title", title: title })
+ end
when "xp"
skill = Skill.find_by_gid(award_data[:skill])
amount = award_data[:base]
diff --git a/app/views/application/components/text/_title.html.erb b/app/views/application/components/text/_title.html.erb
index edcf220..ea00777 100644
--- a/app/views/application/components/text/_title.html.erb
+++ b/app/views/application/components/text/_title.html.erb
@@ -4,6 +4,8 @@
<span class="text-gray-200">Steward</span>
<% when "beryly" %>
<span class="text-yellow-400">Beryly</span>
+ <% when "retributor" %>
+ <span class="text-gray-500">Retribut</span><span class="text-yellow-200">o</span><span class="text-gray-500">r</span>
<% else %>
<%= title.name %>
<% end %>
diff --git a/data/monsters.yml b/data/monsters.yml
index a09bdd7..393bb93 100644
--- a/data/monsters.yml
+++ b/data/monsters.yml
@@ -130,6 +130,8 @@ lesser_trodgeathomp:
- type: "xp"
skill: "beastslay"
base: 24
+ - type: "title"
+ gid: "retributor"
- type: "item"
chance: 1
table:
diff --git a/data/titles.yml b/data/titles.yml
index 8b608be..30cb41e 100644
--- a/data/titles.yml
+++ b/data/titles.yml
@@ -2,3 +2,5 @@ steward:
name: "Steward"
beryly:
name: "Beryly"
+retributor:
+ name: "Retributor"