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.4 by elmex, Wed Feb 22 18:53:56 2006 UTC vs.
Revision 1.9 by root, Fri Mar 31 17:20:10 2006 UTC

1/* 1/*
2 * static char *rcsid_attack_c = 2 * static char *rcsid_attack_c =
3 * "$Id: attack.c,v 1.4 2006/02/22 18:53:56 elmex Exp $"; 3 * "$Id: attack.c,v 1.9 2006/03/31 17:20:10 root Exp $";
4 */ 4 */
5/* 5/*
6 CrossFire, A Multiplayer game for X-windows 6 CrossFire, A Multiplayer game for X-windows
7 7
8 Copyright (C) 2002 Mark Wedel & Crossfire Development Team 8 Copyright (C) 2002 Mark Wedel & Crossfire Development Team
1189 * not much is drained, low rate means a lot is drained. 1189 * not much is drained, low rate means a lot is drained.
1190 */ 1190 */
1191 int rate; 1191 int rate;
1192 1192
1193 if(op->resist[ATNR_DRAIN] >= 0) 1193 if(op->resist[ATNR_DRAIN] >= 0)
1194 rate = 50 + op->resist[ATNR_DRAIN] / 2; 1194 rate = 400 + op->resist[ATNR_DRAIN] * 3;
1195 else if(op->resist[ATNR_DRAIN] < 0) 1195 else
1196 rate = 5000 / (100 - op->resist[ATNR_DRAIN]); 1196 rate = 400 * 100 / (100 - op->resist[ATNR_DRAIN]);
1197 1197
1198 /* full protection has no effect. Nothing else in this
1199 * function needs to get done, so just return. */
1200 if(!rate)
1201 return 0;
1202
1203 if(op->stats.exp <= rate) { 1198 if(op->stats.exp <= rate) {
1204 if(op->type == GOLEM) 1199 if(op->type == GOLEM)
1205 dam = 999; /* Its force is "sucked" away. 8) */ 1200 dam = 999; /* Its force is "sucked" away. 8) */
1206 else 1201 else
1207 /* If we can't drain, lets try to do physical damage */ 1202 /* If we can't drain, lets try to do physical damage */
1653 1648
1654 /* very simple: if our target has no_damage 1 set or is wiz, we can't hurt him */ 1649 /* very simple: if our target has no_damage 1 set or is wiz, we can't hurt him */
1655 if (QUERY_FLAG (op, FLAG_WIZ) || QUERY_FLAG (op, FLAG_NO_DAMAGE)) 1650 if (QUERY_FLAG (op, FLAG_WIZ) || QUERY_FLAG (op, FLAG_NO_DAMAGE))
1656 return 0; 1651 return 0;
1657 1652
1653#ifdef PROHIBIT_PLAYERKILL
1654 if (op->type == PLAYER) {
1655 object *owner = get_owner (hitter);
1656 if (!owner) owner = hitter;
1657 if (owner->type == PLAYER
1658 && (!op_on_battleground (op, 0, 0) || op->contr->peaceful || op->contr->peaceful)
1659 && op != owner) {
1660 return 0;
1661 }
1662 }
1663#endif
1664
1658 op_tag = op->count; 1665 op_tag = op->count;
1659 hitter_tag = hitter->count; 1666 hitter_tag = hitter->count;
1660 1667
1661 if (body_attack) { 1668 if (body_attack) {
1662 /* slow and paralyze must hit the head. But we don't want to just 1669 /* slow and paralyze must hit the head. But we don't want to just

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines