User:Ion frigate/difficulty

From NetHackWiki
Jump to navigation Jump to search

From source code found here, I infer that, in SLASH'EM, difficulty is computed as follows: We have an integer, n

Generation in groups

  • +1 for small groups
  • +2 for large groups
  • +4 for very large groups

Ranged attacks

  • +1 for any gaze, spit, breath, weapon or magic attack (all can be ranged)

Armor class

  • +1 for base AC < 4
  • +1 for base AC < 0 (these two combine)

Speed

  • +1 if speed >= 18

Attacks

For each attack:

  • +1 if it is not passive
  • +1 if it is a magic (AT_MAGC) attack
  • +1 if it is a weapon (AT_WEAP) attack, and monster has the M2_STRONG flag
  • +2 if it is poisonous (AD_DRST, AD_DRDX, AD_DRCO), drain life (AD_DRLI), stoning (AD_STON) or lycanthropy (AD_WERE)
  • +1 if it is not one of the immediate above, and is also not pure physical damage (AD_PHYS)
  • +1 if it can do 24 or more "damage" (specifically, if it is ndm, if nm > 23); does not have to be physical damage

Nastiness

  • +5 if it has the M2_NASTY flag (note that this does not seem to be true for vanilla NetHack, from checking monsters both with and without it, this formula matches for those without, but is off by the correct amount for those with that flag to mean that it is not factored into its calculations)

Difficulty

Then, we have tmp; if mlevel <= 49, tmp = mlevel; otherwise tmp = .5 * (mlevel - 6) Now, what is difficulty?

  • If n = 0, difficulty is tmp - 1
  • If 0 < n < 6, difficulty is tmp + 1 + n/3
  • If n >= 6, difficulty is tmp + n/2

Rounding down for integer division