diff --git a/app.rb b/app.rb index 649d279..a46fd2d 100644 --- a/app.rb +++ b/app.rb @@ -51,12 +51,13 @@ get '/bossfight' do @contributors = [] @contributor_attacks.each do |k, v| attacks = @contributor_attacks[k] || 0 - attacks += @contributor_defenses[k] if @contributor_defenses[k] + defenses = @contributor_defenses[k] || 0 lost = @contributor_soldiers[k] || 0 lost += @contributor_defenders[k] if @contributor_defenders[k] @contributors << { username: k, attacks: attacks, + defenses: defenses, lost: lost } end diff --git a/views/bossfight.erb b/views/bossfight.erb index 00cb408..667daed 100644 --- a/views/bossfight.erb +++ b/views/bossfight.erb @@ -24,7 +24,8 @@ Attacker - Attempts + Attacks + Defenses Soldiers Killed @@ -33,6 +34,7 @@ <%= contributor[:username] %> <%= contributor[:attacks] %> + <%= contributor[:defenses] %> <%= readable_number(contributor[:lost]) %> <% end %>