src/hcode/btech/btech.c

Go to the documentation of this file.
00001 
00002 /*
00003  * $Id: btech.c,v 1.1.1.1 2005/01/11 21:18:02 kstevens Exp $
00004  *
00005  * Author: Markus Stenberg <fingon@iki.fi>
00006  *
00007  *  Copyright (c) 1996 Markus Stenberg
00008  *  Copyright (c) 1998-2002 Thomas Wouters
00009  *  Copyright (c) 2000-2002 Cord Awtry
00010  *       All rights reserved
00011  *
00012  * Created: Thu Sep 19 21:59:09 1996 fingon
00013  * Last modified: Tue Aug 12 19:39:55 1997 fingon
00014  *
00015  */
00016 
00017 /*
00018    Local btech alike stuff for MUX.
00019    Work's based on MUSE's btechstats.c
00020  */
00021 
00022 #include "interface.h"
00023 #include "mech.h"
00024 #include "create.h"
00025 #include "btechstats_global.h"
00026 #include "coolmenu.h"
00027 #include "mycool.h"
00028 #include "p.mech.utils.h"
00029 #include "p.glue.scode.h"
00030 
00031 extern HASHTAB playervaluehash;
00032 extern HASHTAB playervaluehash2;
00033 
00034 #define IsHCO(ref) WizP(ref)
00035 
00036 void do_show(dbref player, dbref cause, int key, char *arg1, char *arg2)
00037 {
00038         int i;
00039         enum {
00040                 CHAVA, CHVAL, CHSKI, CHADV, CHATT,
00041                 MECHVALUES
00042         };
00043         char *cmds[] = { "allvalues",
00044                 "values", "skills", "advantages",
00045                 "attributes", "xcodevalues", NULL
00046         };
00047         char *cmds_help[] = { "[char_]allvalues", "[char_]values",
00048                 "[char_]skills", "[char_]advantages", "[char_]attributes",
00049                 "xcodevalues [scode]", NULL
00050         };
00051         char buf[MBUF_SIZE];
00052 
00053         DOCHECK(!IsHCO(player), "You aren't cleared to know this stuff yet!");
00054 
00055         if(!arg1 || !*arg1) {
00056                 strcpy(buf, "Valid arguments:");
00057                 for(i = 0; cmds_help[i]; i++)
00058                         sprintf(buf + strlen(buf), "%c %s", i > 0 ? ',' : ' ',
00059                                         cmds_help[i]);
00060                 notify(player, buf);
00061                 return;
00062         }
00063         i = listmatch(cmds, arg1);
00064         /* Do da cmd */
00065         switch (i) {
00066         case MECHVALUES:
00067                 list_xcodevalues(player);
00068                 return;
00069         case CHAVA:
00070                 list_charvaluestuff(player, -1);
00071                 return;
00072         case CHVAL:
00073                 list_charvaluestuff(player, CHAR_VALUE);
00074                 return;
00075         case CHSKI:
00076                 list_charvaluestuff(player, CHAR_SKILL);
00077                 return;
00078         case CHADV:
00079                 list_charvaluestuff(player, CHAR_ADVANTAGE);
00080                 return;
00081         case CHATT:
00082                 list_charvaluestuff(player, CHAR_ATTRIBUTE);
00083                 return;
00084         }
00085         notify(player, "Invalid arguments to +show command!");
00086         return;
00087 }

Generated on Mon May 28 04:25:20 2007 for BattletechMUX by  doxygen 1.4.7