Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old October 12, 2008, 16:13   #1
Inquisitivephysicsguy
Scout
 
Join Date: Feb 2008
Posts: 36
Inquisitivephysicsguy is on a distinguished road
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.
Inquisitivephysicsguy is offline   Reply With Quote
Old October 12, 2008, 18:49   #2
PowerDiver
Prophet
 
Join Date: Mar 2008
Posts: 2,712
PowerDiver is on a distinguished road
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]
PowerDiver is offline   Reply With Quote
Old October 12, 2008, 23:46   #3
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,947
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by PowerDiver View Post
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.
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).
takkaria is offline   Reply With Quote
Old October 13, 2008, 00:56   #4
PowerDiver
Prophet
 
Join Date: Mar 2008
Posts: 2,712
PowerDiver is on a distinguished road
Quote:
Originally Posted by takkaria View Post
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).
I was thinking percentage, not percent, thus my silly name. However, perhaps I should interpret your point to mean I should have spelled it permilleage.

Now that I think about it, I don't even know what I think is the difference between percent and percentage.
PowerDiver is offline   Reply With Quote
Old October 13, 2008, 03:59   #5
Inquisitivephysicsguy
Scout
 
Join Date: Feb 2008
Posts: 36
Inquisitivephysicsguy is on a distinguished road
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.
Inquisitivephysicsguy is offline   Reply With Quote
Old October 14, 2008, 01:37   #6
andrewdoull
Unangband maintainer
 
andrewdoull's Avatar
 
Join Date: Apr 2007
Location: Sydney, Australia
Age: 46
Posts: 872
andrewdoull is on a distinguished road
Quote:
Originally Posted by Inquisitivephysicsguy View Post
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.
It's called C. Its a little esoteric and not used that much, but you get used to it after a while...

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
andrewdoull is offline   Reply With Quote
Old October 14, 2008, 02:23   #7
Inquisitivephysicsguy
Scout
 
Join Date: Feb 2008
Posts: 36
Inquisitivephysicsguy is on a distinguished road
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)
Inquisitivephysicsguy is offline   Reply With Quote
Old October 14, 2008, 06:48   #8
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 6,191
Donated: $40
Pete Mack is on a distinguished road
Quote:
Originally Posted by Inquisitivephysicsguy View Post
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)
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...
Pete Mack is offline   Reply With Quote
Old October 14, 2008, 16:38   #9
Inquisitivephysicsguy
Scout
 
Join Date: Feb 2008
Posts: 36
Inquisitivephysicsguy is on a distinguished road
No, I really am naive when it comes to computer programming.
Inquisitivephysicsguy is offline   Reply With Quote
Old October 14, 2008, 19:30   #10
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,947
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by Inquisitivephysicsguy View Post
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)
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 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Magic system thoughts Mangojuice Variants 16 November 13, 2008 02:51
Hengband Trump Magic xxitheworld Variants 1 February 2, 2008 00:19
Compile failure for 3.0.9 on Mac OS X 10.4.10 TreeFrog Vanilla 4 November 8, 2007 14:58
Rod/wand/staff failure rates? Geofferic Vanilla 2 October 22, 2007 06:38
Sangband magic K.I.L.E.R Variants 1 June 10, 2007 11:37


All times are GMT +1. The time now is 12:23.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.