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.60 by root, Mon Apr 30 04:43:46 2007 UTC vs.
Revision 1.61 by root, Tue May 1 05:48:20 2007 UTC

1086 return 0; 1086 return 0;
1087 } 1087 }
1088 1088
1089 if (dam < 0) 1089 if (dam < 0)
1090 { 1090 {
1091 LOG (llevError, "hit_player_attacktype called with negative damage %d (hitter %s, target %s)\n", dam, hitter->debug_desc (), op->debug_desc2 ()); 1091 LOG (llevError, "hit_player_attacktype called with negative damage %d (hitter %s, target %s)\n",
1092 dam, hitter->debug_desc (), op->debug_desc ());
1092 return 0; 1093 return 0;
1093 } 1094 }
1094 1095
1095 /* AT_INTERNAL is supposed to do exactly dam. Put a case here so 1096 /* AT_INTERNAL is supposed to do exactly dam. Put a case here so
1096 * people can't mess with that or it otherwise get confused. */ 1097 * people can't mess with that or it otherwise get confused. */
1325 case ATNR_DEATH: 1326 case ATNR_DEATH:
1326 deathstrike_player (op, hitter, &dam); 1327 deathstrike_player (op, hitter, &dam);
1327 break; 1328 break;
1328 1329
1329 case ATNR_CHAOS: 1330 case ATNR_CHAOS:
1330 LOG (llevError, "%s was hit by %s with non-specific chaos.\n", op->debug_desc (), hitter->debug_desc2 ()); 1331 LOG (llevError, "%s was hit by %s with non-specific chaos.\n", op->debug_desc (), hitter->debug_desc ());
1331 dam = 0; 1332 dam = 0;
1332 break; 1333 break;
1333 1334
1334 case ATNR_COUNTERSPELL: 1335 case ATNR_COUNTERSPELL:
1335 LOG (llevError, "%s was hit by %s with counterspell attack.\n", op->debug_desc (), hitter->debug_desc2 ()); 1336 LOG (llevError, "%s was hit by %s with counterspell attack.\n", op->debug_desc (), hitter->debug_desc ());
1336 dam = 0; 1337 dam = 0;
1337 /* This should never happen. Counterspell is handled 1338 /* This should never happen. Counterspell is handled
1338 * seperately and filtered out. If this does happen, 1339 * seperately and filtered out. If this does happen,
1339 * Counterspell has no effect on anything but spells, so it 1340 * Counterspell has no effect on anything but spells, so it
1340 * does no damage. */ 1341 * does no damage. */
1412 char buf[MAX_BUF]; 1413 char buf[MAX_BUF];
1413 const char *skill; 1414 const char *skill;
1414 int maxdam = 0; 1415 int maxdam = 0;
1415 int battleg = 0; /* true if op standing on battleground */ 1416 int battleg = 0; /* true if op standing on battleground */
1416 int pk = 0; /* true if op and what controls hitter are both players */ 1417 int pk = 0; /* true if op and what controls hitter are both players */
1417 object *owner = NULL; 1418 object *owner = 0;
1418 object *skop = NULL; 1419 object *skop = 0;
1419 1420
1420 if (op->stats.hp >= 0) 1421 if (op->stats.hp >= 0)
1421 return -1; 1422 return -1;
1422 1423
1423 if (INVOKE_OBJECT (KILL, op, ARG_OBJECT (hitter))) 1424 if (INVOKE_OBJECT (KILL, op, ARG_OBJECT (hitter)))
1507 */ 1508 */
1508 if (op->type == PLAYER && owner != op && !battleg) 1509 if (op->type == PLAYER && owner != op && !battleg)
1509 owner->change_luck (-settings.pk_luck_penalty); 1510 owner->change_luck (-settings.pk_luck_penalty);
1510 1511
1511 /* This code below deals with finding the appropriate skill 1512 /* This code below deals with finding the appropriate skill
1512 * to credit exp to. This is a bit problematic - we should 1513 * to credit exp to. This is a bit problematic - we should
1513 * probably never really have to look at current_weapon->skill 1514 * probably never really have to look at current_weapon->skill
1514 */ 1515 */
1515 skill = 0; 1516 skill = 0;
1516 1517
1517 if (hitter->skill && hitter->type != PLAYER) 1518 if (hitter->skill && hitter->type != PLAYER)
1518 skill = hitter->skill; 1519 skill = hitter->skill;
1519 else if (owner->chosen_skill) 1520 else if (owner->chosen_skill)
1520 { 1521 {
1521 skill = owner->chosen_skill->skill;
1522 skop = owner->chosen_skill; 1522 skop = owner->chosen_skill;
1523 skill = skop->skill;
1523 } 1524 }
1524 else if (QUERY_FLAG (owner, FLAG_READY_WEAPON)) 1525 else if (QUERY_FLAG (owner, FLAG_READY_WEAPON))
1525 skill = owner->current_weapon->skill; 1526 skill = owner->current_weapon->skill;
1526 else 1527 else
1527 LOG (llevError, "kill_object - unable to find skill that killed monster\n"); 1528 LOG (llevError, "kill_object - unable to find skill that killed monster\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines