Stat function for mortals to see their own stats

  • Juras
  • Juras's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
5 years 6 months ago - 5 years 6 months ago #1352 by Juras
In act.wizard.c

find line 44 showing:
static void do_stat_character(struct char_data *ch, struct char_data *k);

and add this below:
static void do_stat_mortal(struct char_data *ch);

around line 961 at the end of do_stat_character add this:
static void do_stat_mortal(struct char_data *ch)
{ 
char buf1[MAX_STRING_LENGTH];
char buf2[MAX_STRING_LENGTH];

  sprinttype(GET_SEX(ch), genders, buf1, sizeof(buf1));
  sprinttype(ch->player.chclass, pc_class_types, buf2, sizeof(buf2));
  
  send_to_char(ch, "You are known as %s %s, the level %2d %s %s\r\n",
	  GET_NAME(ch), ch->player.title ? ch->player.title : "the nobody", GET_LEVEL(ch), buf1, buf2);

 
  send_to_char(ch, "Str: [%s%d/%d%s]  Int: [%s%d%s]  Wis: [%s%d%s]  "
	  "Dex: [%s%d%s]  Con: [%s%d%s]  Cha: [%s%d%s]\r\n",
	  CCCYN(ch, C_NRM), GET_STR(ch), GET_ADD(ch), CCNRM(ch, C_NRM),
	  CCCYN(ch, C_NRM), GET_INT(ch), CCNRM(ch, C_NRM),
	  CCCYN(ch, C_NRM), GET_WIS(ch), CCNRM(ch, C_NRM),
	  CCCYN(ch, C_NRM), GET_DEX(ch), CCNRM(ch, C_NRM),
	  CCCYN(ch, C_NRM), GET_CON(ch), CCNRM(ch, C_NRM),
	  CCCYN(ch, C_NRM), GET_CHA(ch), CCNRM(ch, C_NRM));
	  
  send_to_char(ch, "AC: [%d%+d/10], Hitroll: [%2d], Damroll: [%2d]\r\n",
	  GET_AC(ch), dex_app[GET_DEX(ch)].defensive, ch->points.hitroll,
	  ch->points.damroll);
	  
  send_to_char(ch, "Gold: [%9d], Bank: [%9d] (Total: %d) \r\n",
	  GET_GOLD(ch), GET_BANK_GOLD(ch), GET_GOLD(ch) + GET_BANK_GOLD(ch));

	sprintbitarray(AFF_FLAGS(ch), affected_bits, AF_ARRAY_MAX, buf1);
    send_to_char(ch, "Affected by: %s%s%s\r\n", CCYEL(ch, C_NRM), buf1, CCNRM(ch, C_NRM));
}

just below that in ACMD (do_stat) find:
half_chop(argument, buf1, buf2);

and add this below it:
   if (GET_LEVEL(ch) < LVL_IMMORT) {    /* Check to see if they're an imm or a mortal    */
     do_stat_mortal(ch);				/* Mortals use do_stat_mortal - imms continue on */
     return;
   }

Last but not least:
In interpreter.c
line 304

find:
  { "stat"     , "stat"    , POS_DEAD    , do_stat     , LVL_IMMORT, 0 }

and change it to:
  { "stat"     , "stat"    , POS_DEAD    , do_stat     , 1, 0 }
Last edit: 5 years 6 months ago by Juras.
The following user(s) said Thank You: thomas, Axanon, zusuk

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago #1374 by Axanon
This is nice, though I always preferred adding more fields to players' score sheet. The function is already there, just needs some love.

Please Log in or Create an account to join the conversation.

  • Juras
  • Juras's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
5 years 6 months ago #1376 by Juras
Valid point.

From what I've seen that's the direction most muds take.

I like this however as a way to keep the score sheet from becoming bloated with too much information.

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • LuminariMUD Developer
More
5 years 6 months ago #1382 by zusuk
Yeah I hear you, already I have a score-sheet, affects command, attacks command and if you are a caster, various caster-interface commands for info :P

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

Time to create page: 1.136 seconds