mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-06 07:22:42 +00:00
Merge pull request #5554 from Baystation12/master
Updating dev with master
This commit is contained in:
@@ -18,16 +18,10 @@
|
||||
return icon('icons/mob/human.dmi',"blank")
|
||||
|
||||
//Germs
|
||||
/datum/organ/proc/get_cure_threshold()
|
||||
//before reaching level three, the amount of spaceacillin required to cure infections scales between 5 and 30 units
|
||||
//var/germ_scale = max((germ_level - INFECTION_LEVEL_ONE)/(INFECTION_LEVEL_THREE - INFECTION_LEVEL_ONE), 0)
|
||||
//return min(5 + germ_scale*25, 30)
|
||||
return 5 //Based on Hubble's suggestion
|
||||
|
||||
/datum/organ/proc/handle_antibiotics()
|
||||
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
|
||||
|
||||
if (antibiotics <= get_cure_threshold())
|
||||
if (antibiotics < 5)
|
||||
return
|
||||
|
||||
if (germ_level < INFECTION_LEVEL_ONE)
|
||||
|
||||
@@ -377,13 +377,18 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if (owner.germ_level > W.germ_level && W.infection_check())
|
||||
W.germ_level++
|
||||
|
||||
//Infected wounds raise the organ's germ level
|
||||
if (W.germ_level > germ_level && antibiotics < 5) //Badly infected wounds raise internal germ levels
|
||||
germ_level++
|
||||
if (antibiotics < 5)
|
||||
for(var/datum/wound/W in wounds)
|
||||
//Infected wounds raise the organ's germ level
|
||||
if (W.germ_level > germ_level)
|
||||
germ_level++
|
||||
break //limit increase to a maximum of one per second
|
||||
|
||||
/datum/organ/external/proc/handle_germ_effects()
|
||||
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
|
||||
var/cure_threshold = get_cure_threshold()
|
||||
|
||||
if (germ_level < INFECTION_LEVEL_ONE && prob(60)) //this could be an else clause, but it looks cleaner this way
|
||||
germ_level-- //since germ_level increases at a rate of 1 per second with dirty wounds, prob(60) should give us about 5 minutes before level one.
|
||||
|
||||
if(germ_level >= INFECTION_LEVEL_ONE)
|
||||
//having an infection raises your body temperature
|
||||
@@ -393,19 +398,34 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
owner.bodytemperature++
|
||||
|
||||
if(prob(round(germ_level/10)))
|
||||
if (antibiotics < cure_threshold)
|
||||
if (antibiotics < 5)
|
||||
germ_level++
|
||||
|
||||
if (prob(3)) //adjust this to tweak how fast people take toxin damage from infections
|
||||
if (prob(5)) //adjust this to tweak how fast people take toxin damage from infections
|
||||
owner.adjustToxLoss(1)
|
||||
|
||||
if(germ_level >= INFECTION_LEVEL_TWO && antibiotics < cure_threshold)
|
||||
//spread the infection
|
||||
if(germ_level >= INFECTION_LEVEL_TWO && antibiotics < 5)
|
||||
//spread the infection to internal organs
|
||||
var/datum/organ/internal/target_organ = null //make internal organs become infected one at a time instead of all at once
|
||||
for (var/datum/organ/internal/I in internal_organs)
|
||||
if (I.germ_level < germ_level)
|
||||
I.germ_level++
|
||||
if (I.germ_level > 0 && I.germ_level < min(germ_level, INFECTION_LEVEL_TWO)) //once the organ reaches whatever we can give it, or level two, switch to a different one
|
||||
if (!target_organ || I.germ_level > target_organ.germ_level) //choose the organ with the highest germ_level
|
||||
target_organ = I
|
||||
|
||||
if (!target_organ)
|
||||
//figure out which organs we can spread germs to and pick one at random
|
||||
var/list/candidate_organs = list()
|
||||
for (var/datum/organ/internal/I in internal_organs)
|
||||
if (I.germ_level < germ_level)
|
||||
candidate_organs += I
|
||||
if (candidate_organs.len)
|
||||
target_organ = pick(candidate_organs)
|
||||
|
||||
if (target_organ)
|
||||
target_organ.germ_level++
|
||||
|
||||
if (children) //To child organs
|
||||
//spread the infection to child and parent organs
|
||||
if (children)
|
||||
for (var/datum/organ/external/child in children)
|
||||
if (child.germ_level < germ_level && !(child.status & ORGAN_ROBOT))
|
||||
if (child.germ_level < INFECTION_LEVEL_ONE*2 || prob(30))
|
||||
@@ -438,7 +458,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
// let the GC handle the deletion of the wound
|
||||
|
||||
// Internal wounds get worse over time. Low temperatures (cryo) stop them.
|
||||
if(W.internal && !W.is_treated() && owner.bodytemperature >= 170)
|
||||
if(W.internal && !W.can_autoheal() && owner.bodytemperature >= 170)
|
||||
var/bicardose = owner.reagents.get_reagent_amount("bicaridine")
|
||||
var/inaprovaline = owner.reagents.get_reagent_amount("inaprovaline")
|
||||
if(!bicardose || !inaprovaline) //bicaridine and inaprovaline stop internal wounds from growing bigger with time, and also stop bleeding
|
||||
@@ -455,7 +475,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
var/heal_amt = 0
|
||||
|
||||
// if damage >= 50 AFTER treatment then it's probably too severe to heal within the timeframe of a round.
|
||||
if (W.is_treated() && W.wound_damage() < 50)
|
||||
if (W.can_autoheal() && W.wound_damage() < 50)
|
||||
heal_amt += 0.5
|
||||
|
||||
//we only update wounds once in [wound_update_accuracy] ticks so have to emulate realtime
|
||||
@@ -470,8 +490,8 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
|
||||
// Salving also helps against infection
|
||||
if(W.germ_level > 0 && W.salved && prob(2))
|
||||
W.germ_level = 0
|
||||
W.disinfected = 1
|
||||
W.germ_level = 0
|
||||
|
||||
// sync the organ's damage with its wounds
|
||||
src.update_damages()
|
||||
@@ -674,6 +694,15 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
W.bandaged = 1
|
||||
return rval
|
||||
|
||||
/datum/organ/external/proc/disinfect()
|
||||
var/rval = 0
|
||||
for(var/datum/wound/W in wounds)
|
||||
if(W.internal) continue
|
||||
rval |= !W.disinfected
|
||||
W.disinfected = 1
|
||||
W.germ_level = 0
|
||||
return rval
|
||||
|
||||
/datum/organ/external/proc/clamp()
|
||||
var/rval = 0
|
||||
src.status &= ~ORGAN_BLEEDING
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
src.owner = H
|
||||
|
||||
/datum/organ/internal/process()
|
||||
|
||||
//Process infections
|
||||
if (!germ_level)
|
||||
return
|
||||
@@ -48,23 +47,23 @@
|
||||
//** Handle the effects of infections
|
||||
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
|
||||
|
||||
if (germ_level < INFECTION_LEVEL_ONE/2 && prob(30))
|
||||
germ_level--
|
||||
|
||||
if (germ_level >= INFECTION_LEVEL_ONE/2)
|
||||
//aiming for germ level to go from ambient to INFECTION_LEVEL_TWO in an average of 15 minutes
|
||||
if(antibiotics < 5 && prob(round(germ_level/6)))
|
||||
germ_level++
|
||||
if(prob(1))
|
||||
take_damage(1,silent=prob(60))
|
||||
|
||||
if (germ_level >= INFECTION_LEVEL_TWO)
|
||||
var/datum/organ/external/parent = owner.get_organ(parent_organ)
|
||||
//spread germs
|
||||
if (antibiotics < get_cure_threshold() && parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30) ))
|
||||
if (antibiotics < 5 && parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30) ))
|
||||
parent.germ_level++
|
||||
|
||||
if (prob(3)) //about once every 30 seconds
|
||||
take_damage(1,silent=prob(30))
|
||||
|
||||
|
||||
/datum/organ/internal/proc/take_damage(amount, var/silent=0)
|
||||
if(src.robotic == 2)
|
||||
src.damage += (amount * 0.8)
|
||||
@@ -124,6 +123,11 @@
|
||||
parent_organ = "chest"
|
||||
|
||||
process()
|
||||
..()
|
||||
if (germ_level > INFECTION_LEVEL_ONE)
|
||||
if(prob(5))
|
||||
owner.emote("cough") //respitory tract infection
|
||||
|
||||
if(is_bruised())
|
||||
if(prob(2))
|
||||
spawn owner.emote("me", 1, "coughs up blood!")
|
||||
@@ -138,6 +142,14 @@
|
||||
var/process_accuracy = 10
|
||||
|
||||
process()
|
||||
..()
|
||||
if (germ_level > INFECTION_LEVEL_ONE)
|
||||
if(prob(1))
|
||||
owner << "\red Your skin itches."
|
||||
if (germ_level > INFECTION_LEVEL_TWO)
|
||||
if(prob(1))
|
||||
spawn owner.vomit()
|
||||
|
||||
if(owner.life_tick % process_accuracy == 0)
|
||||
if(src.damage < 0)
|
||||
src.damage = 0
|
||||
@@ -180,6 +192,7 @@
|
||||
parent_organ = "head"
|
||||
|
||||
process() //Eye damage replaces the old eye_stat var.
|
||||
..()
|
||||
if(is_bruised())
|
||||
owner.eye_blurry = 20
|
||||
if(is_broken())
|
||||
|
||||
@@ -85,24 +85,25 @@
|
||||
proc/wound_damage()
|
||||
return src.damage / src.amount
|
||||
|
||||
// checks whether the wound has been appropriately treated
|
||||
// always returns 1 for wounds that are too minor to need treatment
|
||||
proc/is_treated()
|
||||
proc/can_autoheal()
|
||||
if(src.wound_damage() <= autoheal_cutoff)
|
||||
return 1
|
||||
|
||||
|
||||
return is_treated()
|
||||
|
||||
// checks whether the wound has been appropriately treated
|
||||
proc/is_treated()
|
||||
if(damage_type == BRUISE || damage_type == CUT)
|
||||
return bandaged
|
||||
else if(damage_type == BURN)
|
||||
return salved
|
||||
|
||||
|
||||
// Checks whether other other can be merged into src.
|
||||
proc/can_merge(var/datum/wound/other)
|
||||
if (other.type != src.type) return 0
|
||||
if (other.current_stage != src.current_stage) return 0
|
||||
if (other.damage_type != src.damage_type) return 0
|
||||
if (!(other.is_treated()) != !(src.is_treated())) return 0
|
||||
if (!(other.can_autoheal()) != !(src.can_autoheal())) return 0
|
||||
if (!(other.bandaged) != !(src.bandaged)) return 0
|
||||
if (!(other.clamped) != !(src.clamped)) return 0
|
||||
if (!(other.salved) != !(src.salved)) return 0
|
||||
@@ -120,20 +121,28 @@
|
||||
// checks if wound is considered open for external infections
|
||||
// untreated cuts (and bleeding bruises) and burns are possibly infectable, chance higher if wound is bigger
|
||||
proc/infection_check()
|
||||
if (is_treated() && damage < 10)
|
||||
if (damage < 10) //small cuts, tiny bruises, and moderate burns shouldn't be infectable.
|
||||
return 0
|
||||
if (is_treated() && damage < 25) //anything less than a flesh wound (or equivalent) isn't infectable if treated properly
|
||||
return 0
|
||||
if (disinfected)
|
||||
germ_level = 0 //reset this, just in case
|
||||
return 0
|
||||
|
||||
if (damage_type == BRUISE && !bleeding()) //bruises only infectable if bleeding
|
||||
return 0
|
||||
|
||||
var/dam_coef = round(damage/10)
|
||||
switch (damage_type)
|
||||
if (BRUISE)
|
||||
return prob(dam_coef*5) && bleeding() //bruises only infectable if bleeding
|
||||
return prob(dam_coef*5)
|
||||
if (BURN)
|
||||
return prob(dam_coef*10)
|
||||
if (CUT)
|
||||
return prob(dam_coef*20)
|
||||
|
||||
return 0
|
||||
|
||||
// heal the given amount of damage, and if the given amount of damage was more
|
||||
// than what needed to be healed, return how much heal was left
|
||||
// set @heals_internal to also heal internal organ damage
|
||||
|
||||
@@ -22,6 +22,7 @@ datum
|
||||
var/custom_metabolism = REAGENTS_METABOLISM
|
||||
var/overdose = 0
|
||||
var/overdose_dam = 1
|
||||
var/scannable = 0 //shows up on health analyzers
|
||||
//var/list/viruses = list()
|
||||
var/color = "#000000" // rgb: 0, 0, 0 (does not support alpha channels - yet!)
|
||||
|
||||
@@ -408,6 +409,7 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
overdose = REAGENTS_OVERDOSE*2
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob, var/alien)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -778,6 +780,8 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#C855DC"
|
||||
overdose = 60
|
||||
scannable = 1
|
||||
custom_metabolism = 0.025 // Lasts 10 minutes for 15 units
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if (volume > overdose)
|
||||
@@ -792,6 +796,8 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC"
|
||||
overdose = 30
|
||||
scannable = 1
|
||||
custom_metabolism = 0.025 // Lasts 10 minutes for 15 units
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if (volume > overdose)
|
||||
@@ -806,6 +812,7 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#C805DC"
|
||||
overdose = 20
|
||||
custom_metabolism = 0.25 // Lasts 10 minutes for 15 units
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if (volume > overdose)
|
||||
@@ -835,6 +842,18 @@ datum
|
||||
description = "Sterilizes wounds in preparation for surgery."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
|
||||
//makes you squeaky clean
|
||||
reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)
|
||||
if (method == TOUCH)
|
||||
M.germ_level -= min(volume*20, M.germ_level)
|
||||
|
||||
reaction_obj(var/obj/O, var/volume)
|
||||
O.germ_level -= min(volume*20, O.germ_level)
|
||||
|
||||
reaction_turf(var/turf/T, var/volume)
|
||||
T.germ_level -= min(volume*20, T.germ_level)
|
||||
|
||||
/* reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)
|
||||
src = null
|
||||
if (method==TOUCH)
|
||||
@@ -996,6 +1015,7 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
overdose = REAGENTS_OVERDOSE
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1031,6 +1051,7 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
overdose = REAGENTS_OVERDOSE
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(M.stat == 2.0)
|
||||
@@ -1048,6 +1069,7 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
overdose = REAGENTS_OVERDOSE/2
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob, var/alien)
|
||||
if(M.stat == 2.0) //THE GUY IS **DEAD**! BEREFT OF ALL LIFE HE RESTS IN PEACE etc etc. He does NOT metabolise shit anymore, god DAMN
|
||||
@@ -1065,6 +1087,7 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
overdose = REAGENTS_OVERDOSE
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob, var/alien)
|
||||
if(M.stat == 2.0)
|
||||
@@ -1088,6 +1111,7 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
overdose = REAGENTS_OVERDOSE/2
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob, var/alien)
|
||||
if(M.stat == 2.0)
|
||||
@@ -1110,6 +1134,7 @@ datum
|
||||
description = "Tricordrazine is a highly potent stimulant, originally derived from cordrazine. Can be used to treat a wide range of injuries."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob, var/alien)
|
||||
if(M.stat == 2.0)
|
||||
@@ -1129,6 +1154,7 @@ datum
|
||||
description = "Dylovene is a broad-spectrum antitoxin."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob, var/alien)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1187,6 +1213,7 @@ datum
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.01
|
||||
overdose = REAGENTS_OVERDOSE
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1226,6 +1253,7 @@ datum
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.05
|
||||
overdose = REAGENTS_OVERDOSE
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1261,6 +1289,7 @@ datum
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.05
|
||||
overdose = REAGENTS_OVERDOSE
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1275,6 +1304,7 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
overdose = REAGENTS_OVERDOSE
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1296,6 +1326,7 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
overdose = 10
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1315,6 +1346,7 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
overdose = REAGENTS_OVERDOSE
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob, var/alien)
|
||||
if(M.stat == 2.0)
|
||||
@@ -1346,6 +1378,7 @@ datum
|
||||
description = "A chemical mixture with almost magical healing powers. Its main limitation is that the targets body temperature must be under 170K for it to metabolise correctly."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1363,6 +1396,7 @@ datum
|
||||
description = "A liquid compound similar to that used in the cloning process. Can be used to 'finish' the cloning process when used in conjunction with a cryo tube."
|
||||
reagent_state = LIQUID
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1381,6 +1415,7 @@ datum
|
||||
reagent_state = SOLID
|
||||
color = "#669900" // rgb: 102, 153, 0
|
||||
overdose = REAGENTS_OVERDOSE
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
@@ -1410,6 +1445,7 @@ datum
|
||||
color = "#C8A5DC" // rgb: 200, 165, 220
|
||||
custom_metabolism = 0.01
|
||||
overdose = REAGENTS_OVERDOSE
|
||||
scannable = 1
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user