Re: [CODE] ***Movement Question***

From: Ray (ruppertr@SNYCORVA.CORTLAND.EDU)
Date: 02/11/97


On Mon, 10 Feb 1997, Leonard Burns IV wrote:

> Lets say you are in a room and your alignment is positive and a char
> with a negative align walks in, instead of it saying 'Bob has arrived
> from the south' I would like it to say 'A -Human- has arrived from the
> south.' And vice versa if an evil person sees a good person come in, or
> exit. Pretty much so opposite aligns see each other as their race and
> note their name.

One way to do this would be to create a macro :

#define IS_OPPOSITE_ALIGN(ch,vict) \
         ((IS_GOOD(ch)&&IS_EVIL(vict))||(IS_EVIL(ch)&&IS_GOOD(vict)))

And then modify the PERS() macro in utils.h (that act uses) to be :

#define PERS(ch, vict) \
        (CAN_SEE(vict, ch) ? (IS_OPPOSITE_ALIGN(vict, ch) ? \
           race_name[GET_RACE(ch)] : GET_NAME(ch)) : "someone")

Where GET_RACE(ch) returns the race of the character, and 
race_name[] is an array something like this with a string for each race:

race_name[] = {
  "Undefined",
  "Human",
  "Orc"
};

You get the idea.  Note that this is probably buggy, as I wrote it 
quickly in the mailer, but it should point you in the right direction at 
least.  I'm not sure if changing PERS is enough, either, but any other 
changes you have to make will look similar to that.

--Ray
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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