Makes dismemberment more adjustable (#17587)

* Makes dismemberment more adjustable

Makes dismemberment more adjustable
Items now return chance for dismemberment
Bodyparts now decide if they are dismemberable or not by the specific
item
Items now decide what sound to play on dismemberment
No balance changes here

* Owner into H

Owner into H
This commit is contained in:
Razharas
2016-05-13 20:27:06 +02:00
committed by phil235
parent 65fb5163bd
commit b46de70537
4 changed files with 23 additions and 21 deletions
@@ -1035,20 +1035,10 @@
return 0 //item force is zero
//dismemberment
if(affecting.get_damage() >= (affecting.max_damage - I.armour_penetration/2))
if(I.can_dismember() && prob(I.force*(I.w_class-1)))
if(affecting.dismember(I.damtype))
I.add_blood(H)
switch(I.damtype)
if(BURN)
playsound(get_turf(H), 'sound/weapons/sear.ogg', 80, 1)
else
playsound(get_turf(H), pick('sound/misc/desceration-01.ogg', 'sound/misc/desceration-02.ogg', 'sound/misc/desceration-03.ogg'), 80, 1)
affecting.add_blood(H)
var/turf/location = H.loc
if(istype(location))
location.add_blood(H)
return
if(prob(I.get_dismemberment_chance(affecting)))
if(affecting.dismember(I.damtype))
I.add_blood(H)
playsound(get_turf(H), I.get_dismember_sound(), 80, 1)
var/bloody = 0
if(((I.damtype == BRUTE) && I.force && prob(25 + (I.force * 2))))
@@ -1,4 +1,6 @@
/obj/item/bodypart/proc/can_dismember(obj/item/I)
. = (get_damage() >= (max_damage - I.armour_penetration/2))
//Dismember a limb
/obj/item/bodypart/proc/dismember(dam_type = BRUTE)
@@ -15,6 +17,10 @@
if(dam_type == BURN)
burn()
return 1
add_blood(H)
var/turf/location = H.loc
if(istype(location))
location.add_blood(H)
var/direction = pick(cardinal)
var/t_range = rand(2,max(throw_range/2, 2))
var/turf/target_turf = get_turf(src)