Files
Bubberstation/code/modules/surgery/limb_augmentation.dm
XDTM 43184b87a5 Limb damage rework (#38436)
balance: Limbs no longer need to have full damage to be dismemberable, although more damage means higher dismemberment chance.
balance: Damaging limbs now only counts as 75% for the mob's total health. Bleeding still applies normally.
add: Limbs that reach max damage will now be disabled until they are healed to half health.
add: Disabled limbs work similarly to missing limbs, but they can still be used to wear items or handcuffs.


Fixes #38445


Always felt odd how reaching max damage on a limb had no consequence. Now it does.
Currently i only added effects for disabling arms and legs; "breaking" heads and torsos has no effect as of now.
2018-07-17 20:34:02 +12:00

67 lines
3.1 KiB
Plaintext

/////AUGMENTATION SURGERIES//////
//SURGERY STEPS
/datum/surgery_step/replace
name = "sever muscles"
implements = list(/obj/item/scalpel = 100, TOOL_WIRECUTTER = 55)
time = 32
/datum/surgery_step/replace/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
user.visible_message("[user] begins to sever the muscles on [target]'s [parse_zone(user.zone_selected)].", "<span class ='notice'>You begin to sever the muscles on [target]'s [parse_zone(user.zone_selected)]...</span>")
/datum/surgery_step/replace_limb
name = "replace limb"
implements = list(/obj/item/bodypart = 100, /obj/item/organ_storage = 100)
time = 32
var/obj/item/bodypart/L = null // L because "limb"
/datum/surgery_step/replace_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(istype(tool, /obj/item/organ_storage) && istype(tool.contents[1], /obj/item/bodypart))
tool = tool.contents[1]
var/obj/item/bodypart/aug = tool
if(aug.status != BODYPART_ROBOTIC)
to_chat(user, "<span class='warning'>That's not an augment, silly!</span>")
return -1
if(aug.body_zone != target_zone)
to_chat(user, "<span class='warning'>[tool] isn't the right type for [parse_zone(target_zone)].</span>")
return -1
L = surgery.operated_bodypart
if(L)
user.visible_message("[user] begins to augment [target]'s [parse_zone(user.zone_selected)].", "<span class ='notice'>You begin to augment [target]'s [parse_zone(user.zone_selected)]...</span>")
else
user.visible_message("[user] looks for [target]'s [parse_zone(user.zone_selected)].", "<span class ='notice'>You look for [target]'s [parse_zone(user.zone_selected)]...</span>")
//ACTUAL SURGERIES
/datum/surgery/augmentation
name = "augmentation"
steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/replace, /datum/surgery_step/saw, /datum/surgery_step/replace_limb)
species = list(/mob/living/carbon/human)
possible_locs = list(BODY_ZONE_R_ARM,BODY_ZONE_L_ARM,BODY_ZONE_R_LEG,BODY_ZONE_L_LEG,BODY_ZONE_CHEST,BODY_ZONE_HEAD)
requires_real_bodypart = TRUE
//SURGERY STEP SUCCESSES
/datum/surgery_step/replace_limb/success(mob/user, mob/living/carbon/target, target_zone, obj/item/bodypart/tool, datum/surgery/surgery)
if(L)
if(istype(tool, /obj/item/organ_storage))
tool.icon_state = initial(tool.icon_state)
tool.desc = initial(tool.desc)
tool.cut_overlays()
tool = tool.contents[1]
if(istype(tool) && user.temporarilyRemoveItemFromInventory(tool))
L.drop_limb(TRUE) //The limb is augmented, not directly replaced, so keep the internal organs
tool.attach_limb(target)
user.visible_message("[user] successfully augments [target]'s [parse_zone(target_zone)]!", "<span class='notice'>You successfully augment [target]'s [parse_zone(target_zone)].</span>")
add_logs(user, target, "augmented", addition="by giving him new [parse_zone(target_zone)] INTENT: [uppertext(user.a_intent)]")
else
to_chat(user, "<span class='warning'>[target] has no organic [parse_zone(target_zone)] there!</span>")
return TRUE