<% title('NPCs') %> <%= javascript_tag "window._token = '#{form_authenticity_token}'" %>
<%= form_tag(npcs_path, method: :get, enforce_utf8: false, class: 'form form-inline search-form d-flex flex-wrap', id: 'npc-search') do %> <%= select_tag :location, options_for_select(Location.order(:id).map(&:region).uniq, @location), include_blank: 'All Locations', class: 'form-control form-control-sm mt-0' %> <%= select_tag :rule, npc_rule_options(@rule), include_blank: 'All Rules', class: 'form-control form-control-sm' %> <% if user_signed_in? %> <%= link_to 'Update Defeated', update_defeated_npcs_path, method: :post, class: 'btn btn-sm btn-secondary mt-2 mt-sm-0', data: { confirm: 'All NPCs with exclusive cards you have obtained will be marked as defeated.' } %> <% end %> <% end %>
<% if user_signed_in? %>
<% end %>
<% if user_signed_in? %>
<%= render 'layouts/progress', value: @count, min: 0, max: @valid_npcs.size %>
<% end %> <% if user_signed_in? %> <% end %> <% @npcs.each do |npc| %> <% if user_signed_in? %> <% end %> <% end %>
Name Location Rules Difficulty Quest Rewards Patch
<%= link_to(format_npc_name(npc), npc_path(npc), class: 'name') %> <%= location(npc) %> <%= format_rules(npc) %> <%= difficulty(npc) %> <%= quest(npc) %>
<% npc.rewards.each do |card| %> <% if user_signed_in? %>
<%= small_image(card) %>
<% else %> <%= link_to card_path(card) do %>
<%= small_image(card) %>
<% end %> <% end %> <% end %>
<%= npc.patch %> <% if @defeated.include?(npc.id) %> <% else %> <% end %>