Improves bullet projectile embedding handling

Commit b1546ee3eb contained a rather
bone-headed mistake, that resulted in embedding with penetrating
projectiles to not behave as desired.

This commit fixes that, and provides a cleaner implementation.
This commit is contained in:
mwerezak
2015-02-18 18:09:24 -05:00
parent b1546ee3eb
commit 583390937e
3 changed files with 23 additions and 13 deletions
@@ -38,9 +38,9 @@ emp_act
return -1 // complete projectile permutation
//Shrapnel
if (P.can_embed())
if(P.can_embed())
var/armor = getarmor_organ(organ, "bullet")
if(P.embed && prob(20 + max(P.damage - armor, -10)))
if(prob(20 + max(P.damage - armor, -10)))
var/obj/item/weapon/shard/shrapnel/SP = new()
SP.name = (P.name != "shrapnel")? "[P.name] shrapnel" : "shrapnel"
SP.desc = "[SP.desc] It looks like it was fired from [P.shot_from]."