/** * Dump autoinscriptions */ void dump_autoinscriptions(ang_file *f) { int i; for (i = 1; i < z_info->k_max; i++) { struct object_kind *k = &k_info[i]; char name[120]; const char *note; if (!k->name || !k->tval) continue; note = get_autoinscription(k); if (note) { object_short_name(name, sizeof name, k->name); file_putf(f, "inscribe:%s:%s:%s\n", tval_find_name(k->tval), name, note); } } }
/** * Dump objects */ void dump_objects(ang_file *fff) { int i; file_putf(fff, "# Objects\n"); for (i = 1; i < z_info->k_max; i++) { struct object_kind *kind = &k_info[i]; char name[120] = ""; if (!kind->name || !kind->tval) continue; object_short_name(name, sizeof name, kind->name); file_putf(fff, "object:%s:%s:%d:%d\n", tval_find_name(kind->tval), name, kind_x_attr[i], kind_x_char[i]); } }
/* Dump objects */ void dump_objects(ang_file *fff) { int i; file_putf(fff, "# Objects\n"); for (i = 1; i < z_info->k_max; i++) { object_kind *k_ptr = &k_info[i]; char name[120] = ""; if (!k_ptr->name || !k_ptr->tval) continue; get_pref_name(name, sizeof name, k_ptr->name); file_putf(fff, "K:%s:%s:%d:%d\n", tval_find_name(k_ptr->tval), name, k_ptr->x_attr, k_ptr->x_char); } }
/* Dump objects */ void dump_objects(ang_file * fff) { int i; file_putf(fff, "# Objects\n"); for (i = 1; i < z_info->k_max; i++) { object_kind *k_ptr = &k_info[i]; const char *name = k_ptr->name; if (!name) continue; if (name[0] == '&' && name[1] == ' ') name += 2; file_putf(fff, "K:%s:%s:%d:%d\n", tval_find_name(k_ptr->tval), name, k_ptr->x_attr, k_ptr->x_char); } }
/* * Search the monster, item, and feature types to find the * meaning for the given symbol. * * Note: We currently search items first, then features, then * monsters, and we return the first hit for a symbol. * This is to prevent mimics and lurkers from matching * a symbol instead of the item or feature it is mimicking. * * Todo: concatenate all matches into buf. This will be much * easier once we can loop through item tvals instead of items * (see note below.) * * Todo: Should this take the user's pref files into account? */ static void lookup_symbol(struct keypress sym, char *buf, size_t max) { int i; monster_base *race; /* Look through items */ /* Note: We currently look through all items, and grab the tval when we find a match. It would make more sense to loop through tvals, but then we need to associate a display character with each tval. */ for (i = 1; i < z_info->k_max; i++) { if (k_info[i].d_char == (char)sym.code) { strnfmt(buf, max, "%c - %s.", (char)sym.code, tval_find_name(k_info[i].tval)); return; } } /* Look through features */ /* Note: We need a better way of doing this. Currently '#' matches secret door, and '^' matches trap door (instead of the more generic "trap"). */ for (i = 1; i < z_info->f_max; i++) { if (f_info[i].d_char == (char)sym.code) { strnfmt(buf, max, "%c - %s.", (char)sym.code, f_info[i].name); return; } } /* Look through monster templates */ for (race = rb_info; race; race = race->next){ if ((char)sym.code == race->d_char) { strnfmt(buf, max, "%c - %s.", (char)sym.code, race->text); return; } } /* No matches */ strnfmt(buf, max, "%c - %s.", (char)sym.code, "Unknown Symbol"); return; }