Re: [CODE] Scan snippet

From: Mark Gerritsen (m.p.h.gerritsen@STUDENT.UTWENTE.NL)
Date: 04/28/98


At 06:33 PM 4/27/98 -0400, George wrote:
>>  maxdis = (1 + ((GET_SKILL(ch, SKILL_SCAN) * 5) / 100));
>>  if (GET_LEVEL(ch) >= LVL_IMMORT)
>>    maxdis = 7;
>
>Might as well not calculate it if you're just going to assign it again
>later for immortals.

Mortals use the calculation. On our MUD, everyone can scan into the
adjecent rooms, but only thieves have the scan skill, and, depending on how
well they've practiced it, get from (1 + ((0 * 5) / 100)) = 1 to (1 + ((100
* 5) / 100)) = 6 rooms distance. Imm+ can scan 7 rooms in each direction,
regardless of class.

>
>>  act("$n quickly scans the area.", FALSE, ch, 0, 0, TO_ROOM);
>>  if (GET_LEVEL(ch) < LVL_IMMORT)
>>    GET_MOVE(ch) -= 3;
>>
>>  is_in = ch->in_room;
>>  for (dir = 0; dir < NUM_OF_DIRS; dir++) {
>>    ch->in_room = is_in;
>
>I don't see a real use for the 'is_in' variable in there.
>
If that is_in wasn't there to reset ch->room to the actual room the char is
in after every direction, you'd scan around corners, or even in circles.
For instance, if your skill would grant you a distance of 2, your
"scan-path" would be this:

              [ ]>[ ]>[ ]
               ^       v      Followed by a double overview of the
              [ ]     [ ]     2 rooms above you, since you scan up
               ^       v      first, then down from there.
              [x]<[ ]<[ ]

This is provided you can go in those directions and have the 6 stock exits,
of course. That's what the is_in is there for.

Thanks a lot for your comments, George, they are much appreciated :)

Havoc of Dagmarck (Mark Gerritsen)


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST