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 = []
|
@contributors = []
|
||||||
@contributor_attacks.each do |k, v|
|
@contributor_attacks.each do |k, v|
|
||||||
attacks = @contributor_attacks[k] || 0
|
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_soldiers[k] || 0
|
||||||
lost += @contributor_defenders[k] if @contributor_defenders[k]
|
lost += @contributor_defenders[k] if @contributor_defenders[k]
|
||||||
@contributors << {
|
@contributors << {
|
||||||
username: k,
|
username: k,
|
||||||
attacks: attacks,
|
attacks: attacks,
|
||||||
|
defenses: defenses,
|
||||||
lost: lost
|
lost: lost
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -24,7 +24,8 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Attacker</td>
|
<td>Attacker</td>
|
||||||
<td>Attempts</td>
|
<td>Attacks</td>
|
||||||
|
<td>Defenses</td>
|
||||||
<td>Soldiers Killed</td>
|
<td>Soldiers Killed</td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -33,6 +34,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= contributor[:username] %></td>
|
<td><%= contributor[:username] %></td>
|
||||||
<td class="text-right"><%= contributor[:attacks] %></td>
|
<td class="text-right"><%= contributor[:attacks] %></td>
|
||||||
|
<td class="text-right"><%= contributor[:defenses] %></td>
|
||||||
<td class="text-right"><%= readable_number(contributor[:lost]) %></td>
|
<td class="text-right"><%= readable_number(contributor[:lost]) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in a new issue