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="table table-bordered table-condensed">
21 <th>Actual Damage</th>
22 <th>Potential Damage</th>
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><span class="sprite sprite-${weapon_stat[1]}"></span></td>
40 <td>${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>