diff --git a/code/__DEFINES/mob.dm b/code/__DEFINES/mob.dm index 588f8526ca1..dde491fbb80 100644 --- a/code/__DEFINES/mob.dm +++ b/code/__DEFINES/mob.dm @@ -2,17 +2,13 @@ // Organ defines. #define ORGAN_CUT_AWAY 1 -#define ORGAN_GAUZED 2 -#define ORGAN_ATTACHABLE 4 -#define ORGAN_BLEEDING 8 -#define ORGAN_BROKEN 32 -#define ORGAN_DESTROYED 64 -#define ORGAN_ROBOT 128 -#define ORGAN_SPLINTED 256 -#define SALVED 512 -#define ORGAN_DEAD 1024 -#define ORGAN_MUTATED 2048 -#define ORGAN_ASSISTED 4096 +#define ORGAN_BROKEN 2 +#define ORGAN_DESTROYED 4 +#define ORGAN_ROBOT 8 +#define ORGAN_SPLINTED 16 +#define ORGAN_DEAD 32 +#define ORGAN_MUTATED 64 +#define ORGAN_ASSISTED 128 #define DROPLIMB_SHARP 0 #define DROPLIMB_BLUNT 1 diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 2ab267ce5a8..6c95d0489ae 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -96,9 +96,6 @@ var/health_threshold_crit = 0 var/health_threshold_dead = -100 - var/organ_health_multiplier = 1 - var/organ_regeneration_multiplier = 1 - var/bones_can_break = 1 var/limbs_can_break = 1 @@ -632,10 +629,6 @@ config.slime_delay = value if("animal_delay") config.animal_delay = value - if("organ_health_multiplier") - config.organ_health_multiplier = value / 100 - if("organ_regeneration_multiplier") - config.organ_regeneration_multiplier = value / 100 if("bones_can_break") config.bones_can_break = value if("limbs_can_break") diff --git a/code/game/gamemodes/changeling/powers/revive.dm b/code/game/gamemodes/changeling/powers/revive.dm index 376e6d5a148..26a1e288adb 100644 --- a/code/game/gamemodes/changeling/powers/revive.dm +++ b/code/game/gamemodes/changeling/powers/revive.dm @@ -44,11 +44,11 @@ QDEL_NULL(O.hidden) O.number_wounds = 0 O.open = 0 + O.internal_bleeding = FALSE O.perma_injury = 0 O.status = 0 O.trace_chemicals.Cut() QDEL_LIST(O.wounds) - O.wound_update_accuracy = 1 for(var/obj/item/organ/internal/IO in H.internal_organs) IO.damage = 0 IO.trace_chemicals.Cut() diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 6514ef82c47..c8cf45665cd 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -429,10 +429,8 @@ if(istype(E, /obj/item/organ/external/chest) && H.is_lung_ruptured()) organData["lungRuptured"] = 1 - for(var/datum/wound/W in E.wounds) - if(W.internal) - organData["internalBleeding"] = 1 - break + if(E.internal_bleeding) + organData["internalBleeding"] = 1 extOrganData.Add(list(organData)) @@ -580,9 +578,8 @@ var/splint = "" var/internal_bleeding = "" var/lung_ruptured = "" - for(var/datum/wound/W in e.wounds) if(W.internal) + if(e.internal_bleeding) internal_bleeding = "
Internal bleeding" - break if(istype(e, /obj/item/organ/external/chest) && occupant.is_lung_ruptured()) lung_ruptured = "Lung ruptured:" if(e.status & ORGAN_SPLINTED) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 53b05ef48d1..c716d060d27 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -216,7 +216,7 @@ REAGENT SCANNER user.show_message(text("Bone fractures detected. Advanced scanner required for location."), 1) break for(var/obj/item/organ/external/e in H.bodyparts) - for(var/datum/wound/W in e.wounds) if(W.internal) + if(e.internal_bleeding) user.show_message(text("Internal bleeding detected. Advanced scanner required for location."), 1) break var/blood_id = H.get_blood_id() diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 04be0d53a1a..3be1404a030 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -96,8 +96,7 @@ var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting) if(affecting.open == 0) - affecting.bandage() - affecting.disinfect() + affecting.germ_level = 0 user.visible_message("[user] bandages the wounds on [H]'s [affecting.name].", \ "You bandage the wounds on [H]'s [affecting.name]." ) @@ -142,7 +141,7 @@ var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting) if(affecting.open == 0) - affecting.salve() + affecting.germ_level = 0 user.visible_message("[user] salves the wounds on [H]'s [affecting.name].", \ "You salve the wounds on [H]'s [affecting.name]." ) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 70034def245..d78676aa6db 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -328,11 +328,7 @@ else if(temp.wounds.len > 0) var/list/wound_descriptors = list() for(var/datum/wound/W in temp.wounds) - if(W.internal && !temp.open) continue // can't see internal wounds var/this_wound_desc = W.desc - if(W.damage_type == BURN && W.salved) this_wound_desc = "salved [this_wound_desc]" - if(W.germ_level > 600) this_wound_desc = "badly infected [this_wound_desc]" - else if(W.germ_level > 330) this_wound_desc = "lightly infected [this_wound_desc]" if(this_wound_desc in wound_descriptors) wound_descriptors[this_wound_desc] += W.amount continue diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 3a8f6ff4f46..6f366ed3b74 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -50,10 +50,9 @@ I.take_damage(rand(3,5)) //Moving makes open wounds get infected much faster - if(E.wounds.len) - for(var/datum/wound/W in E.wounds) - if(W.infection_check()) - W.germ_level += 1 + var/total_damage = E.brute_dam + E.burn_dam + if(total_damage && E.infection_check()) + germ_level++ /mob/living/carbon/human/proc/handle_stance() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index aadd5a74c1b..03bc97c2d73 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -867,19 +867,6 @@ var/list/slot_equipment_priority = list( \ /mob/proc/stripPanelEquip(obj/item/what, mob/who) return - -/mob/proc/pull_damage() - if(ishuman(src)) - var/mob/living/carbon/human/H = src - if(H.health <= config.health_threshold_softcrit) - for(var/name in H.bodyparts_by_name) - var/obj/item/organ/external/e = H.bodyparts_by_name[name] - if(e && H.lying) - if(((e.status & ORGAN_BROKEN && !(e.status & ORGAN_SPLINTED)) || e.status & ORGAN_BLEEDING) && (H.getBruteLoss() + H.getFireLoss() >= 100)) - return 1 - break - return 0 - /mob/MouseDrop(mob/M as mob) ..() if(M != usr) return diff --git a/code/modules/surgery/cavity_implant.dm b/code/modules/surgery/cavity_implant.dm index bd82e7192ae..1b8671c2537 100644 --- a/code/modules/surgery/cavity_implant.dm +++ b/code/modules/surgery/cavity_implant.dm @@ -188,8 +188,7 @@ " You put \the [tool] inside [target]'s [get_cavity(affected)] cavity." ) if((tool.w_class > get_max_wclass(affected)/2 && prob(50) && !(affected.status & ORGAN_ROBOT))) to_chat(user, " You tear some vessels trying to fit the object in the cavity.") - var/datum/wound/internal_bleeding/I = new () - affected.wounds += I + affected.internal_bleeding = TRUE affected.owner.custom_pain("You feel something rip in your [affected.name]!", 1) user.drop_item() affected.hidden = tool diff --git a/code/modules/surgery/face.dm b/code/modules/surgery/face.dm index 28e0be1b046..27552935a89 100644 --- a/code/modules/surgery/face.dm +++ b/code/modules/surgery/face.dm @@ -131,7 +131,6 @@ user.visible_message(" [user] cauterizes the incision on [target]'s face and neck with \the [tool].", \ " You cauterize the incision on [target]'s face and neck with \the [tool].") affected.open = 0 - affected.status &= ~ORGAN_BLEEDING var/obj/item/organ/external/head/h = affected h.disfigured = 0 h.update_icon() diff --git a/code/modules/surgery/generic.dm b/code/modules/surgery/generic.dm index d87458e3ed9..655716232f9 100644 --- a/code/modules/surgery/generic.dm +++ b/code/modules/surgery/generic.dm @@ -47,7 +47,6 @@ user.visible_message(" [user] has made an incision on [target]'s [affected.name] with \the [tool].", \ " You have made an incision on [target]'s [affected.name] with \the [tool].",) affected.open = 1 - affected.status |= ORGAN_BLEEDING return 1 /datum/surgery_step/generic/cut_open/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) @@ -81,7 +80,6 @@ var/obj/item/organ/external/affected = target.get_organ(target_zone) user.visible_message(" [user] clamps bleeders in [target]'s [affected.name] with \the [tool].", \ " You clamp bleeders in [target]'s [affected.name] with \the [tool].") - affected.clamp() spread_germs_to_organ(affected, user, tool) return 1 @@ -173,7 +171,6 @@ " You cauterize the incision on [target]'s [affected.name] with \the [tool].") affected.open = 0 affected.germ_level = 0 - affected.status &= ~ORGAN_BLEEDING return 1 /datum/surgery_step/generic/cauterize/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) diff --git a/code/modules/surgery/helpers.dm b/code/modules/surgery/helpers.dm index 1991ce8ec21..afa0429bdc0 100644 --- a/code/modules/surgery/helpers.dm +++ b/code/modules/surgery/helpers.dm @@ -73,7 +73,6 @@ if(affecting) affecting.open = 0 affecting.germ_level = 0 - affecting.status &= ~ORGAN_BLEEDING qdel(current_surgery) else if(current_surgery.can_cancel) to_chat(user, "You need to hold a cautery in inactive hand to stop [M]'s surgery!") diff --git a/code/modules/surgery/limb_augmentation.dm b/code/modules/surgery/limb_augmentation.dm index 773508c88ea..9674f4aec49 100644 --- a/code/modules/surgery/limb_augmentation.dm +++ b/code/modules/surgery/limb_augmentation.dm @@ -54,5 +54,4 @@ affected.open = 0 affected.germ_level = 0 - affected.status &= ~ORGAN_BLEEDING return 1 \ No newline at end of file diff --git a/code/modules/surgery/organs/blood.dm b/code/modules/surgery/organs/blood.dm index 2cd9d9ff632..7aa7d164279 100644 --- a/code/modules/surgery/organs/blood.dm +++ b/code/modules/surgery/organs/blood.dm @@ -61,6 +61,7 @@ death() var/temp_bleed = 0 + var/internal_bleeding_rate = 0 //Bleeding out for(var/X in bodyparts) var/obj/item/organ/external/BP = X @@ -79,8 +80,14 @@ if(BP.open) temp_bleed += 0.5 + if(BP.internal_bleeding) + internal_bleeding_rate += 0.5 + bleed_rate = max(bleed_rate - 0.5, temp_bleed)//if no wounds, other bleed effects (heparin) naturally decreases + if(internal_bleeding_rate && !(status_flags & FAKEDEATH)) + bleed(internal_bleeding_rate) + if(bleed_rate && !bleedsuppress && !(status_flags & FAKEDEATH)) bleed(bleed_rate) diff --git a/code/modules/surgery/organs/organ.dm b/code/modules/surgery/organs/organ.dm index a84e63649d7..152ce0527ea 100644 --- a/code/modules/surgery/organs/organ.dm +++ b/code/modules/surgery/organs/organ.dm @@ -251,10 +251,8 @@ var/list/organ_cache = list() /obj/item/organ/proc/robotize() //Being used to make robutt hearts, etc robotic = 2 status &= ~ORGAN_BROKEN - status &= ~ORGAN_BLEEDING status &= ~ORGAN_SPLINTED status &= ~ORGAN_CUT_AWAY - status &= ~ORGAN_ATTACHABLE status &= ~ORGAN_DESTROYED status |= ORGAN_ROBOT status |= ORGAN_ASSISTED diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index d01b5e5202e..0670def6c7a 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -60,10 +60,7 @@ var/obj/item/hidden = null var/list/embedded_objects = list() - - // how often wounds should be updated, a higher number means less often - var/wound_update_accuracy = 1 - + var/internal_bleeding = FALSE var/amputation_point // Descriptive string used in amputation. var/can_grasp var/can_stand @@ -241,7 +238,7 @@ else //If we can't inflict the full amount of damage, spread the damage in other ways //How much damage can we actually cause? - var/can_inflict = max_damage * config.organ_health_multiplier - (brute_dam + burn_dam) + var/can_inflict = max_damage - (brute_dam + burn_dam) if(can_inflict) if(brute > 0) //Inflict all burte damage we can @@ -290,7 +287,7 @@ var/mob/living/carbon/owner_old = owner //Need to update health, but need a reference in case the below check cuts off a limb. //If limb took enough damage, try to cut or tear it off if(owner && loc == owner) - if(!cannot_amputate && config.limbs_can_break && (brute_dam) >= (max_damage * config.organ_health_multiplier)) + if(!cannot_amputate && config.limbs_can_break && (brute_dam) >= (max_damage)) if(prob(brute / 2)) if(sharp) droplimb(0, DROPLIMB_SHARP) @@ -345,6 +342,7 @@ This function completely restores a damaged organ to perfect condition. brute_dam = 0 burn_dam = 0 open = 0 //Closing all wounds. + internal_bleeding = FALSE wounds.Cut() //Clears all wounds! Good as new. if(istype(src, /obj/item/organ/external/head) && disfigured) //If their head's disfigured, refigure it. disfigured = 0 @@ -369,8 +367,7 @@ This function completely restores a damaged organ to perfect condition. //Possibly trigger an internal wound, too. var/local_damage = brute_dam + burn_dam + damage if(damage > 15 && type != BURN && local_damage > 30 && prob(damage) && !(status & ORGAN_ROBOT)) - var/datum/wound/internal_bleeding/I = new () - wounds += I + internal_bleeding = TRUE owner.custom_pain("You feel something rip in your [name]!", 1) // first check whether we can widen an existing wound @@ -418,7 +415,7 @@ This function completely restores a damaged organ to perfect condition. //Determines if we even need to process this organ. /obj/item/organ/external/proc/need_process() - if(status & (ORGAN_CUT_AWAY|ORGAN_GAUZED|ORGAN_BLEEDING|ORGAN_BROKEN|ORGAN_DESTROYED|ORGAN_SPLINTED|ORGAN_DEAD|ORGAN_MUTATED)) + if(status & (ORGAN_CUT_AWAY|ORGAN_BROKEN|ORGAN_DESTROYED|ORGAN_SPLINTED|ORGAN_DEAD|ORGAN_MUTATED)) return 1 if(brute_dam || burn_dam) return 1 @@ -444,9 +441,7 @@ This function completely restores a damaged organ to perfect condition. owner.update_body(1) return - // Process wounds, doing healing etc. Only do this every few ticks to save processing power - if(owner.life_tick % wound_update_accuracy == 0) - update_wounds() + update_wounds() //Chem traces slowly vanish if(owner.life_tick % 10 == 0) @@ -500,17 +495,10 @@ Note that amputating the affected organ does in fact remove the infection from t /obj/item/organ/external/proc/handle_germ_sync() var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin") - for(var/datum/wound/W in wounds) - //Open wounds can become infected - if(owner.germ_level > W.germ_level && W.infection_check()) - W.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 + //Open wounds can become infected + if(owner.germ_level > germ_level && infection_check()) + germ_level++ /obj/item/organ/external/handle_germ_effects() @@ -563,47 +551,8 @@ Note that amputating the affected organ does in fact remove the infection from t if((status & ORGAN_ROBOT)) //Robotic limbs don't heal or get worse. return - for(var/datum/wound/W in wounds) - - // Internal wounds get worse over time. Low temperatures (cryo) stop them. - if(W.internal && !W.can_autoheal() && owner.bodytemperature >= 170) - var/bicardose = owner.reagents.get_reagent_amount("styptic_powder") - if(!bicardose) //styptic powder stops internal wounds from growing bigger with time, and also stop bleeding - W.open_wound(0.1 * wound_update_accuracy) - owner.blood_volume = max(owner.blood_volume - (0.05 * W.damage * wound_update_accuracy), 0) - - owner.blood_volume = max(owner.blood_volume - (0.02 * W.damage * wound_update_accuracy), 0) - if(prob(1 * wound_update_accuracy)) - owner.custom_pain("You feel a stabbing pain in your [name]!",1) - - //overdose of styptic powder begins healing IB - if(owner.reagents.get_reagent_amount("styptic_powder") >= 30) - W.damage = max(0, W.damage - 0.2) - - // slow healing - 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.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 - heal_amt = heal_amt * wound_update_accuracy - //configurable regen speed woo, no-regen hardcore or instaheal hugbox, choose your destiny - heal_amt = heal_amt * config.organ_regeneration_multiplier - // amount of healing is spread over all the wounds - heal_amt = heal_amt / (wounds.len + 1) - // making it look prettier on scanners - heal_amt = round(heal_amt,0.1) - W.heal_damage(heal_amt) - - // Salving also helps against infection - if(W.germ_level > 0 && W.salved && prob(2)) - W.disinfected = 1 - W.germ_level = 0 - // sync the organ's damage with its wounds - src.update_damages() + update_damages() if(update_icon()) owner.UpdateDamageIcon(1) @@ -612,12 +561,6 @@ Note that amputating the affected organ does in fact remove the infection from t number_wounds = 0 brute_dam = 0 burn_dam = 0 - status &= ~ORGAN_BLEEDING - var/clamped = 0 - - var/mob/living/carbon/human/H - if(istype(owner,/mob/living/carbon/human)) - H = owner for(var/datum/wound/W in wounds) if(W.damage_type == CUT || W.damage_type == BRUISE) @@ -625,24 +568,11 @@ Note that amputating the affected organ does in fact remove the infection from t else if(W.damage_type == BURN) burn_dam += W.damage - if(!(status & ORGAN_ROBOT) && W.bleeding()) - W.bleed_timer-- - if(H && (NO_BLOOD in H.species.species_traits)) // Bloodless organic races are finicky - W.clamped = 1 - W.bleed_timer = 0 - else - status |= ORGAN_BLEEDING - - clamped |= W.clamped - number_wounds += W.amount - if(open && !clamped && (H && !(NO_BLOOD in H.species.species_traits))) - status |= ORGAN_BLEEDING - //Bone fractures - if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT)) - src.fracture() + if(config.bones_can_break && brute_dam > min_broken_damage && !(status & ORGAN_ROBOT)) + fracture() // new damage icon system // returns just the brute/burn damage code @@ -773,41 +703,6 @@ Note that amputating the affected organ does in fact remove the infection from t "\The [holder.legcuffed.name] falls off you.") holder.unEquip(holder.legcuffed) - -/obj/item/organ/external/proc/bandage() - var/rval = 0 - src.status &= ~ORGAN_BLEEDING - for(var/datum/wound/W in wounds) - if(W.internal) continue - rval |= !W.bandaged - W.bandaged = 1 - return rval - -/obj/item/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 - -/obj/item/organ/external/proc/clamp() - var/rval = 0 - src.status &= ~ORGAN_BLEEDING - for(var/datum/wound/W in wounds) - if(W.internal) continue - rval |= !W.clamped - W.clamped = 1 - return rval - -/obj/item/organ/external/proc/salve() - var/rval = 0 - for(var/datum/wound/W in wounds) - rval |= !W.salved - W.salved = 1 - return rval - /obj/item/organ/external/proc/fracture() if(status & ORGAN_ROBOT) return //ORGAN_BROKEN doesn't have the same meaning for robot limbs @@ -833,7 +728,7 @@ Note that amputating the affected organ does in fact remove the infection from t /obj/item/organ/external/proc/mend_fracture() if(status & ORGAN_ROBOT) return 0 //ORGAN_BROKEN doesn't have the same meaning for robot limbs - if(brute_dam > min_broken_damage * config.organ_health_multiplier) + if(brute_dam > min_broken_damage) return 0 //will just immediately fracture again status &= ~ORGAN_BROKEN @@ -885,10 +780,9 @@ Note that amputating the affected organ does in fact remove the infection from t return max(brute_dam + burn_dam - perma_injury, perma_injury) //could use health? /obj/item/organ/external/proc/has_infected_wound() - for(var/datum/wound/W in wounds) - if(W.germ_level > INFECTION_LEVEL_ONE) - return 1 - return 0 + if(germ_level > INFECTION_LEVEL_ONE) + return TRUE + return FALSE /obj/item/organ/external/proc/is_usable() if(((status & ORGAN_ROBOT) && get_damage() >= max_damage) && !tough) //robot limbs just become inoperable at max damage @@ -898,9 +792,6 @@ Note that amputating the affected organ does in fact remove the infection from t /obj/item/organ/external/proc/is_malfunctioning() return ((status & ORGAN_ROBOT) && (brute_dam + burn_dam) >= 10 && prob(brute_dam + burn_dam) && !tough) -/obj/item/organ/external/proc/open_enough_for_surgery() - return (encased ? (open == 3) : (open == 2)) - /obj/item/organ/external/remove(var/mob/living/user, var/ignore_children) if(!owner) @@ -983,6 +874,18 @@ Note that amputating the affected organ does in fact remove the infection from t wounds -= W qdel(W) +/obj/item/organ/external/proc/infection_check() + var/total_damage = brute_dam + burn_dam + if(total_damage) + if(total_damage < 10) //small amounts of damage aren't infectable + return FALSE + + if(owner && owner.bleedsuppress && total_damage < 25) + return FALSE + + var/dam_coef = round(total_damage / 10) + return prob(dam_coef * 10) + return FALSE /obj/item/organ/external/serialize() var/list/data = ..() diff --git a/code/modules/surgery/organs/wound.dm b/code/modules/surgery/organs/wound.dm index b1f99b34d6b..f07382a6496 100644 --- a/code/modules/surgery/organs/wound.dm +++ b/code/modules/surgery/organs/wound.dm @@ -11,41 +11,20 @@ // amount of damage this wound causes var/damage = 0 - // ticks of bleeding left. - var/bleed_timer = 0 // amount of damage the current wound type requires(less means we need to apply the next healing stage) var/min_damage = 0 - // is the wound bandaged? - var/bandaged = 0 - // Similar to bandaged, but works differently - var/clamped = 0 - // is the wound salved? - var/salved = 0 - // is the wound disinfected? - var/disinfected = 0 var/created = 0 // number of wounds of this type var/amount = 1 - // amount of germs in the wound - var/germ_level = 0 - /* These are defined by the wound type and should not be changed */ // stages such as "cut", "deep cut", etc. var/list/stages - // internal wounds can only be fixed through surgery - var/internal = 0 - // maximum stage at which bleeding should still happen. Beyond this stage bleeding is prevented. - var/max_bleeding_stage = 0 // one of CUT, BRUISE, BURN var/damage_type = CUT // whether this wound needs a bandage/salve to heal at all // the maximum amount of damage that this wound can have and still autoheal - var/autoheal_cutoff = 15 - - - // helper lists var/tmp/list/desc_list = list() @@ -66,7 +45,6 @@ // initialize with the appropriate stage src.init_stage(damage) - bleed_timer += damage // returns 1 if there's a next stage, 0 otherwise proc/init_stage(var/initial_damage) @@ -82,72 +60,22 @@ proc/wound_damage() return src.damage / src.amount - 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.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 - if(!(other.disinfected) != !(src.disinfected)) return 0 - //if(other.germ_level != src.germ_level) return 0 return 1 proc/merge_wound(var/datum/wound/other) src.damage += other.damage src.amount += other.amount - src.bleed_timer += other.bleed_timer - src.germ_level = max(src.germ_level, other.germ_level) src.created = max(src.created, other.created) //take the newer created time - // 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(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) - 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 - proc/heal_damage(amount, heals_internal = 0) - if(src.internal && !heals_internal) - // heal nothing - return amount - + proc/heal_damage(amount) var/healed_damage = min(src.damage, amount) amount -= healed_damage src.damage -= healed_damage @@ -163,7 +91,6 @@ // opens the wound again proc/open_wound(damage) src.damage += damage - bleed_timer += damage while(src.current_stage > 1 && src.damage_list[current_stage-1] <= src.damage / src.amount) src.current_stage-- @@ -189,21 +116,6 @@ return 1 - proc/bleeding() - if(src.internal) - return 0 // internal wounds don't bleed in the sense of this function - - if(current_stage > max_bleeding_stage) - return 0 - - if(bandaged||clamped) - return 0 - - if(wound_damage() <= 30 && bleed_timer <= 0) - return 0 //Bleed timer has run out. Wounds with more than 30 damage don't stop bleeding on their own. - - return (damage_type == BRUISE && wound_damage() >= 20 || damage_type == CUT && wound_damage() >= 5) - /** WOUND DEFINITIONS **/ //Note that the MINIMUM damage before a wound can be applied should correspond to @@ -244,34 +156,27 @@ /** CUTS **/ /datum/wound/cut/small - // Minor cuts have max_bleeding_stage set to the stage that bears the wound type's name. // The major cut types have the max_bleeding_stage set to the clot stage (which is accordingly given the "blood soaked" descriptor). - max_bleeding_stage = 3 stages = list("ugly ripped cut" = 20, "ripped cut" = 10, "cut" = 5, "healing cut" = 2, "small scab" = 0) damage_type = CUT /datum/wound/cut/deep - max_bleeding_stage = 3 stages = list("ugly deep ripped cut" = 25, "deep ripped cut" = 20, "deep cut" = 15, "clotted cut" = 8, "scab" = 2, "fresh skin" = 0) damage_type = CUT /datum/wound/cut/flesh - max_bleeding_stage = 4 stages = list("ugly ripped flesh wound" = 35, "ugly flesh wound" = 30, "flesh wound" = 25, "blood soaked clot" = 15, "large scab" = 5, "fresh skin" = 0) damage_type = CUT /datum/wound/cut/gaping - max_bleeding_stage = 3 stages = list("gaping wound" = 50, "large blood soaked clot" = 25, "blood soaked clot" = 15, "small angry scar" = 5, "small straight scar" = 0) damage_type = CUT /datum/wound/cut/gaping_big - max_bleeding_stage = 3 stages = list("big gaping wound" = 60, "healing gaping wound" = 40, "large blood soaked clot" = 25, "large angry scar" = 10, "large straight scar" = 0) damage_type = CUT datum/wound/cut/massive - max_bleeding_stage = 3 stages = list("massive wound" = 70, "massive healing wound" = 50, "massive blood soaked clot" = 25, "massive angry scar" = 10, "massive jagged scar" = 0) damage_type = CUT @@ -279,8 +184,6 @@ datum/wound/cut/massive /datum/wound/bruise stages = list("monumental bruise" = 80, "huge bruise" = 50, "large bruise" = 30, "moderate bruise" = 20, "small bruise" = 10, "tiny bruise" = 5) - max_bleeding_stage = 3 //only large bruise and above can bleed. - autoheal_cutoff = 30 damage_type = BRUISE /** BURNS **/ @@ -304,13 +207,6 @@ datum/wound/cut/massive stages = list("carbonised area" = 50, "healing carbonised area" = 20, "massive burn scar" = 0) damage_type = BURN -/** INTERNAL BLEEDING **/ -/datum/wound/internal_bleeding - internal = 1 - stages = list("severed artery" = 30, "cut artery" = 20, "damaged artery" = 10, "bruised artery" = 5) - autoheal_cutoff = 5 - max_bleeding_stage = 4 //all stages bleed. It's called internal bleeding after all. - /** EXTERNAL ORGAN LOSS **/ /datum/wound/lost_limb @@ -322,7 +218,6 @@ datum/wound/cut/massive switch(losstype) if(DROPLIMB_SHARP, DROPLIMB_BLUNT) damage_type = CUT - max_bleeding_stage = 3 //clotted stump and above can bleed. stages = list( "ripped stump" = damage_amt*1.3, "bloody stump" = damage_amt, diff --git a/code/modules/surgery/other.dm b/code/modules/surgery/other.dm index cfd6b8e632e..00f887f8e04 100644 --- a/code/modules/surgery/other.dm +++ b/code/modules/surgery/other.dm @@ -33,14 +33,10 @@ if(ishuman(target)) var/mob/living/carbon/human/H = target var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting) - if(!affected) return 0 + if(!affected) + return 0 - var/internal_bleeding = 0 - for(var/datum/wound/W in affected.wounds) - if(W.internal) - internal_bleeding = 1 - break - if(internal_bleeding) + if(affected.internal_bleeding) return 1 return 0 @@ -75,15 +71,10 @@ /datum/surgery_step/fix_vein/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) var/obj/item/organ/external/affected = target.get_organ(target_zone) - if(!affected) return 0 + if(!affected) + return 0 - var/internal_bleeding = 0 - for(var/datum/wound/W in affected.wounds) - if(W.internal) - internal_bleeding = 1 - break - - return internal_bleeding + return affected.internal_bleeding /datum/surgery_step/fix_vein/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -97,9 +88,7 @@ user.visible_message(" [user] has patched the damaged vein in [target]'s [affected.name] with \the [tool].", \ " You have patched the damaged vein in [target]'s [affected.name] with \the [tool].") - for(var/datum/wound/W in affected.wounds) if(W.internal) - affected.wounds -= W - affected.update_damages() + affected.internal_bleeding = FALSE if(ishuman(user) && prob(40)) var/mob/living/carbon/human/U = user U.bloody_hands(target, 0) diff --git a/config/example/game_options.txt b/config/example/game_options.txt index 7246e0773fa..61e7e3aa949 100644 --- a/config/example/game_options.txt +++ b/config/example/game_options.txt @@ -12,14 +12,6 @@ BONES_CAN_BREAK 1 ## 0 means limbs can't be amputated, 1 means they can LIMBS_CAN_BREAK 1 -## Multiplier which enables organs to take more damage before bones breaking or limbs being destroyed -## 100 means normal, 50 means half -ORGAN_HEALTH_MULTIPLIER 100 - -## Multiplier which influences how fast organs regenerate naturally -## 100 means normal, 50 means half -ORGAN_REGENERATION_MULTIPLIER 0 - ### REVIVAL ### ## Whether pod plants work or not REVIVAL_POD_PLANTS 1