From c913f1d50c428aedef57faa46e8ab0e9cb24741c Mon Sep 17 00:00:00 2001 From: David Gay Date: Fri, 28 May 2021 15:33:13 -0400 Subject: Implement trophies --- app/models/character.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/models') diff --git a/app/models/character.rb b/app/models/character.rb index fda6868..f0705f9 100644 --- a/app/models/character.rb +++ b/app/models/character.rb @@ -82,6 +82,11 @@ class Character < ApplicationRecord item.equip_slots.reject { |slot| full_slots.include?(slot) } end + def trophy_monster_gid + equipment = self.equipment.joins(:item).where("items.gid like ?", "%_trophy").first + equipment.item.gid.split("_trophy").first + end + def equip(item) Character.transaction do open_slots = self.open_slots_for(item) -- cgit v1.2.3