1 | /* |
1 | /* |
2 | * static char *rcsid_attack_c = |
2 | * static char *rcsid_attack_c = |
3 | * "$Id: attack.c,v 1.14 2006/05/12 11:33:36 root Exp $"; |
3 | * "$Id: attack.c,v 1.15 2006/06/14 07:33:03 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 |
… | |
… | |
1495 | |
1495 | |
1496 | /* If you didn't kill yourself, and your not the wizard */ |
1496 | /* If you didn't kill yourself, and your not the wizard */ |
1497 | if(owner!=op && !QUERY_FLAG(op, FLAG_WAS_WIZ)) { |
1497 | if(owner!=op && !QUERY_FLAG(op, FLAG_WAS_WIZ)) { |
1498 | int exp; |
1498 | int exp; |
1499 | |
1499 | |
1500 | exp = calc_skill_exp(owner,op, skop); |
|
|
1501 | |
|
|
1502 | /* Really don't give much experience for killing other players */ |
1500 | /* Really don't give much experience for killing other players */ |
|
|
1501 | // schmorp: temporary? reduce the amount of exp gained for pking enourmously |
1503 | if (op->type==PLAYER) { |
1502 | if (op->type==PLAYER) { |
1504 | if (battleg) { |
1503 | if (battleg) { |
1505 | new_draw_info(NDI_UNIQUE, 0,owner, "Your foe has fallen!"); |
1504 | new_draw_info(NDI_UNIQUE, 0,owner, "Your foe has fallen!"); |
1506 | new_draw_info(NDI_UNIQUE, 0,owner, "VICTORY!!!"); |
1505 | new_draw_info(NDI_UNIQUE, 0,owner, "VICTORY!!!"); |
1507 | } |
1506 | } |
1508 | else |
1507 | else |
1509 | exp = MIN(5000000, MAX(0, exp/10)); |
1508 | exp = op->stats.exp / 1000; |
1510 | } |
1509 | } |
1511 | |
1510 | else |
1512 | /* Don't know why this is set this way - doesn't make |
1511 | exp = calc_skill_exp(owner, op, skop); |
1513 | * sense to just divide everything by two for no reason. |
|
|
1514 | */ |
|
|
1515 | |
|
|
1516 | if (!settings.simple_exp) |
|
|
1517 | exp=exp/2; |
|
|
1518 | |
1512 | |
1519 | /* if op is standing on "battleground" (arena), no way to gain |
1513 | /* if op is standing on "battleground" (arena), no way to gain |
1520 | * exp by killing him |
1514 | * exp by killing him |
1521 | */ |
1515 | */ |
1522 | if (battleg) exp = 0; |
1516 | if (battleg) exp = 0; |
|
|
1517 | |
|
|
1518 | /* Don't know why this is set this way - doesn't make |
|
|
1519 | * sense to just divide everything by two for no reason. |
|
|
1520 | */ |
|
|
1521 | |
|
|
1522 | if (!settings.simple_exp) |
|
|
1523 | exp=exp/2; |
1523 | |
1524 | |
1524 | if(owner->type!=PLAYER || owner->contr->party==NULL) { |
1525 | if(owner->type!=PLAYER || owner->contr->party==NULL) { |
1525 | change_exp(owner,exp, skill, 0); |
1526 | change_exp(owner,exp, skill, 0); |
1526 | } |
1527 | } |
1527 | else { |
1528 | else { |
… | |
… | |
1600 | if (hitter->head) hitter=hitter->head; |
1601 | if (hitter->head) hitter=hitter->head; |
1601 | |
1602 | |
1602 | friendlyfire = 0; |
1603 | friendlyfire = 0; |
1603 | |
1604 | |
1604 | if(op->type == PLAYER) { |
1605 | if(op->type == PLAYER) { |
|
|
1606 | if (op_on_battleground (hitter, 0, 0)) |
|
|
1607 | return 0; |
1605 | |
1608 | |
1606 | if(hitter->type == PLAYER && hitter->contr->peaceful == 1) |
1609 | if(hitter->type == PLAYER && hitter->contr->peaceful == 1) |
1607 | return 1; |
1610 | return 1; |
1608 | |
1611 | |
1609 | if((owner = get_owner(hitter))!=NULL) { |
1612 | if((owner = get_owner(hitter))!=NULL) { |
… | |
… | |
1764 | } |
1767 | } |
1765 | } |
1768 | } |
1766 | |
1769 | |
1767 | /* if this is friendly fire then do a set % of damage only |
1770 | /* if this is friendly fire then do a set % of damage only |
1768 | * Note - put a check in to make sure this attack is actually |
1771 | * Note - put a check in to make sure this attack is actually |
1769 | * doing damage - otherwise, the +1 in the coe below will make |
1772 | * doing damage - otherwise, the +1 in the code below will make |
1770 | * an attack do damage before when it otherwise didn't |
1773 | * an attack do damage before when it otherwise didn't |
1771 | */ |
1774 | */ |
1772 | friendlyfire = friendly_fire(op, hitter); |
1775 | friendlyfire = friendly_fire(op, hitter); |
1773 | if (friendlyfire && maxdam){ |
1776 | if (friendlyfire && maxdam){ |
1774 | maxdam = ((dam * settings.set_friendly_fire) / 100); |
1777 | maxdam = ((dam * settings.set_friendly_fire) / 100); |