Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

act_info.c File Reference

#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <time.h>
#include "merc.h"
#include "interp.h"
#include "magic.h"
#include "recycle.h"
#include "tables.h"
#include "lookup.h"
#include "vehicles.h"

Include dependency graph for act_info.c:

Go to the source code of this file.

Defines

#define HEADER   "{c----------------------------------------------------------{x\n\r"
#define WHO_FILE   "/var/www/html/who_file"

Functions

bool check_blind args ((CHAR_DATA *ch))
void show_char_to_char args ((CHAR_DATA *list, CHAR_DATA *ch))
void show_char_to_char_0 args ((CHAR_DATA *victim, CHAR_DATA *ch))
void show_list_to_char args ((OBJ_DATA *list, CHAR_DATA *ch, bool fShort, bool fShowNothing))
char *format_obj_to_char args ((OBJ_DATA *obj, CHAR_DATA *ch, bool fShort))
void bts_about (CHAR_DATA *ch, char *argument)
bool check_blind (CHAR_DATA *ch)
void do_affects (CHAR_DATA *ch, char *argument)
void do_autoall (CHAR_DATA *ch, char *argument)
void do_autoassist (CHAR_DATA *ch, char *argument)
void do_autoexit (CHAR_DATA *ch, char *argument)
void do_autogold (CHAR_DATA *ch, char *argument)
void do_autolist (CHAR_DATA *ch, char *argument)
void do_autoloot (CHAR_DATA *ch, char *argument)
void do_autosac (CHAR_DATA *ch, char *argument)
void do_autosplit (CHAR_DATA *ch, char *argument)
void do_brief (CHAR_DATA *ch, char *argument)
void do_combine (CHAR_DATA *ch, char *argument)
void do_compact (CHAR_DATA *ch, char *argument)
void do_compare (CHAR_DATA *ch, char *argument)
void do_consider (CHAR_DATA *ch, char *argument)
void do_count (CHAR_DATA *ch, char *argument)
void do_credits (CHAR_DATA *ch, char *argument)
void do_description (CHAR_DATA *ch, char *argument)
void do_equipment (CHAR_DATA *ch, char *argument)
void do_examine (CHAR_DATA *ch, char *argument)
void do_exits (CHAR_DATA *ch, char *argument)
void do_game_status (CHAR_DATA *ch, char *argument)
void do_glance (CHAR_DATA *ch, char *argument)
void do_help (CHAR_DATA *ch, char *argument)
void do_imotd (CHAR_DATA *ch, char *argument)
void do_inventory (CHAR_DATA *ch, char *argument)
void do_look (CHAR_DATA *ch, char *argument)
void do_motd (CHAR_DATA *ch, char *argument)
void do_nofollow (CHAR_DATA *ch, char *argument)
void do_noloot (CHAR_DATA *ch, char *argument)
void do_nosummon (CHAR_DATA *ch, char *argument)
void do_password (CHAR_DATA *ch, char *argument)
void do_practice (CHAR_DATA *ch, char *argument)
void do_prompt (CHAR_DATA *ch, char *argument)
void do_read (CHAR_DATA *ch, char *argument)
void do_report (CHAR_DATA *ch, char *argument)
void do_rules (CHAR_DATA *ch, char *argument)
void do_score (CHAR_DATA *ch, char *argument)
void do_score2 (CHAR_DATA *ch, char *argument)
void do_scroll (CHAR_DATA *ch, char *argument)
void do_show (CHAR_DATA *ch, char *argument)
void do_socials (CHAR_DATA *ch, char *argument)
void do_story (CHAR_DATA *ch, char *argument)
void do_telnetga (CHAR_DATA *ch, char *argument)
void do_time (CHAR_DATA *ch, char *argument)
void do_title (CHAR_DATA *ch, char *argument)
void do_weather (CHAR_DATA *ch, char *argument)
void do_web_who ()
void do_where (CHAR_DATA *ch, char *argument)
void do_who (CHAR_DATA *ch, char *argument)
void do_whois (CHAR_DATA *ch, char *argument)
void do_wimpy (CHAR_DATA *ch, char *argument)
void do_wizlist (CHAR_DATA *ch, char *argument)
void do_worth (CHAR_DATA *ch, char *argument)
char * format_obj_to_char (OBJ_DATA *obj, CHAR_DATA *ch, bool fShort)
char * pers (CHAR_DATA *ch, CHAR_DATA *looker, bool check_cloak)
void set_title (CHAR_DATA *ch, char *title)
void show_char_to_char (CHAR_DATA *list, CHAR_DATA *ch)
void show_char_to_char_0 (CHAR_DATA *victim, CHAR_DATA *ch)
void show_char_to_char_1 (CHAR_DATA *victim, CHAR_DATA *ch)
void show_list_to_char (OBJ_DATA *list, CHAR_DATA *ch, bool fShort, bool fShowNothing)

Variables

char *const day_name []
int max_on = 0
char *const month_name []
char *const where_name []


Define Documentation

#define HEADER   "{c----------------------------------------------------------{x\n\r"
 

Referenced by show_char_to_char_1().

#define WHO_FILE   "/var/www/html/who_file"
 

Definition at line 2930 of file act_info.c.


Function Documentation

bool check_blind args (CHAR_DATA *ch)   ) 
 

void show_char_to_char args (CHAR_DATA *list, CHAR_DATA *ch)   ) 
 

void show_char_to_char_0 args (CHAR_DATA *victim, CHAR_DATA *ch)   ) 
 

void show_list_to_char args (OBJ_DATA *list, CHAR_DATA *ch, bool fShort, bool fShowNothing)   ) 
 

char* format_obj_to_char args (OBJ_DATA *obj, CHAR_DATA *ch, bool fShort)   ) 
 

void bts_about CHAR_DATA ch,
char *  argument
 

Definition at line 3236 of file act_info.c.

References D, and W.

03237 {
03238     send_to_char("\n\r\n\r",ch);
03239     send_to_char("{D              ______   _______           _______  _        ______  \n\r",ch);
03240     send_to_char("{D             (  ___ \\ (  ____ \\|\\     /|(  ___  )( (    /|(  __  \\ \n\r",ch);
03241     send_to_char("{D             | (   ) )| (    \\/( \\   / )| (   ) ||  \\  ( || (  \\  ) \n\r",ch);
03242     send_to_char("{w             | (__/ / | (__     \\ (_) / | |   | ||   \\ | || |   ) | \n\r",ch);
03243     send_to_char("{w             |  __ (  |  __)     \\   /  | |   | || (\\ \\) || |   | | \n\r",ch);
03244     send_to_char("{w             | (  \\ \\ | (         ) (   | |   | || | \\   || |   ) | \n\r",ch);
03245     send_to_char("{W             | )___) )| (____/\\   | |   | (___) || )  \\  || (__/  ) \n\r",ch);
03246     send_to_char("{W             |/ \\___/ (_______/   \\_/   (_______)|/    )_)(______/  \n\r",ch);
03247     send_to_char("\n\r",ch);
03248     send_to_char("{D                          _________          _______ \n\r",ch);
03249     send_to_char(" {D                         \\__   __/|\\     /|(  ____ \\ \n\r",ch);
03250     send_to_char("{D                             ) (   | )   ( || (    \\/ \n\r",ch);
03251     send_to_char("{w                             | |   | (___) || (__     \n\r",ch);
03252     send_to_char("{w                             | |   |  ___  ||  __)   \n\r",ch);
03253     send_to_char("{w                             | |   | (   ) || (      \n\r",ch);
03254     send_to_char(" {W                            | |   | )   ( || (____/\\ \n\r",ch);
03255     send_to_char("{W                             )_(   |/     \\|(_______/ \n\r",ch);
03256     send_to_char("\n\r",ch);
03257     send_to_char("{D         _______           _______  ______   _______           _______ \n\r",ch);
03258     send_to_char("{D        (  ____ \\|\\     /|(  ___  )(  __  \\ (  ___  )|\\     /|(  ____ \\ \n\r",ch);
03259     send_to_char("{D        | (    \\/| )   ( || (   ) || (  \\  )| (   ) || )   ( || (    \\/ \n\r",ch);
03260     send_to_char("{w        | (_____ | (___) || (___) || |   ) || |   | || | _ | || (_____  \n\r",ch);
03261     send_to_char("{w        (_____  )|  ___  ||  ___  || |   | || |   | || |( )| |(_____  ) \n\r",ch);
03262     send_to_char("{w              ) || (   ) || (   ) || |   ) || |   | || || || |      ) | \n\r",ch);
03263     send_to_char("{W        /\\____) || )   ( || )   ( || (__/  )| (___) || () () |/\\____) | \n\r",ch);
03264     send_to_char("{W        \\_______)|/     \\||/     \\|(______/ (_______)(_______)\\_______){x \n\r",ch);
03265     return;
03266 }

bool check_blind CHAR_DATA ch  ) 
 

Definition at line 772 of file act_info.c.

References AFF_BLIND, FALSE, IS_AFFECTED, IS_NPC, IS_SET, PLR_HOLYLIGHT, send_to_char(), and TRUE.

Referenced by do_exits(), and do_look().

00773 {
00774 
00775     if (!IS_NPC (ch) && IS_SET (ch->act, PLR_HOLYLIGHT))
00776         return TRUE;
00777 
00778     if (IS_AFFECTED (ch, AFF_BLIND))
00779     {
00780         send_to_char ("You can't see a thing!\n\r", ch);
00781         return FALSE;
00782     }
00783 
00784     return TRUE;
00785 }

Here is the call graph for this function:

void do_affects CHAR_DATA ch,
char *  argument
 

Definition at line 2288 of file act_info.c.

References affect_loc_name(), affect_data::duration, affect_data::location, MAX_STRING_LENGTH, affect_data::modifier, affect_data::next, send_to_char(), skill_table, and affect_data::type.

Referenced by do_score(), and do_score2().

02289 {
02290     AFFECT_DATA *paf, *paf_last = NULL;
02291     char buf[MAX_STRING_LENGTH];
02292 
02293     if (ch->affected != NULL)
02294     {
02295         send_to_char ("You are affected by the following spells:\n\r", ch);
02296         for (paf = ch->affected; paf != NULL; paf = paf->next)
02297         {
02298             if (paf_last != NULL && paf->type == paf_last->type)
02299                 if (ch->level >= 20)
02300                     sprintf (buf, "                      ");
02301                 else
02302                     continue;
02303             else
02304                 sprintf (buf, "Spell: %-15s", skill_table[paf->type].name);
02305 
02306             send_to_char (buf, ch);
02307 
02308             if (ch->level >= 20)
02309             {
02310                 sprintf (buf,
02311                          ": modifies %s by %d ",
02312                          affect_loc_name (paf->location), paf->modifier);
02313                 send_to_char (buf, ch);
02314                 if (paf->duration == -1)
02315                     sprintf (buf, "permanently");
02316                 else
02317                     sprintf (buf, "for %d hours", paf->duration);
02318                 send_to_char (buf, ch);
02319             }
02320 
02321             send_to_char ("\n\r", ch);
02322             paf_last = paf;
02323         }
02324     }
02325     else
02326         send_to_char ("You are not affected by any spells.\n\r", ch);
02327 
02328     return;
02329 }

Here is the call graph for this function:

void do_autoall CHAR_DATA ch,
char *  argument
 

Definition at line 1081 of file act_info.c.

References IS_NPC, PLR_AUTOASSIST, PLR_AUTOEXIT, PLR_AUTOGOLD, PLR_AUTOLOOT, PLR_AUTOSAC, PLR_AUTOSPLIT, REMOVE_BIT, send_to_char(), and SET_BIT.

01082 {
01083     if (IS_NPC(ch))
01084         return;
01085 
01086     if (!strcmp (argument, "on"))
01087     {
01088         SET_BIT(ch->act,PLR_AUTOASSIST);
01089         SET_BIT(ch->act,PLR_AUTOEXIT);
01090         SET_BIT(ch->act,PLR_AUTOGOLD);
01091         SET_BIT(ch->act,PLR_AUTOLOOT);
01092         SET_BIT(ch->act,PLR_AUTOSAC);
01093         SET_BIT(ch->act,PLR_AUTOSPLIT);
01094 
01095         send_to_char("All autos turned on.\n\r",ch);
01096     }
01097     else if (!strcmp (argument, "off"))
01098     {
01099         REMOVE_BIT (ch->act, PLR_AUTOASSIST);
01100         REMOVE_BIT (ch->act, PLR_AUTOEXIT);
01101         REMOVE_BIT (ch->act, PLR_AUTOGOLD);
01102         REMOVE_BIT (ch->act, PLR_AUTOLOOT);
01103         REMOVE_BIT (ch->act, PLR_AUTOSAC);
01104         REMOVE_BIT (ch->act, PLR_AUTOSPLIT);
01105 
01106         send_to_char("All autos turned off.\n\r", ch);
01107     }
01108     else
01109         send_to_char("Usage: autoall [on|off]\n\r", ch);
01110 }

Here is the call graph for this function:

void do_autoassist CHAR_DATA ch,
char *  argument
 

Definition at line 979 of file act_info.c.

References IS_NPC, IS_SET, PLR_AUTOASSIST, REMOVE_BIT, send_to_char(), and SET_BIT.

00980 {
00981     if (IS_NPC (ch))
00982         return;
00983 
00984     if (IS_SET (ch->act, PLR_AUTOASSIST))
00985     {
00986         send_to_char ("Autoassist removed.\n\r", ch);
00987         REMOVE_BIT (ch->act, PLR_AUTOASSIST);
00988     }
00989     else
00990     {
00991         send_to_char ("You will now assist when needed.\n\r", ch);
00992         SET_BIT (ch->act, PLR_AUTOASSIST);
00993     }
00994 }

Here is the call graph for this function:

void do_autoexit CHAR_DATA ch,
char *  argument
 

Definition at line 996 of file act_info.c.

References IS_NPC, IS_SET, PLR_AUTOEXIT, REMOVE_BIT, send_to_char(), and SET_BIT.

00997 {
00998     if (IS_NPC (ch))
00999         return;
01000 
01001     if (IS_SET (ch->act, PLR_AUTOEXIT))
01002     {
01003         send_to_char ("Exits will no longer be displayed.\n\r", ch);
01004         REMOVE_BIT (ch->act, PLR_AUTOEXIT);
01005     }
01006     else
01007     {
01008         send_to_char ("Exits will now be displayed.\n\r", ch);
01009         SET_BIT (ch->act, PLR_AUTOEXIT);
01010     }
01011 }

Here is the call graph for this function:

void do_autogold CHAR_DATA ch,
char *  argument
 

Definition at line 1013 of file act_info.c.

References IS_NPC, IS_SET, PLR_AUTOGOLD, REMOVE_BIT, send_to_char(), and SET_BIT.

01014 {
01015     if (IS_NPC (ch))
01016         return;
01017 
01018     if (IS_SET (ch->act, PLR_AUTOGOLD))
01019     {
01020         send_to_char ("Autogold removed.\n\r", ch);
01021         REMOVE_BIT (ch->act, PLR_AUTOGOLD);
01022     }
01023     else
01024     {
01025         send_to_char ("Automatic gold looting set.\n\r", ch);
01026         SET_BIT (ch->act, PLR_AUTOGOLD);
01027     }
01028 }

Here is the call graph for this function:

void do_autolist CHAR_DATA ch,
char *  argument
 

Definition at line 892 of file act_info.c.

References COMM_COMBINE, COMM_COMPACT, COMM_PROMPT, COMM_TELNET_GA, IS_NPC, IS_SET, PLR_AUTOASSIST, PLR_AUTOEXIT, PLR_AUTOGOLD, PLR_AUTOLOOT, PLR_AUTOSAC, PLR_AUTOSPLIT, PLR_CANLOOT, PLR_NOFOLLOW, PLR_NOSUMMON, and send_to_char().

00893 {
00894     /* lists most player flags */
00895     if (IS_NPC (ch))
00896         return;
00897 
00898     send_to_char ("action    |   status\n\r", ch);
00899     send_to_char ("{R*{G---------------------{R*{x\n\r", ch);
00900 
00901     send_to_char ("autoassist     ", ch);
00902     if (IS_SET (ch->act, PLR_AUTOASSIST))
00903         send_to_char ("{GON{x\n\r", ch);
00904     else
00905         send_to_char ("{ROFF{x\n\r", ch);
00906 
00907     send_to_char ("autoexit       ", ch);
00908     if (IS_SET (ch->act, PLR_AUTOEXIT))
00909         send_to_char ("{GON{x\n\r", ch);
00910     else
00911         send_to_char ("{ROFF{x\n\r", ch);
00912 
00913     send_to_char ("autogold       ", ch);
00914     if (IS_SET (ch->act, PLR_AUTOGOLD))
00915         send_to_char ("{GON{x\n\r", ch);
00916     else
00917         send_to_char ("{ROFF{x\n\r", ch);
00918 
00919     send_to_char ("autoloot       ", ch);
00920     if (IS_SET (ch->act, PLR_AUTOLOOT))
00921         send_to_char ("{GON{x\n\r", ch);
00922     else
00923         send_to_char ("{ROFF{x\n\r", ch);
00924 
00925     send_to_char ("autosac        ", ch);
00926     if (IS_SET (ch->act, PLR_AUTOSAC))
00927         send_to_char ("{GON{x\n\r", ch);
00928     else
00929         send_to_char ("{ROFF{x\n\r", ch);
00930 
00931     send_to_char ("autosplit      ", ch);
00932     if (IS_SET (ch->act, PLR_AUTOSPLIT))
00933         send_to_char ("{GON{x\n\r", ch);
00934     else
00935         send_to_char ("{ROFF{x\n\r", ch);
00936 
00937     send_to_char ("telnetga       ", ch);
00938     if (IS_SET (ch->comm, COMM_TELNET_GA))
00939         send_to_char ("{GON{x\n\r", ch);
00940     else
00941         send_to_char ("{ROFF{x\n\r",ch);
00942 
00943     send_to_char ("compact mode   ", ch);
00944     if (IS_SET (ch->comm, COMM_COMPACT))
00945         send_to_char ("{GON{x\n\r", ch);
00946     else
00947         send_to_char ("{ROFF{x\n\r", ch);
00948 
00949     send_to_char ("prompt         ", ch);
00950     if (IS_SET (ch->comm, COMM_PROMPT))
00951         send_to_char ("{GON{x\n\r", ch);
00952     else
00953         send_to_char ("{ROFF{x\n\r", ch);
00954 
00955     send_to_char ("combine items  ", ch);
00956     if (IS_SET (ch->comm, COMM_COMBINE))
00957         send_to_char ("{GON{x\n\r", ch);
00958     else
00959         send_to_char ("{ROFF{x\n\r", ch);
00960 
00961     if (!IS_SET (ch->act, PLR_CANLOOT))
00962         send_to_char ("Your corpse is safe from thieves.\n\r", ch);
00963     else
00964         send_to_char ("Your corpse may be looted.\n\r", ch);
00965 
00966     if (IS_SET (ch->act, PLR_NOSUMMON))
00967         send_to_char ("You cannot be summoned.\n\r", ch);
00968     else
00969         send_to_char ("You can be summoned.\n\r", ch);
00970 
00971     if (IS_SET (ch->act, PLR_NOFOLLOW))
00972         send_to_char ("You do not welcome followers.\n\r", ch);
00973     else
00974         send_to_char ("You accept followers.\n\r", ch);
00975         send_to_char ("{R*{G---------------------{R*{x\n\r", ch);
00976 
00977 }

Here is the call graph for this function:

void do_autoloot CHAR_DATA ch,
char *  argument
 

Definition at line 1030 of file act_info.c.

References IS_NPC, IS_SET, PLR_AUTOLOOT, REMOVE_BIT, send_to_char(), and SET_BIT.

01031 {
01032     if (IS_NPC (ch))
01033         return;
01034 
01035     if (IS_SET (ch->act, PLR_AUTOLOOT))
01036     {
01037         send_to_char ("Autolooting removed.\n\r", ch);
01038         REMOVE_BIT (ch->act, PLR_AUTOLOOT);
01039     }
01040     else
01041     {
01042         send_to_char ("Automatic corpse looting set.\n\r", ch);
01043         SET_BIT (ch->act, PLR_AUTOLOOT);
01044     }
01045 }

Here is the call graph for this function:

void do_autosac CHAR_DATA ch,
char *  argument
 

Definition at line 1047 of file act_info.c.

References IS_NPC, IS_SET, PLR_AUTOSAC, REMOVE_BIT, send_to_char(), and SET_BIT.

01048 {
01049     if (IS_NPC (ch))
01050         return;
01051 
01052     if (IS_SET (ch->act, PLR_AUTOSAC))
01053     {
01054         send_to_char ("Autosacrificing removed.\n\r", ch);
01055         REMOVE_BIT (ch->act, PLR_AUTOSAC);
01056     }
01057     else
01058     {
01059         send_to_char ("Automatic corpse sacrificing set.\n\r", ch);
01060         SET_BIT (ch->act, PLR_AUTOSAC);
01061     }
01062 }

Here is the call graph for this function:

void do_autosplit CHAR_DATA ch,
char *  argument
 

Definition at line 1064 of file act_info.c.

References IS_NPC, IS_SET, PLR_AUTOSPLIT, REMOVE_BIT, send_to_char(), and SET_BIT.

01065 {
01066     if (IS_NPC (ch))
01067         return;
01068 
01069     if (IS_SET (ch->act, PLR_AUTOSPLIT))
01070     {
01071         send_to_char ("Autosplitting removed.\n\r", ch);
01072         REMOVE_BIT (ch->act, PLR_AUTOSPLIT);
01073     }
01074     else
01075     {
01076         send_to_char ("Automatic gold splitting set.\n\r", ch);
01077         SET_BIT (ch->act, PLR_AUTOSPLIT);
01078     }
01079 }

Here is the call graph for this function:

void do_brief CHAR_DATA ch,
char *  argument
 

Definition at line 1112 of file act_info.c.

References COMM_BRIEF, IS_SET, REMOVE_BIT, send_to_char(), and SET_BIT.

01113 {
01114     if (IS_SET (ch->comm, COMM_BRIEF))
01115     {
01116         send_to_char ("Full descriptions activated.\n\r", ch);
01117         REMOVE_BIT (ch->comm, COMM_BRIEF);
01118     }
01119     else
01120     {
01121         send_to_char ("Short descriptions activated.\n\r", ch);
01122         SET_BIT (ch->comm, COMM_BRIEF);
01123     }
01124 }

Here is the call graph for this function:

void do_combine CHAR_DATA ch,
char *  argument
 

Definition at line 1193 of file act_info.c.

References COMM_COMBINE, IS_SET, REMOVE_BIT, send_to_char(), and SET_BIT.

01194 {
01195     if (IS_SET (ch->comm, COMM_COMBINE))
01196     {
01197         send_to_char ("Long inventory selected.\n\r", ch);
01198         REMOVE_BIT (ch->comm, COMM_COMBINE);
01199     }
01200     else
01201     {
01202         send_to_char ("Combined inventory selected.\n\r", ch);
01203         SET_BIT (ch->comm, COMM_COMBINE);
01204     }
01205 }

Here is the call graph for this function:

void do_compact CHAR_DATA ch,
char *  argument
 

Definition at line 1126 of file act_info.c.

References COMM_COMPACT, IS_SET, REMOVE_BIT, send_to_char(), and SET_BIT.

01127 {
01128     if (IS_SET (ch->comm, COMM_COMPACT))
01129     {
01130         send_to_char ("Compact mode removed.\n\r", ch);
01131         REMOVE_BIT (ch->comm, COMM_COMPACT);
01132     }
01133     else
01134     {
01135         send_to_char ("Compact mode set.\n\r", ch);
01136         SET_BIT (ch->comm, COMM_COMPACT);
01137     }
01138 }

Here is the call graph for this function:

void do_compare CHAR_DATA ch,
char *  argument
 

Definition at line 3269 of file act_info.c.

References P.

03270 {
03271     char arg1[MAX_INPUT_LENGTH];
03272     char arg2[MAX_INPUT_LENGTH];
03273     OBJ_DATA *obj1;
03274     OBJ_DATA *obj2;
03275     int value1;
03276     int value2;
03277     char *msg;
03278 
03279     argument = one_argument (argument, arg1);
03280     argument = one_argument (argument, arg2);
03281     if (arg1[0] == '\0')
03282     {
03283         send_to_char ("Compare what to what?\n\r", ch);
03284         return;
03285     }
03286 
03287     if ((obj1 = get_obj_carry (ch, arg1, ch)) == NULL)
03288     {
03289         send_to_char ("You do not have that item.\n\r", ch);
03290         return;
03291     }
03292 
03293     if (arg2[0] == '\0')
03294     {
03295         for (obj2 = ch->carrying; obj2 != NULL; obj2 = obj2->next_content)
03296         {
03297             if (obj2->wear_loc != WEAR_NONE && can_see_obj (ch, obj2)
03298                 && obj1->item_type == obj2->item_type
03299                 && (obj1->wear_flags & obj2->wear_flags & ~ITEM_TAKE) != 0)
03300                 break;
03301         }
03302 
03303         if (obj2 == NULL)
03304         {
03305             send_to_char ("You aren't wearing anything comparable.\n\r", ch);
03306             return;
03307         }
03308     }
03309 
03310     else if ((obj2 = get_obj_carry (ch, arg2, ch)) == NULL)
03311     {
03312         send_to_char ("You do not have that item.\n\r", ch);
03313         return;
03314     }
03315 
03316     msg = NULL;
03317     value1 = 0;
03318     value2 = 0;
03319 
03320     if (obj1 == obj2)
03321     {
03322         msg = "You compare $p to itself.  It looks about the same.";
03323     }
03324     else if (obj1->item_type != obj2->item_type)
03325     {
03326         msg = "You can't compare $p and $P.";
03327     }
03328     else
03329     {
03330         switch (obj1->item_type)
03331         {
03332             default:
03333                 msg = "You can't compare $p and $P.";
03334                 break;
03335 
03336             case ITEM_ARMOR:
03337                 value1 = obj1->value[0] + obj1->value[1] + obj1->value[2];
03338                 value2 = obj2->value[0] + obj2->value[1] + obj2->value[2];
03339                 break;
03340 
03341             case ITEM_WEAPON:
03342                 if (obj1->pIndexData->new_format)
03343                     value1 = (1 + obj1->value[2]) * obj1->value[1];
03344                 else
03345                     value1 = obj1->value[1] + obj1->value[2];
03346 
03347                 if (obj2->pIndexData->new_format)
03348                     value2 = (1 + obj2->value[2]) * obj2->value[1];
03349                 else
03350                     value2 = obj2->value[1] + obj2->value[2];
03351                 break;
03352         }
03353     }
03354 
03355     if (msg == NULL)
03356     {
03357         if (value1 == value2)
03358             msg = "$p and $P look about the same.";
03359         else if (value1 > value2)
03360             msg = "$p looks better than $P.";
03361         else
03362             msg = "$p looks worse than $P.";
03363     }
03364 
03365     act (msg, ch, obj1, obj2, TO_CHAR);
03366     return;
03367 }

void do_consider CHAR_DATA ch,
char *  argument
 

Definition at line 3448 of file act_info.c.

03449 {
03450     char arg[MAX_INPUT_LENGTH];
03451     CHAR_DATA *victim;
03452     char *msg;
03453     int diff;
03454 
03455     one_argument (argument, arg);
03456 
03457     if (arg[0] == '\0')
03458     {
03459         send_to_char ("Consider killing whom?\n\r", ch);
03460         return;
03461     }
03462 
03463     if ((victim = get_char_room (ch, arg)) == NULL)
03464     {
03465         send_to_char ("They're not here.\n\r", ch);
03466         return;
03467     }
03468 
03469     if (is_safe (ch, victim))
03470     {
03471         send_to_char ("Don't even think about it.\n\r", ch);
03472         return;
03473     }
03474 
03475     diff = victim->level - ch->level;
03476 
03477     if (diff <= -10)
03478         msg = "You can kill $N naked and weaponless.";
03479     else if (diff <= -5)
03480         msg = "$N is no match for you.";
03481     else if (diff <= -2)
03482         msg = "$N looks like an easy kill.";
03483     else if (diff <= 1)
03484         msg = "The perfect match!";
03485     else if (diff <= 4)
03486         msg = "$N says 'Do you feel lucky, punk?'.";
03487     else if (diff <= 9)
03488         msg = "$N laughs at you mercilessly.";
03489     else
03490         msg = "Death will thank you for your gift.";
03491 
03492     act (msg, ch, NULL, victim, TO_CHAR);
03493     return;
03494 }

void do_count CHAR_DATA ch,
char *  argument
 

Definition at line 3138 of file act_info.c.

03139 {
03140     int count;
03141     DESCRIPTOR_DATA *d;
03142     char buf[MAX_STRING_LENGTH];
03143 
03144     count = 0;
03145 
03146     for (d = descriptor_list; d != NULL; d = d->next)
03147         if (d->connected == CON_PLAYING && can_see (ch, d->character))
03148             count++;
03149 
03150     max_on = UMAX (count, max_on);
03151 
03152     if (max_on == count)
03153         sprintf (buf,
03154                  "There are %d characters on, the most so far today.\n\r",
03155                  count);
03156     else
03157         sprintf (buf,
03158                  "There are %d characters on, the most on today was %d.\n\r",
03159                  count, max_on);
03160 
03161     send_to_char (buf, ch);
03162 }

void do_credits CHAR_DATA ch,
char *  argument
 

Definition at line 3371 of file act_info.c.

03372 {
03373     do_function (ch, &do_help, "diku");
03374     return;
03375 }

void do_description CHAR_DATA ch,
char *  argument
 

Definition at line 3558 of file act_info.c.

03559 {
03560     char buf[MAX_STRING_LENGTH];
03561 
03562     if (argument[0] != '\0')
03563     {
03564         buf[0] = '\0';
03565         smash_tilde (argument);
03566 
03567         if (argument[0] == '-')
03568         {
03569             int len;
03570             bool found = FALSE;
03571 
03572             if (ch->description == NULL || ch->description[0] == '\0')
03573             {
03574                 send_to_char ("No lines left to remove.\n\r", ch);
03575                 return;
03576             }
03577 
03578             strcpy (buf, ch->description);
03579 
03580             for (len = strlen (buf); len > 0; len--)
03581             {
03582                 if (buf[len] == '\r')
03583                 {
03584                     if (!found)
03585                     {            /* back it up */
03586                         if (len > 0)
03587                             len--;
03588                         found = TRUE;
03589                     }
03590                     else
03591                     {            /* found the second one */
03592 
03593                         buf[len + 1] = '\0';
03594                         free_string (ch->description);
03595                         ch->description = str_dup (buf);
03596                         send_to_char ("Your description is:\n\r", ch);
03597                         send_to_char (ch->description ? ch->description :
03598                                       "(None).\n\r", ch);
03599                         return;
03600                     }
03601                 }
03602             }
03603             buf[0] = '\0';
03604             free_string (ch->description);
03605             ch->description = str_dup (buf);
03606             send_to_char ("Description cleared.\n\r", ch);
03607             return;
03608         }
03609         if (argument[0] == '+')
03610         {
03611             if (ch->description != NULL)
03612                 strcat (buf, ch->description);
03613             argument++;
03614             while (isspace (*argument))
03615                 argument++;
03616     }
03617     if (!str_prefix(argument, "++"))
03618     {
03619           string_append( ch, &ch->description );
03620           return;
03621     }
03622 
03623           
03624 
03625         if (strlen (buf) >= 1024)
03626         {
03627             send_to_char ("Description too long.\n\r", ch);
03628             return;
03629         }
03630 
03631         strcat (buf, argument);
03632         strcat (buf, "\n\r");
03633         free_string (ch->description);
03634         ch->description = str_dup (buf);
03635     }
03636 
03637     send_to_char ("Your description is:\n\r", ch);
03638     send_to_char (ch->description ? ch->description : "(None).\n\r", ch);
03639     return;
03640 }

void do_equipment CHAR_DATA ch,
char *  argument
 

Definition at line 3189 of file act_info.c.

03190 {
03191     OBJ_DATA *obj;
03192     int iWear;
03193     bool found;
03194 
03195     send_to_char ("You are using:\n\r", ch);
03196     found = FALSE;
03197     for (iWear = 0; iWear < MAX_WEAR; iWear++)
03198     {
03199         /* horrible hack. Try not to do this, aye? ;) -trib */
03200         if (iWear == 18  && (!IS_NPC (ch) &&
03201                     ch->level < skill_table[gsn_dual_wield].skill_level[ch->class]))
03202              continue;
03203       if ((obj = get_eq_char(ch, iWear))== NULL)
03204       {
03205                      
03206          send_to_char(where_name[iWear], ch);
03207          send_to_char("(nothing)\n\r",ch);
03208          continue;
03209       }
03210 
03211            // continue;
03212 
03213         send_to_char (where_name[iWear], ch);
03214         if (!obj)
03215     {
03216         send_to_char("nothing",ch);
03217     }
03218     if (can_see_obj (ch, obj))
03219         {
03220             send_to_char (format_obj_to_char (obj, ch, TRUE), ch);
03221             send_to_char ("\n\r", ch);
03222         }
03223         else
03224         {
03225             send_to_char ("something.\n\r", ch);
03226         }
03227         found = TRUE;
03228     }
03229 
03230     if (!found)
03231         send_to_char ("Nothing.\n\r", ch);
03232 
03233     return;
03234 }

void do_examine CHAR_DATA ch,
char *  argument
 

Definition at line 1603 of file act_info.c.

References do_function(), do_look(), do_play(), get_obj_here(), ITEM_CONTAINER, ITEM_CORPSE_NPC, ITEM_CORPSE_PC, ITEM_DRINK_CON, ITEM_JUKEBOX, ITEM_MONEY, obj_data::item_type, MAX_INPUT_LENGTH, MAX_STRING_LENGTH, one_argument(), send_to_char(), and obj_data::value.

01604 {
01605     char buf[MAX_STRING_LENGTH];
01606     char arg[MAX_INPUT_LENGTH];
01607     OBJ_DATA *obj;
01608 
01609     one_argument (argument, arg);
01610 
01611     if (arg[0] == '\0')
01612     {
01613         send_to_char ("Examine what?\n\r", ch);
01614         return;
01615     }
01616 
01617     do_function (ch, &do_look, arg);
01618 
01619     if ((obj = get_obj_here (ch, arg)) != NULL)
01620     {
01621         switch (obj->item_type)
01622         {
01623             default:
01624                 break;
01625 
01626             case ITEM_JUKEBOX:
01627                 do_function (ch, &do_play, "list");
01628                 break;
01629 
01630             case ITEM_MONEY:
01631                 if (obj->value[0] == 0)
01632                 {
01633                     if (obj->value[1] == 0)
01634                         sprintf (buf,
01635                                  "Odd...there's no coins in the pile.\n\r");
01636                     else if (obj->value[1] == 1)
01637                         sprintf (buf, "Wow. One gold coin.\n\r");
01638                     else
01639                         sprintf (buf,
01640                                  "There are %d gold coins in the pile.\n\r",
01641                                  obj->value[1]);
01642                 }
01643                 else if (obj->value[1] == 0)
01644                 {
01645                     if (obj->value[0] == 1)
01646                         sprintf (buf, "Wow. One silver coin.\n\r");
01647                     else
01648                         sprintf (buf,
01649                                  "There are %d silver coins in the pile.\n\r",
01650                                  obj->value[0]);
01651                 }
01652                 else
01653                     sprintf (buf,
01654                              "There are %d gold and %d silver coins in the pile.\n\r",
01655                              obj->value[1], obj->value[0]);
01656                 send_to_char (buf, ch);
01657                 break;
01658 
01659             case ITEM_DRINK_CON:
01660             case ITEM_CONTAINER:
01661             case ITEM_CORPSE_NPC:
01662             case ITEM_CORPSE_PC:
01663                 sprintf (buf, "in %s", argument);
01664                 do_function (ch, &do_look, buf);
01665         }
01666     }
01667 
01668     return;
01669 }

Here is the call graph for this function:

void do_exits CHAR_DATA ch,
char *  argument
 

Definition at line 1702 of file act_info.c.

References can_see_room(), capitalize(), check_blind(), dir_name, EX_CLOSED, exit_data::exit_info, FALSE, IS_IMMORTAL, IS_SET, MAX_STRING_LENGTH, room_index_data::name, room_is_dark(), send_to_char(), str_cmp(), exit_data::to_room, TRUE, exit_data::u1, and room_index_data::vnum.

Referenced by do_look().

01703 {
01704     extern char *const dir_name[];
01705     char buf[MAX_STRING_LENGTH];
01706     EXIT_DATA *pexit;
01707     bool found;
01708     bool fAuto;
01709     int door;
01710 
01711     fAuto = !str_cmp (argument, "auto");
01712 
01713     if (!check_blind (ch))
01714         return;
01715 
01716     if (fAuto)
01717         sprintf (buf, "{x[Exits:{W");
01718     else if (IS_IMMORTAL (ch))
01719         sprintf (buf, "Obvious exits from room %d:\n\r", ch->in_room->vnum);
01720     else
01721         sprintf (buf, "Obvious exits:\n\r");
01722 
01723     found = FALSE;
01724     for (door = 0; door <= 9; door++)
01725     {
01726         if ((pexit = ch->in_room->exit[door]) != NULL
01727             && pexit->u1.to_room != NULL
01728             && can_see_room (ch, pexit->u1.to_room)
01729             && !IS_SET (pexit->exit_info, EX_CLOSED))
01730         {
01731             found = TRUE;
01732             if (fAuto)
01733             {
01734                 strcat (buf, " ");
01735                 strcat (buf, dir_name[door]);
01736             }
01737             else
01738             {
01739                 sprintf (buf + strlen (buf), "%-5s - %s",
01740                          capitalize (dir_name[door]),
01741                          room_is_dark (pexit->u1.to_room)
01742                          ? "Too dark to tell" : pexit->u1.to_room->name);
01743                 if (IS_IMMORTAL (ch))
01744                     sprintf (buf + strlen (buf),
01745                              " (room %d)\n\r", pexit->u1.to_room->vnum);
01746                 else
01747                     sprintf (buf + strlen (buf), "\n\r");
01748             }
01749         }
01750     }
01751 
01752     if (!found)
01753         strcat (buf, fAuto ? " none" : "None.\n\r");
01754 
01755     if (fAuto)
01756         strcat (buf, "{x]{x\n\r");
01757 
01758     send_to_char (buf, ch);
01759     return;
01760 }

Here is the call graph for this function:

void do_game_status