blob: d66b7586fe993800b51f7144a1faa7c6997563aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
class Activity < ApplicationRecord
include HasWhatnot, HasCostsAndRequirements
belongs_to :location, optional: true
validates :gid, :name, :description, presence: true
attribute :innate, :boolean, default: true
def can_result_in_combat?
self.whatnot[:results].select { |r| %w[monster monster_spawn].include?(r[:type]) }.any?
end
end
|