Changes to how projectiles work: take two!

-Embedding is now a function of armor and projectile base damage.
-Chances to hit varied body parts are modified via miss_modifier. Less likely to hit head, extremities, etc. Distance is more of a factor.
This commit is contained in:
Higgin
2013-11-16 17:45:38 -08:00
parent bad8dbf695
commit 057eaba09e
3 changed files with 33 additions and 13 deletions

View File

@@ -251,15 +251,4 @@ This function restores all organs.
H.drop_item()
W.loc = src
else if(istype(used_weapon,/obj/item/projectile)) //We don't want to use the actual projectile item, so we spawn some shrapnel.
var/obj/item/projectile/P = used_weapon
if(prob(75) && P.embed)
var/obj/item/weapon/shard/shrapnel/S = new()
S.name = "[P.name] shrapnel"
S.desc = "[S.desc] It looks like it was fired from [P.shot_from]."
S.loc = src
organ.implants += S
visible_message("<span class='danger'>The projectile sticks in the wound!</span>")
S.add_blood(src)
return 1

View File

@@ -88,6 +88,18 @@ emp_act
return
//END TASER NERF
var/datum/organ/external/organ = get_organ(check_zone(def_zone))
var/armor = checkarmor(organ, "bullet")
if((P.embed && prob(20 + max(P.damage - armor, -10))) && P.damage_type == BRUTE)
var/obj/item/weapon/shard/shrapnel/SP = new()
(SP.name) = "[P.name] shrapnel"
(SP.desc) = "[SP.desc] It looks like it was fired from [P.shot_from]."
(SP.loc) = organ
organ.implants += SP
visible_message("<span class='danger'>The projectile sticks in the wound!</span>")
SP.add_blood(src)
return (..(P , def_zone))

View File

@@ -50,7 +50,6 @@
var/drowsy = 0
var/agony = 0
var/embed = 0 // whether or not the projectile can embed itself in the mob
proc/on_hit(var/atom/target, var/blocked = 0)
if(blocked >= 2) return 0//Full block
@@ -91,11 +90,31 @@
// close distance, actually RAISE the chance to hit.
var/distance = get_dist(starting,loc)
var/miss_modifier = -30
if(isorgan(def_zone,M)) //modify chances to hit based on the area you're attacking.
if(def_zone == "l_arm")
miss_modifier += 10
if(def_zone == "r_arm")
miss_modifier += 10
if(def_zone == "l_leg")
miss_modifier += 5
if(def_zone == "r_leg")
miss_modifier += 5
if(def_zone == "head")
miss_modifier += 20
if(def_zone == "l_hand")
miss_modifier += 25
if(def_zone == "r_hand")
miss_modifier += 25
if(def_zone == "l_foot")
miss_modifier += 23
if(def_zone == "r_foot")
miss_modifier += 23
if (istype(shot_from,/obj/item/weapon/gun)) //If you aim at someone beforehead, it'll hit more often.
var/obj/item/weapon/gun/daddy = shot_from //Kinda balanced by fact you need like 2 seconds to aim
if (daddy.target && original in daddy.target) //As opposed to no-delay pew pew
miss_modifier += -30
def_zone = get_zone_with_miss_chance(def_zone, M, -30 + 8*distance)
def_zone = get_zone_with_miss_chance(def_zone, M, miss_modifier + 15*distance)
if(!def_zone)
visible_message("\blue \The [src] misses [M] narrowly!")