I've spent some time looking through spoilers, and I haven't found anything that explicitly defines the Magic Device failure rates. I've found a bunch of indices that are probably used in the Magic Device failure rate calculation. Actually, if you could refer me to the right documentation, that would be wonderful.
Magic Device failure rates
Collapse
X
-
Tags: None
-
I extracted the code into a routine in my patch. Here it is. The "permillage"
refers to the fact I multiply the success ratio by 1000 before returning it.
skills[SKILL_DEV] increases with character level and int, and class makes a huge difference.
[CODE]
int object_success_permillage(const object_type *o_ptr, bool impaired)
{
int successes, total;
int lev = k_info[o_ptr->k_idx].level;
/* Hack -- use artifact level instead */
if (artifact_p(o_ptr)) lev = a_info[o_ptr->name1].level;
int chance = p_ptr->skills[SKILL_DEV];
/* Confusion hurts skill */
if (impaired)
chance = chance / 2;
/* Reduce by object level, but only up to 50 */
chance = chance - ((lev > 50) ? 50 : lev);
if (chance < USE_DEVICE)
{
successes = USE_DEVICE - 1;
total = USE_DEVICE * (USE_DEVICE + 1 - chance);
}
else
{
successes = chance - 1;
total = chance;
}
return (int) (1000.0 * successes / total);
}
[\CODE] -
takkaria whispers something about options. -more-Comment
-
FWIW, I just looked up "per mille" and it looks like that's the standard term to use in this situation (see http://en.wikipedia.org/wiki/Permille).
Now that I think about it, I don't even know what I think is the difference between percent and percentage.Comment
-
That's really cool!
Thank you very much PowerDiver. I appreciate this.
I've had some experience in programming w/ Matlab. The syntax is different here, it looks like this language is much more flexible when it comes to defining objects.Comment
-
AndrewThe Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
In UnAngband, the level dives you.
ASCII Dreams: http://roguelikedeveloper.blogspot.com
Unangband: http://unangband.blogspot.com
Comment
-
I knew that it was either C or C++, thanks for clarifying.
Where all is "C" used? (Sorry if this is diverging from the original purpose of this thread)Comment
-
I have a sneaking suspicion that Andrews post was meant in irony. C has been an industry standard since the 1970s. It is widely used, and much of it's basic syntax has been borrowed by other languages like java. Try wikipedia. Unless, of course, your post was meant in irony as well...Comment
-
-
Most operating systems are written in, or at least contain substantial parts of, C. Most dynamic languages (Java, Python, JavaScript, etc) are run by a program written in C. It's fairly widely used, though not as widely as C++ for desktop apps thesedays. On Windows it is being superceded by the .NET framework, on OS X a variant called Objective-C is generally used, and on Linux, more programs are being written in other languages like Python and Ruby.takkaria whispers something about options. -more-Comment
-
The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
In UnAngband, the level dives you.
ASCII Dreams: http://roguelikedeveloper.blogspot.com
Unangband: http://unangband.blogspot.com
Comment
-
Comment
Comment