Vestibule Violator
Posts: 1533
Joined: Thursday, 16th December 2010, 20:52
Patch project: make weapon screen info like spell screen
- the main function / class / procedure / widget for melee damage is player_calc_hit_damage (3830)
- it starts with potential_weapon_damage, which is the base damage of the weapon, modified for hands required and body size (3834) and for shield penalty if applicable (3843)
- then base damage is modified for player stats (3846)
- then base damage is modified for slaying bonuses (3851)
- So by this point, you have something like 14 or whatever as your potential damage. Up to this point everything is calculated and now it's time to start rolling dice
- Now, the first roll is for potential damage, and then extra damage gets rolled for each of weapon skill, fighting skill, misc. modifiers (for might & starvation), and weapon bonuses (enchantment level & racial). (3852-3857)
- Stabbing damage if any is added
- Damage is reduced by monster AC
- Now there's a check to see if the monster is dead.
- If not, weapon brand is applied (3173 is the function but different brands get handled differently from here on and I have to go to bed... also as noted above weapon brands should not be factored in to the damage estimate, but just listed separately)
I think I could code a function that would generate some measure of damage potential from the above .... Speed is probably easy compared to this, and probably To_hit is easier too. I can crunch these formulas. Then I'll have to figure out the interface issues. I think I can do this!
Okay, I think I'm starting to make sense of this. If I need pointers, where's the most appropriate place to ask these kinds of questions?