Seperate attacks and defenses
This commit is contained in:
parent
69bd64abf8
commit
f89437b14c
2 changed files with 5 additions and 2 deletions
3
app.rb
3
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
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<td>Attacker</td>
|
||||
<td>Attempts</td>
|
||||
<td>Attacks</td>
|
||||
<td>Defenses</td>
|
||||
<td>Soldiers Killed</td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -33,6 +34,7 @@
|
|||
<tr>
|
||||
<td><%= contributor[:username] %></td>
|
||||
<td class="text-right"><%= contributor[:attacks] %></td>
|
||||
<td class="text-right"><%= contributor[:defenses] %></td>
|
||||
<td class="text-right"><%= readable_number(contributor[:lost]) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in a new issue