… | |
… | |
118 | * If type is -1, ew don't match on type. |
118 | * If type is -1, ew don't match on type. |
119 | */ |
119 | */ |
120 | object * |
120 | object * |
121 | get_archetype_by_skill_name (const char *skill, int type) |
121 | get_archetype_by_skill_name (const char *skill, int type) |
122 | { |
122 | { |
123 | archetype * |
123 | archetype *at; |
124 | at; |
|
|
125 | |
124 | |
126 | if (skill == NULL) |
125 | if (skill) |
127 | return NULL; |
|
|
128 | |
|
|
129 | for (at = first_archetype; at != NULL; at = at->next) |
126 | for (at = first_archetype; at; at = at->next) |
130 | { |
|
|
131 | if (((type == -1) || (type == at->clone.type)) && (!strcmp (at->clone.skill, skill))) |
127 | if (((type == -1) || (type == at->clone.type)) && (!strcmp (at->clone.skill, skill))) |
132 | return arch_to_object (at); |
128 | return arch_to_object (at); |
133 | } |
129 | |
134 | return NULL; |
130 | return 0; |
135 | } |
131 | } |
136 | |
132 | |
137 | /* similiar to above - this returns the first archetype |
133 | /* similiar to above - this returns the first archetype |
138 | * that matches both the type and subtype. type and subtype |
134 | * that matches both the type and subtype. type and subtype |
139 | * can be -1 to say ignore, but in this case, the match it does |
135 | * can be -1 to say ignore, but in this case, the match it does |
… | |
… | |
179 | for (i = strlen (tmpname); i > 0; i--) |
175 | for (i = strlen (tmpname); i > 0; i--) |
180 | { |
176 | { |
181 | tmpname[i] = 0; |
177 | tmpname[i] = 0; |
182 | at = find_archetype_by_object_name (tmpname); |
178 | at = find_archetype_by_object_name (tmpname); |
183 | |
179 | |
184 | if (at != NULL) |
180 | if (at) |
185 | return arch_to_object (at); |
181 | return arch_to_object (at); |
186 | } |
182 | } |
187 | |
183 | |
188 | return create_singularity (name); |
184 | return create_singularity (name); |
189 | } |
185 | } |
… | |
… | |
575 | object_thawer |
571 | object_thawer |
576 | thawer (filename); |
572 | thawer (filename); |
577 | |
573 | |
578 | LOG (llevDebug, " loading treasure...\n"); |
574 | LOG (llevDebug, " loading treasure...\n"); |
579 | load_treasures (); |
575 | load_treasures (); |
|
|
576 | LOG (llevDebug, " done\n"); |
580 | LOG (llevDebug, " done\n arch-pass 2...\n"); |
577 | LOG (llevDebug, " arch-pass 2...\n"); |
581 | second_arch_pass (thawer); |
578 | second_arch_pass (thawer); |
582 | LOG (llevDebug, " done\n"); |
579 | LOG (llevDebug, " done\n"); |
583 | #ifdef DEBUG |
580 | #ifdef DEBUG |
584 | check_generators (); |
581 | check_generators (); |
585 | #endif |
582 | #endif |
… | |
… | |
631 | |
628 | |
632 | /* |
629 | /* |
633 | * Finds which archetype matches the given name, and returns a new |
630 | * Finds which archetype matches the given name, and returns a new |
634 | * object containing a copy of the archetype. |
631 | * object containing a copy of the archetype. |
635 | */ |
632 | */ |
636 | |
|
|
637 | object * |
633 | object * |
638 | get_archetype (const char *name) |
634 | get_archetype (const char *name) |
639 | { |
635 | { |
640 | archetype *at = archetype::find (name); |
636 | archetype *at = archetype::find (name); |
641 | |
637 | |