-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
This commit is contained in:
giacomand@gmail.com
2012-11-15 02:30:29 +00:00
parent ad5e92d3cd
commit 67906a03a0
13 changed files with 74 additions and 64 deletions

View File

@@ -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)

View File

@@ -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 = "<B>Pressure:</B> [round(environment.return_pressure(), 0.01)] kPa; <B>Temperature:</B> [round(environment.temperature,0.01)]&deg;K ([round(environment.temperature-T0C,0.01)]&deg;C)"
else
t = "\red <B>Results: Sensor Error!</B>"
else
t = "\red <B>Results: Connection Error!</B>"
t += status()
else
usr << "\blue <B>You are too far away.</B>"
return 1
usr << t
return 1

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)))

View File

@@ -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)

View File

@@ -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!

View File

@@ -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)

View File

@@ -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 = "<span class='name'>[name][alt_name]</span> talks but you cannot hear them."
else
deaf_message = "<span class='notice'>You cannot hear yourself!</span>"
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

View File

@@ -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"

View File

@@ -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 += "<b><a href='?src=\ref[src];name_disease=[A.GetDiseaseID()]'>Name Disease</a></b><BR>"
if(!D)
CRASH("We weren't able to get the advance disease from the archive.")

View File

@@ -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

View File

@@ -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."