… | |
… | |
84 | materialtype_t *mt; |
84 | materialtype_t *mt; |
85 | |
85 | |
86 | if (op->materialname == NULL) |
86 | if (op->materialname == NULL) |
87 | { |
87 | { |
88 | for (mt = materialt; mt != NULL && mt->next != NULL; mt = mt->next) |
88 | for (mt = materialt; mt != NULL && mt->next != NULL; mt = mt->next) |
89 | if (op->material & mt->material) |
89 | if (op->materials & mt->material) |
90 | break; |
90 | break; |
91 | } |
91 | } |
92 | else |
92 | else |
93 | mt = name_to_material (op->materialname); |
93 | mt = name_to_material (op->materialname); |
94 | |
94 | |
… | |
… | |
375 | * that weak walls have is_alive set, which prevent objects from |
375 | * that weak walls have is_alive set, which prevent objects from |
376 | * passing over/through them. We don't care what type of movement |
376 | * passing over/through them. We don't care what type of movement |
377 | * the wall blocks - if it blocks any type of movement, can't be |
377 | * the wall blocks - if it blocks any type of movement, can't be |
378 | * destroyed right now. |
378 | * destroyed right now. |
379 | */ |
379 | */ |
380 | else if ((tmp->material || tmp->materialname) && op->stats.dam > 0 && !tmp->move_block) |
380 | else if (tmp->materialname && op->stats.dam > 0 && !tmp->move_block) |
381 | { |
381 | { |
382 | save_throw_object (tmp, type, op); |
382 | save_throw_object (tmp, type, op); |
383 | |
383 | |
384 | if (op->destroyed ()) |
384 | if (op->destroyed ()) |
385 | break; |
385 | break; |
… | |
… | |
1088 | return 0; |
1088 | return 0; |
1089 | } |
1089 | } |
1090 | |
1090 | |
1091 | if (dam < 0) |
1091 | if (dam < 0) |
1092 | { |
1092 | { |
1093 | LOG (llevError, "hit_player_attacktype called with negative damage: %d\n", dam); |
1093 | LOG (llevError, "hit_player_attacktype called with negative damage %d (hitter %s, target %s)\n", dam, hitter->debug_desc (), op->debug_desc2 ()); |
1094 | return 0; |
1094 | return 0; |
1095 | } |
1095 | } |
1096 | |
1096 | |
1097 | /* AT_INTERNAL is supposed to do exactly dam. Put a case here so |
1097 | /* AT_INTERNAL is supposed to do exactly dam. Put a case here so |
1098 | * people can't mess with that or it otherwise get confused. */ |
1098 | * people can't mess with that or it otherwise get confused. */ |
… | |
… | |
1203 | if (tmp->invisible) |
1203 | if (tmp->invisible) |
1204 | continue; |
1204 | continue; |
1205 | if (!QUERY_FLAG (tmp, FLAG_APPLIED) || (tmp->resist[ATNR_ACID] >= 10)) |
1205 | if (!QUERY_FLAG (tmp, FLAG_APPLIED) || (tmp->resist[ATNR_ACID] >= 10)) |
1206 | /* >= 10% acid res. on items will protect these */ |
1206 | /* >= 10% acid res. on items will protect these */ |
1207 | continue; |
1207 | continue; |
1208 | if (!(tmp->material & M_IRON)) |
1208 | if (!(tmp->materials & M_IRON)) |
1209 | continue; |
1209 | continue; |
1210 | if (tmp->magic < -4) /* Let's stop at -5 */ |
1210 | if (tmp->magic < -4) /* Let's stop at -5 */ |
1211 | continue; |
1211 | continue; |
1212 | if (tmp->type == RING |
1212 | if (tmp->type == RING |
1213 | /* removed boots and gloves from exclusion list in PR */ |
1213 | /* removed boots and gloves from exclusion list in PR */ |
… | |
… | |
1602 | if (owner->type != PLAYER || owner->contr->party == NULL) |
1602 | if (owner->type != PLAYER || owner->contr->party == NULL) |
1603 | change_exp (owner, exp, skill, 0); |
1603 | change_exp (owner, exp, skill, 0); |
1604 | else |
1604 | else |
1605 | { |
1605 | { |
1606 | int shares = 0, count = 0; |
1606 | int shares = 0, count = 0; |
1607 | player *pl; |
|
|
1608 | partylist *party = owner->contr->party; |
1607 | partylist *party = owner->contr->party; |
1609 | |
1608 | |
1610 | add_kill_to_party (party, query_name (owner), query_name (op), exp); |
1609 | add_kill_to_party (party, query_name (owner), query_name (op), exp); |
1611 | |
1610 | |
1612 | for_all_players (pl) |
1611 | for_all_players (pl) |
… | |
… | |
1798 | * in case 0>dam>1, we try to "simulate" a float value-effect */ |
1797 | * in case 0>dam>1, we try to "simulate" a float value-effect */ |
1799 | dam = dam * (100 - op->resist[ATNR_MAGIC]); |
1798 | dam = dam * (100 - op->resist[ATNR_MAGIC]); |
1800 | if (dam >= 100) |
1799 | if (dam >= 100) |
1801 | dam /= 100; |
1800 | dam /= 100; |
1802 | else |
1801 | else |
1803 | dam = (dam > (rndm (0, 99))) ? 1 : 0; |
1802 | dam = (dam > rndm (0, 99)) ? 1 : 0; |
1804 | } |
1803 | } |
1805 | |
1804 | |
1806 | /* AT_CHAOS here is a weapon or monster. Spells are handled by hit_map |
1805 | /* AT_CHAOS here is a weapon or monster. Spells are handled by hit_map |
1807 | * If the attacktype still has chaos, shuffle it, then clear the Chaos bit |
1806 | * If the attacktype still has chaos, shuffle it, then clear the Chaos bit |
1808 | */ |
1807 | */ |