… | |
… | |
1453 | /* Oct 95 - altered the following slightly for MULTIPLE_GODS hack |
1453 | /* Oct 95 - altered the following slightly for MULTIPLE_GODS hack |
1454 | * which needs new attacktype AT_HOLYWORD to work . b.t. */ |
1454 | * which needs new attacktype AT_HOLYWORD to work . b.t. */ |
1455 | int |
1455 | int |
1456 | hit_player (object *op, int dam, object *hitter, uint32_t type, int full_hit) |
1456 | hit_player (object *op, int dam, object *hitter, uint32_t type, int full_hit) |
1457 | { |
1457 | { |
|
|
1458 | int magic = type & AT_MAGIC; |
|
|
1459 | int body_attack = op && op->head; /* Did we hit op's head? */ |
1458 | int maxdam = 0, ndam = 0, attacktype = 1, magic = (type & AT_MAGIC); |
1460 | int maxdam = 0, ndam = 0, attacktype = 1; |
1459 | int maxattacktype; |
1461 | int maxattacktype; |
1460 | int body_attack = op && op->head; /* Did we hit op's head? */ |
|
|
1461 | int simple_attack; |
1462 | int simple_attack; |
1462 | int rtn_kill = 0; |
1463 | int rtn_kill = 0; |
1463 | int friendlyfire; |
1464 | int friendlyfire; |
1464 | |
1465 | |
1465 | if (get_attack_mode (&op, &hitter, &simple_attack)) |
1466 | if (get_attack_mode (&op, &hitter, &simple_attack)) |
… | |
… | |
1666 | attack_message (maxdam, maxattacktype, op, hitter); |
1667 | attack_message (maxdam, maxattacktype, op, hitter); |
1667 | |
1668 | |
1668 | op->stats.hp -= maxdam; |
1669 | op->stats.hp -= maxdam; |
1669 | |
1670 | |
1670 | /* Eneq(@csd.uu.se): Check to see if monster runs away. */ |
1671 | /* Eneq(@csd.uu.se): Check to see if monster runs away. */ |
1671 | if ((op->stats.hp >= 0) && |
1672 | if (op->stats.hp >= 0 |
1672 | (QUERY_FLAG (op, FLAG_MONSTER) || op->type == PLAYER) && |
1673 | && (QUERY_FLAG (op, FLAG_MONSTER) || op->type == PLAYER) |
1673 | op->stats.hp < (signed short) (((float) op->run_away / (float) 100) * (float) op->stats.maxhp)) |
1674 | && op->stats.hp < op->run_away * op->stats.maxhp / 100) |
1674 | { |
1675 | { |
1675 | |
1676 | |
1676 | if (QUERY_FLAG (op, FLAG_MONSTER)) |
1677 | if (QUERY_FLAG (op, FLAG_MONSTER)) |
1677 | SET_FLAG (op, FLAG_RUN_AWAY); |
1678 | SET_FLAG (op, FLAG_RUN_AWAY); |
1678 | else |
1679 | else |