ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/spell_effect.C
(Generate patch)

Comparing deliantra/server/server/spell_effect.C (file contents):
Revision 1.56 by root, Mon Jun 4 12:19:09 2007 UTC vs.
Revision 1.57 by root, Mon Jun 4 13:04:01 2007 UTC

104 ncharges = 1; 104 ncharges = 1;
105 105
106 wand->stats.food += ncharges; 106 wand->stats.food += ncharges;
107 new_draw_info_format (NDI_UNIQUE, 0, op, "The %s glows with power.", query_name (wand)); 107 new_draw_info_format (NDI_UNIQUE, 0, op, "The %s glows with power.", query_name (wand));
108 108
109 if (wand->arch && QUERY_FLAG (&wand->arch->clone, FLAG_ANIMATE)) 109 if (wand->arch && QUERY_FLAG (wand->arch, FLAG_ANIMATE))
110 { 110 {
111 SET_FLAG (wand, FLAG_ANIMATE); 111 SET_FLAG (wand, FLAG_ANIMATE);
112 wand->set_speed (wand->arch->clone.speed); 112 wand->set_speed (wand->arch->speed);
113 } 113 }
114 114
115 return 1; 115 return 1;
116} 116}
117 117
224 if (stringarg) 224 if (stringarg)
225 { 225 {
226 at = find_archetype_by_object_type_name (FOOD, stringarg); 226 at = find_archetype_by_object_type_name (FOOD, stringarg);
227 if (at == NULL) 227 if (at == NULL)
228 at = find_archetype_by_object_type_name (DRINK, stringarg); 228 at = find_archetype_by_object_type_name (DRINK, stringarg);
229 if (at == NULL || at->clone.stats.food > food_value) 229 if (at == NULL || at->stats.food > food_value)
230 stringarg = NULL; 230 stringarg = NULL;
231 } 231 }
232 232
233 if (!stringarg) 233 if (!stringarg)
234 { 234 {
240 * We don't use flesh types because the weight values of those need 240 * We don't use flesh types because the weight values of those need
241 * to be altered from the donor. 241 * to be altered from the donor.
242 */ 242 */
243 243
244 /* We assume the food items don't have multiple parts */ 244 /* We assume the food items don't have multiple parts */
245 for (at_tmp = first_archetype; at_tmp != NULL; at_tmp = at_tmp->next) 245 for_all_archetypes (at)
246 { 246 {
247 if (at_tmp->clone.type == FOOD || at_tmp->clone.type == DRINK) 247 if (at_tmp->type == FOOD || at_tmp->type == DRINK)
248 { 248 {
249 /* Basically, if the food value is something that is creatable 249 /* Basically, if the food value is something that is creatable
250 * under the limits of the spell and it is higher than 250 * under the limits of the spell and it is higher than
251 * the item we have now, take it instead. 251 * the item we have now, take it instead.
252 */ 252 */
253 if (at_tmp->clone.stats.food <= food_value && (!at || at_tmp->clone.stats.food > at->clone.stats.food)) 253 if (at_tmp->stats.food <= food_value && (!at || at_tmp->stats.food > at->stats.food))
254 at = at_tmp; 254 at = at_tmp;
255 } 255 }
256 } 256 }
257 } 257 }
258 /* Pretty unlikely (there are some very low food items), but you never 258 /* Pretty unlikely (there are some very low food items), but you never
262 { 262 {
263 new_draw_info (NDI_UNIQUE, 0, op, "You don't have enough experience to create any food."); 263 new_draw_info (NDI_UNIQUE, 0, op, "You don't have enough experience to create any food.");
264 return 0; 264 return 0;
265 } 265 }
266 266
267 food_value /= at->clone.stats.food; 267 food_value /= at->stats.food;
268 new_op = arch_to_object (at); 268 new_op = arch_to_object (at);
269 new_op->nrof = food_value; 269 new_op->nrof = food_value;
270 270
271 new_op->value = 0; 271 new_op->value = 0;
272 if (new_op->nrof < 1) 272 if (new_op->nrof < 1)
716 new_draw_info_format (NDI_UNIQUE, 0, op, "Something destroys your %s", name); 716 new_draw_info_format (NDI_UNIQUE, 0, op, "Something destroys your %s", name);
717 return 0; 717 return 0;
718 } 718 }
719 719
720 /* If this is a spellcasting wall, need to insert the spell object */ 720 /* If this is a spellcasting wall, need to insert the spell object */
721 if (tmp->other_arch && tmp->other_arch->clone.type == SPELL) 721 if (tmp->other_arch && tmp->other_arch->type == SPELL)
722 insert_ob_in_ob (arch_to_object (tmp->other_arch), tmp); 722 insert_ob_in_ob (arch_to_object (tmp->other_arch), tmp);
723 723
724 /* This code causes the wall to extend some distance in 724 /* This code causes the wall to extend some distance in
725 * each direction, or until an obstruction is encountered. 725 * each direction, or until an obstruction is encountered.
726 * posblocked and negblocked help determine how far the 726 * posblocked and negblocked help determine how far the
746 { 746 {
747 object *tmp2 = tmp->clone (); 747 object *tmp2 = tmp->clone ();
748 m->insert (tmp2, x, y, op); 748 m->insert (tmp2, x, y, op);
749 749
750 /* If this is a spellcasting wall, need to insert the spell object */ 750 /* If this is a spellcasting wall, need to insert the spell object */
751 if (tmp2->other_arch && tmp2->other_arch->clone.type == SPELL) 751 if (tmp2->other_arch && tmp2->other_arch->type == SPELL)
752 tmp2->insert (arch_to_object (tmp2->other_arch)); 752 tmp2->insert (arch_to_object (tmp2->other_arch));
753 753
754 } 754 }
755 else 755 else
756 posblocked = 1; 756 posblocked = 1;
763 ((spell_ob->move_block & GET_MAP_MOVE_BLOCK (m, x, y)) != spell_ob->move_block) && !negblocked) 763 ((spell_ob->move_block & GET_MAP_MOVE_BLOCK (m, x, y)) != spell_ob->move_block) && !negblocked)
764 { 764 {
765 object *tmp2 = tmp->clone (); 765 object *tmp2 = tmp->clone ();
766 m->insert (tmp2, x, y, op); 766 m->insert (tmp2, x, y, op);
767 767
768 if (tmp2->other_arch && tmp2->other_arch->clone.type == SPELL) 768 if (tmp2->other_arch && tmp2->other_arch->type == SPELL)
769 tmp2->insert (arch_to_object (tmp2->other_arch)); 769 tmp2->insert (arch_to_object (tmp2->other_arch));
770 } 770 }
771 else 771 else
772 negblocked = 1; 772 negblocked = 1;
773 } 773 }
2022 x = op->x + freearr_x[dir]; 2022 x = op->x + freearr_x[dir];
2023 y = op->y + freearr_y[dir]; 2023 y = op->y + freearr_y[dir];
2024 2024
2025 /* if there's no place to put the golem, abort */ 2025 /* if there's no place to put the golem, abort */
2026 if ((dir == -1) || (get_map_flags (m, &m, x, y, &x, &y) & P_OUT_OF_MAP) || 2026 if ((dir == -1) || (get_map_flags (m, &m, x, y, &x, &y) & P_OUT_OF_MAP) ||
2027 ((spell->other_arch->clone.move_type & GET_MAP_MOVE_BLOCK (m, x, y)) == spell->other_arch->clone.move_type)) 2027 ((spell->other_arch->move_type & GET_MAP_MOVE_BLOCK (m, x, y)) == spell->other_arch->move_type))
2028 { 2028 {
2029 new_draw_info (NDI_UNIQUE, 0, op, "There is something in the way."); 2029 new_draw_info (NDI_UNIQUE, 0, op, "There is something in the way.");
2030 return 0; 2030 return 0;
2031 } 2031 }
2032 2032

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines