From: Bil Simser (bsimser@home.com)
Date: 07/01/01

Hi guys,

Just an idea I thought I'd toss out. I was getting a little frustrated
with the classes in Circle as I look through various code bases. Why?
Because every mud goes off and designs it's own classes but then you end
up with CLASS_ all over the place, and none of them ever match up with
your own classes. So I thought I'd toss out and idea of class groups
(this comes from AD&D so bear with me).

You have 4 groups:
/* Each class must fall into a certain group */

#define NUM_GROUPS    4

Then you define your classes (these are AD&D but you could put whatever
you want in here):

/* Specific classes grouped */

/* warrior group */
#define CLASS_FIGHTER  1
#define CLASS_RANGER  2
#define CLASS_PALADIN  3

/* wizard group */
#define CLASS_MAGE   4

/* priest group */
#define CLASS_CLERIC  6
#define CLASS_DRUID   7

/* rogue group */
#define CLASS_THIEF   8
#define CLASS_BARD   9

#define NUM_CLASSES   9

Then, when you let the player pick his class (however you do it, I won't
get into details here but I think using a structure is better than going
through a giant case statement) you just assign them a class group
value. Then any time you're performing any kind of class type stuff on
the character (like checking to see if he's a fighter) you can check one
of the four groups he's in instead. It would make case statements of
dozens of classes simpler (only 4 to deal with) but of course it does
have it's downfalls. It means gains and such are generic across your
classes, but you could make exceptions for the specific classes. You
could use it to restrict magic to the wizard group, cleric based spells
to the priest group, etc. Further enhancements could be made so you have
spheres of spells (which I saw somewhere on the ftp site).

In any case, just an idea I thought I'd toss out and see if anyone any
thoughts on it. Use it for what it's worth. Your milage may vary.


   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |

This archive was generated by hypermail 2b30 : 12/06/01 PST