From a4c9f31b493cfa5cb388afa15399230d48953ddc Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 7 Jul 2014 17:01:15 -0400 Subject: [PATCH 01/11] Fixes #5532 and increases the time required for organs to become infected from wounds Also removes the now unnecessary get_cure_threshold() proc, caps the rate at which an organ can receive germs from wounds, and makes germs spread from external to internal organs happen one organ at a time instead of all at once. --- code/modules/organs/organ.dm | 8 +----- code/modules/organs/organ_external.dm | 37 +++++++++++++++++++-------- code/modules/organs/organ_internal.dm | 23 +++++++++++++---- code/setup.dm | 2 +- 4 files changed, 47 insertions(+), 23 deletions(-) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 5bb5f53067..f75f9e055d 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -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) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 3c999fc870..b1cb5c5875 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -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,17 +398,29 @@ 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) + if(germ_level >= INFECTION_LEVEL_TWO && antibiotics < 5) //spread the infection + var/datum/organ/internal/target_organ //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 + target_organ = pick(candidate_organs) + + target_organ.germ_level++ if (children) //To child organs for (var/datum/organ/external/child in children) @@ -470,8 +487,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() diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index 4753d7dc8f..66cb9984b3 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -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(60)) + 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(1)) + 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()) diff --git a/code/setup.dm b/code/setup.dm index 7e55158a21..a86e066576 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -774,7 +774,7 @@ var/list/RESTRICTED_CAMERA_NETWORKS = list( //Those networks can only be accesse #define INFECTION_LEVEL_ONE 100 #define INFECTION_LEVEL_TWO 500 -#define INFECTION_LEVEL_THREE 1500 +#define INFECTION_LEVEL_THREE 1000 /* From 5764d958082f1a2406e243bc5e30eefacb04840b Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 7 Jul 2014 17:19:13 -0400 Subject: [PATCH 02/11] Makes minor wounds harder to infect --- code/modules/organs/organ_external.dm | 4 ++-- code/modules/organs/wound.dm | 25 +++++++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index b1cb5c5875..e81964690c 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -455,7 +455,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 @@ -472,7 +472,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 diff --git a/code/modules/organs/wound.dm b/code/modules/organs/wound.dm index 3f4073d3f1..d20fc0dbfb 100644 --- a/code/modules/organs/wound.dm +++ b/code/modules/organs/wound.dm @@ -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 From 008c5447b7bd39feac3ca19323a2337fc24bde36 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 7 Jul 2014 17:27:01 -0400 Subject: [PATCH 03/11] Tweaks internal organ spread rate --- code/modules/organs/organ_internal.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index 66cb9984b3..d9a06185fe 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -47,7 +47,7 @@ //** Handle the effects of infections var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin") - if (germ_level < INFECTION_LEVEL_ONE/2 && prob(60)) + if (germ_level < INFECTION_LEVEL_ONE/2 && prob(30)) germ_level-- if (germ_level >= INFECTION_LEVEL_ONE/2) From b8a102beb4a545936f38e60b0e538673b5566693 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 7 Jul 2014 17:30:19 -0400 Subject: [PATCH 04/11] Increases cough rate for lung infections --- code/modules/organs/organ_internal.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index d9a06185fe..3721633dce 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -125,7 +125,7 @@ process() ..() if (germ_level > INFECTION_LEVEL_ONE) - if(prob(1)) + if(prob(5)) owner.emote("cough") //respitory tract infection if(is_bruised()) From 38ac5ece7cc720a9774626d5040c0f8064eeba66 Mon Sep 17 00:00:00 2001 From: Hubblenaut Date: Tue, 8 Jul 2014 02:09:53 +0200 Subject: [PATCH 05/11] Health Analyzer can read all types of beneficial medicine --- code/game/objects/items/devices/scanners.dm | 23 ++++++++++++++++----- code/modules/reagents/Chemistry-Reagents.dm | 15 ++++++++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 22caeb2090..f1da6cf61a 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -92,7 +92,7 @@ REAGENT SCANNER usr << "\red You don't have the dexterity to do this!" return user.visible_message(" [user] has analyzed [M]'s vitals."," You have analyzed [M]'s vitals.") - + if (!istype(M, /mob/living/carbon) || (ishuman(M) && (M:species.flags & IS_SYNTHETIC))) //these sensors are designed for organic life user.show_message("\blue Analyzing Results for ERROR:\n\t Overall Status: ERROR") @@ -102,7 +102,7 @@ REAGENT SCANNER user.show_message("\red Warning: Blood Level ERROR: --% --cl.\blue Type: ERROR") user.show_message("\blue Subject's pulse: -- bpm.") return - + var/fake_oxy = max(rand(1,40), M.getOxyLoss(), (300 - (M.getToxLoss() + M.getFireLoss() + M.getBruteLoss()))) var/OX = M.getOxyLoss() > 50 ? "[M.getOxyLoss()]" : M.getOxyLoss() var/TX = M.getToxLoss() > 50 ? "[M.getToxLoss()]" : M.getToxLoss() @@ -141,7 +141,20 @@ REAGENT SCANNER user.show_message("[OX] | [TX] | [BU] | [BR]") if (istype(M, /mob/living/carbon)) if(M:reagents.total_volume > 0) - user.show_message(text("\red Warning: Unknown substance detected in subject's blood.")) + var/unknown = 0 + var/reagentlist[0] + for(var/A in M.reagents.reagent_list) + var/datum/reagent/R = A + if(R.scannable) + reagentlist["[R.id]"] = "\t \blue [round(M.reagents.get_reagent_amount(R.id), 1)]u [R.name]" + else + unknown++ + if(data.len) + user.show_message("\blue Beneficial reagents detected in subject's blood:") + for(var/d in reagentlist) + user.show_message(data[d]) + if(unknown) + user.show_message(text("\red Warning: Unknown substance[(unknown>1)?"s":""] detected in subject's blood.")) if(M:virus2.len) var/mob/living/carbon/C = M for (var/ID in C.virus2) @@ -154,8 +167,8 @@ REAGENT SCANNER for(var/datum/disease/D in M.viruses) if(!D.hidden[SCANNER]) user.show_message(text("\red Warning: [D.form] Detected\nName: [D.name].\nType: [D.spread].\nStage: [D.stage]/[D.max_stages].\nPossible Cure: [D.cure]")) - if (M.reagents && M.reagents.get_reagent_amount("inaprovaline")) - user.show_message("\blue Bloodstream Analysis located [M.reagents:get_reagent_amount("inaprovaline")] units of rejuvenation chemicals.") +// if (M.reagents && M.reagents.get_reagent_amount("inaprovaline")) +// user.show_message("\blue Bloodstream Analysis located [M.reagents:get_reagent_amount("inaprovaline")] units of rejuvenation chemicals.") if (M.has_brain_worms()) user.show_message("\red Subject suffering from aberrant brain activity. Recommend further scanning.") else if (M.getBrainLoss() >= 100 || istype(M, /mob/living/carbon/human) && M:brain_op_stage == 4.0) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 94caf95981..92320c00d3 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -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,7 @@ datum reagent_state = LIQUID color = "#C855DC" overdose = 60 + scannable = 1 on_mob_life(var/mob/living/M as mob) if (volume > overdose) @@ -792,6 +795,7 @@ datum reagent_state = LIQUID color = "#C8A5DC" overdose = 30 + scannable = 1 on_mob_life(var/mob/living/M as mob) if (volume > overdose) @@ -1031,6 +1035,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 +1053,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 +1071,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 +1095,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 +1118,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 +1138,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 @@ -1261,6 +1271,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 @@ -1296,6 +1307,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 +1327,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) @@ -1381,6 +1394,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 +1424,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) ..() From d6caeb79d64668adc5577037e5b08cc1eddccbf3 Mon Sep 17 00:00:00 2001 From: Hubblenaut Date: Tue, 8 Jul 2014 02:47:37 +0200 Subject: [PATCH 06/11] Fix: Painkillers stay in body for decent time --- code/modules/reagents/Chemistry-Reagents.dm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 92320c00d3..7f352221f1 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -781,6 +781,7 @@ datum 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) @@ -796,6 +797,7 @@ datum 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) @@ -810,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) @@ -1000,6 +1003,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 @@ -1197,6 +1201,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 @@ -1236,6 +1241,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 @@ -1286,6 +1292,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 @@ -1359,6 +1366,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 @@ -1376,6 +1384,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 From 6f1759a7aaf5a6453f682dad086b239e7774e149 Mon Sep 17 00:00:00 2001 From: Hubblenaut Date: Tue, 8 Jul 2014 03:07:22 +0200 Subject: [PATCH 07/11] Fixes me being dumb with renaming variables --- code/game/objects/items/devices/scanners.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index f1da6cf61a..441dee233a 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -142,17 +142,17 @@ REAGENT SCANNER if (istype(M, /mob/living/carbon)) if(M:reagents.total_volume > 0) var/unknown = 0 - var/reagentlist[0] + var/reagentdata[0] for(var/A in M.reagents.reagent_list) var/datum/reagent/R = A if(R.scannable) - reagentlist["[R.id]"] = "\t \blue [round(M.reagents.get_reagent_amount(R.id), 1)]u [R.name]" + reagentdata["[R.id]"] = "\t \blue [round(M.reagents.get_reagent_amount(R.id), 1)]u [R.name]" else unknown++ - if(data.len) + if(reagentdata.len) user.show_message("\blue Beneficial reagents detected in subject's blood:") - for(var/d in reagentlist) - user.show_message(data[d]) + for(var/d in reagentdata) + user.show_message(reagentdata[d]) if(unknown) user.show_message(text("\red Warning: Unknown substance[(unknown>1)?"s":""] detected in subject's blood.")) if(M:virus2.len) From dcfbeb092433d0e3f5f579ab9de627946edeab59 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Jul 2014 16:12:55 -0400 Subject: [PATCH 08/11] Fixes missing length check before pick() --- code/modules/organs/organ_external.dm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index e81964690c..c4b80a29e2 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -405,8 +405,8 @@ Note that amputating the affected organ does in fact remove the infection from t owner.adjustToxLoss(1) if(germ_level >= INFECTION_LEVEL_TWO && antibiotics < 5) - //spread the infection - var/datum/organ/internal/target_organ //make internal organs become infected one at a time instead of all at once + //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 > 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 @@ -418,11 +418,14 @@ Note that amputating the affected organ does in fact remove the infection from t for (var/datum/organ/internal/I in internal_organs) if (I.germ_level < germ_level) candidate_organs += I - target_organ = pick(candidate_organs) + if (candidate_organs.len) + target_organ = pick(candidate_organs) - target_organ.germ_level++ + 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)) From 910ce676b0fa727d589b6e6447a472034899564c Mon Sep 17 00:00:00 2001 From: mwerezak Date: Tue, 8 Jul 2014 18:49:51 -0400 Subject: [PATCH 09/11] Fixes advanced trauma kits claiming to disinfect but not doing so --- code/game/objects/items/stacks/medical.dm | 8 ++++++-- code/modules/organs/organ_external.dm | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index c53bd3f99b..eeca2089ee 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -157,7 +157,10 @@ var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting) if(affecting.open == 0) - if(!affecting.bandage()) + var/bandaged = affecting.bandage() + var/disinfected = affecting.disinfect() + + if(!(bandaged || disinfected)) user << "\red The wounds on [M]'s [affecting.display_name] have already been treated." return 1 else @@ -174,7 +177,8 @@ else user.visible_message( "\blue [user] smears some bioglue over [W.desc] on [M]'s [affecting.display_name].", \ "\blue You smear some bioglue over [W.desc] on [M]'s [affecting.display_name]." ) - affecting.heal_damage(heal_brute,0) + if (bandaged) + affecting.heal_damage(heal_brute,0) use(1) else if (can_operate(H)) //Checks if mob is lying down on table for surgery diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index c4b80a29e2..942144006c 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -694,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 From 5e56d095129505fa3cead63cbf2cf53e1150c68b Mon Sep 17 00:00:00 2001 From: mwerezak Date: Tue, 8 Jul 2014 18:57:07 -0400 Subject: [PATCH 10/11] Sterilizine reduces germ_level on contact --- code/modules/reagents/Chemistry-Reagents.dm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 94caf95981..a7d5c1c609 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -835,6 +835,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) From ffcb068b9652f145ad6314e534359cd678f961c9 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Wed, 9 Jul 2014 00:11:20 -0400 Subject: [PATCH 11/11] Fixed wrong operator --- code/modules/organs/organ_external.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 942144006c..5cf4d01302 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -387,7 +387,7 @@ Note that amputating the affected organ does in fact remove the infection from t /datum/organ/external/proc/handle_germ_effects() var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin") - if (germ_level < INFECTION_LEVEL_ONE & prob(60)) //this could be an else clause, but it looks cleaner this way + 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)