From 1e6ecb0c88ece95ba2efac83dd0d50aa9df6c8b7 Mon Sep 17 00:00:00 2001 From: Datraen Date: Sat, 28 May 2016 20:06:51 -0400 Subject: [PATCH] Xenobio2 Tweaks Adds nameVar to products, sets it to products/xenos when they are created from the proper machinery. Adds the manual injector to the machinery that can take beakers, preventing them from spilling onto the machine when inserted. Tweaks the NanoUI to properly display percent mutated, adds a proper check to see if it is not a xeno occupant. --- code/game/machinery/kitchen/smartfridge.dm | 1 + code/modules/reagents/reagent_containers/glass.dm | 3 ++- code/modules/xenobio2/machinery/core_extractor.dm | 2 ++ code/modules/xenobio2/machinery/injector_computer.dm | 5 +++-- code/modules/xenobio2/machinery/slime_replicator.dm | 2 ++ code/modules/xenobio2/mob/xeno procs.dm | 2 -- code/modules/xenobio2/mob/xeno_product.dm | 1 + nano/templates/xenobio_computer.tmpl | 4 ++-- 8 files changed, 13 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm index 8790bb337f..a844d248e0 100644 --- a/code/game/machinery/kitchen/smartfridge.dm +++ b/code/game/machinery/kitchen/smartfridge.dm @@ -67,6 +67,7 @@ return 0 /obj/machinery/smartfridge/secure/extract/New() + ..() for(var/i=1 to 5) var/obj/item/xenoproduct/slime/core/C = new(src) C.traits = new() diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 44ea628eca..4eb927444e 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -41,7 +41,8 @@ /obj/machinery/smartfridge/, /obj/machinery/biogenerator, /obj/structure/frame, - /obj/machinery/radiocarbon_spectrometer + /obj/machinery/radiocarbon_spectrometer, + /obj/machinery/xenobio2/manualinjector ) /obj/item/weapon/reagent_containers/glass/New() diff --git a/code/modules/xenobio2/machinery/core_extractor.dm b/code/modules/xenobio2/machinery/core_extractor.dm index 818e3e6510..421c8ed22f 100644 --- a/code/modules/xenobio2/machinery/core_extractor.dm +++ b/code/modules/xenobio2/machinery/core_extractor.dm @@ -112,6 +112,8 @@ var/obj/item/xenoproduct/slime/core/C = new(src) C.traits = occupant.traitdat + C.nameVar = occupant.nameVar + C.create_reagents(C.traits.traits[TRAIT_XENO_CHEMVOL]) for(var/reagent in occupant.traitdat.chems) C.reagents.add_reagent(reagent, occupant.traitdat.chems[reagent]) diff --git a/code/modules/xenobio2/machinery/injector_computer.dm b/code/modules/xenobio2/machinery/injector_computer.dm index d39f791cb7..f65599e485 100644 --- a/code/modules/xenobio2/machinery/injector_computer.dm +++ b/code/modules/xenobio2/machinery/injector_computer.dm @@ -60,9 +60,10 @@ data["occupied"] = 1 if(isxeno(injector.occupant)) var/mob/living/simple_animal/xeno/X = injector.occupant - data["instability"] = (X.mut_level / X.mut_max) * 100 + data["compatible"] = 1 + data["instability"] = 100 * (X.mut_level / X.mut_max) else - data["instability"] = null + data["compatible"] = null if(injector.beaker) data["reagentAmount"] = injector.beaker.reagents.total_volume diff --git a/code/modules/xenobio2/machinery/slime_replicator.dm b/code/modules/xenobio2/machinery/slime_replicator.dm index 77b70bc3b8..3626304bfe 100644 --- a/code/modules/xenobio2/machinery/slime_replicator.dm +++ b/code/modules/xenobio2/machinery/slime_replicator.dm @@ -74,6 +74,8 @@ spawn(30) var/mob/living/simple_animal/xeno/slime/S = new(src) S.traitdat = core.traits + S.nameVar = core.nameVar + S.name = "[S.nameVar] baby slime" S.ProcessTraits() qdel(core) spawn(30) diff --git a/code/modules/xenobio2/mob/xeno procs.dm b/code/modules/xenobio2/mob/xeno procs.dm index e0a64ebdd3..14317f7c26 100644 --- a/code/modules/xenobio2/mob/xeno procs.dm +++ b/code/modules/xenobio2/mob/xeno procs.dm @@ -51,8 +51,6 @@ Procs for targeting if(!stasis) if(!reagents) return - if(reagents.total_volume <= 0) - return //Let's handle some chemical smoke, for scientific smoke bomb purposes. for(var/obj/effect/effect/smoke/chem/smoke in view(1, src)) diff --git a/code/modules/xenobio2/mob/xeno_product.dm b/code/modules/xenobio2/mob/xeno_product.dm index 2ea970c89f..b084b8eea6 100644 --- a/code/modules/xenobio2/mob/xeno_product.dm +++ b/code/modules/xenobio2/mob/xeno_product.dm @@ -9,4 +9,5 @@ Xenobiological product lives here as a basic type. var/datum/xeno/traits/traits var/source = "Unknown" var/product = "mess" + var/nameVar = "blah" \ No newline at end of file diff --git a/nano/templates/xenobio_computer.tmpl b/nano/templates/xenobio_computer.tmpl index 9cf053cddd..96e74b23b3 100644 --- a/nano/templates/xenobio_computer.tmpl +++ b/nano/templates/xenobio_computer.tmpl @@ -11,7 +11,7 @@ Used In File(s): \code\modules\xenobio2\machines\injector_computer.dm {{:data.reagentAmount}}u / {{:data.reagentMax}}u {{:helper.displayBar(data.reagentAmount, data.reagentMax, data.reagentMin, 'good', null, 'displayBarBeaker')}} {{else}} - ERRR% + ERR {{:helper.displayBar(data.reagentAmount, data.reagentMax, data.reagentMin, 'good', null, 'displayBarBeaker')}} {{/if}} @@ -23,7 +23,7 @@ Used In File(s): \code\modules\xenobio2\machines\injector_computer.dm Instability:
- {{if data.instability}} + {{if data.compatible}} {{:data.instability}}% {{else}} ERRR% Please contact your local technician for assistance.