Finished basic race handling
This commit is contained in:
parent
0ec7dd3b79
commit
a922f0812d
@ -45,6 +45,7 @@ void appear(struct char_data *ch);
|
|||||||
void reset_zone(zone_rnum zone);
|
void reset_zone(zone_rnum zone);
|
||||||
void roll_real_abils(struct char_data *ch);
|
void roll_real_abils(struct char_data *ch);
|
||||||
int parse_class(char arg);
|
int parse_class(char arg);
|
||||||
|
int parse_race(char *arg);
|
||||||
void run_autowiz(void);
|
void run_autowiz(void);
|
||||||
|
|
||||||
/* local functions */
|
/* local functions */
|
||||||
@ -2171,6 +2172,7 @@ ACMD(do_show)
|
|||||||
{ "age", LVL_GRGOD, BOTH, NUMBER },
|
{ "age", LVL_GRGOD, BOTH, NUMBER },
|
||||||
{ "height", LVL_GOD, BOTH, NUMBER },
|
{ "height", LVL_GOD, BOTH, NUMBER },
|
||||||
{ "weight", LVL_GOD, BOTH, NUMBER }, /* 50 */
|
{ "weight", LVL_GOD, BOTH, NUMBER }, /* 50 */
|
||||||
|
{ "race", LVL_GRGOD, PC, MISC },
|
||||||
{ "\n", 0, BOTH, MISC }
|
{ "\n", 0, BOTH, MISC }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2497,6 +2499,15 @@ int perform_set(struct char_data *ch, struct char_data *vict, int mode,
|
|||||||
affect_total(vict);
|
affect_total(vict);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 51:
|
||||||
|
if ((i == parse_race(val_arg)) == RACE_UNDEFINED)
|
||||||
|
{
|
||||||
|
send_to_char(ch, "That is not a race.\r\n");
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
GET_RACE(vict) = i;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
send_to_char(ch, "Can't set that!\r\n");
|
send_to_char(ch, "Can't set that!\r\n");
|
||||||
return (0);
|
return (0);
|
||||||
|
2202
src/class.c
2202
src/class.c
File diff suppressed because it is too large
Load Diff
@ -238,6 +238,7 @@ const char *connected_types[] = {
|
|||||||
"Changing PW 3",
|
"Changing PW 3",
|
||||||
"Self-Delete 1",
|
"Self-Delete 1",
|
||||||
"Self-Delete 2",
|
"Self-Delete 2",
|
||||||
|
"Select race",
|
||||||
"Disconnecting",
|
"Disconnecting",
|
||||||
"\n"
|
"\n"
|
||||||
};
|
};
|
||||||
|
2
src/db.c
2
src/db.c
@ -2217,6 +2217,7 @@ void store_to_char(struct char_file_u *st, struct char_data *ch)
|
|||||||
|
|
||||||
GET_SEX(ch) = st->sex;
|
GET_SEX(ch) = st->sex;
|
||||||
GET_CLASS(ch) = st->chclass;
|
GET_CLASS(ch) = st->chclass;
|
||||||
|
GET_RACE(ch) = st->race;
|
||||||
GET_LEVEL(ch) = st->level;
|
GET_LEVEL(ch) = st->level;
|
||||||
|
|
||||||
ch->player.short_descr = NULL;
|
ch->player.short_descr = NULL;
|
||||||
@ -2335,6 +2336,7 @@ void char_to_store(struct char_data *ch, struct char_file_u *st)
|
|||||||
st->height = GET_HEIGHT(ch);
|
st->height = GET_HEIGHT(ch);
|
||||||
st->sex = GET_SEX(ch);
|
st->sex = GET_SEX(ch);
|
||||||
st->chclass = GET_CLASS(ch);
|
st->chclass = GET_CLASS(ch);
|
||||||
|
st->race = GET_RACE(ch);
|
||||||
st->level = GET_LEVEL(ch);
|
st->level = GET_LEVEL(ch);
|
||||||
st->abilities = ch->real_abils;
|
st->abilities = ch->real_abils;
|
||||||
st->points = ch->points;
|
st->points = ch->points;
|
||||||
|
@ -29,6 +29,7 @@ extern room_rnum r_mortal_start_room;
|
|||||||
extern room_rnum r_immort_start_room;
|
extern room_rnum r_immort_start_room;
|
||||||
extern room_rnum r_frozen_start_room;
|
extern room_rnum r_frozen_start_room;
|
||||||
extern const char *class_menu;
|
extern const char *class_menu;
|
||||||
|
extern const char *race_menu;
|
||||||
extern char *motd;
|
extern char *motd;
|
||||||
extern char *imotd;
|
extern char *imotd;
|
||||||
extern char *background;
|
extern char *background;
|
||||||
@ -46,6 +47,7 @@ void echo_on(struct descriptor_data *d);
|
|||||||
void echo_off(struct descriptor_data *d);
|
void echo_off(struct descriptor_data *d);
|
||||||
void do_start(struct char_data *ch);
|
void do_start(struct char_data *ch);
|
||||||
int parse_class(char arg);
|
int parse_class(char arg);
|
||||||
|
int parse_race(char *arg);
|
||||||
int special(struct char_data *ch, int cmd, char *arg);
|
int special(struct char_data *ch, int cmd, char *arg);
|
||||||
int isbanned(char *hostname);
|
int isbanned(char *hostname);
|
||||||
int Valid_Name(char *newname);
|
int Valid_Name(char *newname);
|
||||||
@ -1511,6 +1513,19 @@ void nanny(struct descriptor_data *d, char *arg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
write_to_output(d, "%s\r\nRace: ", race_menu);
|
||||||
|
STATE(d) = CON_QRACE;
|
||||||
|
break;
|
||||||
|
case CON_QRACE:
|
||||||
|
load_result = parse_race(arg);
|
||||||
|
if (load_result == RACE_UNDEFINED)
|
||||||
|
{
|
||||||
|
write_to_output(d, "\r\nThat's not a race.\r\nRace: ");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
GET_RACE(d->character) = load_result;
|
||||||
|
|
||||||
write_to_output(d, "%s\r\nClass: ", class_menu);
|
write_to_output(d, "%s\r\nClass: ", class_menu);
|
||||||
STATE(d) = CON_QCLASS;
|
STATE(d) = CON_QCLASS;
|
||||||
break;
|
break;
|
||||||
|
39
src/races.c
39
src/races.c
@ -1,5 +1,7 @@
|
|||||||
#include "sysdep.h"
|
#include <string.h>
|
||||||
|
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
|
#include "sysdep.h"
|
||||||
#include "structs.h"
|
#include "structs.h"
|
||||||
#include "interpreter.h"
|
#include "interpreter.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
@ -20,30 +22,27 @@ const char *pc_race_types[] = {
|
|||||||
|
|
||||||
const char *race_menu = "\r\n"
|
const char *race_menu = "\r\n"
|
||||||
"Select race:\r\n"
|
"Select race:\r\n"
|
||||||
"(1) Haoon\r\n"
|
"( 1) Haoon\r\n"
|
||||||
"(2) Utnir\r\n"
|
"( 2) Utnir\r\n"
|
||||||
"(3) Duaron\r\n";
|
"( 3) Duaron\r\n";
|
||||||
|
|
||||||
int
|
int
|
||||||
parse_race(char arg)
|
parse_race(char *arg)
|
||||||
{
|
{
|
||||||
arg = LOWER(arg);
|
if (strcmp(arg, "1") == 0)
|
||||||
|
|
||||||
switch (arg)
|
|
||||||
{
|
{
|
||||||
case '1':
|
return RACE_HAOON;
|
||||||
return RACE_HAOON;
|
|
||||||
break;
|
|
||||||
case '2':
|
|
||||||
return RACE_UTNIR;
|
|
||||||
break;
|
|
||||||
case '3':
|
|
||||||
return RACE_DUARON;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return RACE_UNDEFINED;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else if (strcmp(arg, "2") == 0)
|
||||||
|
{
|
||||||
|
return RACE_UTNIR;
|
||||||
|
}
|
||||||
|
else if (strcmp(arg, "3") == 0)
|
||||||
|
{
|
||||||
|
return RACE_DUARON;
|
||||||
|
}
|
||||||
|
|
||||||
|
return RACE_UNDEFINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
long
|
long
|
||||||
|
Loading…
Reference in New Issue
Block a user