115 if (((type == -1) || (type == at->
clone.
type))
141 if (((type == -1) || (type == at->
clone.
type))
166 strncpy(tmpname, name,
MAX_BUF-1);
168 for (i = strlen(tmpname); i > 0; i--) {
201 "%d searches and %d strcmp()'s",
220 if (at->
name == NULL) {
322 new->clone.other_arch = NULL;
323 new->clone.name = NULL;
324 new->clone.name_pl = NULL;
325 new->clone.title = NULL;
326 new->clone.race = NULL;
327 new->clone.slaying = NULL;
328 new->clone.msg = NULL;
334 new->clone.arch =
new;
349 archetype *at, *head = NULL, *last_more = NULL;
361 if (last_more != NULL)
362 last_more->next = at;
365 head = last_more = at;
373 if (last_more != NULL) {
374 last_more->
more = at;
417 char buf[
MAX_BUF], *variable = buf, *argument, *cp;
421 while (fgets(buf,
MAX_BUF, fp) != NULL) {
424 if ((argument = strchr(buf,
' ')) != NULL) {
425 *argument =
'\0', argument++;
426 cp = argument+strlen(argument)-1;
427 while (isspace(*cp)) {
432 if (!strcmp(
"Object", variable)) {
435 LOG(
llevError,
"Fatal: failed to find arch %s in second_arch_pass\n", argument);
438 }
else if (!strcmp(
"other_arch", variable)) {
441 LOG(
llevError,
"Warning: failed to find other_arch %s\n", argument);
445 }
else if (!strcmp(
"randomitems", variable)) {
449 LOG(
llevError,
"Failed to link treasure to arch (%s): %s\n", at->
name, argument);
453 }
else if (!strcmp(
"arch", variable)) {
459 LOG(
llevError,
"Got an arch %s not inside an Object.\n", argument);
478 LOG(
llevError,
"Fatal: %s is generator without content_on_gen but lacks other_arch.\n", at->
name);
483 LOG(
llevError,
"Fatal: %s is generator with content_on_gen but lacks inventory.\n", at->
name);
539 if ((fp = fopen(filename,
"r")) == NULL) {
640 unsigned long hash = 0;
649 for (p = str; i <
MAXSTRING && *p; p++, i++) {
657 return hash%tablesize;
676 at = arch_table[index];
681 if (!strcmp(at->
name, name))
714 if (arch_table[index] == NULL) {
715 arch_table[index] = at;
720 if (index == org_index)
737 object *op, *prev = NULL, *head = NULL;
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
archetype * find_archetype(const char *name)
static void first_arch_pass(FILE *fp)
static void check_spells(void)
void object_copy_with_inv(const object *src_ob, object *dest_ob)
object * create_singularity(const char *name)
void fatal(enum fatal_error err)
treasurelist * find_treasurelist(const char *name)
StringBuffer * stringbuffer_new(void)
void free_string(sstring str)
struct treasureliststruct * randomitems
static archetype * arch_table[ARCHTABLE]
void init_archetypes(void)
static void init_archetable(void)
void check_summoned(void)
static void add_arch(archetype *at)
void dump_all_archetypes(void)
object * create_archetype_by_object_name(const char *name)
struct archt * other_arch
archetype * find_archetype_by_object_type_name(int type, const char *name)
void object_free_drop_inventory(object *ob)
sstring find_string(const char *str)
void clear_archetable(void)
void object_dump(const object *op, StringBuffer *sb)
EXTERN archetype * empty_archetype
static void load_archetypes(void)
object * object_new(void)
object * create_archetype(const char *name)
void dump_arch(archetype *at, StringBuffer *sb)
object * object_insert_in_ob(object *op, object *where)
static void second_arch_pass(FILE *fp)
void free_arch(archetype *at)
archetype * get_archetype_by_skill_name(const char *skill, int type)
void load_treasures(void)
archetype * find_archetype_by_object_name(const char *name)
void object_clear(object *op)
archetype * try_find_archetype(const char *name)
static unsigned long hasharch(const char *str, int tablesize)
void check_generators(void)
#define QUERY_FLAG(xyz, p)
#define CLEAR_FLAG(xyz, p)
#define MSG_TYPE_COMMAND_DEBUG
object * object_create_arch(archetype *at)
void free_all_archs(void)
archetype * get_archetype_by_type_subtype(int type, int subtype)
int load_object(FILE *fp, object *op, int bufstate, int map_flags)
void arch_info(object *op)
sstring add_string(const char *str)
void LOG(LogLevel logLevel, const char *format,...)
void object_free_key_values(object *op)
EXTERN archetype * first_archetype
object * arch_to_object(archetype *at)
#define FLAG_CONTENT_ON_GEN
archetype * get_archetype_struct(void)
char * stringbuffer_finish(StringBuffer *sb)