Implements Maim / Maiming projectiles. (#3750)

This commit is contained in:
chaoko99
2017-11-25 16:24:16 -08:00
committed by Lohikar
parent 13af7990ee
commit adf21c24e8
9 changed files with 125 additions and 35 deletions

View File

@@ -63,6 +63,8 @@
var/list/genetic_markings // Markings (body_markings) to apply to the icon
var/list/temporary_markings // Same as above, but not preserved when cloning
var/list/cached_markings // The two above lists cached for perf. reasons.
var/maim_bonus = 0.75 //For special projectile gibbing calculation, dubbed "maiming"
var/can_be_maimed = TRUE //Can this limb be 'maimed'?
/obj/item/organ/external/proc/invalidate_marking_cache()
cached_markings = null
@@ -301,22 +303,31 @@
//Check edge eligibility
var/edge_eligible = 0
var/gibs_traditionally = TRUE
if(edge)
if(istype(used_weapon,/obj/item))
var/obj/item/W = used_weapon
if(W.w_class >= w_class)
edge_eligible = 1
if(isprojectile(W)) //Maiming projectiles use a different method to calcualate gibbing.
var/obj/item/projectile/P = used_weapon
if(P.maiming)
gibs_traditionally = FALSE
else
if(W.w_class >= w_class)
edge_eligible = 1
else
edge_eligible = 1
if(edge_eligible && brute >= max_damage / DROPLIMB_THRESHOLD_EDGE && prob(brute))
droplimb(0, DROPLIMB_EDGE)
else if(burn >= max_damage / DROPLIMB_THRESHOLD_DESTROY && prob(burn/3))
droplimb(0, DROPLIMB_BURN)
else if(brute >= max_damage / DROPLIMB_THRESHOLD_DESTROY && prob(brute))
droplimb(0, DROPLIMB_BLUNT)
else if(brute >= max_damage / DROPLIMB_THRESHOLD_TEAROFF && prob(brute/3))
droplimb(0, DROPLIMB_EDGE)
if(gibs_traditionally)
if(edge_eligible && brute >= max_damage / DROPLIMB_THRESHOLD_EDGE && prob(brute))
droplimb(0, DROPLIMB_EDGE)
else if(burn >= max_damage / DROPLIMB_THRESHOLD_DESTROY && prob(burn/3))
droplimb(0, DROPLIMB_BURN)
else if(brute >= max_damage / DROPLIMB_THRESHOLD_DESTROY && prob(brute))
droplimb(0, DROPLIMB_BLUNT)
else if(brute >= max_damage / DROPLIMB_THRESHOLD_TEAROFF && prob(brute/3))
droplimb(0, DROPLIMB_EDGE)
return update_icon()

View File

@@ -2,6 +2,7 @@
name = "limb stump"
icon_name = ""
dislocated = -1
can_be_maimed = FALSE
/obj/item/organ/external/stump/Initialize(mapload, var/internal, var/obj/item/organ/external/limb)
if(istype(limb))

View File

@@ -18,6 +18,7 @@
cannot_amputate = 1
parent_organ = null
encased = "ribcage"
can_be_maimed = FALSE
/obj/item/organ/external/groin
name = "lower body"
@@ -33,6 +34,7 @@
joint = "hip"
dislocated = -1
gendered_icon = 1
maim_bonus = 0.25
/obj/item/organ/external/arm
limb_name = "l_arm"
@@ -91,6 +93,7 @@
joint = "left ankle"
amputation_point = "left ankle"
can_stand = 1
maim_bonus = 1
/obj/item/organ/external/foot/removed()
if(owner) owner.drop_from_inventory(owner.shoes)
@@ -118,6 +121,7 @@
joint = "left wrist"
amputation_point = "left wrist"
can_grasp = 1
maim_bonus = 1
/obj/item/organ/external/hand/removed()
owner.drop_from_inventory(owner.gloves)
@@ -147,6 +151,7 @@
gendered_icon = 1
encased = "skull"
var/can_intake_reagents = 1
maim_bonus = 0.33
/obj/item/organ/external/head/removed()
if(owner)

View File

@@ -6,39 +6,49 @@
/obj/item/organ/external/groin/unbreakable
cannot_break = 1
dislocated = -1
can_be_maimed = FALSE
/obj/item/organ/external/arm/unbreakable
cannot_break = 1
dislocated = -1
can_be_maimed = FALSE
/obj/item/organ/external/arm/right/unbreakable
cannot_break = 1
dislocated = -1
can_be_maimed = FALSE
/obj/item/organ/external/leg/unbreakable
cannot_break = 1
dislocated = -1
can_be_maimed = FALSE
/obj/item/organ/external/leg/right/unbreakable
cannot_break = 1
dislocated = -1
can_be_maimed = FALSE
/obj/item/organ/external/foot/unbreakable
cannot_break = 1
dislocated = -1
can_be_maimed = FALSE
/obj/item/organ/external/foot/right/unbreakable
cannot_break = 1
dislocated = -1
can_be_maimed = FALSE
/obj/item/organ/external/hand/unbreakable
cannot_break = 1
dislocated = -1
can_be_maimed = FALSE
/obj/item/organ/external/hand/right/unbreakable
cannot_break = 1
dislocated = -1
can_be_maimed = FALSE
/obj/item/organ/external/head/unbreakable
cannot_break = 1
dislocated = -1
can_be_maimed = FALSE