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

Comparing deliantra/server/server/attack.C (file contents):
Revision 1.62 by root, Thu May 3 09:39:56 2007 UTC vs.
Revision 1.63 by root, Sat May 12 21:56:34 2007 UTC

744 744
745 /* 745 /*
746 * A little check to make it more difficult to dance forward and back 746 * A little check to make it more difficult to dance forward and back
747 * to avoid ever being hit by monsters. 747 * to avoid ever being hit by monsters.
748 */ 748 */
749 if (!simple_attack && QUERY_FLAG (op, FLAG_MONSTER) && op->speed_left > -(FABS (op->speed)) * 0.3) 749 if (!simple_attack && QUERY_FLAG (op, FLAG_MONSTER) && op->speed_left > abs (op->speed) * -0.3f)
750 { 750 {
751 /* Decrease speed BEFORE calling process_object. Otherwise, an 751 /* Decrease speed BEFORE calling process_object. Otherwise, an
752 * infinite loop occurs, with process_object calling move_monster, 752 * infinite loop occurs, with process_object calling move_monster,
753 * which then gets here again. By decreasing the speed before 753 * which then gets here again. By decreasing the speed before
754 * we call process_object, the 'if' statement above will fail. 754 * we call process_object, the 'if' statement above will fail.
1433 if (QUERY_FLAG (op, FLAG_BLOCKSVIEW)) 1433 if (QUERY_FLAG (op, FLAG_BLOCKSVIEW))
1434 update_all_los (op->map, op->x, op->y); /* makes sure los will be recalculated */ 1434 update_all_los (op->map, op->x, op->y); /* makes sure los will be recalculated */
1435 1435
1436 if (op->type == DOOR) 1436 if (op->type == DOOR)
1437 { 1437 {
1438 op->set_speed (0.1); 1438 op->set_speed (0.1f);
1439 op->speed_left = -0.05; 1439 op->speed_left = -0.05f;
1440 return maxdam; 1440 return maxdam;
1441 } 1441 }
1442 1442
1443 if (QUERY_FLAG (op, FLAG_FRIENDLY) && op->type != PLAYER) 1443 if (QUERY_FLAG (op, FLAG_FRIENDLY) && op->type != PLAYER)
1444 { 1444 {
2059 tmp->stats.Int = MAX (-dam / 7, -10); 2059 tmp->stats.Int = MAX (-dam / 7, -10);
2060 SET_FLAG (tmp, FLAG_APPLIED); 2060 SET_FLAG (tmp, FLAG_APPLIED);
2061 op->update_stats (); 2061 op->update_stats ();
2062 new_draw_info (NDI_UNIQUE, 0, op, "You suddenly feel very ill."); 2062 new_draw_info (NDI_UNIQUE, 0, op, "You suddenly feel very ill.");
2063 } 2063 }
2064
2064 if (hitter->type == PLAYER) 2065 if (hitter->type == PLAYER)
2065 new_draw_info_format (NDI_UNIQUE, 0, hitter, "You poison %s.", &op->name); 2066 new_draw_info_format (NDI_UNIQUE, 0, hitter, "You poison %s.", &op->name);
2066 else if (hitter->owner != NULL && hitter->owner->type == PLAYER) 2067 else if (hitter->owner != NULL && hitter->owner->type == PLAYER)
2067 new_draw_info_format (NDI_UNIQUE, 0, hitter->owner, "Your %s poisons %s.", &hitter->name, &op->name); 2068 new_draw_info_format (NDI_UNIQUE, 0, hitter->owner, "Your %s poisons %s.", &hitter->name, &op->name);
2068 } 2069 }
2070
2069 tmp->speed_left = 0; 2071 tmp->speed_left = 0;
2070 } 2072 }
2071 else 2073 else
2072 tmp->stats.food++; 2074 tmp->stats.food++;
2073} 2075}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines