# Difference between revisions of "Talk:Weapons"

From Discworld MUD Wiki

Line 4: | Line 4: | ||

:Indeed. | :Indeed. | ||

− | : | + | :obj/weapon.c, lines 176-177: |

:<pre> tmp = val + (val * query_enchant()) / (query_max_enchant() + query_enchant());</pre> | :<pre> tmp = val + (val * query_enchant()) / (query_max_enchant() + query_enchant());</pre> | ||

:Subtract out the base damage: | :Subtract out the base damage: | ||

Line 15: | Line 15: | ||

It's close. And probably close enough for _most_ integer math since the decimal bits get dropped off. But it's not right. Why not just leave it at the real formula so that it's right all the time? | It's close. And probably close enough for _most_ integer math since the decimal bits get dropped off. But it's not right. Why not just leave it at the real formula so that it's right all the time? | ||

+ | |||

+ | :The formula is as presented because: | ||

+ | :*Percentage enchantment is a much more relevant figure to players than absolute enchantment and max enchantment - the enchantment level you see when looking at an object (as a magic user) is directly related to the percentage enchantment. In order to get the absolute current and max enchantment levels, you need to use a thaumometer and the post office balance (and know the relevant conversions from the mudlib). | ||

+ | :*Presenting the data this way also highlights that the damage increment is (to all intents and purposes) independent of the weapon's maximum enchantment level, and thus, of the weapon's weight. See the text that follows the formula in the article. | ||

+ | :*The error introduced by conversion from discrete to continuous calculation here is at most 1hp of damage, and I call that sufficiently small as to be disregarded. | ||

+ | |||

+ | :PS: Please sign and indent your talk edits: | ||

+ | :*You can sign edits by entering '<nowiki>~~~~</nowiki>' at the end of them. | ||

+ | :*You can indent by placing colons in front of your lines - one colon gives one level of indentation, two colons two levels, etc. | ||

+ | :--[[User:Chat|Chat]] 17:36, 11 August 2009 (UTC) |

## Revision as of 13:36, 11 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?

- Indeed.

- obj/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)

It's close. And probably close enough for _most_ integer math since the decimal bits get dropped off. But it's not right. Why not just leave it at the real formula so that it's right all the time?

- The formula is as presented because:
- Percentage enchantment is a much more relevant figure to players than absolute enchantment and max enchantment - the enchantment level you see when looking at an object (as a magic user) is directly related to the percentage enchantment. In order to get the absolute current and max enchantment levels, you need to use a thaumometer and the post office balance (and know the relevant conversions from the mudlib).
- Presenting the data this way also highlights that the damage increment is (to all intents and purposes) independent of the weapon's maximum enchantment level, and thus, of the weapon's weight. See the text that follows the formula in the article.
- The error introduced by conversion from discrete to continuous calculation here is at most 1hp of damage, and I call that sufficiently small as to be disregarded.

- PS: Please sign and indent your talk edits:
- You can sign edits by entering '~~~~' at the end of them.
- You can indent by placing colons in front of your lines - one colon gives one level of indentation, two colons two levels, etc.

- --Chat 17:36, 11 August 2009 (UTC)