mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 11:36:24 +01:00
[Ready for review/merge]Rolls chainsaw surgery into prosthetic replacement, makes synthetic armblades implantable (#23213)
🆑 XDTM tweak: Implanting chainsaws is now a prosthetic replacement instead of its own surgery. add: You can now implant synthetic armblades (from an emagged limb grower) into people's arms to use it at its full potential. del: Chainsaw removal surgery has been removed as well; you'll have to sever the limb and get a new one. /🆑 Reason for adding Makes the surgery code more consistent, without a snowflake surgery for chainsaws. This also gives a legitimate use for synthetic armblades, which were otherwise just a much shittier and harder to get circular saw.
This commit is contained in:
@@ -19,5 +19,10 @@
|
||||
var/mob/living/carbon/human/L = target
|
||||
user.visible_message("[user] severs [L]'s [parse_zone(target_zone)]!", "<span class='notice'>You sever [L]'s [parse_zone(target_zone)].</span>")
|
||||
if(surgery.operated_bodypart)
|
||||
surgery.operated_bodypart.drop_limb()
|
||||
var/obj/item/bodypart/target_limb = surgery.operated_bodypart
|
||||
var/obj/item/held_item = L.get_item_for_held_index(target_limb.held_index)
|
||||
target_limb.drop_limb()
|
||||
if(held_item && held_item.flags & NODROP)
|
||||
qdel(target_limb) // arm is ruined
|
||||
|
||||
return 1
|
||||
@@ -57,69 +57,4 @@
|
||||
add_logs(user, target, "augmented", addition="by giving him new [parse_zone(target_zone)] INTENT: [uppertext(user.a_intent)]")
|
||||
else
|
||||
user << "<span class='warning'>[target] has no organic [parse_zone(target_zone)] there!</span>"
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/datum/surgery/chainsaw
|
||||
name = "chainsaw augmentation"
|
||||
steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders,
|
||||
/datum/surgery_step/incise, /datum/surgery_step/chainsaw)
|
||||
species = list(/mob/living/carbon/human)
|
||||
possible_locs = list("r_arm", "l_arm")
|
||||
requires_organic_bodypart = 0
|
||||
|
||||
|
||||
/datum/surgery_step/chainsaw
|
||||
time = 64
|
||||
name = "insert chainsaw"
|
||||
implements = list(/obj/item/weapon/twohanded/required/chainsaw = 100)
|
||||
|
||||
/datum/surgery_step/chainsaw/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
user.visible_message("[user] begins to install the chainsaw onto [target].", "<span class='notice'>You begin to install the chainsaw onto [target]...</span>")
|
||||
|
||||
/datum/surgery_step/chainsaw/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
if(!target.get_empty_held_indexes())
|
||||
user << "<span class='warning'>You can't fit the chainsaw in while [target]'s hands are full!</span>"
|
||||
return 0
|
||||
else
|
||||
user.visible_message("[user] finishes installing the chainsaw!", "<span class='notice'>You install the chainsaw.</span>")
|
||||
user.unEquip(tool)
|
||||
qdel(tool)
|
||||
var/obj/item/weapon/mounted_chainsaw/sawarms = new(target)
|
||||
target.put_in_hands(sawarms)
|
||||
|
||||
return 1
|
||||
|
||||
/datum/surgery/chainsaw_removal
|
||||
name = "chainsaw removal"
|
||||
steps = list(/datum/surgery_step/chainsaw_removal)
|
||||
species = list(/mob/living/carbon/human)
|
||||
possible_locs = list("r_arm", "l_arm")
|
||||
requires_organic_bodypart = 0
|
||||
|
||||
/datum/surgery/chainsaw_removal/can_start(mob/user, mob/living/carbon/target)
|
||||
if(target.is_holding_item_of_type(/obj/item/weapon/mounted_chainsaw))
|
||||
return 1//can continue surgery
|
||||
else
|
||||
return 0//surgery will never be available
|
||||
|
||||
/datum/surgery_step/chainsaw_removal
|
||||
time = 128
|
||||
name = "saw off chainsaw"
|
||||
implements = list(/obj/item/weapon/circular_saw = 100, /obj/item/weapon/melee/energy/sword/cyborg/saw = 100, /obj/item/weapon/melee/arm_blade = 75, /obj/item/weapon/mounted_chainsaw = 65, /obj/item/weapon/twohanded/fireaxe = 50, /obj/item/weapon/twohanded/required/chainsaw = 50, /obj/item/weapon/hatchet = 35, /obj/item/weapon/kitchen/knife/butcher = 25)
|
||||
|
||||
/datum/surgery_step/chainsaw_removal/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
user.visible_message("[user] begins sawing the chainsaw off of [target]'s arms.", "<span class='notice'>You begin removing [target]'s chainsaw...</span>")
|
||||
|
||||
/datum/surgery_step/chainsaw_removal/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
for(var/obj/item/weapon/mounted_chainsaw/V in target.held_items)
|
||||
target.unEquip(V, 1)
|
||||
user.visible_message("[user] carefully saws [target]'s arm free of the chainsaw.", "<span class='notice'>You remove the chainsaw.</span>")
|
||||
return 1
|
||||
return 1
|
||||
@@ -16,38 +16,58 @@
|
||||
|
||||
/datum/surgery_step/add_prosthetic
|
||||
name = "add prosthetic"
|
||||
implements = list(/obj/item/bodypart = 100)
|
||||
implements = list(/obj/item/bodypart = 100, /obj/item/weapon/twohanded/required/chainsaw = 100, /obj/item/weapon/melee/synthetic_arm_blade = 100)
|
||||
time = 32
|
||||
var/organ_rejection_dam = 0
|
||||
|
||||
/datum/surgery_step/add_prosthetic/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
var/obj/item/bodypart/BP = tool
|
||||
if(ismonkey(target))// monkey patient only accept organic monkey limbs
|
||||
if(BP.status == BODYPART_ROBOTIC || BP.animal_origin != MONKEY_BODYPART)
|
||||
user << "<span class='warning'>[BP] doesn't match the patient's morphology.</span>"
|
||||
return -1
|
||||
if(BP.status != BODYPART_ROBOTIC)
|
||||
organ_rejection_dam = 10
|
||||
if(ishuman(target))
|
||||
if(BP.animal_origin)
|
||||
if(istype(tool, /obj/item/bodypart))
|
||||
var/obj/item/bodypart/BP = tool
|
||||
if(ismonkey(target))// monkey patient only accept organic monkey limbs
|
||||
if(BP.status == BODYPART_ROBOTIC || BP.animal_origin != MONKEY_BODYPART)
|
||||
user << "<span class='warning'>[BP] doesn't match the patient's morphology.</span>"
|
||||
return -1
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(H.dna.species.id != BP.species_id)
|
||||
organ_rejection_dam = 30
|
||||
if(BP.status != BODYPART_ROBOTIC)
|
||||
organ_rejection_dam = 10
|
||||
if(ishuman(target))
|
||||
if(BP.animal_origin)
|
||||
user << "<span class='warning'>[BP] doesn't match the patient's morphology.</span>"
|
||||
return -1
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(H.dna.species.id != BP.species_id)
|
||||
organ_rejection_dam = 30
|
||||
|
||||
if(target_zone == BP.body_zone) //so we can't replace a leg with an arm, or a human arm with a monkey arm.
|
||||
user.visible_message("[user] begins to replace [target]'s [parse_zone(target_zone)].", "<span class ='notice'>You begin to replace [target]'s [parse_zone(target_zone)]...</span>")
|
||||
if(target_zone == BP.body_zone) //so we can't replace a leg with an arm, or a human arm with a monkey arm.
|
||||
user.visible_message("[user] begins to replace [target]'s [parse_zone(target_zone)].", "<span class ='notice'>You begin to replace [target]'s [parse_zone(target_zone)]...</span>")
|
||||
else
|
||||
user << "<span class='warning'>[tool] isn't the right type for [parse_zone(target_zone)].</span>"
|
||||
return -1
|
||||
else if(target_zone == "l_arm" || target_zone == "r_arm")
|
||||
user.visible_message("[user] begins to attach [tool] onto [target].", "<span class='notice'>You begin to attach [tool] onto [target]...</span>")
|
||||
else
|
||||
user << "<span class='warning'>[tool] isn't the right type for [parse_zone(target_zone)].</span>"
|
||||
user << "<span class='warning'>[tool] must be installed onto an arm.</span>"
|
||||
return -1
|
||||
|
||||
/datum/surgery_step/add_prosthetic/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
var/obj/item/bodypart/L = tool
|
||||
user.drop_item()
|
||||
L.attach_limb(target)
|
||||
if(organ_rejection_dam)
|
||||
target.adjustToxLoss(organ_rejection_dam)
|
||||
user.visible_message("[user] successfully replaces [target]'s [parse_zone(target_zone)]!", "<span class='notice'>You succeed in replacing [target]'s [parse_zone(target_zone)].</span>")
|
||||
return 1
|
||||
if(istype(tool, /obj/item/bodypart))
|
||||
var/obj/item/bodypart/L = tool
|
||||
user.drop_item()
|
||||
L.attach_limb(target)
|
||||
if(organ_rejection_dam)
|
||||
target.adjustToxLoss(organ_rejection_dam)
|
||||
user.visible_message("[user] successfully replaces [target]'s [parse_zone(target_zone)]!", "<span class='notice'>You succeed in replacing [target]'s [parse_zone(target_zone)].</span>")
|
||||
return 1
|
||||
else
|
||||
target.regenerate_limb(target_zone)
|
||||
user.visible_message("[user] finishes attaching [tool]!", "<span class='notice'>You attach [tool].</span>")
|
||||
user.unEquip(tool)
|
||||
qdel(tool)
|
||||
if(istype(tool, /obj/item/weapon/twohanded/required/chainsaw))
|
||||
var/obj/item/weapon/mounted_chainsaw/new_arm = new(target)
|
||||
target_zone == "r_arm" ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm)
|
||||
return 1
|
||||
else if(istype(tool, /obj/item/weapon/melee/synthetic_arm_blade))
|
||||
var/obj/item/weapon/melee/arm_blade/new_arm = new(target, silent = TRUE, synthetic = TRUE)
|
||||
target_zone == "r_arm" ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm)
|
||||
return 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user