Dungeon Crawl Stone Soup Tracker - DCSS
Viewing Issue Advanced Details
8390 Source Cleanup minor always 2014-04-18 20:37 2014-05-20 15:37
Lasty Both  
wheals All  
normal Both  
resolved 0.15 ancient branch  
done  
none    
none 0.15 ancient branch  
0008390: Clean up a weird bit of melee damage code
melee_attack.cc line 5755 and 5756:
damage_done =
            potential_damage > 0 ? one_chance_in(3) + random2(potential_damage) : 0;

This can be replaced with:

damage_done = random2(potential_damage+1);

This would represent a minor balance change in that the extra point of damage would go from a 1 in 3 to 1 in 2 probability. reaver has expressed concerns that the extra 17% chance to get +1 damage would negatively affect the early game by making hitting things with weapons slightly stronger on D1.

I advocate for the change not because of balance but because this is a really ugly line of code, and it took about 3 people (me, reaver, Keanan) to decipher why it was doing what it is doing. My proposed change is significantly cleaner and more straight-forward.
Issue History
2014-04-18 20:37 Lasty New Issue
2014-05-20 15:37 wheals Note Added: 0026236
2014-05-20 15:37 wheals Status new => resolved
2014-05-20 15:37 wheals Fixed in Branch => 0.15 development branch
2014-05-20 15:37 wheals Resolution open => done
2014-05-20 15:37 wheals Assigned To => wheals

Notes
(0026236)
wheals   
2014-05-20 15:37   
Done, although the lines have moved from melee_attack.cc to attack.cc.