Binsult.ogg

This commit is contained in:
Fox-McCloud
2017-07-15 12:12:59 -04:00
parent b160582f09
commit cb35d1f6e9
20 changed files with 62 additions and 318 deletions
+1 -2
View File
@@ -188,8 +188,7 @@
"<span class='notice'> You put \the [tool] inside [target]'s [get_cavity(affected)] cavity.</span>" )
if((tool.w_class > get_max_wclass(affected)/2 && prob(50) && !(affected.status & ORGAN_ROBOT)))
to_chat(user, "<span class='warning'> You tear some vessels trying to fit the object in the cavity.</span>")
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
-1
View File
@@ -131,7 +131,6 @@
user.visible_message("<span class='notice'> [user] cauterizes the incision on [target]'s face and neck with \the [tool].</span>", \
"<span class='notice'> You cauterize the incision on [target]'s face and neck with \the [tool].</span>")
affected.open = 0
affected.status &= ~ORGAN_BLEEDING
var/obj/item/organ/external/head/h = affected
h.disfigured = 0
h.update_icon()
-3
View File
@@ -47,7 +47,6 @@
user.visible_message("<span class='notice'> [user] has made an incision on [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'> You have made an incision on [target]'s [affected.name] with \the [tool].</span>",)
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("<span class='notice'> [user] clamps bleeders in [target]'s [affected.name] with \the [tool]</span>.", \
"<span class='notice'> You clamp bleeders in [target]'s [affected.name] with \the [tool].</span>")
affected.clamp()
spread_germs_to_organ(affected, user, tool)
return 1
@@ -173,7 +171,6 @@
"<span class='notice'> You cauterize the incision on [target]'s [affected.name] with \the [tool].</span>")
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)
-1
View File
@@ -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, "<span class='warning'>You need to hold a cautery in inactive hand to stop [M]'s surgery!</span>")
@@ -54,5 +54,4 @@
affected.open = 0
affected.germ_level = 0
affected.status &= ~ORGAN_BLEEDING
return 1
+7
View File
@@ -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)
-2
View File
@@ -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
+29 -126
View File
@@ -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 = ..()
+1 -106
View File
@@ -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,
+7 -18
View File
@@ -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("<span class='notice'> [user] has patched the damaged vein in [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'> You have patched the damaged vein in [target]'s [affected.name] with \the [tool].</span>")
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)