From: snelling@bnr.ca (Peter Snelling)
Subject: Re: Poison resistance
Reply-To: snelling@bnr.ca (Peter Snelling)
Organization: Bell-Northern Research Ltd.
Date: Fri, 6 Nov 1992 22:29:44 GMT

In article <18939.2af9a63a@ecs.umass.edu>, daly@ecs.umass.edu (Bryon Daly, ECE dept, UMass, Amherst) writes:
>In article <1992Nov5.195413.24374@bmers95.bnr.ca>, snelling@bnr.ca (Peter Snelling) writes:
>> Here are the chances of getting intrisic poison resistance from all
>> non-poisonous monsters.  The chance is (monster leve)/15 * (chance of
>> not getting another intrisic instead).  Surprisingly, these chances 
>> don't depend on what intrinsics you currently have.
>
>Yeah, the game just goes down the list of intrinsics in the following order:
>(according to the NH spoiler file-I've changed their order in my own source...)
>Intrinsic        Fractional Probability
>---------        ----------------------
>Teleport       - monster level / 10
>Tel. Cont.     - monster level / 15
>Fire Res       - monster level / 15
>Cold Res       - monster level / 15
>Disin Res      - monster level / 15
>Pois Res       - monster level / 15 (killer bee and scorpion are 1/4)
>Shock Res      - monster level / 15
>Sleep Res      - monster level / 15 (undead cannot confer this)
>
>And for each, it checks if the monster offers that intrinsic, then it
>randomly decides whether to give it according to the above probability.
>If not, it goes down the list.  If it does decide to give that intrinsic,
>it then checks to see if you already have it, and gives it to you if you don't.
>Either way, though, it exits the loop without checking for other intrinsics.

This is exactly right.  Keep it in mind below.

>> The following are also not poisonous, and have poison resistance, but
>> for one reason or another, probably aren't worth eating to get poison
>> resistance.

>> 30 Wizard of Yendor (only gives intrisic teleportation, human)
>
>Why do you say that it only gives intrinsic telep?  I don't see anything in 
>the eat.c code to verify this, and I know I've received intrinsic telep.
>control from him, also.  I think you should be able to get any of the
>intrinsics he has to offer (tport, tport control, fire res, poison res)
>I think he is useful to eat especially in the case of teleport control,
>which is a hard intrinsic to get since so few monsters offer it.  If you
>unluckily manage to get down to him without getting tport control from a
>tengu, he's your best bet, since he's 30th level, and will automatically
>guarantee getting the rare intrinsic (and also aggravate monster, if you're 
>human).

Since the Wizard is a level 30 monster, the random number from 1-15
(or 1-10) will always be less than the monster level, so with him
you always get the first intrinsic on the list, and you never get
any of the others. ("exits the loop without checking for other intrinsics").

I suspect that the reason you got teleport control from him is that you
changed the order of the intrinsics.  Now, I'll bet you ALWAYS get 
teleport control from him and never anything else.

Perhaps this code should be rewritten to allow you to get intrinsics
you don't have and skip the rest.  Right now the code looks like this:

If (monster has teleport) and (random[1-10] <= monster level) then
  if (you don't have teleport) then give you teleport intrinsic
else if (monster has tel.cont.) and (random[1-15] <= monster level) then
  if (you don't have tel.cont.) then give you tel.cont. intrinsic
else if ...

[Yes, that is only pseudo-code]

It could be rewritten:
If (monster has teleport) and (random[1-10] <= monster level) and 
   (you don't have teleport) then give you teleport intrinsic
else if (monster has tel.cont.) and (random[1-15] <= monster level) and
   (you don't have tel.cont.) then give you tel.cont. intrinsic
else if ...

That would probably make it a lot easier to get those last few 
intrinsics you don't have.  Maybe it should work this way if you
don't have HARD defined.
-- 
Peter Snelling
Newsgroups: rec.games.hack