Update weapon.rb

* Update to check key compatibility against an array instead of an int
* Add convenience function to check if the weapon is part of a Draconic Weapon series
This commit is contained in:
Justin Edmund 2023-12-05 10:30:55 -08:00
parent 8f5a4af68f
commit 20b3ec993c

View file

@ -48,11 +48,16 @@ class Weapon < ApplicationRecord
end
def compatible_with_key?(key)
key.series == series
key.series.include?(series)
end
# Returns whether the weapon is included in the Draconic or Dark Opus series
def opus_or_draconic?
[2, 3].include?(series)
end
# Returns whether the weapon belongs to the Draconic Weapon series or the Draconic Weapon Providence series
def draconic_or_providence?
[3, 34].include?(series)
end
end