Races

lchataig@ensem.u-nancy.fr
Date: 03/16/94


Ok,

Here comes what I've done for races. It's just basic stuff, I'll perhaps 
improve it later, but It's a good starting point:

1- in structs.h, I've added:

#define RACE_HUMAN	0
#define RACE_DWARF	1
#define RACE_ELF	2
#define RACE_HOBBIT	3
#define RACE_TROLL	4

In the char_specials2_data, instead of
   ubyte spare0;
I've put
   ubyte race;

2- in utils.h,

#define GET_RACE(ch)	((ch)->specials2.race)

3- in constants.c,

I've added:

const char	*pc_race_type[] = {
	"Humans",
	"Dwarves",
	"Elves",
	"Hobbits",
	"Trolls",
	"\n"
};

and

const int	race_apply[5][5] = {
	{0,0,0,0,0},
	{0,0,0,-1,+1},
	{0,0,0,+1,-1},
	{-1,0,0,+1,0},
	{+2,-1,-1,0,0}
};

This one is for affecting stats (str int wis dex con)

and

const int 	race_phy_apply[5][2] = {
	{0,0},
	{-70,-50},
	{-20,-40},
	{-100,-100},
	{30,50}
};

affects races height and weight ...

3- in interpreter.c,

Add question about choosing race (see how it's done for classes, and just
do the same ).

You'll surely need to add #define CON_QRACE 18 in structs.h

4- in act.wizard.c,

in roll_abilities, here is what I've done:

   case CLASS_WARRIOR:
      ch->abilities.str = table[0];
      ch->abilities.dex = table[1];
      ch->abilities.con = table[2];
      ch->abilities.wis = table[3];
      ch->abilities.intel = table[4];
      break;
}   

/* Races Modifications (Ludo)	*/

   ch->abilities.str = ch->abilities.str + race_apply[GET_RACE(ch)][0];
   ch->abilities.intel = ch->abilities.intel + race_apply[GET_RACE(ch)][1];
   ch->abilities.wis = ch->abilities.wis + race_apply[GET_RACE(ch)][2];
   ch->abilities.dex = ch->abilities.dex + race_apply[GET_RACE(ch)][3];
   ch->abilities.con = ch->abilities.con + race_apply[GET_RACE(ch)][4];

   if (ch->abilities.str>18) {ch->abilities.str=18;ch->abilities.str_add = number(0, 100);};
   if (ch->abilities.intel>18) ch->abilities.intel=18;
   if (ch->abilities.wis>18) ch->abilities.wis=18;
   if (ch->abilities.dex>18) ch->abilities.dex=18;
   if (ch->abilities.con>18) ch->abilities.con=18;

   ch->tmpabilities = ch->abilities;
}

5- in dc.c,

in init_char,

   if (ch->player.sex == SEX_MALE) {
      ch->player.weight = number(120, 180);
      ch->player.height = number(160, 200);
   } else {
      ch->player.weight = number(100, 160);
      ch->player.height = number(150, 180);
   }

   /* modifications according to the race */
   ch->player.weight=ch->player.weight + race_phy_apply[GET_RACE(ch)][1];
   ch->player.height=ch->player.height + race_phy_apply[GET_RACE(ch)][0];

Well.. that's about all... If u have got problems with that, ask me on this
list or send me a mail ...
If u have any extra ideas, let me know too.

Ludo  

--------------------------------------------------------------------------------
Ludovic CHATAIGNER               |   e-mail adress : lchataig@ensem.u-nancy.fr
                                 |
Ensem 3A (ISA Instrumentation 91)|       v                       v        \|/  
                                 |                     v                  -O- 
                                 |                                        /|\
2 rue de la foret de haye        |   /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\      
                                 |    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/      
54500 VANDOEUVRE LES NANCY       |   /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
--------------------------------------------------------------------------------



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