mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
Okay, this is a pretty big revision!
Viruses:
The virus system was COMPLETELY reworked.
Good news, Virologists! This means people can now be infected by multiple viruses at once. Some of the virus-spreading protocols were tweaked to support this change, and as a result, they are now considerably more infectious. I also changed some background reagent variables to better support DNA, blood type, and virus combination.
Turrets:
Fixed some lingering bugs that would bog down the global event processor.
Changelings:
People turned into "husks" after being drained of their DNA by changelings can no longer be cloned.
Miscellaneous:
I tweaked a LOT of mob code. This shouldn't have any noticeable impact on anything, but was required in order support the virus overhaul.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1753 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
+51
-25
@@ -84,6 +84,13 @@ to null does not delete the object itself. Thank you.
|
||||
/mob/proc/contract_disease(var/datum/disease/virus, var/skip_this = 0, var/force_species_check=1)
|
||||
// world << "Contract_disease called by [src] with virus [virus]"
|
||||
if(stat >=2) return
|
||||
if(virus.type in resistances)
|
||||
if(prob(99.9)) return
|
||||
resistances.Remove(virus.type)//the resistance is futile
|
||||
|
||||
for(var/datum/disease/D in viruses)
|
||||
if(istype(D, virus.type))
|
||||
return // two viruses of the same kind can't infect a body at once!!
|
||||
|
||||
|
||||
if(force_species_check)
|
||||
@@ -95,23 +102,21 @@ to null does not delete the object itself. Thank you.
|
||||
break
|
||||
if(fail) return
|
||||
|
||||
if(skip_this == 1)//be wary, it replaces the current disease...
|
||||
if(src.virus)
|
||||
src.virus.cure(0)
|
||||
src.virus = new virus.type
|
||||
src.virus.affected_mob = src
|
||||
src.virus.strain_data = virus.strain_data.Copy()
|
||||
src.virus.holder = src
|
||||
if(skip_this == 1)
|
||||
//if(src.virus) < -- this used to replace the current disease. Not anymore!
|
||||
//src.virus.cure(0)
|
||||
|
||||
var/datum/disease/v = new virus.type
|
||||
src.viruses += v
|
||||
v.affected_mob = src
|
||||
v.strain_data = v.strain_data.Copy()
|
||||
v.holder = src
|
||||
if(prob(5))
|
||||
src.virus.carrier = 1
|
||||
v.carrier = 1
|
||||
return
|
||||
|
||||
if(src.virus)
|
||||
return
|
||||
|
||||
if(virus.type in resistances)
|
||||
if(prob(99.9)) return
|
||||
resistances.Remove(virus.type)//the resistance is futile
|
||||
//if(src.virus) //
|
||||
//return //
|
||||
|
||||
|
||||
/*
|
||||
@@ -223,7 +228,7 @@ to null does not delete the object itself. Thank you.
|
||||
passed = (prob(50*virus.permeability_mod))
|
||||
|
||||
if(passed)
|
||||
// world << "Infection in the mob [src]. YAY"
|
||||
//world << "Infection in the mob [src]. YAY"
|
||||
|
||||
|
||||
/*
|
||||
@@ -253,18 +258,20 @@ to null does not delete the object itself. Thank you.
|
||||
else if(prob(15))
|
||||
return
|
||||
else*/
|
||||
src.virus = new virus.type
|
||||
src.virus.strain_data = virus.strain_data.Copy()
|
||||
src.virus.affected_mob = src
|
||||
src.virus.holder = src
|
||||
var/datum/disease/v = new virus.type
|
||||
src.viruses += v
|
||||
v.affected_mob = src
|
||||
v.strain_data = v.strain_data.Copy()
|
||||
v.holder = src
|
||||
if(prob(5))
|
||||
src.virus.carrier = 1
|
||||
v.carrier = 1
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
/datum/disease/proc/spread(var/source=null)
|
||||
/datum/disease/proc/spread(var/atom/source=null)
|
||||
//world << "Disease [src] proc spread was called from holder [source]"
|
||||
|
||||
if(spread_type == SPECIAL)//does not spread
|
||||
return
|
||||
|
||||
@@ -279,8 +286,9 @@ to null does not delete the object itself. Thank you.
|
||||
|
||||
|
||||
var/check_range = AIRBORNE//defaults to airborne - range 4
|
||||
|
||||
if(spread_type != AIRBORNE)
|
||||
check_range = 0
|
||||
check_range = 0 // everything else, like infect-on-contact things, only infect things on top of it
|
||||
|
||||
for(var/mob/living/carbon/M in oviewers(check_range, source))
|
||||
M.contract_disease(src)
|
||||
@@ -290,8 +298,15 @@ to null does not delete the object itself. Thank you.
|
||||
|
||||
/datum/disease/proc/process()
|
||||
if(!holder) return
|
||||
if(prob(40))
|
||||
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))
|
||||
del(D) // if there are somehow two viruses of the same kind in the system, delete the other one
|
||||
|
||||
if(holder == affected_mob)
|
||||
if(affected_mob.stat < 2) //he's alive
|
||||
stage_act()
|
||||
@@ -301,8 +316,19 @@ to null does not delete the object itself. Thank you.
|
||||
affected_mob = null
|
||||
if(!affected_mob) //the virus is in inanimate obj
|
||||
// world << "[src] longevity = [longevity]"
|
||||
if(--longevity<=0)
|
||||
cure(0)
|
||||
/*
|
||||
if(holder)
|
||||
|
||||
// spreads the love. Why hasn't anyone coded this in yet?!?!?!?
|
||||
for(var/mob/living/M in view(1, holder))
|
||||
if(M.stat != 2)
|
||||
if(prob(90))
|
||||
M.contract_disease(src)
|
||||
*/
|
||||
|
||||
if(prob(70))
|
||||
if(--longevity<=0)
|
||||
cure(0)
|
||||
return
|
||||
|
||||
/datum/disease/proc/cure(var/resistance=1)//if resistance = 0, the mob won't develop resistance to disease
|
||||
|
||||
+14
-7
@@ -181,10 +181,15 @@ datum/mind
|
||||
if (istype(current, /mob/living/carbon/human))
|
||||
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 (istype(current, /mob/living/carbon/monkey))
|
||||
if(istype(current.virus, /datum/disease/jungle_fever))
|
||||
var/found = 0
|
||||
for(var/datum/disease/D in current.viruses)
|
||||
if(istype(D, /datum/disease/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"
|
||||
else
|
||||
text += "<b>HEALTHY</b>|<a href='?src=\ref[src];monkey=infected'>infected</a>|<a href='?src=\ref[src];monkey=human'>human</a>|other"
|
||||
|
||||
else
|
||||
text += "healthy|infected|human|<b>OTHER</b>"
|
||||
sections["monkey"] = text
|
||||
@@ -675,9 +680,10 @@ datum/mind
|
||||
M = H.monkeyize()
|
||||
src = M.mind
|
||||
//world << "DEBUG: \"healthy\": M=[M], M.mind=[M.mind], src=[src]!"
|
||||
else if (istype(M) && M.virus)
|
||||
M.virus.cure(0)
|
||||
sleep(0) //because deleting of virus is doing throught spawn(0)
|
||||
else if (istype(M) && length(M.viruses))
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
D.cure(0)
|
||||
sleep(0) //because deleting of virus is done through spawn(0)
|
||||
if("infected")
|
||||
if (usr.client.holder.level >= 3)
|
||||
var/mob/living/carbon/human/H = current
|
||||
@@ -694,9 +700,10 @@ datum/mind
|
||||
if("human")
|
||||
var/mob/living/carbon/monkey/M = current
|
||||
if (istype(M))
|
||||
if (istype(M.virus,/datum/disease/jungle_fever))
|
||||
M.virus.cure(0)
|
||||
sleep(0) //because deleting of virus is doing throught spawn(0)
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
if (istype(D,/datum/disease/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("\blue [key_name_admin(usr)] attempting to humanize [key_name_admin(current)]", 1)
|
||||
var/obj/item/weapon/dnainjector/m2h/m2h = new
|
||||
|
||||
Reference in New Issue
Block a user