From 26f80f3442ca14aac9a75130bc2c4dddc076a145 Mon Sep 17 00:00:00 2001 From: David Gay Date: Fri, 28 May 2021 12:17:09 -0400 Subject: Add `retributor` title, awarded for killing a lesser trodgeathomp --- app/controllers/game_controller.rb | 5 +++++ app/views/application/components/text/_title.html.erb | 2 ++ 2 files changed, 7 insertions(+) (limited to 'app') 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 @@ Steward <% when "beryly" %> Beryly + <% when "retributor" %> + Retributor <% else %> <%= title.name %> <% end %> -- cgit v1.2.3