From 67906a03a0a98469e90940d92e32f742332ebbf5 Mon Sep 17 00:00:00 2001 From: "giacomand@gmail.com" Date: Thu, 15 Nov 2012 02:30:29 +0000 Subject: [PATCH] -You can now name your advance diseases. You can only name unnamed diseases. -Removed the mutagen requirement from a metroid recipe so it does not conflict with the mix_virus recipe. -When deaf, you'll get a notice when you see someone talking but you don't hear them. Being blind and deaf will give you no message, because you won't be able to tell. Talking while deaf will give you a message, even while blind. -Diseases can't be cured by having a high body temperature now. -I cut down the copy+paste on the meter code. -Advance diseases now have a limit of 3 in a single mob, increased the amount of symptoms you can have to compensate. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5069 316c924e-a436-60f5-8080-3fe189b3f50e --- code/datums/diseases/advance/advance.dm | 35 ++++++++++++------- code/game/machinery/atmoalter/meter.dm | 22 ++++++------ .../mob/living/carbon/alien/humanoid/life.dm | 6 ---- .../mob/living/carbon/alien/larva/life.dm | 5 --- code/modules/mob/living/carbon/brain/life.dm | 5 --- code/modules/mob/living/carbon/human/life.dm | 9 ----- .../modules/mob/living/carbon/metroid/life.dm | 6 ---- code/modules/mob/living/carbon/monkey/life.dm | 7 ---- code/modules/mob/living/say.dm | 9 ++++- code/modules/mob/mob_cleanup.dm | 6 ++++ code/modules/reagents/Chemistry-Machinery.dm | 16 +++++++++ code/modules/reagents/Chemistry-Recipes.dm | 2 +- .../reagent_containers/glass/bottle.dm | 10 ++++++ 13 files changed, 74 insertions(+), 64 deletions(-) diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index 4ea713bb2b7..36ace2d6b39 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -31,6 +31,7 @@ var/list/archive_diseases = list() // NEW VARS var/list/symptoms = list() // The symptoms of the disease. + var/id = "" /* @@ -38,7 +39,7 @@ var/list/archive_diseases = list() */ -/datum/disease/advance/New(var/process = 1, var/datum/disease/advance/D, var/copy = 0) +/datum/disease/advance/New(var/process = 1, var/datum/disease/advance/D) // Setup our dictionary if it hasn't already. if(!dictionary_symptoms.len) @@ -57,9 +58,8 @@ var/list/archive_diseases = list() else for(var/datum/symptom/S in D.symptoms) symptoms += new S.type - name = D.name - Refresh(!copy) + Refresh() ..(process, D) return @@ -149,13 +149,20 @@ var/list/archive_diseases = list() return generated -/datum/disease/advance/proc/Refresh(var/save = 1) +/datum/disease/advance/proc/Refresh(var/new_name = 0) //world << "[src.name] \ref[src] - REFRESH!" var/list/properties = GenerateProperties() AssignProperties(properties) - if(save) + + if(!archive_diseases[GetDiseaseID()]) + if(new_name) + AssignName() + archive_diseases[GetDiseaseID()] = src // So we don't infinite loop archive_diseases[GetDiseaseID()] = new /datum/disease/advance(0, src, 1) + var/datum/disease/advance/A = archive_diseases[GetDiseaseID()] + AssignName(A.name) + //Generate disease properties based on the effects. Returns an associated list. /datum/disease/advance/proc/GenerateProperties() @@ -184,7 +191,7 @@ var/list/archive_diseases = list() // The more symptoms we have, the less transmittable it is but some symptoms can make up for it. SetSpread(max(BLOOD, min(properties["transmittable"] - symptoms.len, AIRBORNE))) permeability_mod = max(round(0.5 * properties["transmittable"]), 1) - stage_prob = max(properties["stage_rate"], 1) + stage_prob = max(properties["stage_rate"], 2) SetSeverity(properties["severity"]) GenerateCure(properties) else @@ -213,7 +220,7 @@ var/list/archive_diseases = list() switch(level_sev) - if(0) + if(-INFINITY to 0) severity = "Non-Threat" if(1) severity = "Minor" @@ -223,7 +230,7 @@ var/list/archive_diseases = list() severity = "Harmful" if(4) severity = "Dangerous!" - if(5) + if(5 to INFINITY) severity = "BIOHAZARD THREAT!" else severity = "Unknown" @@ -300,11 +307,15 @@ var/list/archive_diseases = list() // Return a unique ID of the disease. /datum/disease/advance/proc/GetDiseaseID() + var/list/L = list() for(var/datum/symptom/S in symptoms) L += S.id L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in. - return dd_list2text(L, ":") + var/result = dd_list2text(L, ":") + id = result + return result + // Add a symptom, if it is over the limit (with a small chance to be able to go over) // we take a random symptom away and add the new one. @@ -313,7 +324,7 @@ var/list/archive_diseases = list() if(HasSymptom(S)) return - if(symptoms.len < 3 + rand(-1, 1)) + if(symptoms.len < 5 + rand(-1, 1)) symptoms += S else RemoveSymptom(pick(symptoms)) @@ -338,7 +349,7 @@ var/list/archive_diseases = list() var/list/diseases = list() - for(var/datum/disease/advance/A in D_list.Copy()) + for(var/datum/disease/advance/A in D_list) diseases += A.Copy() if(!diseases.len) @@ -361,7 +372,7 @@ var/list/archive_diseases = list() // Should be only 1 entry left, but if not let's only return a single entry //world << "END MIXING!!!!!" var/datum/disease/advance/to_return = pick(diseases) - to_return.Refresh() + to_return.Refresh(1) return to_return /proc/SetViruses(var/datum/reagent/R, var/list/data) diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm index 0db8c0c14e0..09fb8faa2a7 100644 --- a/code/game/machinery/atmoalter/meter.dm +++ b/code/game/machinery/atmoalter/meter.dm @@ -54,10 +54,8 @@ ) radio_connection.post_signal(src, signal) -/obj/machinery/meter/examine() - set src in view(3) - - var/t = "A gas flow meter. " +/obj/machinery/meter/proc/status() + var/t = "" if (src.target) var/datum/gas_mixture/environment = target.return_air() if(environment) @@ -66,7 +64,13 @@ t += "The sensor error light is blinking." else t += "The connect error light is blinking." + return t +/obj/machinery/meter/examine() + set src in view(3) + + var/t = "A gas flow meter. " + t += status() usr << t @@ -78,16 +82,10 @@ var/t = null if (get_dist(usr, src) <= 3 || istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/dead)) - if (src.target) - var/datum/gas_mixture/environment = target.return_air() - if(environment) - t = "Pressure: [round(environment.return_pressure(), 0.01)] kPa; Temperature: [round(environment.temperature,0.01)]°K ([round(environment.temperature-T0C,0.01)]°C)" - else - t = "\red Results: Sensor Error!" - else - t = "\red Results: Connection Error!" + t += status() else usr << "\blue You are too far away." + return 1 usr << t return 1 diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index 9582616e7a5..4bc1c63fd16 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -446,12 +446,6 @@ return 1 - proc/handle_virus_updates() - if(bodytemperature > 406) - for(var/datum/disease/D in viruses) - D.cure() - return - proc/handle_stomach() spawn(0) for(var/mob/living/M in stomach_contents) diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 8c63041d644..e8b51722fbb 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -364,11 +364,6 @@ proc/handle_random_events() return - proc/handle_virus_updates() - if(bodytemperature > 406) - for(var/datum/disease/D in viruses) - D.cure() - return proc/handle_stomach() spawn(0) diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index cf5ee8ce95c..9919317fce1 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -270,11 +270,6 @@ return 1 - proc/handle_virus_updates() - if(bodytemperature > 409) - for(var/datum/disease/D in viruses) - D.cure() - return /*/mob/living/carbon/brain/emp_act(severity) if(!(container && istype(container, /obj/item/device/mmi))) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index e056e18e730..d87445919ae 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -67,9 +67,6 @@ var/obj/location_as_object = loc location_as_object.handle_internal_lifeform(src, 0) - //Disease Check - handle_virus_updates() - //Updates the number of stored chemicals for powers handle_changeling() @@ -1220,12 +1217,6 @@ if(!currentTurf.lighting_lumcount) playsound_local(src,pick(scarySounds),50, 1, -1) - proc/handle_virus_updates() - if(bodytemperature > 406) - for(var/datum/disease/D in viruses) - D.cure() - return - proc/handle_stomach() spawn(0) for(var/mob/living/M in stomach_contents) diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index 95c1f517093..fc60aa4f819 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -361,12 +361,6 @@ A.rabid = rabid del(src) -/mob/living/carbon/metroid/proc/handle_virus_updates() - if(bodytemperature > 406) - for(var/datum/disease/D in viruses) - D.cure() - return - /mob/living/carbon/metroid/proc/handle_targets() if(Tempstun) if(!Victim) // not while they're eating! diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 3fc8609cf65..1ae9a904a97 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -29,8 +29,6 @@ var/obj/location_as_object = loc location_as_object.handle_internal_lifeform(src, 0) - //Disease Check - handle_virus_updates() //Updates the number of stored chemicals for powers handle_changeling() @@ -566,11 +564,6 @@ emote("scratch") return - proc/handle_virus_updates() - if(bodytemperature > 406) - for(var/datum/disease/D in viruses) - D.cure() - return proc/handle_changeling() if(mind && mind.changeling) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index e024ac1cc32..333747b5c37 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -341,7 +341,14 @@ var/list/department_radio_keys = list( for (var/M in heard_a) if(hascall(M,"show_message")) - M:show_message(rendered, 2) + var/deaf_message = "" + var/deaf_type = 1 + if(M != src) + deaf_message = "[name][alt_name] talks but you cannot hear them." + else + deaf_message = "You cannot hear yourself!" + deaf_type = 2 // Since you should be able to hear yourself without looking + M:show_message(rendered, 2, deaf_message, deaf_type) if (length(heard_b)) var/message_b diff --git a/code/modules/mob/mob_cleanup.dm b/code/modules/mob/mob_cleanup.dm index 6161ee97fca..6b032a9c077 100644 --- a/code/modules/mob/mob_cleanup.dm +++ b/code/modules/mob/mob_cleanup.dm @@ -22,6 +22,12 @@ Put (mob/proc)s here that are in dire need of a code cleanup. if(A.GetDiseaseID() in resistances) //world << "It resisted us!" return + var/count = 0 + for(var/datum/disease/advance/AD in viruses) + count++ + if(count >= 3) + return + else if(src.resistances.Find(virus.type)) //world << "Normal virus and resisted" diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 23ad3db0826..e1aee9117b9 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -565,6 +565,20 @@ src.temphtml = "" src.updateUsrDialog() return + else if(href_list["name_disease"]) + var/new_name = stripped_input(usr, "Name the Disease", "New Name", "", MAX_NAME_LEN) + if(stat & (NOPOWER|BROKEN)) return + if(usr.stat || usr.restrained()) return + if(!in_range(src, usr)) return + var/id = href_list["name_disease"] + if(archive_diseases[id]) + var/datum/disease/advance/A = archive_diseases[id] + A.AssignName(new_name) + for(var/datum/disease/advance/AD in active_diseases) + AD.Refresh() + src.updateUsrDialog() + + else usr << browse(null, "window=pandemic") src.updateUsrDialog() @@ -621,6 +635,8 @@ var/datum/disease/advance/A = D D = archive_diseases[A.GetDiseaseID()] disease_creation = A.GetDiseaseID() + if(D.name == "Unknown") + dat += "Name Disease
" if(!D) CRASH("We weren't able to get the advance disease from the archive.") diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index ee2c0ad62a0..9a411a0ee45 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -785,7 +785,7 @@ datum id = "m_tele" result = null required_reagents = list("sacid" = 1, "blood" = 1) - required_catalysts = list("plasma" = 1, "mutagen" = 1) + required_catalysts = list("plasma" = 1) result_amount = 1 required_container = /obj/item/metroid_core required_other = 4 diff --git a/code/modules/reagents/reagent_containers/glass/bottle.dm b/code/modules/reagents/reagent_containers/glass/bottle.dm index 07aa9ed79e2..0fc0d239cf6 100644 --- a/code/modules/reagents/reagent_containers/glass/bottle.dm +++ b/code/modules/reagents/reagent_containers/glass/bottle.dm @@ -77,6 +77,16 @@ ..() reagents.add_reagent("anti_toxin", 30) +/obj/item/weapon/reagent_containers/glass/bottle/mutagen + name = "unstable mutagen bottle" + desc = "A small bottle of unstable mutagen. Randomly changes the DNA structure of whoever comes in contact." + icon = 'icons/obj/chemical.dmi' + icon_state = "bottle20" + + New() + ..() + reagents.add_reagent("mutagen", 30) + /obj/item/weapon/reagent_containers/glass/bottle/ammonia name = "ammonia bottle" desc = "A small bottle."