mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-24 12:37:50 +01:00
Merge remote-tracking branch 'refs/remotes/origin/dev' into dev
Conflicts: code/__HELPERS/maths.dm code/__HELPERS/type2type.dm code/modules/clothing/head/hardhat.dm code/modules/clothing/spacesuits/captain.dm code/modules/clothing/spacesuits/miscellaneous.dm code/modules/clothing/spacesuits/rig/rig_pieces.dm code/modules/clothing/spacesuits/rig/suits/light.dm code/modules/clothing/spacesuits/spacesuits.dm code/modules/clothing/suits/armor.dm code/modules/clothing/suits/utility.dm code/modules/events/event_manager.dm code/modules/mob/living/living.dm code/setup.dm
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
infectionchance = rand(10,20)
|
||||
else
|
||||
infectionchance = rand(60,90)
|
||||
|
||||
|
||||
antigen |= text2num(pick(ANTIGENS))
|
||||
antigen |= text2num(pick(ANTIGENS))
|
||||
spreadtype = prob(70) ? "Airborne" : "Contact"
|
||||
@@ -88,7 +88,8 @@
|
||||
clicks = 0
|
||||
//Do nasty effects
|
||||
for(var/datum/disease2/effectholder/e in effects)
|
||||
e.runeffect(mob,stage)
|
||||
if(prob(33))
|
||||
e.runeffect(mob,stage)
|
||||
|
||||
//Short airborne spread
|
||||
if(src.spreadtype == "Airborne")
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
/datum/disease2/effectholder/proc/runeffect(var/mob/living/carbon/human/mob,var/stage)
|
||||
if(happensonce > -1 && effect.stage <= stage && prob(chance))
|
||||
effect.activate(mob)
|
||||
effect.activate(mob, multiplier)
|
||||
if(happensonce == 1)
|
||||
happensonce = -1
|
||||
|
||||
|
||||
@@ -1,53 +1,61 @@
|
||||
//Returns 1 if mob can be infected, 0 otherwise. Checks his clothing.
|
||||
proc/get_infection_chance(var/mob/living/carbon/M, var/vector = "Airborne")
|
||||
var/score = 0
|
||||
//Returns 1 if mob can be infected, 0 otherwise.
|
||||
proc/infection_check(var/mob/living/carbon/M, var/vector = "Airborne")
|
||||
if (!istype(M))
|
||||
return 0
|
||||
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/protection = M.getarmor(null, "bio") //gets the full body bio armour value, weighted by body part coverage.
|
||||
var/score = round(0.06*protection) //scales 100% protection to 6.
|
||||
|
||||
if (vector == "Airborne")
|
||||
if(M.internal) //not breathing infected air helps greatly
|
||||
score = 30
|
||||
if(M.wear_mask)
|
||||
score += 5
|
||||
if(istype(M:wear_mask, /obj/item/clothing/mask/surgical) && !M.internal)
|
||||
score += 10
|
||||
if(istype(M:wear_suit, /obj/item/clothing/suit/space) && istype(M:head, /obj/item/clothing/head/helmet/space))
|
||||
score += 20
|
||||
if(istype(M:wear_suit, /obj/item/clothing/suit/bio_suit) && istype(M:head, /obj/item/clothing/head/bio_hood))
|
||||
score += 30
|
||||
switch(vector)
|
||||
if("Airborne")
|
||||
if(M.internal)
|
||||
score = 6 //not breathing infected air helps greatly
|
||||
var/obj/item/I = M.wear_mask
|
||||
|
||||
//masks provide a small bonus and can replace overall bio protection
|
||||
score = max(score, round(0.06*I.armor["bio"]))
|
||||
if (istype(I, /obj/item/clothing/mask))
|
||||
score += 1 //this should be added after
|
||||
|
||||
if("Contact")
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
|
||||
//gloves provide a larger bonus
|
||||
if (istype(H.gloves, /obj/item/clothing/gloves))
|
||||
score += 2
|
||||
|
||||
|
||||
if (vector == "Contact")
|
||||
if(M:gloves) score += 15
|
||||
if(istype(M:wear_suit, /obj/item/clothing/suit/space) && istype(M:head, /obj/item/clothing/head/helmet/space))
|
||||
score += 15
|
||||
if(istype(M:wear_suit, /obj/item/clothing/suit/bio_suit) && istype(M:head, /obj/item/clothing/head/bio_hood))
|
||||
score += 15
|
||||
|
||||
|
||||
// log_debug("[M]'s resistance to [vector] viruses: [score]")
|
||||
|
||||
if(score >= 30)
|
||||
if(score >= 6)
|
||||
return 0
|
||||
else if(score == 25 && prob(99))
|
||||
else if(score >= 5 && prob(99))
|
||||
return 0
|
||||
else if(score == 20 && prob(95))
|
||||
else if(score >= 4 && prob(95))
|
||||
return 0
|
||||
else if(score == 15 && prob(75))
|
||||
else if(score >= 3 && prob(75))
|
||||
return 0
|
||||
else if(score == 10 && prob(55))
|
||||
else if(score >= 2 && prob(55))
|
||||
return 0
|
||||
else if(score == 5 && prob(35))
|
||||
else if(score >= 1 && prob(35))
|
||||
return 0
|
||||
// log_debug("Infection got through")
|
||||
return 1
|
||||
|
||||
//Similar to infection check, but used for when M is spreading the virus.
|
||||
/proc/infection_spreading_check(var/mob/living/carbon/M, var/vector = "Airborne")
|
||||
if (!istype(M))
|
||||
return 0
|
||||
|
||||
var/protection = M.getarmor(null, "bio") //gets the full body bio armour value, weighted by body part coverage.
|
||||
|
||||
if (vector == "Airborne")
|
||||
var/obj/item/I = M.wear_mask
|
||||
if (istype(I))
|
||||
protection = max(protection, round(0.06*I.armor["bio"]))
|
||||
|
||||
return prob(protection)
|
||||
|
||||
//Checks if table-passing table can reach target (5 tile radius)
|
||||
proc/airborne_can_reach(turf/source, turf/target)
|
||||
var/obj/dummy = new(source)
|
||||
dummy.flags = FPRINT | TABLEPASS
|
||||
dummy.pass_flags = PASSTABLE
|
||||
|
||||
for(var/i=0, i<5, i++) if(!step_towards(dummy, target)) break
|
||||
@@ -84,17 +92,14 @@ proc/airborne_can_reach(turf/source, turf/target)
|
||||
|
||||
// log_debug("Infecting [M]")
|
||||
|
||||
if(prob(disease.infectionchance) || forced)
|
||||
// certain clothes can prevent an infection
|
||||
if(!forced && !get_infection_chance(M, disease.spreadtype))
|
||||
return
|
||||
|
||||
if(forced || (infection_check(M, disease.spreadtype) && prob(disease.infectionchance)))
|
||||
var/datum/disease2/disease/D = disease.getcopy()
|
||||
D.minormutate()
|
||||
// log_debug("Adding virus")
|
||||
M.virus2["[D.uniqueID]"] = D
|
||||
BITSET(M.hud_updateflag, STATUS_HUD)
|
||||
|
||||
|
||||
//Infects mob M with disease D
|
||||
/proc/infect_mob(var/mob/living/carbon/M, var/datum/disease2/disease/D)
|
||||
infect_virus2(M,D,1)
|
||||
@@ -128,12 +133,15 @@ proc/airborne_can_reach(turf/source, turf/target)
|
||||
// log_debug("Attempting virus [ID]")
|
||||
var/datum/disease2/disease/V = virus2[ID]
|
||||
if(V.spreadtype != vector) continue
|
||||
|
||||
//It's hard to get other people sick if you're in an airtight suit.
|
||||
if(!infection_spreading_check(src, V.spreadtype)) continue
|
||||
|
||||
if (vector == "Airborne")
|
||||
if(airborne_can_reach(get_turf(src), get_turf(victim)))
|
||||
// log_debug("In range, infecting")
|
||||
infect_virus2(victim,V)
|
||||
else
|
||||
// else
|
||||
// log_debug("Could not reach target")
|
||||
|
||||
if (vector == "Contact")
|
||||
@@ -150,7 +158,7 @@ proc/airborne_can_reach(turf/source, turf/target)
|
||||
var/mob/living/carbon/human/H = victim
|
||||
var/datum/organ/external/select_area = H.get_organ(src.zone_sel.selecting)
|
||||
var/list/clothes = list(H.head, H.wear_mask, H.wear_suit, H.w_uniform, H.gloves, H.shoes)
|
||||
for(var/obj/item/clothing/C in clothes )
|
||||
for(var/obj/item/clothing/C in clothes)
|
||||
if(C && istype(C))
|
||||
if(C.body_parts_covered & select_area.body_part)
|
||||
nudity = 0
|
||||
@@ -158,4 +166,5 @@ proc/airborne_can_reach(turf/source, turf/target)
|
||||
for (var/ID in victim.virus2)
|
||||
var/datum/disease2/disease/V = victim.virus2[ID]
|
||||
if(V && V.spreadtype != vector) continue
|
||||
if(!infection_spreading_check(victim, V.spreadtype)) continue
|
||||
infect_virus2(src,V)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
icon_state = "health"
|
||||
w_class = 2.0
|
||||
item_state = "electronic"
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
flags = CONDUCT
|
||||
|
||||
/obj/item/device/antibody_scanner/attack(mob/M as mob, mob/user as mob)
|
||||
if(!istype(M,/mob/living/carbon/))
|
||||
|
||||
Reference in New Issue
Block a user