                 Magical Cancellation vs. Magic Resistance
                ===========================================

                    by Peter Snelling (snelling@bnr.ca),
                   Boudewijn Wayers (dedos4@win.tue.nl),
		 and Michal Pawlak (pawlak@zeubac.desy.de).


Magic resistance - which can be obtained by wearing gray dragon scale
mail or a cloak of magic resistance, by wielding Magicbane, or by
carrying the Orb of Detection, the Sceptre of Might, the Magic Mirror
of Merlin, the Platinum Yendorian Express Card, or the Eye of the
Aethiopica - provides complete protection from some magical things such
as polymorph traps, teleport traps, or level teleport traps, and touch
of death attacks.

However, gray (or any other colour) dragon scale mail doesn't provide
"magical cancellation", which is something different.

All cloaks, and some pieces of body armour, in addition to the Armour
Class (AC), also provide magical cancellation. The magical cancellation
is a number between 0 and 3, and is not affected by either enchantment
or blesses and curses. It is also not additive - wearing both body
armour and a cloak gives you the higher of the two cancellation
factors, not their sum.  A list of all armour with a non-zero
cancellation factor is given below.

	Armour                    Weight   AC   MC
	~~~~~~~~~~~~~~~~~~~~~~~   ~~~~~~   ~~   ~~
	chain mail                   300    5    1
	crystal plate mail           450    7    2
	dwarvish mithril coat        150    6    3
	elven mithril coat           150    5    3
	orcish chain mail            300    5    1
	orcish ring mail             250    2    1
	plate mail / tanko           450    7    2
	splint mail                  400    6    1
	studded leather armor        200    3    1

	cloak of displacement         10    1    2
	cloak of invisibility         10    1    2
	cloak of magic resist         10    1    3
	cloak of protection           10    3    3
	dwarvish cloak                10    0    2
	elven cloak                   10    1    3
	mummy wrapping                 3    0    1
	oilskin cloak                 10    1    3
	orcish cloak                  10    0    2

Cancellation affects the chance of success of the following special
attacks: fire, cold, electricity, sleep, poison, paralysis, level
drain, "sticking to" ("You cannot escape from the mimic!" - but not
grab-attacks by, for example, owlbears or krakens), lycanthropy,
teleport, intrinsic speed stealing (shades and skeletons) and energy
drain. Note that it does NOT affect the success probability of ray
attacks, nor does it help against "defensive attacks" (like a floating
eye's paralysis).

The chances of any one of the above special attacks succeeding are
calculated in the following way:

- the attack must first hit, i.e. pass your AC. If it did, then you
  take the associated physical damage (if any);
- some of the attacks succeed only sometimes - the probability is:
    1/3 - drain level and paralysis
    1/4 - lycanthropy, steal speed and drain energy
    1/5 - sleep
    1/8 - poison
- the attack must then pass the cancellation test. The probability
  of this depends on your cancellation factor:
    Cancellation = 0: 150/150 (100%)
    Cancellation = 1: 101/150 (~67%)
    Cancellation = 2:  52/150 (~35%)
    Cancellation = 3:   3/150   (2%)

If all the above tests have been passed, then you suffer the effect of
the special attack. For example: if you are wearing a gray dragon scale
mail, and are attacked by a vampire, then 1/3 of his successful bites
will end in you losing a level. If you however wear a lowly orcish
cloak over your armour (MC=2), the probability will immediately drop to
about 1/9 (1/3 * 52/150) and an oilskin cloak will reduce the
probability to below 1%.

Incidentally, if you wondered about the similarity between the name of
this property ("magic cancellation") and the name of a certain wand and
spell - it is no accident. Zapping the attacker with the wand of
cancellation (or equivalent spell) effectively makes the last test
always fail - you never suffer from special attacks from this
creature.

Note also that the magical cancellation is different from intrinsic
resistance for fire/cold/electricity attacks. If you are e.g. hit by a
fire attack while fire resistant you get no physical damage, but
there's still a chance of losing your scrolls/spellbooks/potions. If
you are protected from a fire attack by cancellation, the attacks fails
and your equipment is safe.

WARNING: There is a bug in version 3.1.3 (confirmed with the Dev Team -
  probably it affects all the 3.1 releases) - the logic of the magical
  cancellation check is reversed for drain energy and steal speed
  attacks.  Thus a player with magical cancellation 0 happens to be
  completely immune to the intrinsic speed stealing by
  shades/skeletons, whereas high cancellation (or zapping the creatures
  with WoC) makes you more susceptible to it...

