… | |
… | |
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. */ |
… | |
… | |
1798 | * in case 0>dam>1, we try to "simulate" a float value-effect */ |
1798 | * in case 0>dam>1, we try to "simulate" a float value-effect */ |
1799 | dam = dam * (100 - op->resist[ATNR_MAGIC]); |
1799 | dam = dam * (100 - op->resist[ATNR_MAGIC]); |
1800 | if (dam >= 100) |
1800 | if (dam >= 100) |
1801 | dam /= 100; |
1801 | dam /= 100; |
1802 | else |
1802 | else |
1803 | dam = (dam > (rndm (0, 99))) ? 1 : 0; |
1803 | dam = (dam > rndm (0, 99)) ? 1 : 0; |
1804 | } |
1804 | } |
1805 | |
1805 | |
1806 | /* AT_CHAOS here is a weapon or monster. Spells are handled by hit_map |
1806 | /* 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 |
1807 | * If the attacktype still has chaos, shuffle it, then clear the Chaos bit |
1808 | */ |
1808 | */ |