do_score.txt
snippets · 5.6 KB · 2010-03-30
do_score replacement: shows hitroll, damroll, alignment, position and more.
Download « Back to the snippets list
void do_score (CHAR_DATA * ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
int hitroll;
int damroll;
int align;
char cposition[100];
char calignment[100];
if (ch->level <= 9)
{
align = 0;
strcpy(calignment, "NULL");
}
else
{
align = ch->alignment;
if (ch->alignment > 900)
strcpy(calignment, "saintly");
else if (ch->alignment > 700)
strcpy(calignment, "very good");
else if (ch->alignment > 350)
strcpy(calignment, "good");
else if (ch->alignment > 100)
strcpy(calignment, "neutral good");
else if (ch->alignment > -100)
strcpy(calignment, "neutral bad");
else if (ch->alignment > -350)
strcpy(calignment, "bad");
else if (ch->alignment > -700)
strcpy(calignment, "evil");
else if (ch->alignment > -900)
strcpy(calignment, "chaotic");
else
strcpy(calignment, "satanic");
}
switch (ch->position)
{
case POS_DEAD:
strcpy(cposition, "You are DEAD");
break;
case POS_MORTAL:
strcpy(cposition, "You are Mortally Wounded");
break;
case POS_INCAP:
strcpy(cposition, "You are Incapacitated");
break;
case POS_STUNNED:
strcpy(cposition, "You are Stunned");
break;
case POS_SLEEPING:
strcpy(cposition, "You are Sleeping");
break;
case POS_RESTING:
strcpy(cposition, "You are Resting");
break;
case POS_SITTING:
strcpy(cposition, "You are Sitting");
break;
case POS_STANDING:
strcpy(cposition, "You are Standing");
break;
case POS_FIGHTING:
strcpy(cposition, "You are Fighting");
break;
}
if (ch->level >= 15)
{
hitroll = GET_HITROLL(ch);
damroll = GET_DAMROLL(ch);
}
else
{
hitroll = 0;
damroll = 0;
}
send_to_char (" {G+{g------------------------------------------------------{G+{x\n\r", ch);
sprintf (buf, " {g|{C Scoresheet %41s {g|{x\n\r", ch->name);
send_to_char(buf, ch);
send_to_char (" {G+{g------------------------{G+{g-----------------------------{G+{x\n\r", ch);
sprintf (buf, " {g|{c Race:{C %-15s {g|{c Health:{C %4d {c/{C %-12d {g|{x\r\n",
race_table[ch->race].name,
ch->hit, ch->max_hit);
send_to_char(buf, ch);
sprintf (buf, " {g|{c Class:{C %-15s {g|{c Mana:{C %4d {c/{C %-12d {g|{x\n\r",
IS_NPC(ch) ? "mobile" : class_table[ch->class].name,
ch->mana, ch->max_mana);
send_to_char(buf, ch);
sprintf (buf, " {g|{c Sex:{C %-15s {g|{c Move:{C %4d {c/{C %-12d {g|{x\n\r",
ch->sex == 0 ? "Sexless" : ch->sex == 1 ? "Male" : "Female",
ch->move, ch->max_move);
send_to_char(buf, ch);
sprintf(buf, " {g|{c Level: {C%-11d {G+{g---{G+{g--------{G+{g--------------{G+ {g|{x\n\r",
ch->level);
send_to_char(buf, ch);
sprintf(buf, " {g|{c Age:{C %-11d {g|{c Str:{C %2d{c/{C%2d {g|{c Prce:{C %-6d {g| |{x\n\r",
get_age(ch), get_curr_stat(ch, STAT_STR), ch->perm_stat[STAT_STR],
GET_AC(ch, AC_PIERCE));
send_to_char(buf, ch);
sprintf(buf, " {g|{c Exp:{C %-11d {g|{c Int:{C %2d{c/{C%2d {g| {cBash:{C %-6d {G+{g-----{G+{x\n\r",
ch->exp, get_curr_stat(ch, STAT_INT), ch->perm_stat[STAT_INT],
GET_AC(ch, AC_BASH));
send_to_char(buf, ch);
sprintf(buf, " {G+{g--------------------{G+ {cWis:{C %2d{c/{C%2d {g|{c Slsh:{C %-6d {g|{x\n\r",
get_curr_stat(ch, STAT_WIS), ch->perm_stat[STAT_WIS],
GET_AC(ch, AC_SLASH));
send_to_char(buf, ch);
sprintf(buf, " {g|{c Hitroll:{C %-9d {g|{c Dex:{C %2d{c/{C%2d {g|{c Magc:{C %-6d {g|{x\n\r",
hitroll, get_curr_stat(ch, STAT_DEX), ch->perm_stat[STAT_DEX],
GET_AC(ch, AC_EXOTIC));
send_to_char(buf, ch);
sprintf(buf, " {g|{c Damroll:{C %-9d {g|{c Con:{C %2d{c/{C%2d {g| |{x\n\r",
damroll, get_curr_stat(ch, STAT_CON), ch->perm_stat[STAT_CON]);
send_to_char(buf, ch);
sprintf(buf, " {g|{c Gold:{C %-9ld {G+{g------------{G+{g--------------{G+{x\n\r", ch->gold);
send_to_char(buf, ch);
sprintf(buf, " {g|{c Silver:{C %-9ld {g|{C %-25s {g|{x\n\r",
ch->silver, cposition);
send_to_char(buf, ch);
send_to_char(" {G+{g--------------------{G+{g--{G+{g------------------------{G+{x\n\r", ch);
sprintf(buf, " {g|{c Alignment:{C %-10d {g|{c Items:{C %4d {c/{C %-7d {g|{x\n\r",
align, ch->carry_number, can_carry_n(ch));
send_to_char(buf, ch);
sprintf(buf, " {g|{c You are{C %-13s {g|{c Weight:{C %4ld {c/{C %-7d {g|{x\n\r",
calignment, get_carry_weight(ch) / 10, can_carry_w(ch) / 10);
send_to_char(buf, ch);
send_to_char(" {G+{g-----------------------{G+{g------------------------{G+{x\n\r", ch);
sprintf(buf, " {g|{c Wimpy:{C %-39d {g|{x\n\r",
ch->wimpy);
send_to_char(buf, ch);
send_to_char(" {G+{g------------------------------------------------{G+{x\n\r", ch);
send_to_char("\n\r", ch);
if (IS_SET(ch->comm, COMM_SHOW_AFFECTS))
do_function(ch, &do_affects, "");
}