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:
parent
8f5a4af68f
commit
20b3ec993c
1 changed files with 6 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue