Re: Utility Macros

From: waliczek gary jason (gwalicze@coewl.cen.uiuc.edu)
Date: 11/20/95


On Mon, 20 Nov 1995, Master of Magic wrote:

> 
> 	I have (as a big suprise to me) succesfully, at first, look coded 
> in multiclassing by changing GET_CLASS and GET_LEVEL into 4 parts each so
> i can check for level prime.second, third etc and same withlevel. My 
> problem is im not sure how to addin checks to see if soemthing is a thief 
> or what level thief they are since the primeness of the thief class 
> varies from player to player. The only idea i have to check for IS_THIEF 
> would be : 
> 
> #define  IS_THIEF    ((GET_CLASS_PRIME(ch) == CLASS_THIEF) && 
> (GET_LEVEL_PRIME(ch) >= 1)) || (GET_CLASS_SECOND>..etc
> 
> Now first of all im not even sure if this would work and secondly im sure 
> there is an easier way. I also im trying to figure out how to find out if 
> class X is prime secondary etc and how to find a level value for a 
> specific class name and not by its primeness (i.e. GET_LEVEL_THIEF or 
> something). And ideas would be greately appreciated.
> 

   OK, I don't know what you want with prime class and that type of 
thing, but what you might want to do (if you have the number of classes 
on your mud done) is define level as an array:

  int level[NUM_CLASSES]

Through that into your char_data struct in the place of the old level 
(desroying your p-file) ans then write macros for GET_MAGE_LEVEL(), 
GET_THIEF_LEVEL(), etc...  (Or write one that is GET_LEVEL(ch, CLASS_XXX) 
and you might also want a REAL_LEVEL() that returns the characters highest 
level).  I don't know if this would work with your prime and secondary 
class scheme, beacuase I'm not sure how it works, but this way you just use
a class as an array subscript to get the level.

Gary



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