1 <%def name="accuracy(weapon_stats)">
4 ## weapon_stats is an array containing what we'll call "weapon_stat"
5 ## objects. These objects have the following attributes:
7 ## [0] = Weapon description
14 <table class="accuracy-table" border="1" cellpadding="3" align="center">
15 <tr class="table-header">
21 <td>Actual Damage</td>
22 <td>Potential Damage</td>
25 % for weapon_stat in weapon_stats:
27 if weapon_stat[3] > 0:
28 damage_pct = round(float(weapon_stat[2])/weapon_stat[3]*100, 2)
31 if weapon_stat[5] > 0:
32 hit_pct = round(float(weapon_stat[4])/weapon_stat[5]*100, 2)
37 ## Note: the name of the image must match up with the weapon_cd
38 ## entry of that weapon, else this won't work
39 <td><img src="${request.static_url("xonstat:static/images/%s.png" % weapon_stat[1])}" /></td>
40 <td style="text-align: left;">${weapon_stat[0]}</td>
41 <td>${weapon_stat[4]}</td>
42 <td>${weapon_stat[5]}</td>
44 <td>${weapon_stat[2]}</td>
45 <td>${weapon_stat[3]}</td>
46 <td>${damage_pct}%</td>