Merge pull request #13801 from SandPoot/master
Makes limb grower better
This commit is contained in:
@@ -24,19 +24,24 @@
|
||||
var/selected_category
|
||||
var/screen = 1
|
||||
var/list/categories = list(
|
||||
"human",
|
||||
"lizard",
|
||||
"fly",
|
||||
"insect",
|
||||
"plasmaman",
|
||||
"mammal",
|
||||
"xeno",
|
||||
"other"
|
||||
"human" = /datum/species/human,
|
||||
"lizard" = /datum/species/lizard,
|
||||
"mammal" = /datum/species/mammal,
|
||||
"insect" = /datum/species/insect,
|
||||
"fly" = /datum/species/fly,
|
||||
"plasmaman" = /datum/species/plasmaman,
|
||||
"xeno" = /datum/species/xeno,
|
||||
"other" = /datum/species,
|
||||
)
|
||||
var/list/stored_species = list()
|
||||
var/obj/item/disk/data/dna_disk
|
||||
|
||||
/obj/machinery/limbgrower/Initialize()
|
||||
create_reagents(100, OPENCONTAINER)
|
||||
stored_research = new /datum/techweb/specialized/autounlocking/limbgrower
|
||||
for(var/i in categories)
|
||||
var/species = categories[i]
|
||||
stored_species[i] = new species()
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/limbgrower/ui_interact(mob/user)
|
||||
@@ -64,8 +69,8 @@
|
||||
..()
|
||||
|
||||
/obj/machinery/limbgrower/attackby(obj/item/O, mob/user, params)
|
||||
if (busy)
|
||||
to_chat(user, "<span class=\"alert\">The Limb Grower is busy. Please wait for completion of previous operation.</span>")
|
||||
if(busy)
|
||||
to_chat(user, "<span class=\"alert\">\The [src] is busy. Please wait for completion of previous operation.</span>")
|
||||
return
|
||||
|
||||
if(default_deconstruction_screwdriver(user, "limbgrower_panelopen", "limbgrower_idleoff", O))
|
||||
@@ -78,6 +83,16 @@
|
||||
if(user.a_intent == INTENT_HARM) //so we can hit the machine
|
||||
return ..()
|
||||
|
||||
if(istype(O, /obj/item/disk))
|
||||
if(dna_disk)
|
||||
to_chat(user, "<span class='warning'>\The [src] already has a dna disk, take it out first!</span>")
|
||||
return
|
||||
else
|
||||
O.forceMove(src)
|
||||
dna_disk = O
|
||||
to_chat(user, "<span class='notice'>You insert \the [O] into \the [src].</span>")
|
||||
return
|
||||
|
||||
/obj/machinery/limbgrower/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
@@ -110,8 +125,24 @@
|
||||
icon_state = "limbgrower_idleon"
|
||||
addtimer(CALLBACK(src, .proc/build_item),32*prod_coeff)
|
||||
|
||||
if(href_list["dna_disk"])
|
||||
var/mob/living/carbon/user = usr
|
||||
if(istype(user))
|
||||
if(!dna_disk)
|
||||
var/obj/item/disk/diskette = user.get_active_held_item()
|
||||
if(istype(diskette))
|
||||
diskette.forceMove(src)
|
||||
dna_disk = diskette
|
||||
to_chat(user, "<span class='notice'>You insert \the [diskette] into \the [src].</span>")
|
||||
else
|
||||
dna_disk.forceMove(src.loc)
|
||||
user.put_in_active_hand(dna_disk)
|
||||
to_chat(user, "<span class='notice'>You remove \the [dna_disk] from \the [src].</span>")
|
||||
dna_disk = null
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You are unable to grasp \the [dna_disk] disk from \the [src].</span>")
|
||||
else
|
||||
to_chat(usr, "<span class=\"alert\">The limb grower is busy. Please wait for completion of previous operation.</span>")
|
||||
to_chat(usr, "<span class=\"alert\">\The [src] is busy. Please wait for completion of previous operation.</span>")
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
@@ -120,8 +151,10 @@
|
||||
if(reagents.has_reagent(/datum/reagent/medicine/synthflesh, being_built.reagents_list[/datum/reagent/medicine/synthflesh]*prod_coeff)) //sanity check, if this happens we are in big trouble
|
||||
reagents.remove_reagent(/datum/reagent/medicine/synthflesh, being_built.reagents_list[/datum/reagent/medicine/synthflesh]*prod_coeff)
|
||||
var/buildpath = being_built.build_path
|
||||
if(ispath(buildpath, /obj/item/bodypart)) //This feels like spatgheti code, but i need to initilise a limb somehow
|
||||
if(ispath(buildpath, /obj/item/bodypart)) //This feels like spaghetti code, but i need to initiliaze a limb somehow
|
||||
build_limb(buildpath)
|
||||
else if(ispath(buildpath, /obj/item/organ/genital)) //genitals are uhh... customizable
|
||||
build_genital(buildpath)
|
||||
else
|
||||
//Just build whatever it is
|
||||
new buildpath(loc)
|
||||
@@ -135,19 +168,65 @@
|
||||
/obj/machinery/limbgrower/proc/build_limb(buildpath)
|
||||
//i need to create a body part manually using a set icon (otherwise it doesnt appear)
|
||||
var/obj/item/bodypart/limb
|
||||
var/datum/species/selected = stored_species[selected_category]
|
||||
limb = new buildpath(loc)
|
||||
if(selected_category=="human" || selected_category=="lizard") //Species with greyscale parts should be included here
|
||||
limb.icon = 'icons/mob/human_parts_greyscale.dmi'
|
||||
limb.base_bp_icon = DEFAULT_BODYPART_ICON_ORGANIC
|
||||
limb.color_src = MUTCOLORS
|
||||
else
|
||||
limb.icon = 'icons/mob/human_parts.dmi'
|
||||
// Set this limb up using the specias name and body zone
|
||||
limb.icon_state = "[selected_category]_[limb.body_zone]"
|
||||
limb.name = "\improper synthetic [selected_category] [parse_zone(limb.body_zone)]"
|
||||
limb.desc = "A synthetic [selected_category] limb that will morph on its first use in surgery. This one is for the [parse_zone(limb.body_zone)]."
|
||||
limb.species_id = selected_category
|
||||
limb.base_bp_icon = selected.icon_limbs || DEFAULT_BODYPART_ICON_ORGANIC
|
||||
limb.species_id = selected.limbs_id
|
||||
limb.color_src = (MUTCOLORS in selected.species_traits ? MUTCOLORS : (selected.use_skintones ? SKINTONE : FALSE))
|
||||
limb.should_draw_gender = (selected.sexes && (limb.body_zone in list(BODY_ZONE_HEAD, BODY_ZONE_CHEST)))
|
||||
limb.update_limb(TRUE)
|
||||
limb.update_icon_dropped()
|
||||
limb.name = "\improper synthetic [lowertext(selected.name)] [limb.name]"
|
||||
limb.desc = "A synthetic [selected_category] limb that will morph on its first use in surgery. This one is for the [parse_zone(limb.body_zone)]."
|
||||
for(var/obj/item/bodypart/BP in limb)
|
||||
BP.base_bp_icon = selected.icon_limbs || DEFAULT_BODYPART_ICON_ORGANIC
|
||||
BP.species_id = selected.limbs_id
|
||||
BP.color_src = (MUTCOLORS in selected.species_traits ? MUTCOLORS : (selected.use_skintones ? SKINTONE : FALSE))
|
||||
BP.should_draw_gender = (selected.sexes && (limb.body_zone in list(BODY_ZONE_HEAD, BODY_ZONE_CHEST)))
|
||||
BP.update_limb(TRUE)
|
||||
BP.update_icon_dropped()
|
||||
BP.name = "\improper synthetic [lowertext(selected.name)] [limb.name]"
|
||||
BP.desc = "A synthetic [selected_category] limb that will morph on its first use in surgery. This one is for the [parse_zone(limb.body_zone)]."
|
||||
|
||||
/obj/machinery/limbgrower/proc/build_genital(buildpath)
|
||||
//i needed to create a way to customize gene tools using dna
|
||||
var/list/features = dna_disk?.fields["features"]
|
||||
if(length(features))
|
||||
switch(buildpath)
|
||||
if(/obj/item/organ/genital/penis)
|
||||
var/obj/item/organ/genital/penis/penis = new(loc)
|
||||
if(features["has_cock"])
|
||||
penis.shape = features["cock_shape"]
|
||||
penis.length = features["cock_shape"]
|
||||
penis.diameter_ratio = features["cock_diameter_ratio"]
|
||||
penis.color = sanitize_hexcolor(features["cock_color"], 6)
|
||||
penis.update_icon()
|
||||
if(/obj/item/organ/genital/testicles)
|
||||
var/obj/item/organ/genital/testicles/balls = new(loc)
|
||||
if(features["has_balls"])
|
||||
balls.color = sanitize_hexcolor(features["balls_color"], 6)
|
||||
balls.shape = features["balls_shape"]
|
||||
balls.size = features["balls_size"]
|
||||
balls.fluid_rate = features["balls_cum_rate"]
|
||||
balls.fluid_mult = features["balls_cum_mult"]
|
||||
balls.fluid_efficiency = features["balls_efficiency"]
|
||||
if(/obj/item/organ/genital/vagina)
|
||||
var/obj/item/organ/genital/vagina/vegana = new(loc)
|
||||
if(features["has_vagina"])
|
||||
vegana.color = sanitize_hexcolor(features["vag_color"], 6)
|
||||
vegana.shape = features["vag_shape"]
|
||||
if(/obj/item/organ/genital/breasts)
|
||||
var/obj/item/organ/genital/breasts/boobs = new(loc)
|
||||
if(features["has_breasts"])
|
||||
boobs.color = sanitize_hexcolor(features["breasts_color"], 6)
|
||||
boobs.size = features["breasts_size"]
|
||||
boobs.shape = features["breasts_shape"]
|
||||
if(!features["breasts_producing"])
|
||||
boobs.genital_flags &= ~(GENITAL_FUID_PRODUCTION|CAN_CLIMAX_WITH|CAN_MASTURBATE_WITH)
|
||||
else
|
||||
new buildpath(loc)
|
||||
else
|
||||
new buildpath(loc)
|
||||
|
||||
/obj/machinery/limbgrower/RefreshParts()
|
||||
reagents.maximum_volume = 0
|
||||
@@ -165,7 +244,9 @@
|
||||
. += "<span class='notice'>The status display reads: Storing up to <b>[reagents.maximum_volume]u</b> of synthflesh.<br>Synthflesh consumption at <b>[prod_coeff*100]%</b>.<span>"
|
||||
|
||||
/obj/machinery/limbgrower/proc/main_win(mob/user)
|
||||
var/dat = "<div class='statusDisplay'><h3>Limb Grower Menu:</h3><br>"
|
||||
var/dat = "<div class='statusDisplay'><h3>[src] Menu:</h3><br>"
|
||||
dat += "<A href='?src=[REF(src)];dna_disk=1'>[dna_disk ? "Remove" : "Insert"] cloning data disk</A>"
|
||||
dat += "<hr>"
|
||||
dat += "<A href='?src=[REF(src)];menu=[LIMBGROWER_CHEMICAL_MENU]'>Chemical Storage</A>"
|
||||
dat += materials_printout()
|
||||
dat += "<table style='width:100%' align='center'><tr>"
|
||||
@@ -218,7 +299,7 @@
|
||||
|
||||
/obj/machinery/limbgrower/proc/get_design_cost(datum/design/D)
|
||||
var/dat
|
||||
if(D.reagents_list["synthflesh"])
|
||||
if(D.reagents_list[/datum/reagent/medicine/synthflesh])
|
||||
dat += "[D.reagents_list[/datum/reagent/medicine/synthflesh] * prod_coeff] Synthetic flesh "
|
||||
return dat
|
||||
|
||||
@@ -233,3 +314,47 @@
|
||||
to_chat(user, "<span class='warning'>A warning flashes onto the screen, stating that safety overrides have been deactivated!</span>")
|
||||
obj_flags |= EMAGGED
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/limbgrower/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(istype(user) && user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
if(busy)
|
||||
to_chat(user, "<span class=\"alert\">\The [src] is busy. Please wait for completion of previous operation.</span>")
|
||||
else
|
||||
if(dna_disk)
|
||||
dna_disk.forceMove(src.loc)
|
||||
user.put_in_active_hand(dna_disk)
|
||||
to_chat(user, "<span class='notice'>You remove \the [dna_disk] from \the [src].</span>")
|
||||
dna_disk = null
|
||||
else
|
||||
to_chat(user, "<span class='warning'>\The [src] has doesn't have a disk on it!")
|
||||
|
||||
//Defines some vars that makes limbs appears, TO-DO: define every single species.
|
||||
|
||||
/datum/species/human
|
||||
limbs_id = SPECIES_HUMAN
|
||||
icon_limbs = 'icons/mob/human_parts_greyscale.dmi'
|
||||
|
||||
/datum/species/lizard
|
||||
limbs_id = SPECIES_LIZARD
|
||||
icon_limbs = 'icons/mob/human_parts_greyscale.dmi'
|
||||
|
||||
/datum/species/mammal
|
||||
limbs_id = SPECIES_MAMMAL
|
||||
icon_limbs = 'icons/mob/human_parts_greyscale.dmi'
|
||||
|
||||
/datum/species/insect
|
||||
limbs_id = SPECIES_INSECT
|
||||
icon_limbs = 'icons/mob/human_parts_greyscale.dmi'
|
||||
|
||||
/datum/species/fly
|
||||
limbs_id = SPECIES_FLY
|
||||
icon_limbs = 'icons/mob/human_parts.dmi'
|
||||
|
||||
/datum/species/plasmaman
|
||||
limbs_id = SPECIES_PLASMAMAN
|
||||
icon_limbs = 'icons/mob/human_parts.dmi'
|
||||
|
||||
/datum/species/xeno
|
||||
limbs_id = SPECIES_XENOHYBRID
|
||||
icon_limbs = 'icons/mob/human_parts_greyscale.dmi'
|
||||
|
||||
@@ -41,3 +41,162 @@
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 75)
|
||||
build_path = /obj/item/melee/synthetic_arm_blade
|
||||
category = list("other","emagged")
|
||||
|
||||
//Extra limbs
|
||||
|
||||
/datum/design/chest
|
||||
name = "Chest"
|
||||
id = "chest"
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 50)
|
||||
build_path = /obj/item/bodypart/chest
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/head
|
||||
name = "Head"
|
||||
id = "head"
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 75)
|
||||
build_path = /obj/item/bodypart/head
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
//Organs
|
||||
/datum/design/brain
|
||||
name = "Brain"
|
||||
id = "brain"
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 50)
|
||||
build_path = /obj/item/organ/brain
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/heart
|
||||
name = "Heart"
|
||||
id = "heart"
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 25)
|
||||
build_path = /obj/item/organ/heart
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/lungs
|
||||
name = "Lungs"
|
||||
id = "lungs"
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 25)
|
||||
build_path = /obj/item/organ/lungs
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/liver
|
||||
name = "Liver"
|
||||
id = "liver"
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 25)
|
||||
build_path = /obj/item/organ/liver
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/stomach
|
||||
name = "Stomach"
|
||||
id = "stomach"
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 25)
|
||||
build_path = /obj/item/organ/stomach
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/appendix
|
||||
name = "Appendix"
|
||||
id = "appendix"
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 10)
|
||||
build_path = /obj/item/organ/appendix
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/tail
|
||||
name = "Tail"
|
||||
id = "tail"
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 25)
|
||||
build_path = /obj/item/organ/tail
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/ears
|
||||
name = "Ears"
|
||||
id = "ears"
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 25)
|
||||
build_path = /obj/item/organ/ears
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/eyes
|
||||
name = "Eyes"
|
||||
id = "eyes"
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 30)
|
||||
build_path = /obj/item/organ/eyes
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/tongue
|
||||
name = "Tongue"
|
||||
id = "tongue"
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 25)
|
||||
build_path = /obj/item/organ/tongue
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/vocal_cords
|
||||
name = "Vocal cords"
|
||||
id = "vocal_cords"
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 25)
|
||||
build_path = /obj/item/organ/vocal_cords
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
//genitals
|
||||
|
||||
/datum/design/penis
|
||||
name = "Penis"
|
||||
id = "penis"
|
||||
build_type = LIMBGROWER
|
||||
research_icon_state = "penis_human_3_s"
|
||||
research_icon = 'icons/obj/genitals/penis.dmi'
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 25)
|
||||
build_path = /obj/item/organ/genital/penis
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/vagina
|
||||
name = "Vagina"
|
||||
id = "vagina"
|
||||
research_icon_state = "vagina-s"
|
||||
research_icon = 'icons/obj/genitals/vagina.dmi'
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 25)
|
||||
build_path = /obj/item/organ/genital/vagina
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/womb
|
||||
name = "Womb"
|
||||
id = "womb"
|
||||
research_icon_state = "womb"
|
||||
research_icon = 'icons/obj/genitals/vagina.dmi'
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 25)
|
||||
build_path = /obj/item/organ/genital/womb
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/testicles
|
||||
name = "Testicles"
|
||||
id = "testicles"
|
||||
research_icon_state = "testicles_single_3_s"
|
||||
research_icon = 'icons/obj/genitals/testicles.dmi'
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 25)
|
||||
build_path = /obj/item/organ/genital/testicles
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
/datum/design/breasts
|
||||
name = "Breasts"
|
||||
id = "breasts"
|
||||
research_icon_state = "breasts_pair_e_s"
|
||||
research_icon = 'icons/obj/genitals/breasts.dmi'
|
||||
build_type = LIMBGROWER
|
||||
reagents_list = list(/datum/reagent/medicine/synthflesh = 25)
|
||||
build_path = /obj/item/organ/genital/breasts
|
||||
category = list("initial","human","lizard","fly","insect","plasmaman","mammal","xeno")
|
||||
|
||||
Reference in New Issue
Block a user