Magic Device failure rates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Inquisitivephysicsguy
    Scout
    • Feb 2008
    • 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.
  • PowerDiver
    Prophet
    • Mar 2008
    • 2820

    #2
    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]

    Comment

    • takkaria
      Veteran
      • Apr 2007
      • 1951

      #3
      Originally posted by PowerDiver
      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 whispers something about options. -more-

      Comment

      • PowerDiver
        Prophet
        • Mar 2008
        • 2820

        #4
        Originally posted by takkaria
        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.

        Comment

        • Inquisitivephysicsguy
          Scout
          • Feb 2008
          • 36

          #5
          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

          • andrewdoull
            Unangband maintainer
            • Apr 2007
            • 872

            #6
            Originally posted by Inquisitivephysicsguy
            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

            Comment

            • Inquisitivephysicsguy
              Scout
              • Feb 2008
              • 36

              #7
              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

              • Pete Mack
                Prophet
                • Apr 2007
                • 6883

                #8
                Originally posted by Inquisitivephysicsguy
                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...

                Comment

                • Inquisitivephysicsguy
                  Scout
                  • Feb 2008
                  • 36

                  #9
                  No, I really am naive when it comes to computer programming.

                  Comment

                  • takkaria
                    Veteran
                    • Apr 2007
                    • 1951

                    #10
                    Originally posted by Inquisitivephysicsguy
                    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 whispers something about options. -more-

                    Comment

                    • andrewdoull
                      Unangband maintainer
                      • Apr 2007
                      • 872

                      #11
                      Originally posted by Pete Mack
                      I have a sneaking suspicion that Andrews post was meant in irony.
                      Hi,

                      I'm new to this thread and just wondering irony is. Is it used frequently?

                      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

                      Comment

                      • Nick
                        Vanilla maintainer
                        • Apr 2007
                        • 9647

                        #12
                        Originally posted by andrewdoull
                        I'm new to this thread and just wondering irony is. Is it used frequently?
                        Well, there's this song by Alanis Morissette...
                        One for the Dark Lord on his dark throne
                        In the Land of Mordor where the Shadows lie.

                        Comment

                        • Pete Mack
                          Prophet
                          • Apr 2007
                          • 6883

                          #13
                          It's not just a lake in Ireland--or a city in Tennessee either.

                          Comment

                          Working...
                          😀
                          😂
                          🥰
                          😘
                          🤢
                          😎
                          😞
                          😡
                          👍
                          👎