Difference between revisions of "Talk:Weapons"

From Discworld MUD Wiki
Jump to: navigation, search
(Looks correct to me.)
Line 1: Line 1:
 
The modification of damage formula for enchantments looks inconsistent with the the information in the distribution lib. Can the person who posted the formula cite their source?
 
The modification of damage formula for enchantments looks inconsistent with the the information in the distribution lib. Can the person who posted the formula cite their source?
 
:The source was the mudlib I believe. [[User:Rehevkor|Rehevkor]] <big>[[User talk:Rehevkor|<FONT COLOR="black">✉</FONT>]]</big> 13:24, 9 August 2009 (UTC)
 
:The source was the mudlib I believe. [[User:Rehevkor|Rehevkor]] <big>[[User talk:Rehevkor|<FONT COLOR="black">✉</FONT>]]</big> 13:24, 9 August 2009 (UTC)
 +
 +
:Indeed. 
 +
 +
:std/weapon.c, lines 176-177:
 +
:<pre>  tmp = val + (val * query_enchant()) / (query_max_enchant() + query_enchant());</pre>
 +
:Subtract out the base damage:
 +
:<pre>  extra_dmg = base * query_enchant() / (query_max_enchant() + query_enchant())</pre>
 +
:Divide top and bottom by max_enchant gives:
 +
:<pre>  extra_dmg = base * fraction_enchant / (1 + fraction_enchant)</pre>
 +
:Then multiple top and bottom by 100 to use a percentage:
 +
:<pre>  extra_dmg = base * (%enchant / (100 + %enchant)</pre>
 +
:Which is what is in the article. --[[User:Chat|Chat]] 14:14, 9 August 2009 (UTC)

Revision as of 09:14, 9 August 2009

The modification of damage formula for enchantments looks inconsistent with the the information in the distribution lib. Can the person who posted the formula cite their source?

The source was the mudlib I believe. Rehevkor 13:24, 9 August 2009 (UTC)
Indeed.
std/weapon.c, lines 176-177:
  tmp = val + (val * query_enchant()) / (query_max_enchant() + query_enchant());
Subtract out the base damage:
  extra_dmg = base * query_enchant() / (query_max_enchant() + query_enchant())
Divide top and bottom by max_enchant gives:
  extra_dmg = base * fraction_enchant / (1 + fraction_enchant)
Then multiple top and bottom by 100 to use a percentage:
  extra_dmg = base * (%enchant / (100 + %enchant)
Which is what is in the article. --Chat 14:14, 9 August 2009 (UTC)