00001
00002
00003
00004
00005
00006
00007
00008
00009 #define HUD_PROTO_VERSION "0.8"
00010
00011 static void hud_generalstatus(DESC *, MECH *, char *, char *);
00012 static void hud_weapons(DESC *, MECH *, char *, char *);
00013 static void hud_weaponlist(DESC *, MECH *, char *, char *);
00014 static void hud_limbstatus(DESC *, MECH *, char *, char *);
00015 static void hud_ammostatus(DESC *, MECH *, char *, char *);
00016 static void hud_templateinfo(DESC *, MECH *, char *, char *);
00017 static void hud_templatearmor(DESC *, MECH *, char *, char *);
00018 static void hud_armorstatus(DESC *, MECH *, char *, char *);
00019 static void hud_contacts(DESC *, MECH *, char *, char *);
00020 static void hud_building_contacts(DESC *, MECH *, char *, char *);
00021 static void hud_armorscan(DESC *, MECH *, char *, char *);
00022 static void hud_weapscan(DESC *, MECH *, char *, char *);
00023 static void hud_tactical(DESC *, MECH *, char *, char *);
00024 static void hud_conditions(DESC *, MECH *, char *, char *);
00025
00026 typedef struct hudinfo_command_struct HUDCMD;
00027
00028 #define HUDCMD_HASARG 0x00001
00029 #define HUDCMD_NEEDMECH 0x00002
00030 #define HUDCMD_STARTED 0x00004
00031 #define HUDCMD_NONDEST 0x00008
00032 #define HUDCMD_AWAKE 0x00016
00033
00034 #define HUDCMD_ACTIVE (HUDCMD_NEEDMECH | HUDCMD_STARTED | HUDCMD_NONDEST \
00035 | HUDCMD_AWAKE)
00036
00037 #define HUDCMD_PASSIVE (HUDCMD_NEEDMECH)
00038
00039 #define HUDCMD_INFO (0)
00040
00041 struct hudinfo_command_struct {
00042 char *cmd;
00043 char *msgclass;
00044 int flag;
00045 void (*handler)(DESC *, MECH *, char *, char *);
00046 } hudinfo_cmds[] = {
00047 { "gs", "GS", HUDCMD_PASSIVE, hud_generalstatus },
00048 { "we", "WE", HUDCMD_PASSIVE, hud_weapons },
00049 { "wl", "WL", HUDCMD_INFO, hud_weaponlist },
00050 { "li", "LI", HUDCMD_PASSIVE, hud_limbstatus },
00051 { "am", "AM", HUDCMD_PASSIVE, hud_ammostatus },
00052 { "sgi", "SGI", HUDCMD_PASSIVE, hud_templateinfo },
00053 { "oas", "OAS", HUDCMD_PASSIVE, hud_templatearmor },
00054 { "as", "AS", HUDCMD_PASSIVE, hud_armorstatus },
00055 { "c", "C", HUDCMD_ACTIVE, hud_contacts },
00056 { "cb", "CB", HUDCMD_ACTIVE, hud_building_contacts },
00057 { "asc", "ASC", HUDCMD_ACTIVE | HUDCMD_HASARG, hud_armorscan },
00058 { "wsc", "WSC", HUDCMD_ACTIVE | HUDCMD_HASARG, hud_weapscan },
00059 { "t", "T", HUDCMD_ACTIVE | HUDCMD_HASARG, hud_tactical },
00060 { "con", "CON", HUDCMD_ACTIVE, hud_conditions },
00061 { "co", "CO", HUDCMD_ACTIVE, hud_conditions },
00062 { NULL, NULL, 0, NULL },
00063 };
00064
00065 extern const int num_def_weapons;
00066 extern struct weapon_struct MechWeapons[];