--- deliantra/server/server/spell_attack.C 2006/12/13 03:28:42 1.19 +++ deliantra/server/server/spell_attack.C 2006/12/26 08:55:00 1.24 @@ -29,9 +29,7 @@ #include #include #include -#ifndef __CEXTRACT__ -# include -#endif +#include #include #include @@ -59,7 +57,7 @@ /*LOG (llevDebug, "DEBUG: arch weighs %d and masses %d (%s,level %d)\n", op->weight,weight_move,op->name,op->level); */ } - for (tmp = get_map_ob (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above) + for (tmp = GET_MAP_OB (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above) { int num_sections = 1; @@ -282,7 +280,6 @@ * This function sets up the appropriate owner and skill * pointers. */ - int fire_bolt (object *op, object *caster, int dir, object *spob, object *skill) { @@ -317,13 +314,16 @@ tmp->y = op->y + DIRY (tmp); tmp->map = op->map; - mflags = get_map_flags (tmp->map, &tmp->map, tmp->x, tmp->y, &tmp->x, &tmp->y); + maptile *newmap; + mflags = get_map_flags (tmp->map, &newmap, tmp->x, tmp->y, &tmp->x, &tmp->y); if (mflags & P_OUT_OF_MAP) { tmp->destroy (); return 0; } + tmp->map = newmap; + if (OB_TYPE_MOVE_BLOCK (tmp, GET_MAP_MOVE_BLOCK (tmp->map, tmp->x, tmp->y))) { if (!QUERY_FLAG (tmp, FLAG_REFLECTING)) @@ -538,7 +538,7 @@ if (!(mflags & P_IS_ALIVE)) return; - for (tmp = get_map_ob (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above) + for (tmp = GET_MAP_OB (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above) { if (QUERY_FLAG (tmp, FLAG_ALIVE)) { @@ -555,13 +555,11 @@ } } - /* Basically, we move 'op' one square, and if it hits something, * call check_bullet. * This function is only applicable to bullets, but not to all * fired arches (eg, bolts). */ - void move_bullet (object *op) { @@ -626,9 +624,7 @@ update_turn_face (op); } else - { - check_bullet (op); - } + check_bullet (op); } @@ -680,13 +676,16 @@ tmp->y = op->y + freearr_y[dir]; tmp->map = op->map; - mflags = get_map_flags (tmp->map, &tmp->map, tmp->x, tmp->y, &tmp->x, &tmp->y); + maptile *newmap; + mflags = get_map_flags (tmp->map, &newmap, tmp->x, tmp->y, &tmp->x, &tmp->y); if (mflags & P_OUT_OF_MAP) { tmp->destroy (); return 0; } + tmp->map = newmap; + if (OB_TYPE_MOVE_BLOCK (tmp, GET_MAP_MOVE_BLOCK (tmp->map, tmp->x, tmp->y))) { if (!QUERY_FLAG (tmp, FLAG_REFLECTING)) @@ -701,7 +700,7 @@ tmp->map = op->map; } - if ((tmp = insert_ob_in_map (tmp, tmp->map, op, 0)) != NULL) + if ((tmp = insert_ob_in_map (tmp, tmp->map, op, 0))) check_bullet (tmp); return 1; @@ -748,8 +747,7 @@ if (!op->map) { LOG (llevError, "Tried to move_cone object %s without a map.\n", op->name ? &op->name : "unknown"); - op->speed = 0; - update_ob_speed (op); + op->set_speed (0); return; } @@ -1125,7 +1123,7 @@ if (mflags & P_IS_ALIVE) { - for (target = get_map_ob (mp, x, y); target; target = target->above) + for (target = GET_MAP_OB (mp, x, y); target; target = target->above) { if (QUERY_FLAG (target->head ? target->head : target, FLAG_MONSTER)) { @@ -1202,8 +1200,7 @@ effect->level = spell->stats.dam + SP_level_dam_adjust (caster, spell); /* casting death spells at undead isn't a good thing */ - if QUERY_FLAG - (target, FLAG_UNDEAD) + if (QUERY_FLAG (target, FLAG_UNDEAD)) { if (random_roll (0, 2, op, PREFER_LOW)) { @@ -1400,7 +1397,7 @@ continue; if (mflags & P_IS_ALIVE) { - for (tmp = get_map_ob (m, sx, sy); tmp; tmp = tmp->above) + for (tmp = GET_MAP_OB (m, sx, sy); tmp; tmp = tmp->above) { if (QUERY_FLAG (tmp, FLAG_ALIVE) || tmp->type == PLAYER) break; @@ -1533,7 +1530,7 @@ change_abil (tmp, force); /* Mostly to display any messages */ insert_ob_in_ob (force, tmp); - fix_player (tmp); + tmp->update_stats (); return 1; } @@ -1594,7 +1591,7 @@ if (!(mflags & P_IS_ALIVE)) continue; - for (tmp = get_map_ob (m, nx, ny); tmp; tmp = tmp->above) + for (tmp = GET_MAP_OB (m, nx, ny); tmp; tmp = tmp->above) if (QUERY_FLAG (tmp, FLAG_MONSTER)) break; @@ -2027,7 +2024,7 @@ if (mflags & P_IS_ALIVE && spell->attacktype) { - for (target = get_map_ob (m, x, y); target; target = target->above) + for (target = GET_MAP_OB (m, x, y); target; target = target->above) if (QUERY_FLAG (target, FLAG_MONSTER)) { /* oky doky. got a target monster. Lets make a blinding attack */ @@ -2119,7 +2116,7 @@ if (mflags & P_IS_ALIVE) { /* search this square for a victim */ - for (walk = get_map_ob (m, x, y); walk; walk = walk->above) + for (walk = GET_MAP_OB (m, x, y); walk; walk = walk->above) if (QUERY_FLAG (walk, FLAG_MONSTER) || (walk->type == PLAYER)) { /* found a victim */ object *disease = arch_to_object (spell->other_arch);