do_equipment.txt
snippets · 995 B · 2010-03-30
New do_equipment: shows equipment slots that are not worn.
Download « Back to the snippets list
// New do_equipment() function. Shows eq slots not worn.
void do_equipment (CHAR_DATA * ch, char *argument) {
OBJ_DATA *obj;
int iWear;
bool found;
send_to_char ("{wYou are using:{x\n\r", ch);
found = FALSE;
for (iWear = 0; iWear < MAX_WEAR; iWear++) {
if ((obj = get_eq_char (ch, iWear)) == NULL) {
send_to_char("{w", ch);
send_to_char(where_name[iWear], ch);
send_to_char(" ---\r\n", ch);
continue;
}
send_to_char("{Y", ch);
send_to_char (where_name[iWear], ch);
send_to_char("{W", ch);
if (can_see_obj (ch, obj)) {
send_to_char("{W", ch);
send_to_char (format_obj_to_char (obj, ch, TRUE), ch);
send_to_char ("{x\n\r", ch);
}
else {
send_to_char ("{Wsomething.\n\r", ch);
}
found = TRUE;
}
send_to_char("{x", ch);
return;
}