From 4cf95b9958efd9c37fff59b41101c876ce7e54f1 Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Sat, 29 Sep 2018 22:59:05 +0200 Subject: [PATCH 1/2] PANDEMIC print stuf. Yiz --- .../reagents/chemistry/machinery/pandemic.dm | 52 ++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm index ee2ac418555..54c52b7d096 100644 --- a/code/modules/reagents/chemistry/machinery/pandemic.dm +++ b/code/modules/reagents/chemistry/machinery/pandemic.dm @@ -9,6 +9,7 @@ use_power = IDLE_POWER_USE idle_power_usage = 20 var/temp_html = "" + var/printing = null var/wait = null var/obj/item/reagent_containers/beaker = null @@ -162,6 +163,10 @@ for(var/datum/disease/advance/AD in active_diseases) AD.Refresh() updateUsrDialog() + else if(href_list["print_form"]) + var/datum/disease/D = GetVirusByIndex(text2num(href_list["print_form"])) + D = archive_diseases[D.GetDiseaseID()]//We know it's advanced no need to check + print_form(D, usr) else @@ -172,6 +177,46 @@ add_fingerprint(usr) return +//Prints a nice virus release form. Props to Urbanliner for the layout +/obj/machinery/computer/pandemic/proc/print_form(var/datum/disease/advance/D, mob/living/user) + D = archive_diseases[D.GetDiseaseID()] + if(!(printing) && D) + var/reason = input(user,"Enter a reason for the release", "Write", null) as message + reason += "" + var/english_symptoms = list() + for(var/datum/symptom/S in D.symptoms) + english_symptoms += S.name + var/symtoms = english_list(english_symptoms) + + + var/signature + if(alert(user,"Would you like to add your signature?",,"Yes","No") == "Yes") + signature = "[user ? user.real_name : "Anonymous"]" + else + signature = "" + + printing = 1 + var/obj/item/paper/P = new /obj/item/paper(loc) + visible_message("[src] rattles and prints out a sheet of paper.") + playsound(loc, 'sound/goonstation/machines/printer_dotmatrix.ogg', 50, 1) + + P.info = "
Releasing Virus
" + P.info += "
" + P.info += "Name of the Virus: [D.name]
" + P.info += "Symptoms: [symtoms]
" + P.info += "Spreads by: [D.spread_text]
" + P.info += "Cured by: [D.cure_text]
" + P.info += "
" + P.info += "Reason for releasing: [reason]" + P.info += "
" + P.info += "The Virologist is responsible for any biohazards caused by the virus released.
" + P.info += "Virologist's sign: [signature]
" + P.info += "If approved, stamp below with the Chief Medical Officer's stamp, and/or the Captain's stamp if required:" + P.populatefields() + P.updateinfolinks() + P.name = "Releasing Virus - [D.name]" + printing = null + /obj/machinery/computer/pandemic/attack_hand(mob/user) if(..()) return @@ -214,8 +259,11 @@ var/datum/disease/advance/A = D D = archive_diseases[A.GetDiseaseID()] - if(D && D.name == "Unknown") - dat += "Name Disease
" + if(D) + if(D.name == "Unknown") + dat += "Name Disease
" + else + dat += "Print release form
" if(!D) CRASH("We weren't able to get the advance disease from the archive.") From 78a8da9e8b28b4e00b83e86ceacfe3594a35a0fa Mon Sep 17 00:00:00 2001 From: farie82 Date: Mon, 1 Oct 2018 20:00:36 +0200 Subject: [PATCH 2/2] Update pandemic.dm --- code/modules/reagents/chemistry/machinery/pandemic.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm index 54c52b7d096..1d300767488 100644 --- a/code/modules/reagents/chemistry/machinery/pandemic.dm +++ b/code/modules/reagents/chemistry/machinery/pandemic.dm @@ -184,7 +184,8 @@ var/reason = input(user,"Enter a reason for the release", "Write", null) as message reason += "" var/english_symptoms = list() - for(var/datum/symptom/S in D.symptoms) + for(var/I in D.symptoms) + var/datum/symptom/S = I english_symptoms += S.name var/symtoms = english_list(english_symptoms)