… | |
… | |
96 | |
96 | |
97 | if (init_spells_done) |
97 | if (init_spells_done) |
98 | return; |
98 | return; |
99 | LOG (llevDebug, "Checking spells...\n"); |
99 | LOG (llevDebug, "Checking spells...\n"); |
100 | |
100 | |
101 | for (at = first_archetype; at; at = at->next) |
101 | for_all_archetypes (at) |
102 | { |
102 | { |
103 | if (at->clone.type == SPELL) |
103 | if (at->type == SPELL) |
104 | { |
104 | { |
105 | if (at->clone.skill) |
105 | if (at->skill) |
106 | { |
106 | { |
107 | for (i = 1; i < NUM_SKILLS; i++) |
107 | for (i = 1; i < NUM_SKILLS; i++) |
108 | if (!strcmp (skill_names[i], at->clone.skill)) |
108 | if (!strcmp (skill_names[i], at->skill)) |
109 | break; |
109 | break; |
110 | if (i == NUM_SKILLS) |
110 | if (i == NUM_SKILLS) |
111 | { |
111 | { |
112 | LOG (llevError, "Spell %s has improper associated skill %s\n", at->name, at->clone.skill); |
112 | LOG (llevError, "Spell %s has improper associated skill %s\n", at->name, at->skill); |
113 | } |
113 | } |
114 | } |
114 | } |
115 | /* other_arch is already checked for in the loader */ |
115 | /* other_arch is already checked for in the loader */ |
116 | } |
116 | } |
117 | } |
117 | } |
… | |
… | |
136 | void |
136 | void |
137 | dump_spells (void) |
137 | dump_spells (void) |
138 | { |
138 | { |
139 | archetype *at; |
139 | archetype *at; |
140 | |
140 | |
141 | for (at = first_archetype; at; at = at->next) |
141 | for_all_archetypes (at) |
142 | { |
142 | { |
143 | if (at->clone.type == SPELL) |
143 | if (at->type == SPELL) |
144 | { |
144 | { |
145 | fprintf (stderr, "%s:%s:%s:%s:%d\n", &at->clone.name, |
145 | fprintf (stderr, "%s:%s:%s:%s:%d\n", &at->object::name, |
146 | &at->archname, at->clone.other_arch ? &at->clone.other_arch->archname : "<nil>", &at->clone.skill, at->clone.level); |
146 | &at->archname, at->other_arch ? &at->other_arch->archname : "<nil>", &at->skill, at->level); |
147 | } |
147 | } |
148 | } |
148 | } |
149 | } |
149 | } |
150 | |
150 | |
151 | /* pretty basic function - basically just takes |
151 | /* pretty basic function - basically just takes |
… | |
… | |
748 | |
748 | |
749 | /* find a free square nearby |
749 | /* find a free square nearby |
750 | * first we check the closest square for free squares |
750 | * first we check the closest square for free squares |
751 | */ |
751 | */ |
752 | |
752 | |
753 | dir = find_first_free_spot (&at->clone, op->map, op->x, op->y); |
753 | dir = find_first_free_spot (at, op->map, op->x, op->y); |
754 | if (dir != -1) |
754 | if (dir != -1) |
755 | { |
755 | { |
756 | /* This is basically grabbed for generate monster. Fixed 971225 to |
756 | /* This is basically grabbed for generate monster. Fixed 971225 to |
757 | * insert multipart monsters properly |
757 | * insert multipart monsters properly |
758 | */ |
758 | */ |
759 | while (at != NULL) |
759 | while (at != NULL) |
760 | { |
760 | { |
761 | tmp = arch_to_object (at); |
761 | tmp = arch_to_object (at); |
762 | tmp->x = op->x + freearr_x[dir] + at->clone.x; |
762 | tmp->x = op->x + freearr_x[dir] + at->x; |
763 | tmp->y = op->y + freearr_y[dir] + at->clone.y; |
763 | tmp->y = op->y + freearr_y[dir] + at->y; |
764 | tmp->map = op->map; |
764 | tmp->map = op->map; |
765 | if (head) |
765 | if (head) |
766 | { |
766 | { |
767 | tmp->head = head; |
767 | tmp->head = head; |
768 | prev->more = tmp; |
768 | prev->more = tmp; |