Skip to content

Commit

Permalink
Update lc13_machinery.dm
Browse files Browse the repository at this point in the history
  • Loading branch information
InsightfulParasite committed Jan 24, 2024
1 parent a2da73e commit d92e38a
Showing 1 changed file with 24 additions and 31 deletions.
55 changes: 24 additions & 31 deletions ModularTegustation/lc13_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@
var/prosthetic_cost = 300
var/organic_cost = 1200
var/obj/item/organ/brain/slotted_brain
var/obj/item/bodypart/head/slotted_head

/obj/machinery/body_fabricator/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/holochip))
Expand All @@ -266,20 +265,16 @@
AdjustMoney(ahn_amount)
return

if(!slotted_head || !slotted_brain)
if(!slotted_brain)
if(istype(I, /obj/item/bodypart/head))
var/obj/item/bodypart/head/heed = I
if(heed.brain)
SlottedHead(heed)

if(istype(I, /obj/item/mmi))
var/obj/item/mmi/case = I
if(case.brainmob)
SlottedBrain(case.brainmob)

return
if(istype(I, /obj/item/organ/brain))
var/obj/item/organ/brain/B = I
SlottedBrain(B)
return
..()

/obj/machinery/body_fabricator/ui_interact(mob/user)
Expand All @@ -288,17 +283,15 @@
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
var/dat
dat += "<b>FABRICATION_FUNDS: [stored_money]</b><br>----------------------<br>"
if(slotted_head || slotted_brain)
if(slotted_brain)
if(slotted_brain)
dat += "BRAIN DETECTED|<br>--<br>"
if(slotted_head)
dat += "HEAD DETECTED|<br>--<br>"
dat += " <A href='byond://?src=[REF(src)];PRINT_PROSTHETIC=[REF(src)]'>PRINT PROSTHETIC TORSO: [prosthetic_cost] AHN:</A><br>"
dat += " Areas of the body have been replaced with scrap prosthetics. Clients have claimed to suffer a small attribute decrease.<br>"
dat += " <A href='byond://?src=[REF(src)];PRINT_ORGANIC=[REF(src)]'>PRINT ORGANIC TORSO: [organic_cost] AHN</A><br>"
dat += " Through undisclosed means we will print you a new torso with no attribute decay.<br>"
else
dat += "<b>NO HEAD OR BRAIN DETECTED|</b><br>--<br>"
dat += "<b>NO BRAIN DETECTED|</b><br>--<br>"
var/datum/browser/popup = new(user, "body_fab", "body fabricator", 500, 550)
popup.set_content(dat)
popup.open()
Expand Down Expand Up @@ -343,12 +336,14 @@
return TRUE

/obj/machinery/body_fabricator/proc/SlottedHead(obj/item/bodypart/head/H)
if(slotted_head)
if(slotted_brain)
return FALSE
slotted_head = H
H.forceMove(src)
if(H.brain)
slotted_brain = H.brain
if(!H.brain)
return FALSE
slotted_brain = H.brain
H.drop_organs()
qdel(H)
slotted_brain.forceMove(src)
return TRUE

/*
Expand All @@ -366,23 +361,20 @@
//DNA TRANSFER GO!!!
if(slotted_brain)
var/mob/living/brain/B = locate(/mob/living/brain) in slotted_brain
if(slotted_head)
B = slotted_head.brainmob
var/datum/dna/gibbed_dna = B.stored_dna
if(gibbed_dna)
H.real_name = gibbed_dna.real_name
gibbed_dna.transfer_identity(H)

//LIMB ATTACHMENT
if(!H.get_bodypart(BODY_ZONE_HEAD))
if(slotted_head)
slotted_head.attach_limb(H)
else
slotted_head = new /obj/item/bodypart/head(src)

//BRAIN INSERTION
if(slotted_brain)
slotted_brain.Insert(H)

//REVIVE
H.revive(full_heal = FALSE, admin_revive = FALSE)
H.emote("gasp")
H.Jitter(100)

//YOU DIDNT PAY FOR PREMIUM SO WE ARE MAKING YOUR BODY WORSE
if(biotype == 2)
RoboticizeBody(H)
Expand All @@ -391,24 +383,25 @@
DumpBody(H)

/obj/machinery/body_fabricator/proc/RoboticizeBody(mob/living/carbon/human/H)
var/obj/item/bodypart/head/robot/robohead = new /obj/item/bodypart/head/robot(src)
var/old_head = H.get_bodypart(BODY_ZONE_HEAD)
robohead.replace_limb(H)
qdel(old_head)

var/obj/item/bodypart/chest/robot/robobody = new /obj/item/bodypart/chest/robot(src)
if(!slotted_head)
var/obj/item/bodypart/head/robot/robohead = new /obj/item/bodypart/head/robot(src)
robohead.attach_limb(H)
var/refuse = H.get_bodypart(BODY_ZONE_CHEST)
robobody.replace_limb(H)
qdel(refuse)

/obj/machinery/body_fabricator/proc/RemoveAllLimbs(mob/living/carbon/human/H)
var/static/list/zones = list(BODY_ZONE_HEAD, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)
var/static/list/zones = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)
for(var/zone in zones)
var/obj/item/bodypart/BP = H.get_bodypart(zone)
if(BP)
BP.drop_limb()
qdel(BP)

/obj/machinery/body_fabricator/proc/DumpBody(mob/living/carbon/human/dude)
slotted_head = null
slotted_brain = null
ANIMATE_FABRICATOR_ACTIVE
playsound(get_turf(src), 'sound/effects/cashregister.ogg', 35, 3, 3)
Expand Down

0 comments on commit d92e38a

Please sign in to comment.