diff options
author | David Gay <david@davidgay.org> | 2021-05-28 15:33:13 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-05-28 15:33:13 -0400 |
commit | c913f1d50c428aedef57faa46e8ab0e9cb24741c (patch) | |
tree | f656eb5aaee281dc7072e0ab01929c46d0d7e6b5 /app/models | |
parent | 1a27db1925501902b4a122b6b76e8e20075adb85 (diff) |
Implement trophies
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/character.rb | 5 |
1 files changed, 5 insertions, 0 deletions
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) |