mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-28 11:02:41 +00:00
-Added advance diseases! Virology can create and mutate advance with different symptoms and effects. Read my comments if you're interested in each symptom.
This isn't done, I still need to add more symptoms and a way for virology to identify and name them. -Metroids will die in space again. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4987 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#define NON_CONTAGIOUS -1
|
||||
#define SPECIAL 0
|
||||
#define CONTACT_GENERAL 1
|
||||
#define CONTACT_HANDS 2
|
||||
#define CONTACT_FEET 3
|
||||
#define AIRBORNE 4
|
||||
#define BLOOD 5
|
||||
#define SPECIAL -1
|
||||
#define NON_CONTAGIOUS 0
|
||||
#define BLOOD 1
|
||||
#define CONTACT_FEET 2
|
||||
#define CONTACT_HANDS 3
|
||||
#define CONTACT_GENERAL 4
|
||||
#define AIRBORNE 5
|
||||
|
||||
#define SCANNER 1
|
||||
#define PANDEMIC 2
|
||||
@@ -17,7 +17,7 @@ to null does not delete the object itself. Thank you.
|
||||
|
||||
*/
|
||||
|
||||
var/list/diseases = typesof(/datum/disease) - /datum/disease
|
||||
var/list/diseases = typesof(/datum/disease) - /datum/disease - /datum/disease/advance
|
||||
|
||||
|
||||
/datum/disease
|
||||
@@ -94,10 +94,15 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
|
||||
return result
|
||||
|
||||
|
||||
/datum/disease/proc/spread(var/atom/source=null)
|
||||
/datum/disease/proc/spread(var/atom/source=null, var/airborne_range = 2, var/force_spread)
|
||||
//world << "Disease [src] proc spread was called from holder [source]"
|
||||
|
||||
if(spread_type == SPECIAL || spread_type == NON_CONTAGIOUS)//does not spread
|
||||
// If we're overriding how we spread, say so here
|
||||
var/how_spread = spread_type
|
||||
if(force_spread)
|
||||
how_spread = force_spread
|
||||
|
||||
if(how_spread == SPECIAL || how_spread == NON_CONTAGIOUS)//does not spread
|
||||
return
|
||||
|
||||
if(stage < contagious_period) //the disease is not contagious at this stage
|
||||
@@ -110,26 +115,28 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
|
||||
return
|
||||
|
||||
|
||||
var/check_range = AIRBORNE//defaults to airborne - range 4
|
||||
var/check_range = airborne_range//defaults to airborne - range 2
|
||||
|
||||
if(spread_type != AIRBORNE && spread_type != SPECIAL)
|
||||
if(how_spread != AIRBORNE && how_spread != SPECIAL)
|
||||
check_range = 0 // everything else, like infect-on-contact things, only infect things on top of it
|
||||
|
||||
for(var/mob/living/carbon/M in oview(check_range, source)) //I have no idea why oview works when oviewers doesn't. -Pete
|
||||
for(var/mob/living/carbon/M in oview(check_range, source))
|
||||
M.contract_disease(src)
|
||||
|
||||
return
|
||||
|
||||
|
||||
/datum/disease/proc/process()
|
||||
if(!holder) return
|
||||
if(!holder)
|
||||
active_diseases -= src
|
||||
return
|
||||
if(prob(65))
|
||||
spread(holder)
|
||||
|
||||
if(affected_mob)
|
||||
for(var/datum/disease/D in affected_mob.viruses)
|
||||
if(D != src)
|
||||
if(istype(src, D.type))
|
||||
if(IsSame(D))
|
||||
del(D) // if there are somehow two viruses of the same kind in the system, delete the other one
|
||||
|
||||
if(holder == affected_mob)
|
||||
@@ -159,11 +166,16 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
|
||||
return
|
||||
|
||||
|
||||
/datum/disease/New(var/process=1)//process = 1 - adding the object to global list. List is processed by master controller.
|
||||
/datum/disease/New(var/process=1, var/datum/disease/D)//process = 1 - adding the object to global list. List is processed by master controller.
|
||||
cure_list = list(cure_id) // to add more cures, add more vars to this list in the actual disease's New()
|
||||
if(process) // Viruses in list are considered active.
|
||||
active_diseases += src
|
||||
|
||||
/datum/disease/proc/IsSame(var/datum/disease/D)
|
||||
if(istype(src, D.type))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/*
|
||||
/datum/disease/Del()
|
||||
active_diseases.Remove(src)
|
||||
|
||||
309
code/datums/diseases/advance/advance.dm
Normal file
309
code/datums/diseases/advance/advance.dm
Normal file
@@ -0,0 +1,309 @@
|
||||
/*
|
||||
|
||||
Advance Disease is a system for Virologist to Engineer their own disease with symptoms that have effects and properties
|
||||
which add onto the overall disease.
|
||||
|
||||
If you need help with creating new symptoms or expanding the advance disease, ask for Giacom on #coderbus.
|
||||
|
||||
*/
|
||||
|
||||
#define RANDOM_STARTING_LEVEL 2
|
||||
|
||||
/*
|
||||
|
||||
PROPERTIES
|
||||
|
||||
*/
|
||||
|
||||
/datum/disease/advance
|
||||
|
||||
name = "Unknown" // We will always let our Virologist name our disease.
|
||||
desc = "An engineered disease which can contain a multitude of symptoms."
|
||||
form = "Advance Disease" // Will let med-scanners know that this disease was engineered.
|
||||
agent = "advance microbes"
|
||||
max_stages = 5
|
||||
|
||||
|
||||
// NEW VARS
|
||||
|
||||
var/alpha_level = 0 // To determine if the advanced disease will overwrite another advance disease.
|
||||
var/list/symptoms = list() // The symptoms of the disease.
|
||||
|
||||
/*
|
||||
|
||||
OLD PROCS
|
||||
|
||||
*/
|
||||
|
||||
/datum/disease/advance/New(var/process = 1, var/datum/disease/advance/D)
|
||||
if(!istype(D))
|
||||
D = null
|
||||
// Generate symptoms if we weren't given any.
|
||||
if(!symptoms || !symptoms.len)
|
||||
if(!D || !D.symptoms || !D.symptoms.len)
|
||||
symptoms = GenerateSymptoms()
|
||||
else
|
||||
symptoms = D.symptoms
|
||||
Refresh() // Refresh our properties and cure.
|
||||
..(process, D)
|
||||
return
|
||||
|
||||
// Randomly pick a symptom to activate.
|
||||
/datum/disease/advance/stage_act()
|
||||
..()
|
||||
if(symptoms && symptoms.len)
|
||||
for(var/datum/symptom/S in symptoms)
|
||||
S.Activate(src)
|
||||
else
|
||||
CRASH("We do not have any symptoms during stage_act()!")
|
||||
|
||||
// Compares type then ID.
|
||||
/datum/disease/advance/IsSame(var/datum/disease/advance/D)
|
||||
if(!(istype(D, /datum/disease/advance)))
|
||||
return 0
|
||||
if(src.GetDiseaseID() != D.GetDiseaseID())
|
||||
return 0
|
||||
return 1
|
||||
|
||||
// To add special resistances.
|
||||
/datum/disease/advance/cure(var/resistance=1)
|
||||
if(affected_mob)
|
||||
var/id = "[GetDiseaseID()]"
|
||||
if(resistance && !(id in affected_mob.resistances))
|
||||
affected_mob.resistances[id] = /datum/disease/advance
|
||||
affected_mob.viruses -= src //remove the datum from the list
|
||||
del(src) //delete the datum to stop it processing
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
|
||||
NEW PROCS
|
||||
|
||||
*/
|
||||
|
||||
// Mix the symptoms of two diseases (the src and the argument)
|
||||
/datum/disease/advance/proc/Mix(var/datum/disease/advance/D)
|
||||
if(!(src.IsSame(D)))
|
||||
var/list/possible_symptoms = shuffle(D.symptoms)
|
||||
for(var/datum/symptom/S in possible_symptoms)
|
||||
AddSymptom(new S.type)
|
||||
|
||||
// Will generate new unique symptoms, use this if there are none. Returns a list of symptoms that were generated.
|
||||
/datum/disease/advance/proc/GenerateSymptoms(var/type_level_limit = RANDOM_STARTING_LEVEL, var/amount_get = 0)
|
||||
|
||||
var/list/generated = list() // Symptoms we generated.
|
||||
|
||||
// Generate symptoms. By default, we only choose non-deadly symptoms.
|
||||
var/list/possible_symptoms = list()
|
||||
for(var/symp in list_symptoms)
|
||||
var/datum/symptom/S = new symp
|
||||
if((S.level <= type_level_limit) && !(S in symptoms))
|
||||
possible_symptoms += S
|
||||
|
||||
// Random chance to get more than one symptom
|
||||
var/number_of = amount_get
|
||||
if(!amount_get)
|
||||
number_of = 1
|
||||
while(prob(10))
|
||||
number_of += 1
|
||||
|
||||
for(var/i = 0; number_of >= i; i++)
|
||||
var/datum/symptom/S = pick(possible_symptoms)
|
||||
generated += S
|
||||
possible_symptoms -= S
|
||||
|
||||
return generated
|
||||
|
||||
/datum/disease/advance/proc/Refresh()
|
||||
//world << "[src.name] \ref[src] - REFRESH!"
|
||||
var/list/properties = GenerateProperties()
|
||||
AssignProperties(properties)
|
||||
|
||||
//Generate disease properties based on the effects. Returns an associated list.
|
||||
/datum/disease/advance/proc/GenerateProperties()
|
||||
|
||||
if(!symptoms || !symptoms.len)
|
||||
CRASH("We did not have any symptoms before generating properties.")
|
||||
return
|
||||
|
||||
var/list/properties = list("resistance" = 0, "stealth" = 0, "stage_rate" = 0, "tansmittable" = 0, "severity" = 0)
|
||||
|
||||
for(var/datum/symptom/S in symptoms)
|
||||
|
||||
properties["resistance"] += S.resistance
|
||||
properties["stealth"] += S.stealth
|
||||
properties["stage_rate"] += S.stage_speed
|
||||
properties["tansmittable"] += S.transmittable
|
||||
properties["severity"] = max(properties["severity"], S.level) // severity is based on the highest level symptom
|
||||
|
||||
return properties
|
||||
|
||||
// Assign the properties that are in the list.
|
||||
/datum/disease/advance/proc/AssignProperties(var/list/properties = list())
|
||||
|
||||
if(properties && properties.len)
|
||||
|
||||
hidden = list( (properties["stealth"] > 2), (properties["stealth"] > 3) )
|
||||
// The more symptoms we have, the less transmittable it is but some symptoms can make up for it.
|
||||
SetSpread(max(BLOOD, min(properties["tansmittable"] - symptoms.len, AIRBORNE)))
|
||||
permeability_mod = 0.5 * properties["transmittable"]
|
||||
stage_prob = max(properties["stage_rate"], 1)
|
||||
SetSeverity(properties["severity"])
|
||||
GenerateCure(properties)
|
||||
|
||||
|
||||
// Assign the spread type and give it the correct description.
|
||||
/datum/disease/advance/proc/SetSpread(var/spread_id)
|
||||
//world << "Setting spread type to [spread_id]"
|
||||
switch(spread_id)
|
||||
|
||||
if(NON_CONTAGIOUS)
|
||||
spread = "None"
|
||||
if(SPECIAL)
|
||||
spread = "None"
|
||||
if(CONTACT_GENERAL, CONTACT_HANDS, CONTACT_FEET)
|
||||
spread = "On contact"
|
||||
if(AIRBORNE)
|
||||
spread = "Airborne"
|
||||
if(BLOOD)
|
||||
spread = "Blood"
|
||||
|
||||
spread_type = spread_id
|
||||
|
||||
/datum/disease/advance/proc/SetSeverity(var/level_sev)
|
||||
|
||||
switch(level_sev)
|
||||
|
||||
if(0)
|
||||
severity = "Non-Threat"
|
||||
if(1)
|
||||
severity = "Minor"
|
||||
if(2)
|
||||
severity = "Medium"
|
||||
if(3)
|
||||
severity = "Harmful"
|
||||
if(4)
|
||||
severity = "Dangerous!"
|
||||
if(5)
|
||||
severity = "BIOHAZARD THREAT!"
|
||||
else
|
||||
severity = "Unknown"
|
||||
|
||||
|
||||
// Will generate a random cure, the less resistance the symptoms have, the harder the cure.
|
||||
/datum/disease/advance/proc/GenerateCure(var/list/properties = list())
|
||||
if(properties && properties.len)
|
||||
var/res = max(properties["resistance"] - symptoms.len, 1)
|
||||
//world << "Res = [res]"
|
||||
switch(res)
|
||||
// Due to complications, I cannot randomly generate cures or randomly give cures.
|
||||
if(0)
|
||||
cure_id = "nutriment"
|
||||
|
||||
if(1)
|
||||
cure_id = "sodiumchloride"
|
||||
|
||||
if(2)
|
||||
cure_id = "orangejuice"
|
||||
|
||||
if(3)
|
||||
cure_id = "spaceacillin"
|
||||
|
||||
if(4)
|
||||
cure_id = "ethanol"
|
||||
|
||||
if(5)
|
||||
cure_id = "ethylredoxrazine"
|
||||
|
||||
if(6)
|
||||
cure_id = "silver"
|
||||
|
||||
if(7)
|
||||
cure_id = "gold"
|
||||
|
||||
if(8)
|
||||
cure_id = "plasma"
|
||||
|
||||
// Get the cure name from the cure_id
|
||||
var/datum/reagent/D = chemical_reagents_list[cure_id]
|
||||
cure = D.name
|
||||
|
||||
|
||||
return
|
||||
|
||||
// Randomly generate a symptom, has a chance to lose or gain a symptom.
|
||||
/datum/disease/advance/proc/Evolve(var/level = 2)
|
||||
AddSymptom(pick(GenerateSymptoms(level, 1)))
|
||||
Refresh()
|
||||
return
|
||||
|
||||
// Name the disease.
|
||||
/datum/disease/advance/proc/AssignName(var/name = "Unknown")
|
||||
src.name = name
|
||||
return
|
||||
|
||||
/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, ":")
|
||||
|
||||
// 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.
|
||||
/datum/disease/advance/proc/AddSymptom(var/datum/symptom/S)
|
||||
|
||||
for(var/datum/symptom/symp in symptoms)
|
||||
if(S.id == symp.id)
|
||||
return
|
||||
|
||||
if(symptoms.len < 4 + rand(-1, 1))
|
||||
symptoms += S
|
||||
else
|
||||
RemoveSymptom(pick(symptoms))
|
||||
symptoms += S
|
||||
return
|
||||
|
||||
// Simply removes the symptom at the moment.
|
||||
/datum/disease/advance/proc/RemoveSymptom(var/datum/symptom/S)
|
||||
symptoms -= S
|
||||
return
|
||||
|
||||
/*
|
||||
|
||||
Static Procs
|
||||
|
||||
*/
|
||||
|
||||
// Mix a list of advance diseases and return the mixed result.
|
||||
/proc/Advance_Mix(var/list/D_list)
|
||||
|
||||
var/list/diseases = list()
|
||||
for(var/datum/disease/advance/A in D_list)
|
||||
diseases += A
|
||||
if(!diseases.len)
|
||||
return null
|
||||
if(diseases.len <= 1)
|
||||
return pick(diseases) // Just return the only entry.
|
||||
|
||||
var/i = 0
|
||||
// Mix our diseases until we are left with only one result.
|
||||
while(i < 20 && diseases.len > 1)
|
||||
|
||||
i++
|
||||
|
||||
var/datum/disease/advance/D1 = pick(diseases)
|
||||
diseases -= D1
|
||||
D_list -= D1
|
||||
|
||||
var/datum/disease/advance/D2 = pick(diseases)
|
||||
D2.Mix(D1)
|
||||
|
||||
// Should be only 1 entry left, but if not let's only return a single entry
|
||||
var/datum/disease/advance/to_return = pick(diseases)
|
||||
to_return.Refresh()
|
||||
return to_return
|
||||
|
||||
|
||||
#undef RANDOM_STARTING_LEVEL
|
||||
4
code/datums/diseases/advance/cold.dm
Normal file
4
code/datums/diseases/advance/cold.dm
Normal file
@@ -0,0 +1,4 @@
|
||||
/datum/disease/advance/cold/New(var/process = 1, var/datum/disease/advance/D)
|
||||
name = "Cold"
|
||||
symptoms = list(new/datum/symptom/sneeze)
|
||||
..(process, D)
|
||||
4
code/datums/diseases/advance/flu.dm
Normal file
4
code/datums/diseases/advance/flu.dm
Normal file
@@ -0,0 +1,4 @@
|
||||
/datum/disease/advance/flu/New(var/process = 1, var/datum/disease/advance/D)
|
||||
name = "Flu"
|
||||
symptoms = list(new/datum/symptom/cough)
|
||||
..(process, D)
|
||||
35
code/datums/diseases/advance/symptoms/confusion.dm
Normal file
35
code/datums/diseases/advance/symptoms/confusion.dm
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Confusion
|
||||
|
||||
Little bit hidden.
|
||||
Lowers resistance.
|
||||
Decreases stage speed.
|
||||
Intense Level.
|
||||
|
||||
Bonus
|
||||
Makes the affected mob be confused for short periods of time.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/confusion
|
||||
|
||||
stealth = 1
|
||||
resistance = -1
|
||||
stage_speed = -3
|
||||
level = 4
|
||||
|
||||
/datum/symptom/confusion/Activate(var/datum/disease/advance/A)
|
||||
..()
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB))
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
M << "<span class='notice'>[pick("You feel confused.", "You forgot what you were thinking about.")]</span>"
|
||||
else
|
||||
M << "<span class='notice'>You are unable to think straight!</span>"
|
||||
M.confused = min(100, M.confused + 2)
|
||||
|
||||
return
|
||||
34
code/datums/diseases/advance/symptoms/cough.dm
Normal file
34
code/datums/diseases/advance/symptoms/cough.dm
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Coughing
|
||||
|
||||
Noticable.
|
||||
No Resistance.
|
||||
Doesn't increase stage speed..
|
||||
Low Level.
|
||||
|
||||
BONUS
|
||||
Will force the affected mob to drop items!
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/cough
|
||||
|
||||
stealth = -1
|
||||
resistance = 0
|
||||
stage_speed = 0
|
||||
level = 1
|
||||
|
||||
/datum/symptom/cough/Activate(var/datum/disease/advance/A)
|
||||
..()
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB))
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3)
|
||||
M << "<span notice='notice'>[pick("You swallow excess mucus.", "You lightly cough .")]</span>"
|
||||
else
|
||||
M.emote("cough")
|
||||
M.drop_item()
|
||||
return
|
||||
40
code/datums/diseases/advance/symptoms/damage_converter.dm
Normal file
40
code/datums/diseases/advance/symptoms/damage_converter.dm
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Damage Converter
|
||||
|
||||
Little bit hidden.
|
||||
Lowers resistance tremendously.
|
||||
Decreases stage speed tremendously.
|
||||
Intense Level.
|
||||
|
||||
Bonus
|
||||
Slowly converts brute/fire damage to toxin.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/damage_converter // Not the egg
|
||||
|
||||
stealth = 1
|
||||
resistance = -5
|
||||
stage_speed = -5
|
||||
level = 4
|
||||
|
||||
/datum/symptom/damage_converter/Activate(var/datum/disease/advance/A)
|
||||
..()
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB))
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(5)
|
||||
Convert(M)
|
||||
return
|
||||
|
||||
/datum/symptom/damage_converter/proc/Convert(var/mob/living/M)
|
||||
|
||||
if(M.getFireLoss() < M.getMaxHealth() || M.getBruteLoss() < M.getMaxHealth())
|
||||
var/get_damage = rand(1, 2)
|
||||
M.adjustFireLoss(-get_damage)
|
||||
M.adjustBruteLoss(-get_damage)
|
||||
M.adjustToxLoss(get_damage * 2)
|
||||
return 1
|
||||
34
code/datums/diseases/advance/symptoms/dizzy.dm
Normal file
34
code/datums/diseases/advance/symptoms/dizzy.dm
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Dizziness
|
||||
|
||||
Little bit hidden.
|
||||
Lowers resistance considerably.
|
||||
Decreases stage speed.
|
||||
Intense Level.
|
||||
|
||||
Bonus
|
||||
Shakes the affected mob's screen for short periods.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/dizzy // Not the egg
|
||||
|
||||
stealth = 1
|
||||
resistance = -2
|
||||
stage_speed = -3
|
||||
level = 4
|
||||
|
||||
/datum/symptom/dizzy/Activate(var/datum/disease/advance/A)
|
||||
..()
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB))
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
M << "<span class='notice'>[pick("You feel dizzy.", "Your head starts spinning.")]</span>"
|
||||
else
|
||||
M << "<span class='notice'>You are unable to look straight!</span>"
|
||||
M.make_dizzy(5)
|
||||
return
|
||||
30
code/datums/diseases/advance/symptoms/headache.dm
Normal file
30
code/datums/diseases/advance/symptoms/headache.dm
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Headache
|
||||
|
||||
Noticable.
|
||||
Highly resistant.
|
||||
Doesn't increase stage speed..
|
||||
Low Level.
|
||||
|
||||
BONUS
|
||||
Displays an annoying message!
|
||||
Should be used for buffing your disease.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/cough
|
||||
|
||||
stealth = -1
|
||||
resistance = 4
|
||||
stage_speed = 0
|
||||
level = 1
|
||||
|
||||
/datum/symptom/cough/Activate(var/datum/disease/advance/A)
|
||||
..()
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB))
|
||||
var/mob/living/M = A.affected_mob
|
||||
M << "<span class='notice'>[pick("Your head hurts.", "Your head starts pounding.")]</span>"
|
||||
return
|
||||
35
code/datums/diseases/advance/symptoms/sneeze.dm
Normal file
35
code/datums/diseases/advance/symptoms/sneeze.dm
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Sneezing
|
||||
|
||||
Very Noticable.
|
||||
Decreases resistance.
|
||||
Doesn't increase stage speed.
|
||||
Low Level.
|
||||
|
||||
Bonus
|
||||
Forces a spread type of AIRBORNE
|
||||
with extra range!
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/sneeze
|
||||
|
||||
stealth = -2
|
||||
resistance = -1
|
||||
stage_speed = 0
|
||||
level = 1
|
||||
|
||||
/datum/symptom/sneeze/Activate(var/datum/disease/advance/A)
|
||||
..()
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB + (A.stage * 2)))
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
M.emote("sniffs")
|
||||
else
|
||||
M.emote("sneeze")
|
||||
A.spread(A.holder, 4, AIRBORNE)
|
||||
return
|
||||
29
code/datums/diseases/advance/symptoms/symptoms.dm
Normal file
29
code/datums/diseases/advance/symptoms/symptoms.dm
Normal file
@@ -0,0 +1,29 @@
|
||||
// Symptoms are the effects that engineered advanced diseases do.
|
||||
|
||||
var/list/list_symptoms = typesof(/datum/symptom) - /datum/symptom
|
||||
|
||||
var/global/const/SYMPTOM_ACTIVATION_PROB = 1
|
||||
|
||||
/datum/symptom
|
||||
// Buffs/Debuffs the symptom has to the overall engineered disease.
|
||||
var/stealth = 0
|
||||
var/resistance = 0
|
||||
var/stage_speed = 0
|
||||
var/transmittable = 0
|
||||
// The type level of the symptom. Higher is more lethal and harder to generate.
|
||||
var/level = 0
|
||||
// The hash tag for our diseases, we will add it up with our other symptoms to get a unique id! ID MUST BE UNIQUE!!!
|
||||
var/id = ""
|
||||
|
||||
/datum/symptom/New()
|
||||
var/list/S = list_symptoms
|
||||
for(var/i = 1; i <= S.len; i++)
|
||||
if(src.type == S[i])
|
||||
id = "[i]"
|
||||
return
|
||||
CRASH("We couldn't assign an ID!")
|
||||
|
||||
|
||||
/datum/symptom/proc/Activate(var/mob/living/M, var/stage)
|
||||
return
|
||||
|
||||
89
code/datums/diseases/advance/symptoms/vomit.dm
Normal file
89
code/datums/diseases/advance/symptoms/vomit.dm
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Vomiting
|
||||
|
||||
Very Very Noticable.
|
||||
Decreases resistance.
|
||||
Doesn't increase stage speed.
|
||||
Medium Level.
|
||||
|
||||
Bonus
|
||||
Forces the affected mob to vomit!
|
||||
Meaning your disease can spread via
|
||||
people walking on vomit.
|
||||
Makes the affected mob lose nutrition and
|
||||
heal toxin damage.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/vomit
|
||||
|
||||
stealth = -2
|
||||
resistance = -1
|
||||
stage_speed = 0
|
||||
level = 3
|
||||
|
||||
/datum/symptom/vomit/Activate(var/datum/disease/advance/A)
|
||||
..()
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB))
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
M << "<span class='notice'>[pick("You feel nauseous.", "You feel like you're going to throw up!")]</span>"
|
||||
else
|
||||
Vomit(M)
|
||||
|
||||
return
|
||||
|
||||
/datum/symptom/vomit/proc/Vomit(var/mob/living/M)
|
||||
|
||||
M.Stun(5)
|
||||
M.emote("vomits on the floor")
|
||||
|
||||
M.nutrition -= 20
|
||||
M.adjustToxLoss(-3)
|
||||
|
||||
var/turf/pos = get_turf(M)
|
||||
pos.add_vomit_floor(M)
|
||||
playsound(pos, 'sound/effects/splat.ogg', 50, 1)
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Vomiting Blood
|
||||
|
||||
Very Very Noticable.
|
||||
Decreases resistance.
|
||||
Decreases stage speed.
|
||||
Intense level.
|
||||
|
||||
Bonus
|
||||
Forces the affected mob to vomit blood!
|
||||
Meaning your disease can spread via
|
||||
people walking on the blood.
|
||||
Makes the affected mob lose health.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/vomit/blood
|
||||
|
||||
stealth = -2
|
||||
resistance = -1
|
||||
stage_speed = -1
|
||||
level = 4
|
||||
|
||||
/datum/symptom/vomit/blood/Vomit(var/mob/living/M)
|
||||
|
||||
M.Stun(5)
|
||||
M.emote("vomits on the floor")
|
||||
|
||||
// They lose blood and health.
|
||||
var/brute_dam = M.getBruteLoss()
|
||||
if(brute_dam >= 50)
|
||||
M.adjustBruteLoss(3)
|
||||
|
||||
var/turf/pos = get_turf(M)
|
||||
pos.add_vomit_floor(M)
|
||||
playsound(pos, 'sound/effects/splat.ogg', 50, 1)
|
||||
@@ -33,7 +33,7 @@
|
||||
spread = "None"
|
||||
spread_type = SPECIAL
|
||||
cure = "Unknown"
|
||||
cure_id = list("lexorin","toxin","gargleblaster", "cyanide")
|
||||
cure_id = list("lexorin","toxin","gargleblaster")
|
||||
cure_chance = 50
|
||||
affected_species = list("Human", "Monkey")
|
||||
permeability_mod = 15//likely to infect
|
||||
|
||||
@@ -73,26 +73,5 @@
|
||||
S.update_solar_exposure()
|
||||
|
||||
|
||||
//returns the north-zero clockwise angle in degrees, given a direction
|
||||
|
||||
/proc/dir2angle(var/D)
|
||||
switch(D)
|
||||
if(1)
|
||||
return 0
|
||||
if(2)
|
||||
return 180
|
||||
if(4)
|
||||
return 90
|
||||
if(8)
|
||||
return 270
|
||||
if(5)
|
||||
return 45
|
||||
if(6)
|
||||
return 135
|
||||
if(9)
|
||||
return 315
|
||||
if(10)
|
||||
return 225
|
||||
else
|
||||
return null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user