Re: [CODE] text based alignment

From: Mythran (kip_potter@hotmail.com)
Date: 06/27/02


>
> I actually solved the problem yesterday.. so there is no need to reply
> anymore to this mail, thanx for the assistance :)
> i solved it like this..
>
> i added char align[MAX_INPUT_LENGTH]; at the top of the line, in case i
want
> to add it to other functions.
>
> if ((GET_ALIGNMENT(ch) >= 750) && !IS_NPC(ch))
>         strcpy(align,"Saintly");
>   else if (GET_ALIGNMENT(ch) < 750 && GET_ALIGNMENT(ch) > 500 &&
> !IS_NPC(ch))
>         strcpy(align,"Beatific");
>   else if (GET_ALIGNMENT(ch) < 500 && GET_ALIGNMENT(ch) > 250 &&
> !IS_NPC(ch))
>         strcpy(align,"Good");
>   else if (GET_ALIGNMENT(ch) < 250 && GET_ALIGNMENT(ch) > -250 &&
> !IS_NPC(ch))
>         strcpy(align,"Neutral");
>   else if (GET_ALIGNMENT(ch) < -250 && GET_ALIGNMENT(ch) > -500 &&
> !IS_NPC(ch))
>         strcpy(align,"Evil");
>   else if (GET_ALIGNMENT(ch) < -500 && GET_ALIGNMENT(ch) > -750 &&
> !IS_NPC(ch))
>         strcpy(align,"Diabolic");
>   else if (GET_ALIGNMENT(ch) < -750 && !IS_NPC(ch))
>         strcpy(align,"Demonic");
>
> It works like a charm.
> i had to change the range of IS_GOOD and IS_EVIL so that it would fit me..
>
> //Peter
>

If that is the exact code, try setting someones alignment to -749.  It will
return Beatific.  Notice, the order, if GET_ALIGNMENT < 750 then
strcpy(align, "Beautific");

Notice the problem?

Mythran

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT