Fixes organ bioprinter and the organs. Now less debuggy and less buggy too.

This commit is contained in:
Chinsky
2015-03-12 15:07:20 +03:00
parent 100ffe4966
commit f03759a246
2 changed files with 27 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
//These machines are mostly just here for debugging/spawning. Skeletons of the feature to come. //These machines are mostly just here for debugging/spawning. Skeletons of the feature to come.
/obj/machinery/bioprinter /obj/machinery/bioprinter
name = "bioprinter" name = "organ bioprinter"
desc = "It's a machine that grows replacement organs." desc = "It's a machine that grows replacement organs."
icon = 'icons/obj/surgery.dmi' icon = 'icons/obj/surgery.dmi'
@@ -41,33 +41,45 @@
if(prints_prosthetics) if(prints_prosthetics)
O.robotic = 2 O.robotic = 2
else if(loaded_dna) else if(loaded_dna)
visible_message("The printer would be using the DNA sample if it was coded.") visible_message("<span class='notice'>The printer injects stored DNA in used biomass.</span>.")
//TODO: Copy DNA hash or donor reference over to new organ. var/datum/organ/internal/I = new O.organ_type
I.transplant_data = list()
var/mob/living/carbon/C = loaded_dna["donor"]
I.transplant_data["species"] = C.species.name
I.transplant_data["blood_type"] = loaded_dna["blood_type"]
I.transplant_data["blood_DNA"] = loaded_dna["blood_DNA"]
O.organ_data = I
I.organ_holder = O
visible_message("The bioprinter spits out a new organ.")
visible_message("<span class='info'>The bioprinter spits out a new organ.")
else else
user << "There is not enough matter in the printer." user << "<span class='warning'>There is not enough matter in the printer.</span>"
/obj/machinery/bioprinter/attackby(obj/item/weapon/W, mob/user) /obj/machinery/bioprinter/attackby(obj/item/weapon/W, mob/user)
// DNA sample from syringe. // DNA sample from syringe.
if(!prints_prosthetics && istype(W,/obj/item/weapon/reagent_containers/syringe)) if(!prints_prosthetics && istype(W,/obj/item/weapon/reagent_containers/syringe))
user << "You inject the blood sample into the bioprinter, but it isn't coded yet." var/obj/item/weapon/reagent_containers/syringe/S = W
var/datum/reagent/blood/injected = locate() in S.reagents.reagent_list //Grab some blood
if(injected && injected.data)
loaded_dna = injected.data
user << "<span class='info'>You inject the blood sample into the bioprinter.</span>"
return return
// Meat for biomass. // Meat for biomass.
else if(!prints_prosthetics && istype(W, /obj/item/weapon/reagent_containers/food/snacks/meat)) else if(!prints_prosthetics && istype(W, /obj/item/weapon/reagent_containers/food/snacks/meat))
user << "\blue \The [src] processes \the [W]."
stored_matter += 50 stored_matter += 50
user.drop_item() user.drop_item()
user << "<span class='info'>\The [src] processes \the [W]. Levels of stored biomass now: [stored_matter]</span>"
del(W) del(W)
return return
// Steel for matter. // Steel for matter.
else if(prints_prosthetics && istype(W, /obj/item/stack/sheet/metal)) else if(prints_prosthetics && istype(W, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = W var/obj/item/stack/sheet/metal/M = W
user << "\blue \The [src] processes \the [W]."
stored_matter += M.amount * 10 stored_matter += M.amount * 10
user.drop_item() user.drop_item()
user << "<span class='info'>\The [src] processes \the [W]. Levels of stored matter now: [stored_matter]</span>"
del(W) del(W)
return return
else else

View File

@@ -76,7 +76,7 @@
/obj/item/organ/proc/update() /obj/item/organ/proc/update()
if(!organ_data) if(!organ_data)
organ_data = new /datum/organ/internal() organ_data = new organ_type()
if(robotic) if(robotic)
organ_data.robotic = robotic organ_data.robotic = robotic
@@ -93,6 +93,7 @@
organ_tag = "heart" organ_tag = "heart"
fresh = 6 // Juicy. fresh = 6 // Juicy.
dead_icon = "heart-off" dead_icon = "heart-off"
organ_type = /datum/organ/internal/heart
/obj/item/organ/lungs /obj/item/organ/lungs
name = "lungs" name = "lungs"
@@ -101,6 +102,7 @@
prosthetic_name = "gas exchange system" prosthetic_name = "gas exchange system"
prosthetic_icon = "lungs-prosthetic" prosthetic_icon = "lungs-prosthetic"
organ_tag = "lungs" organ_tag = "lungs"
organ_type = /datum/organ/internal/lungs
/obj/item/organ/kidneys /obj/item/organ/kidneys
name = "kidneys" name = "kidneys"
@@ -109,6 +111,7 @@
prosthetic_name = "prosthetic kidneys" prosthetic_name = "prosthetic kidneys"
prosthetic_icon = "kidneys-prosthetic" prosthetic_icon = "kidneys-prosthetic"
organ_tag = "kidneys" organ_tag = "kidneys"
organ_type = /datum/organ/internal/kidney
/obj/item/organ/eyes /obj/item/organ/eyes
name = "eyeballs" name = "eyeballs"
@@ -117,7 +120,7 @@
prosthetic_name = "visual prosthesis" prosthetic_name = "visual prosthesis"
prosthetic_icon = "eyes-prosthetic" prosthetic_icon = "eyes-prosthetic"
organ_tag = "eyes" organ_tag = "eyes"
organ_type = /datum/organ/internal/eyes
var/eye_colour var/eye_colour
/obj/item/organ/liver /obj/item/organ/liver
@@ -126,11 +129,13 @@
prosthetic_name = "toxin filter" prosthetic_name = "toxin filter"
prosthetic_icon = "liver-prosthetic" prosthetic_icon = "liver-prosthetic"
organ_tag = "liver" organ_tag = "liver"
organ_type = /datum/organ/internal/liver
/obj/item/organ/appendix /obj/item/organ/appendix
name = "appendix" name = "appendix"
icon_state = "appendix" icon_state = "appendix"
organ_tag = "appendix" organ_tag = "appendix"
organ_type = /datum/organ/internal/appendix
//These are here so they can be printed out via the fabricator. //These are here so they can be printed out via the fabricator.
/obj/item/organ/heart/prosthetic /obj/item/organ/heart/prosthetic