… | |
… | |
780 | * for help. */ |
780 | * for help. */ |
781 | if (op->type != PLAYER && !can_see_enemy (op, hitter) && !op->owner && rndm (0, op->stats.Int)) |
781 | if (op->type != PLAYER && !can_see_enemy (op, hitter) && !op->owner && rndm (0, op->stats.Int)) |
782 | npc_call_help (op); |
782 | npc_call_help (op); |
783 | |
783 | |
784 | /* if you were hidden and hit by a creature, you are discovered */ |
784 | /* if you were hidden and hit by a creature, you are discovered */ |
785 | if (op->hide && QUERY_FLAG (hitter, FLAG_ALIVE)) |
785 | if (op->flag [FLAG_HIDDEN] && hitter->flag [FLAG_ALIVE]) |
786 | { |
786 | { |
787 | make_visible (op); |
787 | make_visible (op); |
788 | |
788 | |
789 | if (op->type == PLAYER) |
789 | if (op->type == PLAYER) |
790 | new_draw_info (NDI_UNIQUE, 0, op, "You were hit by a wild attack. " "You are no longer hidden!"); |
790 | new_draw_info (NDI_UNIQUE, 0, op, "You were hit by a wild attack. " "You are no longer hidden!"); |
… | |
… | |
1488 | else if (owner->chosen_skill) |
1488 | else if (owner->chosen_skill) |
1489 | { |
1489 | { |
1490 | skop = owner->chosen_skill; |
1490 | skop = owner->chosen_skill; |
1491 | skill = skop->skill; |
1491 | skill = skop->skill; |
1492 | } |
1492 | } |
1493 | else if (QUERY_FLAG (owner, FLAG_READY_WEAPON)) |
1493 | else if (QUERY_FLAG (owner, FLAG_READY_WEAPON) && owner->current_weapon) |
1494 | skill = owner->current_weapon->skill; |
1494 | skill = owner->current_weapon->skill; |
1495 | else |
1495 | else |
1496 | { |
1496 | { |
1497 | LOG (llevError, "kill_object - unable to find skill that killed monster\n"); |
1497 | LOG (llevError, "BUG: kill_object - unable to find skill that killed monster\n" |
|
|
1498 | "op: %s\n" "hitter: %s\n" "owner: %s\n", |
|
|
1499 | owner->debug_desc (), hitter->debug_desc (), op->debug_desc ()); |
1498 | skill = 0; |
1500 | skill = 0; |
1499 | } |
1501 | } |
1500 | |
1502 | |
1501 | /* We have the skill we want to credit to - now find the object this goes |
1503 | /* We have the skill we want to credit to - now find the object this goes |
1502 | * to. Make sure skop is an actual skill, and not a skill tool! |
1504 | * to. Make sure skop is an actual skill, and not a skill tool! |
… | |
… | |
2264 | { |
2266 | { |
2265 | /* target is unseen */ |
2267 | /* target is unseen */ |
2266 | if (target->invisible || QUERY_FLAG (attacker, FLAG_BLIND)) |
2268 | if (target->invisible || QUERY_FLAG (attacker, FLAG_BLIND)) |
2267 | adjust -= 10; |
2269 | adjust -= 10; |
2268 | /* dark map penalty for the hitter (lacks infravision if we got here). */ |
2270 | /* dark map penalty for the hitter (lacks infravision if we got here). */ |
2269 | else if (target->map && target->map->darkness > 0 && !stand_in_light (target)) |
2271 | else if (target->map && target->map->darklevel () > 0 && !stand_in_light (target)) |
2270 | adjust -= target->map->darkness; |
2272 | adjust -= target->map->darklevel (); |
2271 | } |
2273 | } |
2272 | |
2274 | |
2273 | if (QUERY_FLAG (attacker, FLAG_SCARED)) |
2275 | if (QUERY_FLAG (attacker, FLAG_SCARED)) |
2274 | adjust -= 3; |
2276 | adjust -= 3; |
2275 | |
2277 | |