1 | /* |
1 | /* |
2 | * static char *rcsid_spell_effect_c = |
2 | * static char *rcsid_spell_effect_c = |
3 | * "$Id: spell_effect.c,v 1.7 2006/05/07 12:54:36 root Exp $"; |
3 | * "$Id: spell_effect.c,v 1.8 2006/05/12 13:32:35 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | |
6 | |
7 | /* |
7 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
8 | CrossFire, A Multiplayer game for X-windows |
… | |
… | |
689 | if(op->type!=PLAYER) |
689 | if(op->type!=PLAYER) |
690 | return 0; |
690 | return 0; |
691 | |
691 | |
692 | range=spell_ob->range + SP_level_range_adjust(caster, spell_ob); |
692 | range=spell_ob->range + SP_level_range_adjust(caster, spell_ob); |
693 | |
693 | |
694 | for(i= -range;i<range;i++) |
694 | for(i= -range;i<=range;i++) |
695 | for(j= -range;j<range;j++) { |
695 | for(j= -range;j<=range;j++) { |
696 | sx = op->x + i; |
696 | sx = op->x + i; |
697 | sy = op->y + j; |
697 | sy = op->y + j; |
698 | m = op->map; |
698 | m = op->map; |
699 | mflags = get_map_flags(m, &m, sx, sy, &sx, &sy); |
699 | mflags = get_map_flags(m, &m, sx, sy, &sx, &sy); |
700 | |
700 | |
701 | if (mflags & P_OUT_OF_MAP) continue; |
701 | if (mflags & P_OUT_OF_MAP) continue; |
702 | |
702 | |
703 | /* If the space doesn't block, no wall here to remove |
703 | // earth to dust tears down everything that can be teared down |
704 | * Don't care too much what it blocks - this allows for |
|
|
705 | * any sort of earthwall/airwall/waterwall, etc |
|
|
706 | * type effects. |
|
|
707 | */ |
|
|
708 | if (GET_MAP_MOVE_BLOCK(m, sx, sy)) |
|
|
709 | for (tmp = get_map_ob(m, sx, sy); tmp != NULL; tmp = next) |
704 | for (tmp = get_map_ob(m, sx, sy); tmp != NULL; tmp = next) |
710 | { |
705 | { |
711 | next = tmp->above; |
706 | next = tmp->above; |
712 | if (QUERY_FLAG (tmp, FLAG_TEAR_DOWN)) |
707 | if (QUERY_FLAG (tmp, FLAG_TEAR_DOWN)) |
713 | hit_player (tmp, 9998, op, AT_PHYSICAL, 0); |
708 | hit_player (tmp, 9998, op, AT_PHYSICAL, 0); |
714 | } |
709 | } |
715 | } |
710 | } |
716 | return 1; |
711 | return 1; |
717 | } |
712 | } |
718 | |
713 | |
719 | |
714 | |