* Make weapon key series an array Draconic Weapons Providence can have original Draconic Weapon keys, but also have a new key that can only be equipped to them. Thanks, Cygames. * 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 * Update grid_weapon.rb Update conflict detection to: * Detect Draconic Weapons Providence * Add multiple weapons to conflicting weapons instead of just one * (WIP) Update conflict view rendering Conflict blueprints should render multiple conflict weapons instead of just one. Also adds Draconic Weapon Providence series to various places that check series by number * Finish last bugs We tested to ensure that conflict resolution appears for * Opus and Draconic * Draconic and Draconic 2 * Draconic 2 + Opus and Draconic 1
52 lines
1.4 KiB
Ruby
52 lines
1.4 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
module Api
|
|
module V1
|
|
class GridWeaponBlueprint < ApiBlueprint
|
|
view :uncap do
|
|
association :party, blueprint: PartyBlueprint, view: :minimal
|
|
fields :position, :uncap_level
|
|
end
|
|
|
|
view :nested do
|
|
fields :mainhand, :position, :uncap_level, :element
|
|
association :weapon, name: :object, blueprint: WeaponBlueprint
|
|
|
|
association :weapon_keys,
|
|
blueprint: WeaponKeyBlueprint,
|
|
if: lambda { |_field_name, w, _options|
|
|
[2, 3, 17, 24, 34].include?(w.weapon.series)
|
|
}
|
|
|
|
field :ax, if: ->(_field_name, w, _options) { w.weapon.ax } do |w|
|
|
[
|
|
{
|
|
modifier: w.ax_modifier1,
|
|
strength: w.ax_strength1
|
|
},
|
|
{
|
|
modifier: w.ax_modifier2,
|
|
strength: w.ax_strength2
|
|
}
|
|
]
|
|
end
|
|
end
|
|
|
|
field :awakening, if: ->(_field_name, w, _options) { w.awakening_id } do |w|
|
|
{
|
|
type: AwakeningBlueprint.render_as_hash(w.awakening),
|
|
level: w.awakening_level
|
|
}
|
|
end
|
|
|
|
view :full do
|
|
include_view :nested
|
|
association :party, blueprint: PartyBlueprint, view: :minimal
|
|
end
|
|
|
|
view :destroyed do
|
|
fields :mainhand, :position, :created_at, :updated_at
|
|
end
|
|
end
|
|
end
|
|
end
|