Aliens
<% alien_total = 0 %>
<% consecutives = 0 %>
<% @round.logs.each do |log| %>
<% next unless e = Round.alien_event(log.details) %>
<% next if log.details == "kill" and (m = log.frag)[2] != "alien" %>
<% add = log.since*8 - alien_total %>
<% consecutives = add < 0 ? (consecutives + 1) : 0 %>
<% left = 145 - (add < 0 ? 105*consecutives : 0) %>
<% if log.details == "kill" %>
<%= Verification.uncrap(m[1])[0, 7] %>
<%= image_tag 'weapons/' + m[5] + '.gif', :width => 22, :height => 14 %>
<%= Verification.uncrap(m[3])[0, 7] %>
<% else %>
<% if ["onos", "fade", "lerk", "gorge"].include? log.details %>
<%= Verification.uncrap(log.role[1])[0, 7] %> <%= log.role[2] %>s
<% else %>
<%= h e %>
<% end %>
<% end %>
<% add = add + 15 %>
<% alien_total = alien_total + (add > 0 ? add : 0) %>
<% end %>
Marines
<% marine_total = 0 %>
<% consecutives = 0 %>
<% @round.logs.each do |log| %>
<% next unless e = Round.marine_event(log.details) %>
<% next if log.details == "kill" and (m = log.frag)[2] != "marine" %>
<% add = log.since*8 - marine_total %>
<% consecutives = add < 0 ? (consecutives + 1) : 0 %>
<% left = 3 + (add < 0 ? 105*consecutives : 0) %>
<% if log.details == "kill" %>
<%= Verification.uncrap(m[1])[0, 7] %>
<%= image_tag 'weapons/' + m[5] + '.gif', :width => 30, :height => 14 %>
<%= Verification.uncrap(m[3])[0, 7] %>
<% else %>
<%= h e %>
<% end %>
<% add = add + 15 %>
<% marine_total = marine_total + (add > 0 ? add : 0) %>
<% end %>
<% total = marine_total > alien_total ? marine_total : alien_total %>