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

Comparing deliantra/server/server/spell_util.C (file contents):
Revision 1.16 by root, Thu Sep 14 23:13:49 2006 UTC vs.
Revision 1.17 by root, Sat Sep 16 22:24:13 2006 UTC

153/* pretty basic function - basically just takes 153/* pretty basic function - basically just takes
154 * an object, sets the x,y, and calls insert_ob_in_map 154 * an object, sets the x,y, and calls insert_ob_in_map
155 */ 155 */
156 156
157void 157void
158spell_effect (object *spob, int x, int y, mapstruct *map, object *originator) 158spell_effect (object *spob, int x, int y, maptile *map, object *originator)
159{ 159{
160 160
161 if (spob->other_arch != NULL) 161 if (spob->other_arch != NULL)
162 { 162 {
163 object *effect = arch_to_object (spob->other_arch); 163 object *effect = arch_to_object (spob->other_arch);
444 * reflect_spell fails.) 444 * reflect_spell fails.)
445 * Caller should be sure it passes us valid map coordinates 445 * Caller should be sure it passes us valid map coordinates
446 * eg, updated for tiled maps. 446 * eg, updated for tiled maps.
447 */ 447 */
448int 448int
449reflwall (mapstruct *m, int x, int y, object *sp_op) 449reflwall (maptile *m, int x, int y, object *sp_op)
450{ 450{
451 object *op; 451 object *op;
452 452
453 if (OUT_OF_REAL_MAP (m, x, y)) 453 if (OUT_OF_REAL_MAP (m, x, y))
454 return 0; 454 return 0;
468 * in. 468 * in.
469 */ 469 */
470int 470int
471cast_create_obj (object *op, object *caster, object *new_op, int dir) 471cast_create_obj (object *op, object *caster, object *new_op, int dir)
472{ 472{
473 mapstruct *m; 473 maptile *m;
474 sint16 sx, sy; 474 sint16 sx, sy;
475 475
476 if (dir && 476 if (dir &&
477 ((get_map_flags (op->map, &m, op->x + freearr_x[dir], op->y + freearr_y[dir], &sx, &sy) & P_OUT_OF_MAP) || 477 ((get_map_flags (op->map, &m, op->x + freearr_x[dir], op->y + freearr_y[dir], &sx, &sy) & P_OUT_OF_MAP) ||
478 OB_TYPE_MOVE_BLOCK (op, GET_MAP_MOVE_BLOCK (m, sx, sy)))) 478 OB_TYPE_MOVE_BLOCK (op, GET_MAP_MOVE_BLOCK (m, sx, sy))))
498 * does not have AT_MAGIC, then counterwalls do not effect the spell. 498 * does not have AT_MAGIC, then counterwalls do not effect the spell.
499 * 499 *
500 */ 500 */
501 501
502int 502int
503ok_to_put_more (mapstruct *m, sint16 x, sint16 y, object *op, int immune_stop) 503ok_to_put_more (maptile *m, sint16 x, sint16 y, object *op, int immune_stop)
504{ 504{
505 object *tmp; 505 object *tmp;
506 int mflags; 506 int mflags;
507 mapstruct *mp; 507 maptile *mp;
508 508
509 mp = m; 509 mp = m;
510 mflags = get_map_flags (m, &mp, x, y, &x, &y); 510 mflags = get_map_flags (m, &mp, x, y, &x, &y);
511 511
512 if (mflags & P_OUT_OF_MAP) 512 if (mflags & P_OUT_OF_MAP)
578int 578int
579fire_arch_from_position (object *op, object *caster, sint16 x, sint16 y, int dir, object *spell) 579fire_arch_from_position (object *op, object *caster, sint16 x, sint16 y, int dir, object *spell)
580{ 580{
581 object *tmp; 581 object *tmp;
582 int mflags; 582 int mflags;
583 mapstruct *m; 583 maptile *m;
584 584
585 if (spell->other_arch == NULL) 585 if (spell->other_arch == NULL)
586 return 0; 586 return 0;
587 587
588 m = op->map; 588 m = op->map;
678 678
679object * 679object *
680find_target_for_friendly_spell (object *op, int dir) 680find_target_for_friendly_spell (object *op, int dir)
681{ 681{
682 object *tmp; 682 object *tmp;
683 mapstruct *m; 683 maptile *m;
684 sint16 x, y; 684 sint16 x, y;
685 int mflags; 685 int mflags;
686 686
687 /* I don't really get this block - if op isn't a player or rune, 687 /* I don't really get this block - if op isn't a player or rune,
688 * we then make the owner of this object the target. 688 * we then make the owner of this object the target.
738 * any, otherwise -1. 738 * any, otherwise -1.
739 * note that exclude can be NULL, in which case all bets are off. 739 * note that exclude can be NULL, in which case all bets are off.
740 */ 740 */
741 741
742int 742int
743spell_find_dir (mapstruct *m, int x, int y, object *exclude) 743spell_find_dir (maptile *m, int x, int y, object *exclude)
744{ 744{
745 int i, max = SIZEOFFREE; 745 int i, max = SIZEOFFREE;
746 sint16 nx, ny; 746 sint16 nx, ny;
747 int owner_type = 0, mflags; 747 int owner_type = 0, mflags;
748 object *tmp; 748 object *tmp;
749 mapstruct *mp; 749 maptile *mp;
750 750
751 if (exclude && exclude->head) 751 if (exclude && exclude->head)
752 exclude = exclude->head; 752 exclude = exclude->head;
753 if (exclude && exclude->type) 753 if (exclude && exclude->type)
754 owner_type = exclude->type; 754 owner_type = exclude->type;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines