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

* Revert "Automatic changelog generation for PR #2021 [ci skip]"

This reverts commit 9d0cd37dd3.

* Revert "Disease Refactor (#2021)"

This reverts commit f2ac487927.
This commit is contained in:
kevinz000
2017-07-15 11:41:36 -07:00
committed by GitHub
parent 9d0cd37dd3
commit 44742cb115
56 changed files with 255 additions and 210 deletions
+3 -7
View File
@@ -1,7 +1,6 @@
/mob/proc/HasDisease(datum/disease/D)
for(var/thing in viruses)
var/datum/disease/DD = thing
for(var/datum/disease/DD in viruses)
if(D.IsSame(DD))
return 1
return 0
@@ -40,7 +39,7 @@
var/datum/disease/DD = new D.type(1, D, 0)
viruses += DD
DD.affected_mob = src
SSdisease.active_diseases += DD //Add it to the active diseases list, now that it's actually in a mob and being processed.
DD.holder = src
//Copy properties over. This is so edited diseases persist.
var/list/skipped = list("affected_mob","holder","carrier","stage","type","parent_type","vars","transformed")
@@ -148,9 +147,6 @@
/mob/living/carbon/human/CanContractDisease(datum/disease/D)
if(dna && (VIRUSIMMUNE in dna.species.species_traits) && !D.bypasses_immunity)
if(dna && (VIRUSIMMUNE in dna.species.species_traits))
return 0
for(var/thing in D.required_organs)
if(!((locate(thing) in bodyparts) || (locate(thing) in internal_organs)))
return 0
return ..()
+58 -15
View File
@@ -46,23 +46,21 @@
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 = 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/carrier = 0 //If our host is only a carrier
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()
@@ -95,16 +93,13 @@
if(!. || (needs_all_cures && . < cures.len))
return 0
/datum/disease/proc/spread(force_spread = 0)
if(!affected_mob)
return
/datum/disease/proc/spread(atom/source, force_spread = 0)
if((spread_flags & SPECIAL || spread_flags & NON_CONTAGIOUS || spread_flags & BLOOD) && !force_spread)
return
if(affected_mob.reagents.has_reagent("spaceacillin") || (affected_mob.satiety > 0 && prob(affected_mob.satiety/10)))
return
if(affected_mob)
if( affected_mob.reagents.has_reagent("spaceacillin") || (affected_mob.satiety > 0 && prob(affected_mob.satiety/10)) )
return
var/spread_range = 1
@@ -114,9 +109,15 @@
if(spread_flags & AIRBORNE)
spread_range++
var/turf/T = affected_mob.loc
if(!source)
if(affected_mob)
source = affected_mob
else
return
var/turf/T = source.loc
if(istype(T))
for(var/mob/living/carbon/C in oview(spread_range, affected_mob))
for(var/mob/living/carbon/C in oview(spread_range, source))
var/turf/V = get_turf(C)
if(V)
while(TRUE)
@@ -128,6 +129,29 @@
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)
@@ -137,6 +161,20 @@
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
@@ -153,6 +191,11 @@
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
+11 -3
View File
@@ -91,7 +91,7 @@
if(!(istype(D, /datum/disease/advance)))
return 0
if(GetDiseaseID() != D.GetDiseaseID())
if(src.GetDiseaseID() != D.GetDiseaseID())
return 0
return 1
@@ -116,7 +116,7 @@
// Mix the symptoms of two diseases (the src and the argument)
/datum/disease/advance/proc/Mix(datum/disease/advance/D)
if(!(IsSame(D)))
if(!(src.IsSame(D)))
var/list/possible_symptoms = shuffle(D.symptoms)
for(var/datum/symptom/S in possible_symptoms)
AddSymptom(new S.type)
@@ -156,6 +156,7 @@
return generated
/datum/disease/advance/proc/Refresh(new_name = 0)
//to_chat(world, "[src.name] \ref[src] - REFRESH!")
GenerateProperties()
AssignProperties()
id = null
@@ -394,7 +395,7 @@
D.AssignName(new_name)
D.Refresh()
for(var/datum/disease/advance/AD in SSdisease.active_diseases)
for(var/datum/disease/advance/AD in SSdisease.processing)
AD.Refresh()
for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list))
@@ -409,6 +410,13 @@
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"]
@@ -35,5 +35,5 @@ Bonus
M.emote("sniff")
else
M.emote("sneeze")
A.spread(5)
A.spread(A.holder, 5)
return
@@ -18,7 +18,7 @@
/datum/symptom/New()
var/list/S = SSdisease.list_symptoms
for(var/i = 1; i <= S.len; i++)
if(type == S[i])
if(src.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/organ/brain)
required_organs = list(/obj/item/bodypart/head)
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"])
carrier = TRUE
stage = 4
src.carrier = 1
src.stage = 4
return
switch(stage)
+1
View File
@@ -10,6 +10,7 @@
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")
cure()
src.cure()
return
switch(stage)
if(2)
+1
View File
@@ -73,6 +73,7 @@
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
+1 -3
View File
@@ -1,5 +1,4 @@
/datum/disease/tuberculosis
form = "Disease"
name = "Fungal tuberculosis"
max_stages = 5
spread_text = "Airborne"
@@ -9,9 +8,8 @@
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/organ/lungs)
required_organs = list(/obj/item/bodypart/head)
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
..()
+9 -10
View File
@@ -629,11 +629,10 @@
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 = FALSE
for(var/datum/disease/transformation/jungle_fever/JF in current.viruses)
found = TRUE
break
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
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"
@@ -1343,8 +1342,7 @@
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/thing in M.viruses)
var/datum/disease/D = thing
for(var/datum/disease/D in M.viruses)
D.cure(0)
if("infected")
if (check_rights(R_ADMIN, 0))
@@ -1364,9 +1362,10 @@
var/mob/living/carbon/human/H = current
var/mob/living/carbon/monkey/M = current
if (istype(M))
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
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)
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)