Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0008390 [DCSS] Source Cleanup minor always 2014-04-18 20:37 2014-05-20 15:37
Reporter Lasty View Status public  
Assigned To wheals
Priority normal Resolution done  
Status resolved   Product Branch 0.15 ancient branch
Summary 0008390: Clean up a weird bit of melee damage code
Description 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.
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0026236)
wheals (administrator)
2014-05-20 15:37

Done, although the lines have moved from melee_attack.cc to attack.cc.

- Issue History
Date Modified Username Field Change
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


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker