![]() |
#1 |
Scout
Join Date: Feb 2008
Posts: 36
![]() |
Magic Device failure rates
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.
|
![]() |
![]() |
![]() |
#2 |
Prophet
Join Date: Mar 2008
Posts: 2,712
![]() |
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] |
![]() |
![]() |
![]() |
#3 | |
Veteran
Join Date: Apr 2007
Posts: 1,950
Donated: $40
![]() |
Quote:
|
|
![]() |
![]() |
![]() |
#4 | |
Prophet
Join Date: Mar 2008
Posts: 2,712
![]() |
Quote:
![]() Now that I think about it, I don't even know what I think is the difference between percent and percentage. |
|
![]() |
![]() |
![]() |
#5 |
Scout
Join Date: Feb 2008
Posts: 36
![]() |
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. |
![]() |
![]() |
![]() |
#6 | |
Unangband maintainer
Join Date: Apr 2007
Location: Sydney, Australia
Age: 48
Posts: 872
![]() |
Quote:
Andrew
__________________
The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more- In UnAngband, the level dives you. ASCII Dreams: http://roguelikedeveloper.blogspot.com Unangband: http://unangband.blogspot.com |
|
![]() |
![]() |
![]() |
#7 |
Scout
Join Date: Feb 2008
Posts: 36
![]() |
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) |
![]() |
![]() |
![]() |
#8 |
Prophet
Join Date: Apr 2007
Location: Seattle, WA
Posts: 6,705
Donated: $40
![]() |
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...
|
![]() |
![]() |
![]() |
#9 |
Scout
Join Date: Feb 2008
Posts: 36
![]() |
No, I really am naive when it comes to computer programming.
|
![]() |
![]() |
![]() |
#10 |
Veteran
Join Date: Apr 2007
Posts: 1,950
Donated: $40
![]() |
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.
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Magic system thoughts | Mangojuice | Variants | 16 | November 13, 2008 03:51 |
Hengband Trump Magic | xxitheworld | Variants | 1 | February 2, 2008 01:19 |
Compile failure for 3.0.9 on Mac OS X 10.4.10 | TreeFrog | Vanilla | 4 | November 8, 2007 15:58 |
Rod/wand/staff failure rates? | Geofferic | Vanilla | 2 | October 22, 2007 07:38 |
Sangband magic | K.I.L.E.R | Variants | 1 | June 10, 2007 12:37 |