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:
vageyenaman@gmail.com
2011-07-02 04:00:25 +00:00
parent dfc0156af7
commit eee36e4f7e
43 changed files with 432 additions and 234 deletions
+6 -4
View File
@@ -2163,10 +2163,12 @@ var/showadminmessages = 1
if (ticker.mode.config_tag == "changeling")
return 2
return 1
if(istype(M.virus, /datum/disease/jungle_fever))
if (ticker.mode.config_tag == "monkey")
return 2
return 1
for(var/datum/disease/D in M.viruses)
if(istype(D, /datum/disease/jungle_fever))
if (ticker.mode.config_tag == "monkey")
return 2
return 1
if(isrobot(M))
var/mob/living/silicon/robot/R = M
if(R.emagged)
+1 -1
View File
@@ -96,7 +96,7 @@
/client/proc/mod_list(var/list/L)
if(!istype(L,/list)) src << "Not a List."
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "cuffed", "ka", "last_eaten", "urine", "poo", "icon", "icon_state")
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine", "poo", "icon", "icon_state")
var/list/names = sortList(L)
+1 -2
View File
@@ -725,8 +725,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
message_admins("[key_name_admin(usr)] has gibbed [key_name_admin(M)]", 1)
if (istype(M, /mob/dead/observer))
var/virus = M.virus
gibs(M.loc, virus)
gibs(M.loc, M.viruses)
return
M.gib()
+1 -1
View File
@@ -255,7 +255,7 @@
..()
/*
var/datum/disease/F = new /datum/disease/pierrot_throat(0)
var/list/data = list("virus"= F)
var/list/data = list("viruses"= list(F))
reagents.add_reagent("blood", 4, data)
*/
reagents.add_reagent("nutriment", 6)
@@ -154,7 +154,7 @@
return
else if (stat == 2 && !client)
gibs(loc, virus)
gibs(loc, viruses)
del(src)
return
@@ -533,8 +533,9 @@
return 1
handle_virus_updates()
if(src.bodytemperature > 406 && src.virus)
src.virus.cure()
if(src.bodytemperature > 406)
for(var/datum/disease/D in viruses)
D.cure()
return
check_if_buckled()
@@ -139,7 +139,7 @@
return
else if (stat == 2 && !client)
gibs(loc, virus)
gibs(loc, viruses)
del(src)
return
@@ -465,8 +465,9 @@
return
handle_virus_updates()
if(bodytemperature > 406 && virus)
virus.cure()
if(bodytemperature > 406)
for(var/datum/disease/D in viruses)
D.cure()
return
check_if_buckled()
+3 -2
View File
@@ -295,6 +295,7 @@
return 1
handle_virus_updates()
if(bodytemperature > 406 && virus)
virus.cure()
if(bodytemperature > 409)
for(var/datum/disease/D in viruses)
D.cure()
return
+40
View File
@@ -47,6 +47,24 @@
/mob/living/carbon/attack_hand(mob/M as mob)
if(!istype(M, /mob/living/carbon)) return
for(var/datum/disease/D in viruses)
var/s_spread_type
if(D.spread_type!=SPECIAL && D.spread_type!=AIRBORNE)
s_spread_type = D.spread_type
D.spread_type = CONTACT_HANDS
M.contract_disease(D)
D.spread_type = s_spread_type
for(var/datum/disease/D in M.viruses)
var/s_spread_type
if(D.spread_type!=SPECIAL && D.spread_type!=AIRBORNE)
s_spread_type = D.spread_type
D.spread_type = CONTACT_HANDS
contract_disease(D)
D.spread_type = s_spread_type
/* // old code: doesn't support multiple viruses
if(src.virus || M.virus)
var/s_spread_type
if(src.virus && src.virus.spread_type!=SPECIAL && src.virus.spread_type!=AIRBORNE)
@@ -60,11 +78,32 @@
M.virus.spread_type = CONTACT_GENERAL
src.contract_disease(M.virus)
M.virus.spread_type = s_spread_type
*/
return
/mob/living/carbon/attack_paw(mob/M as mob)
if(!istype(M, /mob/living/carbon)) return
for(var/datum/disease/D in viruses)
var/s_spread_type
if(D.spread_type!=SPECIAL && D.spread_type!=AIRBORNE)
s_spread_type = D.spread_type
D.spread_type = CONTACT_HANDS
M.contract_disease(D)
D.spread_type = s_spread_type
for(var/datum/disease/D in M.viruses)
var/s_spread_type
if(D.spread_type!=SPECIAL && D.spread_type!=AIRBORNE)
s_spread_type = D.spread_type
D.spread_type = CONTACT_HANDS
contract_disease(D)
D.spread_type = s_spread_type
/*
if(src.virus || M.virus)
var/s_spread_type
if(src.virus && src.virus.spread_type!=SPECIAL && src.virus.spread_type!=AIRBORNE)
@@ -78,6 +117,7 @@
M.virus.spread_type = CONTACT_GENERAL
src.contract_disease(M.virus)
M.virus.spread_type = s_spread_type
*/
return
/mob/living/carbon/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0)
+15 -11
View File
@@ -459,7 +459,7 @@
return
else if (stat == 2 && !client)
gibs(loc, virus)
gibs(loc, viruses)
del(src)
return
@@ -1440,11 +1440,13 @@
else
UpdateDamage()
updatehealth()
if(istype(M.virus, /datum/disease/jungle_fever))
var/mob/living/carbon/human/H = src
src = null
src = H.monkeyize()
contract_disease(M.virus,1,0)
for(var/datum/disease/D in M.viruses)
if(istype(D, /datum/disease/jungle_fever))
var/mob/living/carbon/human/H = src
src = null
src = H.monkeyize()
contract_disease(D,1,0)
return
@@ -1493,11 +1495,13 @@
else
UpdateDamage()
updatehealth()
if(istype(M.virus, /datum/disease/jungle_fever))
var/mob/living/carbon/human/H = src
src = null
src = H.monkeyize()
contract_disease(M.virus,1,0)
for(var/datum/disease/D in M.viruses)
if(istype(D, /datum/disease/jungle_fever))
var/mob/living/carbon/human/H = src
src = null
src = H.monkeyize()
contract_disease(D,1,0)
return
/mob/living/carbon/human/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
+10 -3
View File
@@ -838,14 +838,20 @@
see_invisible = 0
else if (istype(glasses, /obj/item/clothing/glasses/hud/health))
if(client)
var/icon/tempHud = 'hud.dmi'
for(var/mob/living/carbon/human/patient in view(src))
var/foundVirus = 0
for(var/datum/disease/D in patient.viruses)
foundVirus++
client.images += image(tempHud,patient,"hud[RoundHealth(patient.health)]")
if(patient.stat == 2)
client.images += image(tempHud,patient,"huddead")
else if(patient.alien_egg_flag)
client.images += image(tempHud,patient,"hudxeno")
else if(patient.virus)
else if(foundVirus)
client.images += image(tempHud,patient,"hudill")
else
client.images += image(tempHud,patient,"hudhealthy")
@@ -986,8 +992,9 @@
return
handle_virus_updates()
if(bodytemperature > 406 && virus)
virus.cure()
if(bodytemperature > 406)
for(var/datum/disease/D in viruses)
D.cure()
return
+15 -12
View File
@@ -12,18 +12,21 @@
var/imax = rand(5,20)
for(var/i = 0,i<imax,i++)
message += "E"
if(istype(src.virus, /datum/disease/pierrot_throat))
var/list/temp_message = dd_text2list(message, " ")
var/list/pick_list = list()
for(var/i = 1, i <= temp_message.len, i++)
pick_list += i
for(var/i=1, ((i <= src.virus.stage) && (i <= temp_message.len)), i++)
if(prob(5 * src.virus.stage))
var/H = pick(pick_list)
if(findtext(temp_message[H], "*") || findtext(temp_message[H], ";") || findtext(temp_message[H], ":")) continue
temp_message[H] = "HONK"
pick_list -= H
message = dd_list2text(temp_message, " ")
for(var/datum/disease/D in viruses)
if(istype(D, /datum/disease/pierrot_throat))
var/list/temp_message = dd_text2list(message, " ")
var/list/pick_list = list()
for(var/i = 1, i <= temp_message.len, i++)
pick_list += i
for(var/i=1, ((i <= src.virus.stage) && (i <= temp_message.len)), i++)
if(prob(5 * src.virus.stage))
var/H = pick(pick_list)
if(findtext(temp_message[H], "*") || findtext(temp_message[H], ";") || findtext(temp_message[H], ":")) continue
temp_message[H] = "HONK"
pick_list -= H
message = dd_list2text(temp_message, " ")
//Ninja mask obscures text and voice if set to do so.
//Would make it more global but it's sort of ninja specific.
if(istype(src.wear_mask, /obj/item/clothing/mask/gas/voice/space_ninja)&&src.wear_mask:voice=="Unknown")
@@ -558,8 +558,9 @@
return
handle_virus_updates()
if(src.bodytemperature > 406 && src.virus)
src.virus.cure()
if(src.bodytemperature > 406)
for(var/datum/disease/D in viruses)
D.cure()
return
check_if_buckled()
@@ -160,8 +160,10 @@
if (mutations & HULK) damage += 10
bruteloss += damage
updatehealth()
if(istype(M.virus, /datum/disease/jungle_fever))
contract_disease(M.virus,1,0)
for(var/datum/disease/D in M.viruses)
if(istype(D, /datum/disease/jungle_fever))
contract_disease(D,1,0)
else
for(var/mob/O in viewers(src, null))
O.show_message(text("\red <B>[M.name] has attempted to bite []!</B>", src), 1)
@@ -181,8 +183,9 @@
var/damage = rand(1, 5)
bruteloss += damage
health = 100 - oxyloss - toxloss - fireloss - bruteloss
if(istype(M.virus, /datum/disease/jungle_fever))
contract_disease(M.virus,1,0)
for(var/datum/disease/D in M.viruses)
if(istype(D, /datum/disease/jungle_fever))
contract_disease(D,1,0)
else
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>[M.name] has attempted to bite [name]!</B>", 1)
+5 -1
View File
@@ -34,12 +34,16 @@
var/icon/tempHud = 'hud.dmi'
var/turf/T = get_turf_or_move(src.loc)
for(var/mob/living/carbon/human/patient in view(T))
var/foundVirus = 0
for(var/datum/disease/D in patient.viruses) foundVirus = 1
client.images += image(tempHud,patient,"hud[RoundHealth(patient.health)]")
if(patient.stat == 2)
client.images += image(tempHud,patient,"huddead")
else if(patient.alien_egg_flag)
client.images += image(tempHud,patient,"hudxeno")
else if(patient.virus)
else if(foundVirus)
client.images += image(tempHud,patient,"hudill")
else
client.images += image(tempHud,patient,"hudhealthy")
@@ -469,12 +469,12 @@
Structural Integrity: [M.bruteloss > 50 ? "<font color=#FF5555>" : "<font color=#55FF55>"][M.bruteloss]</font><br>
Body Temperature: [M.bodytemperature-T0C]&deg;C ([M.bodytemperature*1.8-459.67]&deg;F)<br>
"}
if(M.virus)
for(var/datum/disease/D in M.viruses)
dat += {"<h4>Infection Detected.</h4><br>
Name: [M.virus.name]<br>
Type: [M.virus.spread]<br>
Stage: [M.virus.stage]/[M.virus.max_stages]<br>
Possible Cure: [M.virus.cure]<br>
Name: [D.name]<br>
Type: [D.spread]<br>
Stage: [D.stage]/[D.max_stages]<br>
Possible Cure: [D.cure]<br>
"}
dat += "<a href='byond://?src=\ref[src];software=medicalhud;sub=0'>Visual Status Overlay</a><br>"
return dat
+8 -11
View File
@@ -2008,8 +2008,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
/mob/proc/gib()
if (istype(src, /mob/dead/observer))
var/V = virus
gibs(loc, V)
gibs(loc, viruses)
return
if(!isrobot(src))//Cyborgs no-longer "die" when gibbed.
death(1)
@@ -2033,22 +2032,20 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
flick("gibbed-r", animation)
if(key)
var/V = virus
if (istype(src, /mob/living/silicon))
robogibs(loc, V)
robogibs(loc, viruses)
else if (istype(src, /mob/living/carbon/alien))
xgibs(loc, V)
xgibs(loc, viruses)
else
gibs(loc, V)
gibs(loc, viruses)
else
var/V = virus
if (istype(src, /mob/living/silicon))
robogibs(loc, V)
robogibs(loc, viruses)
else if (istype(src, /mob/living/carbon/alien))
xgibs(loc, V)
xgibs(loc, viruses)
else
gibs(loc, V)
gibs(loc, viruses)
sleep(15)
del(src)
@@ -2216,7 +2213,7 @@ note dizziness decrements automatically in the mob's Life() proc.
/client/proc/station_explosion_cinematic(var/derp)
if(!src.mob)
return
var/mob/M = src.mob
M.loc = null // HACK, but whatever, this works
+5 -4
View File
@@ -30,10 +30,11 @@
//O.dna.struc_enzymes = "0983E840344C39F4B059D5145FC5785DC6406A4BB8"
O.dna.struc_enzymes = "[copytext(O.dna.struc_enzymes,1,1+3*13)]BB8"
O.loc = loc
O.virus = virus
virus = null
if (O.virus)
O.virus.affected_mob = O
O.viruses = viruses
viruses = list()
for(var/datum/disease/D in O.viruses)
D.affected_mob = O
if (client)
client.mob = O
if(mind)