mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-16 20:16:09 +00:00
Merge pull request #5545 from RemieRichards/DiseaseRework
Disease Code Partial Rework
This commit is contained in:
@@ -449,7 +449,7 @@ var/list/admin_verbs_hideable = list(
|
||||
set desc = "Gives a Disease to a mob."
|
||||
var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in diseases
|
||||
if(!D) return
|
||||
T.contract_disease(new D, 1)
|
||||
T.ForceContractDisease(new D,)
|
||||
feedback_add_details("admin_verb","GD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
log_admin("[key_name(usr)] gave [key_name(T)] the disease [D].")
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] gave [key_name(T)] the disease [D].</span>")
|
||||
|
||||
@@ -1636,7 +1636,7 @@ ________________________________________________________________________________
|
||||
dat += "Body Temperature: [U.bodytemperature-T0C]°C ([U.bodytemperature*1.8-459.67]°F)<br>"
|
||||
|
||||
for(var/datum/disease/D in U.viruses)
|
||||
dat += "Warning: Virus Detected. Name: [D.name].Type: [D.spread]. Stage: [D.stage]/[D.max_stages]. Possible Cure: [D.cure].<br>"
|
||||
dat += "Warning: Virus Detected. Name: [D.name].Type: [D.spread_text]. Stage: [D.stage]/[D.max_stages]. Possible Cure: [D.cure_text].<br>"
|
||||
dat += "<ul>"
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
if(R.id=="radium"&&s_control)//Can only directly inject radium when AI is in control.
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
B.data["donor"] = O
|
||||
|
||||
for(var/datum/disease/D in O.viruses)
|
||||
if(D.spread_type != SPECIAL)
|
||||
if(!(D.spread_flags & SPECIAL))
|
||||
B.data["viruses"] += D.Copy()
|
||||
if(check_dna_integrity(O))
|
||||
B.data["blood_DNA"] = copytext(O.dna.unique_enzymes,1,0)
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/carbon/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0)
|
||||
shock_damage *= siemens_coeff
|
||||
if (shock_damage<1)
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
return
|
||||
|
||||
for(var/datum/disease/D in viruses)
|
||||
if(D.spread_by_touch())
|
||||
user.contract_disease(D, 0, 1, CONTACT_HANDS)
|
||||
if(D.IsSpreadByTouch())
|
||||
user.ContractDisease(D)
|
||||
|
||||
for(var/datum/disease/D in user.viruses)
|
||||
if(D.spread_by_touch())
|
||||
contract_disease(D, 0, 1, CONTACT_HANDS)
|
||||
if(D.IsSpreadByTouch())
|
||||
ContractDisease(D)
|
||||
|
||||
if(lying || isslime(src))
|
||||
if(user.a_intent == "help")
|
||||
@@ -48,16 +48,16 @@
|
||||
return 0
|
||||
|
||||
for(var/datum/disease/D in viruses)
|
||||
if(D.spread_by_touch())
|
||||
M.contract_disease(D, 0, 1, CONTACT_HANDS)
|
||||
if(D.IsSpreadByTouch())
|
||||
M.ContractDisease(D)
|
||||
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
if(D.spread_by_touch())
|
||||
contract_disease(D, 0, 1, CONTACT_HANDS)
|
||||
if(D.IsSpreadByTouch())
|
||||
ContractDisease(D)
|
||||
|
||||
if(..()) //successful monkey bite.
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
contract_disease(D,1,0)
|
||||
ForceContractDisease(D)
|
||||
return 1
|
||||
|
||||
if(M.a_intent == "help")
|
||||
|
||||
@@ -7,4 +7,6 @@
|
||||
apply_damage(damage, BRUTE, affecting, run_armor_check(affecting, "melee"))
|
||||
updatehealth()
|
||||
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
ContractDisease(D)
|
||||
return
|
||||
|
||||
@@ -508,9 +508,9 @@
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
dat += {"<h4>Infection Detected.</h4><br>
|
||||
Name: [D.name]<br>
|
||||
Type: [D.spread]<br>
|
||||
Type: [D.spread_text]<br>
|
||||
Stage: [D.stage]/[D.max_stages]<br>
|
||||
Possible Cure: [D.cure]<br>
|
||||
Possible Cure: [D.cure_text]<br>
|
||||
"}
|
||||
dat += "<a href='byond://?src=\ref[src];software=medicalhud;sub=0'>Visual Status Overlay</a><br>"
|
||||
return dat
|
||||
@@ -641,4 +641,4 @@
|
||||
/mob/living/silicon/pai/proc/chatroom()
|
||||
|
||||
pda.mode = 5
|
||||
pda.attack_self()
|
||||
pda.attack_self()
|
||||
|
||||
@@ -3,174 +3,3 @@
|
||||
Put (mob/proc)s here that are in dire need of a code cleanup.
|
||||
*/
|
||||
|
||||
/mob/proc/has_disease(var/datum/disease/virus)
|
||||
for(var/datum/disease/D in viruses)
|
||||
if(D.IsSame(virus))
|
||||
//error("[D.name]/[D.type] is the same as [virus.name]/[virus.type]")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/proc/contract_disease(var/datum/disease/virus, var/skip_this = 0, var/force_species_check=1, var/spread_type = -5)
|
||||
//world << "Contract_disease called by [src] with virus [virus]"
|
||||
if(stat >=2)
|
||||
//world << "He's dead jim."
|
||||
return
|
||||
if(istype(virus, /datum/disease/advance))
|
||||
//world << "It's an advance virus."
|
||||
var/datum/disease/advance/A = virus
|
||||
if(A.GetDiseaseID() in resistances)
|
||||
//world << "It resisted us!"
|
||||
return
|
||||
if(count_by_type(viruses, /datum/disease/advance) >= 3)
|
||||
return
|
||||
|
||||
else
|
||||
if(src.resistances.Find(virus.type))
|
||||
//world << "Normal virus and resisted"
|
||||
return
|
||||
|
||||
|
||||
if(has_disease(virus))
|
||||
return
|
||||
|
||||
|
||||
if(force_species_check)
|
||||
var/fail = 1
|
||||
for(var/name in virus.affected_species)
|
||||
var/mob_type = text2path("/mob/living/carbon/[lowertext(name)]")
|
||||
if(mob_type && istype(src, mob_type))
|
||||
fail = 0
|
||||
break
|
||||
if(fail) return
|
||||
|
||||
if(skip_this == 1)
|
||||
//world << "infectin"
|
||||
//if(src.virus) < -- this used to replace the current disease. Not anymore!
|
||||
//src.virus.cure(0)
|
||||
var/datum/disease/v = new virus.type(1, virus, 0)
|
||||
src.viruses += v
|
||||
v.affected_mob = src
|
||||
v.strain_data = virus.strain_data.Copy()
|
||||
v.holder = src
|
||||
if(v.can_carry && prob(5))
|
||||
v.carrier = 1
|
||||
return
|
||||
//world << "Not skipping."
|
||||
//if(src.virus) //
|
||||
//return //
|
||||
|
||||
|
||||
/*
|
||||
var/list/clothing_areas = list()
|
||||
var/list/covers = list(CHEST,GROIN,LEGS,FEET,ARMS,HANDS)
|
||||
for(var/Covers in covers)
|
||||
clothing_areas[Covers] = list()
|
||||
|
||||
for(var/obj/item/clothing/Clothing in src)
|
||||
if(Clothing)
|
||||
for(var/Covers in covers)
|
||||
if(Clothing&Covers)
|
||||
clothing_areas[Covers] += Clothing
|
||||
|
||||
*/
|
||||
if(prob(15/virus.permeability_mod)) return //the power of immunity compels this disease! but then you forgot resistances
|
||||
//world << "past prob()"
|
||||
var/obj/item/clothing/Cl = null
|
||||
var/passed = 1
|
||||
|
||||
//chances to target this zone
|
||||
var/head_ch
|
||||
var/body_ch
|
||||
var/hands_ch
|
||||
var/feet_ch
|
||||
|
||||
if(spread_type == -5)
|
||||
spread_type = virus.spread_type
|
||||
|
||||
switch(spread_type)
|
||||
if(CONTACT_HANDS)
|
||||
head_ch = 0
|
||||
body_ch = 0
|
||||
hands_ch = 100
|
||||
feet_ch = 0
|
||||
if(CONTACT_FEET)
|
||||
head_ch = 0
|
||||
body_ch = 0
|
||||
hands_ch = 0
|
||||
feet_ch = 100
|
||||
else
|
||||
head_ch = 100
|
||||
body_ch = 100
|
||||
hands_ch = 25
|
||||
feet_ch = 25
|
||||
|
||||
|
||||
var/target_zone = pick(head_ch;1,body_ch;2,hands_ch;3,feet_ch;4)//1 - head, 2 - body, 3 - hands, 4- feet
|
||||
|
||||
if(istype(src, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = src
|
||||
|
||||
switch(target_zone)
|
||||
if(1)
|
||||
if(isobj(H.head) && !istype(H.head, /obj/item/weapon/paper))
|
||||
Cl = H.head
|
||||
passed = prob((Cl.permeability_coefficient*100) - 1)
|
||||
if(passed && isobj(H.wear_mask))
|
||||
Cl = H.wear_mask
|
||||
passed = prob((Cl.permeability_coefficient*100) - 1)
|
||||
if(2)//arms and legs included
|
||||
if(isobj(H.wear_suit))
|
||||
Cl = H.wear_suit
|
||||
passed = prob((Cl.permeability_coefficient*100) - 1)
|
||||
if(passed && isobj(slot_w_uniform))
|
||||
Cl = slot_w_uniform
|
||||
passed = prob((Cl.permeability_coefficient*100) - 1)
|
||||
if(3)
|
||||
if(isobj(H.wear_suit) && H.wear_suit.body_parts_covered&HANDS)
|
||||
Cl = H.wear_suit
|
||||
passed = prob((Cl.permeability_coefficient*100) - 1)
|
||||
|
||||
if(passed && isobj(H.gloves))
|
||||
Cl = H.gloves
|
||||
passed = prob((Cl.permeability_coefficient*100) - 1)
|
||||
if(4)
|
||||
if(isobj(H.wear_suit) && H.wear_suit.body_parts_covered&FEET)
|
||||
Cl = H.wear_suit
|
||||
passed = prob((Cl.permeability_coefficient*100) - 1)
|
||||
|
||||
if(passed && isobj(H.shoes))
|
||||
Cl = H.shoes
|
||||
passed = prob((Cl.permeability_coefficient*100) - 1)
|
||||
else
|
||||
src << "Something strange's going on, something's wrong."
|
||||
|
||||
/*if("feet")
|
||||
if(H.shoes && istype(H.shoes, /obj/item/clothing/))
|
||||
Cl = H.shoes
|
||||
passed = prob(Cl.permeability_coefficient*100)
|
||||
//
|
||||
world << "Shoes pass [passed]"
|
||||
*/ //
|
||||
else if(istype(src, /mob/living/carbon/monkey))
|
||||
var/mob/living/carbon/monkey/M = src
|
||||
switch(target_zone)
|
||||
if(1)
|
||||
if(M.wear_mask && isobj(M.wear_mask))
|
||||
Cl = M.wear_mask
|
||||
passed = prob((Cl.permeability_coefficient*100) - 1)
|
||||
//world << "Mask pass [passed]"
|
||||
|
||||
if(!passed && spread_type == AIRBORNE && !internals)
|
||||
passed = (prob((50*virus.permeability_mod) - 1))
|
||||
|
||||
if(passed)
|
||||
//world << "Infection in the mob [src]. YAY"
|
||||
var/datum/disease/v = new virus.type(1, virus, 0)
|
||||
src.viruses += v
|
||||
v.affected_mob = src
|
||||
v.strain_data = virus.strain_data.Copy()
|
||||
v.holder = src
|
||||
if(v.can_carry && prob(5))
|
||||
v.carrier = 1
|
||||
return
|
||||
return
|
||||
|
||||
@@ -723,7 +723,7 @@ obj/machinery/computer/pandemic/proc/replicator_cooldown(var/waittime)
|
||||
var/i = 0
|
||||
for(var/datum/disease/D in Blood.data["viruses"])
|
||||
i++
|
||||
if(!D.hidden[PANDEMIC])
|
||||
if(!(D.visibility_flags & HIDDEN_PANDEMIC))
|
||||
|
||||
if(istype(D, /datum/disease/advance))
|
||||
|
||||
@@ -738,8 +738,8 @@ obj/machinery/computer/pandemic/proc/replicator_cooldown(var/waittime)
|
||||
dat += "<b>Disease Agent:</b> [D?"[D.agent] - <A href='?src=\ref[src];create_virus_culture=[i]'>Create virus culture bottle</A>":"none"]<BR>"
|
||||
dat += "<b>Common name:</b> [(D.name||"none")]<BR>"
|
||||
dat += "<b>Description: </b> [(D.desc||"none")]<BR>"
|
||||
dat += "<b>Spread:</b> [(D.spread||"none")]<BR>"
|
||||
dat += "<b>Possible cure:</b> [(D.cure||"none")]<BR><BR>"
|
||||
dat += "<b>Spread:</b> [(D.spread_text||"none")]<BR>"
|
||||
dat += "<b>Possible cure:</b> [(D.cure_text||"none")]<BR><BR>"
|
||||
|
||||
if(istype(D, /datum/disease/advance))
|
||||
var/datum/disease/advance/A = D
|
||||
|
||||
@@ -94,14 +94,14 @@ datum/reagent/blood/reaction_mob(var/mob/M, var/method=TOUCH, var/volume)
|
||||
src = null
|
||||
if(self.data && self.data["viruses"])
|
||||
for(var/datum/disease/D in self.data["viruses"])
|
||||
//var/datum/disease/virus = new D.type(0, D, 1)
|
||||
// We don't spread.
|
||||
if(D.spread_type == SPECIAL || D.spread_type == NON_CONTAGIOUS) continue
|
||||
|
||||
if(D.spread_flags & SPECIAL || D.spread_flags & NON_CONTAGIOUS)
|
||||
continue
|
||||
|
||||
if(method == TOUCH)
|
||||
M.contract_disease(D)
|
||||
M.ContractDisease(D)
|
||||
else //injected
|
||||
M.contract_disease(D, 1, 0)
|
||||
M.ForceContractDisease(D)
|
||||
|
||||
datum/reagent/blood/on_new(var/list/data)
|
||||
if(istype(data))
|
||||
@@ -349,7 +349,7 @@ datum/reagent/aslimetoxin
|
||||
|
||||
datum/reagent/aslimetoxin/reaction_mob(var/mob/M, var/volume)
|
||||
src = null
|
||||
M.contract_disease(new /datum/disease/transformation/slime(0),1)
|
||||
M.ForceContractDisease(new /datum/disease/transformation/slime(0))
|
||||
|
||||
datum/reagent/inaprovaline
|
||||
name = "Inaprovaline"
|
||||
@@ -997,9 +997,9 @@ datum/reagent/adminordrazine/on_mob_life(var/mob/living/carbon/M as mob)
|
||||
M.sleeping = 0
|
||||
M.jitteriness = 0
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
if(D.severity == D.non_threat)
|
||||
if(D.severity == NONTHREAT)
|
||||
continue
|
||||
D.spread = "Remissive"
|
||||
D.spread_text = "Remissive"
|
||||
D.stage--
|
||||
if(D.stage < 1)
|
||||
D.cure()
|
||||
@@ -1231,7 +1231,7 @@ datum/reagent/nanites
|
||||
datum/reagent/nanites/reaction_mob(var/mob/M, var/method=TOUCH, var/volume)
|
||||
src = null
|
||||
if( (prob(10) && method==TOUCH) || method==INGEST)
|
||||
M.contract_disease(new /datum/disease/transformation/robot(0),1)
|
||||
M.ForceContractDisease(new /datum/disease/transformation/robot(0))
|
||||
|
||||
datum/reagent/xenomicrobes
|
||||
name = "Xenomicrobes"
|
||||
@@ -1243,7 +1243,7 @@ datum/reagent/xenomicrobes
|
||||
datum/reagent/xenomicrobes/reaction_mob(var/mob/M, var/method=TOUCH, var/volume)
|
||||
src = null
|
||||
if( (prob(10) && method==TOUCH) || method==INGEST)
|
||||
M.contract_disease(new /datum/disease/transformation/xeno(0),1)
|
||||
M.ContractDisease(new /datum/disease/transformation/xeno(0))
|
||||
|
||||
datum/reagent/fluorosurfactant//foam precursor
|
||||
name = "Fluorosurfactant"
|
||||
|
||||
Reference in New Issue
Block a user