[NEWBIE][CODE]Races

From: Jimmie Tryon (zereth@EARTHLINK.NET)
Date: 12/14/02


When I type 'd' for dwarf at the main menu, it makes the character an elf.

This is the code from races.c

const char *race_abbrevs[] = {
  "Hum",
  "Elf",
  "Gno",
  "Dwa",
  "Hob",
  "Orc",
  "Tro",
  "Ogr",
  "Gia",
  "Gob",
  "Dra",
  "Hlf",
  "Hrc",
  "Hal",
  "\n"
};



const char *pc_race_types[] = {
  "Human",
  "Dwarf",
  "Elf",
  "Hobbit",
  "Gnome",
  "Orc",
  "Troll",
  "Ogre",
  "Goblin",
  "Half-Elf",
  "Half-Orc",
  "Halfing",
  "\n"
};

const char *race_menu =
"\r\n"
"Select a race:\r\n"
"  [H]uman\r\n"
"  [D]warf\r\n"
"  [E]lf\r\n"
"  Half-E[l]f\r\n"
"  H[o]bbit\r\n""
"[G]nome\r\n"
"  Or[c]\r\n"
"  Hal[f]-Orc\r\n"
"  [T]roll\r\n"
"  Og[r]e\r\n"
"  G[i]ant\r\n"
"  Go[b]lin\r\n"
"  Halfli[n]g\r\n"
"  Dr[a]gon\r\n";



int parse_race(char arg) {
  switch(arg) {
    case 'h': return RACE_HUMAN;
    case 'd': return RACE_DWARF;
    case 'e': return RACE_ELF;
    case 'o': return RACE_HOBBIT;
    case 'g': return RACE_GNOME;

    case 'c': return RACE_ORC;
    case 't': return RACE_TROLL;
    case 'r': return RACE_OGRE;
    case 'i': return RACE_GIANT;
    case 'a': return RACE_DRAGON;
    case 'b': return RACE_GOBLIN;

    case 'l': return RACE_HALF_ELF;
    case 'f': return RACE_HALF_ORC;  case 'n': return RACE_HALFLING;

    default: return RACE_UNDEFINED;
  }
}

long find_race_bitvector(char arg) {

  switch (arg) {
    case 'h': return (1 << RACE_HUMAN);
    case 'd': return (1 << RACE_DWARF);
    case 'e': return (1 << RACE_ELF);
    case 'o': return (1 << RACE_HOBBIT);
    case 'g': return (1 << RACE_GNOME);
    case 'c': return (1 << RACE_ORC);
    case 't': return (1 << RACE_TROLL);
    case 'r': return (1 << RACE_OGRE);
    case 'i': return (1 << RACE_GIANT);
    case 'a': return (1 << RACE_DRAGON);
    case 'b': return (1 << RACE_GOBLIN);
    case 'l': return (1 << RACE_HALF_ELF);
    case 'f': return (1 << RACE_HALF_ORC);
    case 'n': return (1 << RACE_HALFLING);
    default: return 0;
  }
}

--
   +---------------------------------------------------------------+
   | 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