Formulas for holy wrath vs orc / dragon slaying.


If you are interested in helping with tiles, vaults, patches or documentation, this is the place for that.

User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Saturday, 5th February 2011, 00:59

Formulas for holy wrath vs orc / dragon slaying.

In creating my spreadsheet, I noticed that the damage formulas for orc and dragon slaying are identical. Holy wrath has a _nearly_ identical formula which leads to virtually the same result, but not quite. Is this intentional or an oversight? Can I submit a patch to make holy wrath use the same formula?

Orc and Dragon slaying are:
  Code:
special_damage = 1 + random2(3*damage_done/2);


Holy Wrath:
  Code:
special_damage = 1 + (random2(damage_done * 15) / 10);


If damage_done=10:

Orc / Dragon avg= 1 + random2(15)
Holy avg = 1+ random2(150)/10

The two have different results because random2 generates a number from 0 to (value - 1)
Holy is slightly better because it can randomize up to 149, which is essentially 150, while orc/dragon can only randomize up to 14.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Monday, 7th February 2011, 10:20

Re: Formulas for holy wrath vs orc / dragon slaying.

I think they are identical. When dividing numbers, if the result is an integer, it's always rounded down. So 149 / 10 = 14. Unifying them into a single function is indeed a good idea.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Monday, 7th February 2011, 21:17

Re: Formulas for holy wrath vs orc / dragon slaying.

Is that what it means if a function is initiated as e.g. "int functionname (arguments)"?

If true, I probably have to re-evaluate a lot of the calculations in my spreadsheet...
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Monday, 7th February 2011, 23:05

Re: Formulas for holy wrath vs orc / dragon slaying.

Yes, it means the function returns an integer. That's why some functions use the scale parameter set to 100, to fix rounding errors. You can use INT() in excel to convert a result to integer for better accuracy.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Tuesday, 8th February 2011, 00:54

Re: Formulas for holy wrath vs orc / dragon slaying.

Hmm. I think keeping decimals may still be good for estimating averages. E.g there may be a bonus that will only return 0, 1, 2 or 3, but for estimating average, you are best off with 1.5, and not chopping it to 1.

Return to Contributions

Who is online

Users browsing this forum: No registered users and 6 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.