Refactors virus spreading

This commit is contained in:
XDTM
2017-10-09 14:08:21 +02:00
committed by CitadelStationBot
parent 6f2b89ae88
commit 7a0ce217db
60 changed files with 1057 additions and 187 deletions
+3 -3
View File
@@ -139,7 +139,7 @@
if(blood_data["viruses"])
for(var/thing in blood_data["viruses"])
var/datum/disease/D = thing
if((D.spread_flags & SPECIAL) || (D.spread_flags & NON_CONTAGIOUS))
if((D.spread_flags & VIRUS_SPREAD_SPECIAL) || (D.spread_flags & VIRUS_SPREAD_NON_CONTAGIOUS))
continue
C.ForceContractDisease(D)
if(!(blood_data["blood_type"] in get_safe_blood(C.dna.blood_type)))
@@ -258,14 +258,14 @@
temp_blood_DNA |= drop.blood_DNA.Copy() //we transfer the dna from the drip to the splatter
qdel(drop)//the drip is replaced by a bigger splatter
else
drop = new(T)
drop = new(T, get_static_viruses())
drop.transfer_mob_blood_dna(src)
return
// Find a blood decal or create a new one.
var/obj/effect/decal/cleanable/blood/B = locate() in T
if(!B)
B = new /obj/effect/decal/cleanable/blood/splatter(T)
B = new /obj/effect/decal/cleanable/blood/splatter(T, get_static_viruses())
B.transfer_mob_blood_dna(src) //give blood info to the blood decal.
if(temp_blood_DNA)
B.blood_DNA |= temp_blood_DNA
+1 -1
View File
@@ -756,7 +756,7 @@
B.damaged_brain = 0
for(var/thing in viruses)
var/datum/disease/D = thing
if(D.severity != NONTHREAT)
if(D.severity != VIRUS_SEVERITY_POSITIVE)
D.cure(0)
if(admin_revive)
regenerate_limbs()
@@ -113,13 +113,13 @@
for(var/thing in viruses)
var/datum/disease/D = thing
if(D.IsSpreadByTouch())
user.ContractDisease(D)
if(D.spread_flags & VIRUS_SPREAD_CONTACT_SKIN)
user.ContactContractDisease(D)
for(var/thing in user.viruses)
var/datum/disease/D = thing
if(D.IsSpreadByTouch())
ContractDisease(D)
if(D.spread_flags & VIRUS_SPREAD_CONTACT_SKIN)
ContactContractDisease(D)
if(lying && surgeries.len)
if(user.a_intent == INTENT_HELP)
@@ -132,13 +132,13 @@
/mob/living/carbon/attack_paw(mob/living/carbon/monkey/M)
for(var/thing in viruses)
var/datum/disease/D = thing
if(D.IsSpreadByTouch())
M.ContractDisease(D)
if(D.spread_flags & VIRUS_SPREAD_CONTACT_SKIN)
M.ContactContractDisease(D)
for(var/thing in M.viruses)
var/datum/disease/D = thing
if(D.IsSpreadByTouch())
ContractDisease(D)
if(D.spread_flags & VIRUS_SPREAD_CONTACT_SKIN)
ContactContractDisease(D)
if(M.a_intent == INTENT_HELP)
help_shake_act(M)
@@ -6,9 +6,9 @@
/mob/living/carbon/human/spawn_gibs(with_bodyparts)
if(with_bodyparts)
new /obj/effect/gibspawner/human(get_turf(src), dna)
new /obj/effect/gibspawner/human(get_turf(src), dna, get_static_viruses())
else
new /obj/effect/gibspawner/humanbodypartless(get_turf(src), dna)
new /obj/effect/gibspawner/humanbodypartless(get_turf(src), dna, get_static_viruses())
/mob/living/carbon/human/spawn_dust(just_ash = FALSE)
if(just_ash)
+1 -1
View File
@@ -18,7 +18,7 @@
return
/mob/living/proc/spawn_gibs()
new /obj/effect/gibspawner/generic(get_turf(src))
new /obj/effect/gibspawner/generic(get_turf(src), null, get_static_viruses())
/mob/living/proc/spill_organs()
return
+12 -1
View File
@@ -108,6 +108,17 @@
//Even if we don't push/swap places, we "touched" them, so spread fire
spreadFire(M)
//Also diseases
for(var/thing in viruses)
var/datum/disease/D = thing
if(D.spread_flags & VIRUS_SPREAD_CONTACT_SKIN)
M.ContactContractDisease(D)
for(var/thing in M.viruses)
var/datum/disease/D = thing
if(D.spread_flags & VIRUS_SPREAD_CONTACT_SKIN)
ContactContractDisease(D)
if(now_pushing)
return 1
@@ -507,7 +518,7 @@
if((newdir in GLOB.cardinals) && (prob(50)))
newdir = turn(get_dir(target_turf, start), 180)
if(!blood_exists)
new /obj/effect/decal/cleanable/trail_holder(start)
new /obj/effect/decal/cleanable/trail_holder(start, get_static_viruses())
for(var/obj/effect/decal/cleanable/trail_holder/TH in start)
if((!(newdir in TH.existing_dirs) || trail_type == "trails_1" || trail_type == "trails_2") && TH.existing_dirs.len <= 16) //maximum amount of overlays is 16 (all light & heavy directions filled)
@@ -376,8 +376,8 @@
var/datum/disease/D = thing
//the medibot can't detect viruses that are undetectable to Health Analyzers or Pandemic machines.
if(!(D.visibility_flags & HIDDEN_SCANNER || D.visibility_flags & HIDDEN_PANDEMIC) \
&& D.severity != NONTHREAT \
&& (D.stage > 1 || (D.spread_flags & AIRBORNE))) // medibot can't detect a virus in its initial stage unless it spreads airborne.
&& D.severity != VIRUS_SEVERITY_POSITIVE \
&& (D.stage > 1 || (D.spread_flags & VIRUS_SPREAD_AIRBORNE))) // medibot can't detect a virus in its initial stage unless it spreads airborne.
return 1 //STOP DISEASE FOREVER
return 0
@@ -428,8 +428,8 @@
var/datum/disease/D = thing
//detectable virus
if((!(D.visibility_flags & HIDDEN_SCANNER)) || (!(D.visibility_flags & HIDDEN_PANDEMIC)))
if(D.severity != NONTHREAT) //virus is harmful
if((D.stage > 1) || (D.spread_flags & AIRBORNE))
if(D.severity != VIRUS_SEVERITY_POSITIVE) //virus is harmful
if((D.stage > 1) || (D.spread_flags & VIRUS_SPREAD_AIRBORNE))
virus = 1
if(!reagent_id && (virus))
@@ -1000,7 +1000,7 @@
var/datum/disease/parrot_possession/P = new
P.parrot = src
loc = H
H.ContractDisease(P)
H.ForceContractDisease(P)
parrot_interest = null
H.visible_message("<span class='danger'>[src] dive bombs into [H]'s chest and vanishes!</span>", "<span class='userdanger'>[src] dive bombs into your chest, vanishing! This can't be good!</span>")
+22
View File
@@ -336,6 +336,18 @@
if(ismob(AM))
var/mob/M = AM
//Share diseases that are spread by touch
for(var/thing in viruses)
var/datum/disease/D = thing
if(D.spread_flags & VIRUS_SPREAD_CONTACT_SKIN)
M.ContactContractDisease(D)
for(var/thing in M.viruses)
var/datum/disease/D = thing
if(D.spread_flags & VIRUS_SPREAD_CONTACT_SKIN)
ContactContractDisease(D)
add_logs(src, M, "grabbed", addition="passive grab")
if(!supress_message)
visible_message("<span class='warning'>[src] has grabbed [M] passively!</span>")
@@ -941,6 +953,16 @@
/mob/proc/get_idcard()
return
/mob/proc/get_static_viruses() //used when creating blood and other infective objects
if(!LAZYLEN(viruses))
return
var/list/datum/disease/diseases = list()
for(var/datum/disease/D in viruses)
var/static_virus = D.Copy()
diseases += static_virus
return diseases
/mob/vv_get_dropdown()
. = ..()
. += "---"