Proper mirror PR for the disease refactor because I fucked up the first one. (#2026)

* Revert "im a dumbass and didn't see the .rej files Revert "[MIRROR] Disease Refactor" (#2025)"

This reverts commit 44742cb115.

* Delete shuttle_loan.dm.rej

* Delete life.dm.rej

* Update life.dm

* Delete life.dm.rej

* compile
This commit is contained in:
kevinz000
2017-07-31 23:41:22 -07:00
committed by GitHub
parent 277b7e6f80
commit bbcad2fa58
55 changed files with 246 additions and 322 deletions
+7 -3
View File
@@ -1,6 +1,7 @@
/mob/proc/HasDisease(datum/disease/D)
for(var/datum/disease/DD in viruses)
for(var/thing in viruses)
var/datum/disease/DD = thing
if(D.IsSame(DD))
return 1
return 0
@@ -39,7 +40,7 @@
var/datum/disease/DD = new D.type(1, D, 0)
viruses += DD
DD.affected_mob = src
DD.holder = src
SSdisease.active_diseases += DD //Add it to the active diseases list, now that it's actually in a mob and being processed.
//Copy properties over. This is so edited diseases persist.
var/list/skipped = list("affected_mob","holder","carrier","stage","type","parent_type","vars","transformed")
@@ -147,6 +148,9 @@
/mob/living/carbon/human/CanContractDisease(datum/disease/D)
if(dna && (VIRUSIMMUNE in dna.species.species_traits))
if(dna && (VIRUSIMMUNE in dna.species.species_traits) && !D.bypasses_immunity)
return 0
for(var/thing in D.required_organs)
if(!((locate(thing) in bodyparts) || (locate(thing) in internal_organs)))
return 0
return ..()
+15 -58
View File
@@ -46,21 +46,23 @@
var/stage_prob = 4
//Other
var/longevity = 150 //Time in ticks disease stays in objects, Syringes and such are infinite.
var/list/viable_mobtypes = list() //typepaths of viable mobs
var/mob/living/carbon/affected_mob = null
var/atom/movable/holder = null
var/list/cures = list() //list of cures if the disease has the CURABLE flag, these are reagent ids
var/infectivity = 65
var/cure_chance = 8
var/carrier = 0 //If our host is only a carrier
var/carrier = FALSE //If our host is only a carrier
var/bypasses_immunity = FALSE //Does it skip species virus immunity check? Some things may diseases and not viruses
var/permeability_mod = 1
var/severity = NONTHREAT
var/list/required_organs = list()
var/needs_all_cures = TRUE
var/list/strain_data = list() //dna_spread special bullshit
/datum/disease/Destroy()
affected_mob = null
SSdisease.active_diseases.Remove(src)
return ..()
/datum/disease/proc/stage_act()
var/cure = has_cure()
@@ -93,13 +95,16 @@
if(!. || (needs_all_cures && . < cures.len))
return 0
/datum/disease/proc/spread(atom/source, force_spread = 0)
/datum/disease/proc/spread(force_spread = 0)
if(!affected_mob)
return
if((spread_flags & SPECIAL || spread_flags & NON_CONTAGIOUS || spread_flags & BLOOD) && !force_spread)
return
if(affected_mob)
if( affected_mob.reagents.has_reagent("spaceacillin") || (affected_mob.satiety > 0 && prob(affected_mob.satiety/10)) )
return
if(affected_mob.reagents.has_reagent("spaceacillin") || (affected_mob.satiety > 0 && prob(affected_mob.satiety/10)))
return
var/spread_range = 1
@@ -109,15 +114,9 @@
if(spread_flags & AIRBORNE)
spread_range++
if(!source)
if(affected_mob)
source = affected_mob
else
return
var/turf/T = source.loc
var/turf/T = affected_mob.loc
if(istype(T))
for(var/mob/living/carbon/C in oview(spread_range, source))
for(var/mob/living/carbon/C in oview(spread_range, affected_mob))
var/turf/V = get_turf(C)
if(V)
while(TRUE)
@@ -129,29 +128,6 @@
break
V = Temp
/datum/disease/process()
if(!holder)
SSdisease.processing -= src
return
if(prob(infectivity))
spread(holder)
if(affected_mob)
for(var/datum/disease/D in affected_mob.viruses)
if(D != src)
if(IsSame(D))
qdel(D)
if(holder == affected_mob)
if(affected_mob.stat != DEAD)
stage_act()
if(!affected_mob)
if(prob(70))
if(--longevity<=0)
cure()
/datum/disease/proc/cure()
if(affected_mob)
@@ -161,20 +137,6 @@
remove_virus()
qdel(src)
/datum/disease/New()
if(required_organs && required_organs.len)
if(ishuman(affected_mob))
var/mob/living/carbon/human/H = affected_mob
for(var/obj/item/organ/O in required_organs)
if(!locate(O) in H.bodyparts)
if(!locate(O) in H.internal_organs)
cure()
return
SSdisease.processing += src
/datum/disease/proc/IsSame(datum/disease/D)
if(istype(src, D.type))
return 1
@@ -191,11 +153,6 @@
return type
/datum/disease/Destroy()
SSdisease.processing.Remove(src)
return ..()
/datum/disease/proc/IsSpreadByTouch()
if(spread_flags & CONTACT_FEET || spread_flags & CONTACT_HANDS || spread_flags & CONTACT_GENERAL)
return 1
+3 -11
View File
@@ -93,7 +93,7 @@
if(!(istype(D, /datum/disease/advance)))
return 0
if(src.GetDiseaseID() != D.GetDiseaseID())
if(GetDiseaseID() != D.GetDiseaseID())
return 0
return 1
@@ -118,7 +118,7 @@
// Mix the symptoms of two diseases (the src and the argument)
/datum/disease/advance/proc/Mix(datum/disease/advance/D)
if(!(src.IsSame(D)))
if(!(IsSame(D)))
var/list/possible_symptoms = shuffle(D.symptoms)
for(var/datum/symptom/S in possible_symptoms)
AddSymptom(S.Copy())
@@ -158,7 +158,6 @@
return generated
/datum/disease/advance/proc/Refresh(new_name = FALSE)
//to_chat(world, "[src.name] \ref[src] - REFRESH!")
GenerateProperties()
AssignProperties()
id = null
@@ -412,7 +411,7 @@
D.AssignName(new_name)
D.Refresh()
for(var/datum/disease/advance/AD in SSdisease.processing)
for(var/datum/disease/advance/AD in SSdisease.active_diseases)
AD.Refresh()
for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list))
@@ -427,13 +426,6 @@
name_symptoms += S.name
message_admins("[key_name_admin(user)] has triggered a custom virus outbreak of [D.name]! It has these symptoms: [english_list(name_symptoms)]")
/*
/mob/verb/test()
for(var/datum/disease/D in SSdisease.processing)
to_chat(src, "<a href='?_src_=vars;Vars=\ref[D]'>[D.name] - [D.holder]</a>")
*/
/datum/disease/advance/proc/totalStageSpeed()
return properties["stage_rate"]
+36 -36
View File
@@ -24,45 +24,45 @@ BONUS
transmittable = 2
level = 1
severity = 1
base_message_chance = 15
symptom_delay_min = 2
symptom_delay_max = 15
var/infective = FALSE
base_message_chance = 15
symptom_delay_min = 2
symptom_delay_max = 15
var/infective = FALSE
/datum/symptom/cough/Start(datum/disease/advance/A)
/datum/symptom/cough/Start(datum/disease/advance/A)
..()
if(A.properties["stealth"] >= 4)
suppress_warning = TRUE
if(A.spread_flags &= AIRBORNE) //infect bystanders
infective = TRUE
if(A.properties["resistance"] >= 3) //strong enough to drop items
power = 1.5
if(A.properties["resistance"] >= 10) //strong enough to stun (rarely)
power = 2
if(A.properties["stage_rate"] >= 6) //cough more often
symptom_delay_max = 10
/datum/symptom/cough/Activate(datum/disease/advance/A)
if(!..())
return
var/mob/living/M = A.affected_mob
switch(A.stage)
if(1, 2, 3)
if(prob(base_message_chance) && !suppress_warning)
if(A.properties["stealth"] >= 4)
suppress_warning = TRUE
if(A.spread_flags &= AIRBORNE) //infect bystanders
infective = TRUE
if(A.properties["resistance"] >= 3) //strong enough to drop items
power = 1.5
if(A.properties["resistance"] >= 10) //strong enough to stun (rarely)
power = 2
if(A.properties["stage_rate"] >= 6) //cough more often
symptom_delay_max = 10
/datum/symptom/cough/Activate(datum/disease/advance/A)
if(!..())
return
var/mob/living/M = A.affected_mob
switch(A.stage)
if(1, 2, 3)
if(prob(base_message_chance) && !suppress_warning)
to_chat(M, "<span notice='warning'>[pick("You swallow excess mucus.", "You lightly cough.")]</span>")
else
M.emote("cough")
if(power >= 1.5)
else
M.emote("cough")
if(power >= 1.5)
var/obj/item/I = M.get_active_held_item()
if(I && I.w_class == WEIGHT_CLASS_TINY)
M.drop_item()
if(power >= 2 && prob(10))
to_chat(M, "<span notice='userdanger'>[pick("You have a coughing fit!", "You can't stop coughing!")]</span>")
M.Stun(20)
M.emote("cough")
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 6)
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 12)
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 18)
if(infective)
A.spread(A.holder, 1)
if(power >= 2 && prob(10))
to_chat(M, "<span notice='userdanger'>[pick("You have a coughing fit!", "You can't stop coughing!")]</span>")
M.Stun(20)
M.emote("cough")
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 6)
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 12)
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 18)
if(infective)
A.spread(1)
@@ -63,14 +63,14 @@ Bonus
M.adjust_fire_stacks(1 * power)
M.adjustFireLoss(3 * power)
if(infective)
A.spread(A.holder, 2)
A.spread(2)
return 1
/datum/symptom/fire/proc/Firestacks_stage_5(mob/living/M, datum/disease/advance/A)
M.adjust_fire_stacks(3 * power)
M.adjustFireLoss(5 * power)
if(infective)
A.spread(A.holder, 4)
A.spread(4)
return 1
/*
+33 -32
View File
@@ -1,34 +1,34 @@
/*
//////////////////////////////////////
Sneezing
Very Noticable.
Increases resistance.
Doesn't increase stage speed.
Very transmittable.
Low Level.
Bonus
Forces a spread type of AIRBORNE
with extra range!
//////////////////////////////////////
*/
/datum/symptom/sneeze
name = "Sneezing"
stealth = -2
resistance = 3
stage_speed = 0
transmittable = 4
level = 1
severity = 1
/*
//////////////////////////////////////
Sneezing
Very Noticable.
Increases resistance.
Doesn't increase stage speed.
Very transmittable.
Low Level.
Bonus
Forces a spread type of AIRBORNE
with extra range!
//////////////////////////////////////
*/
/datum/symptom/sneeze
name = "Sneezing"
stealth = -2
resistance = 3
stage_speed = 0
transmittable = 4
level = 1
severity = 1
symptom_delay_min = 5
symptom_delay_max = 35
/datum/symptom/sneeze/Start(datum/disease/advance/A)
..()
..()
if(A.properties["transmittable"] >= 9) //longer spread range
power = 2
if(A.properties["stealth"] >= 4)
@@ -41,7 +41,8 @@ Bonus
switch(A.stage)
if(1, 2, 3)
if(!suppress_warning)
M.emote("sniff")
else
M.emote("sneeze")
A.spread(A.holder, 4 + power)
M.emote("sniff")
else
M.emote("sneeze")
A.spread(5)
return
@@ -29,7 +29,7 @@
/datum/symptom/New()
var/list/S = SSdisease.list_symptoms
for(var/i = 1; i <= S.len; i++)
if(src.type == S[i])
if(type == S[i])
id = "[i]"
return
CRASH("We couldn't assign an ID!")
+1 -1
View File
@@ -8,11 +8,11 @@
permeability_mod = 1
desc = "If left untreated the subject will become very weak, and may vomit often."
severity = "Dangerous!"
longevity = 1000
disease_flags = CAN_CARRY|CAN_RESIST
spread_flags = NON_CONTAGIOUS
visibility_flags = HIDDEN_PANDEMIC
required_organs = list(/obj/item/organ/appendix)
bypasses_immunity = TRUE // Immunity is based on not having an appendix; this isn't a virus
/datum/disease/appendicitis/stage_act()
..()
+1 -1
View File
@@ -9,7 +9,7 @@
viable_mobtypes = list(/mob/living/carbon/human)
cure_chance = 15//higher chance to cure, since two reagents are required
desc = "This disease destroys the braincells, causing brain fever, brain necrosis and general intoxication."
required_organs = list(/obj/item/bodypart/head)
required_organs = list(/obj/item/organ/brain)
severity = DANGEROUS
/datum/disease/brainrot/stage_act() //Removed toxloss because damaging diseases are pretty horrible. Last round it killed the entire station because the cure didn't work -- Urist -ACTUALLY Removed rather than commented out, I don't see it returning - RR
+2 -2
View File
@@ -25,8 +25,8 @@
//Absorbs the target DNA.
strain_data["dna"] = new affected_mob.dna.type
affected_mob.dna.copy_dna(strain_data["dna"])
src.carrier = 1
src.stage = 4
carrier = TRUE
stage = 4
return
switch(stage)
-1
View File
@@ -10,7 +10,6 @@
permeability_mod = 0.75
desc = "If left untreated the subject will probably drive others to insanity."
severity = MEDIUM
longevity = 400
/datum/disease/pierrot_throat/stage_act()
..()
+1 -1
View File
@@ -13,7 +13,7 @@
/datum/disease/rhumba_beat/stage_act()
..()
if(affected_mob.ckey == "rosham")
src.cure()
cure()
return
switch(stage)
if(2)
-1
View File
@@ -73,7 +73,6 @@
permeability_mod = 1
cure_chance = 1
disease_flags = CAN_CARRY|CAN_RESIST
longevity = 30
desc = "Monkeys with this disease will bite humans, causing humans to mutate into a monkey."
severity = BIOHAZARD
stage_prob = 4
+3 -1
View File
@@ -1,4 +1,5 @@
/datum/disease/tuberculosis
form = "Disease"
name = "Fungal tuberculosis"
max_stages = 5
spread_text = "Airborne"
@@ -8,8 +9,9 @@
viable_mobtypes = list(/mob/living/carbon/human)
cure_chance = 5//like hell are you getting out of hell
desc = "A rare highly transmittable virulent virus. Few samples exist, rumoured to be carefully grown and cultured by clandestine bio-weapon specialists. Causes fever, blood vomiting, lung damage, weight loss, and fatigue."
required_organs = list(/obj/item/bodypart/head)
required_organs = list(/obj/item/organ/lungs)
severity = DANGEROUS
bypasses_immunity = TRUE // TB primarily impacts the lungs; it's also bacterial or fungal in nature; viral immunity should do nothing.
/datum/disease/tuberculosis/stage_act() //it begins
..()
+10 -9
View File
@@ -629,10 +629,11 @@
text = "<i><b>[text]</b></i>: "
if (ishuman(current))
text += "<a href='?src=\ref[src];monkey=healthy'>healthy</a>|<a href='?src=\ref[src];monkey=infected'>infected</a>|<b>HUMAN</b>|other"
else if (ismonkey(current))
var/found = 0
for(var/datum/disease/D in current.viruses)
if(istype(D, /datum/disease/transformation/jungle_fever)) found = 1
else if(ismonkey(current))
var/found = FALSE
for(var/datum/disease/transformation/jungle_fever/JF in current.viruses)
found = TRUE
break
if(found)
text += "<a href='?src=\ref[src];monkey=healthy'>healthy</a>|<b>INFECTED</b>|<a href='?src=\ref[src];monkey=human'>human</a>|other"
@@ -1348,7 +1349,8 @@
src = M.mind
//to_chat(world, "DEBUG: \"healthy\": M=[M], M.mind=[M.mind], src=[src]!")
else if (istype(M) && length(M.viruses))
for(var/datum/disease/D in M.viruses)
for(var/thing in M.viruses)
var/datum/disease/D = thing
D.cure(0)
if("infected")
if (check_rights(R_ADMIN, 0))
@@ -1368,10 +1370,9 @@
var/mob/living/carbon/human/H = current
var/mob/living/carbon/monkey/M = current
if (istype(M))
for(var/datum/disease/D in M.viruses)
if (istype(D,/datum/disease/transformation/jungle_fever))
D.cure(0)
sleep(0) //because deleting of virus is doing throught spawn(0)
for(var/datum/disease/transformation/jungle_fever/JF in M.viruses)
JF.cure(0)
sleep(0) //because deleting of virus is doing throught spawn(0) //What
log_admin("[key_name(usr)] attempting to humanize [key_name(current)]")
message_admins("<span class='notice'>[key_name_admin(usr)] attempting to humanize [key_name_admin(current)]</span>")
H = M.humanize(TR_KEEPITEMS | TR_KEEPIMPLANTS | TR_KEEPORGANS | TR_KEEPDAMAGE | TR_KEEPVIRUS | TR_DEFAULTMSG)