diff --git a/code/datums/organs/organ_external.dm b/code/datums/organs/organ_external.dm index 81a8715c54b..aba465b3a14 100644 --- a/code/datums/organs/organ_external.dm +++ b/code/datums/organs/organ_external.dm @@ -33,6 +33,9 @@ var/open = 0 var/stage = 0 + // how often wounds should be updated, a higher number means less often + var/wound_update_accuracy = 20 // update every 20 ticks(roughly every minute) + proc/take_damage(brute, burn, sharp, used_weapon = null, list/forbidden_limbs = list()) // TODO: this proc needs to be rewritten to not update damages directly if((brute <= 0) && (burn <= 0)) @@ -69,32 +72,22 @@ // If the limbs can break, make sure we don't exceed the maximum damage a limb can take before breaking if((brute_dam + burn_dam + brute + burn) < max_damage || !config.limbs_can_break) if(brute) - brute_dam += brute if( (prob(brute*2) && !sharp) || sharp ) createwound( CUT, brute ) else if(!sharp) createwound( BRUISE, brute ) if(burn) - burn_dam += burn createwound( BURN, burn ) else + // If we can't inflict the full amount of damage, spread the damage in other ways var/can_inflict = max_damage * config.organ_health_multiplier - (brute_dam + burn_dam) //How much damage can we actually cause? if(can_inflict) - if (brute > 0 && burn > 0) - brute = can_inflict/2 - burn = can_inflict/2 - var/ratio = brute / (brute + burn) - brute_dam += ratio * can_inflict - burn_dam += (1 - ratio) * can_inflict - else - if (brute > 0) - brute = can_inflict - brute_dam += brute - createwound(BRUISE, brute) - else - burn = can_inflict - burn_dam += burn - createwound(BRUISE, brute) + if (brute > 0) + brute = can_inflict + createwound(BRUISE, brute) + if (burn > 0) + burn = can_inflict + createwound(BURN, burn) else if(!(status & ORGAN_ROBOT)) var/passed_dam = (brute + burn) - can_inflict //Getting how much overdamage we have. var/list/datum/organ/external/possible_points = list() @@ -169,7 +162,7 @@ else if(W.damage_type == BURN) burn_dam += W.damage - if(!W.bandaged && W.damage > 4) + if(W.bleeding()) status |= ORGAN_BLEEDING number_wounds += W.amount @@ -187,11 +180,16 @@ if(W.salved) amount++ if(W.disinfected) amount++ // amount of healing is spread over all the wounds - W.heal_damage((amount * W.amount * config.organ_regeneration_multiplier) / (5*owner.number_wounds+1)) + W.heal_damage((wound_update_accuracy * amount * W.amount * config.organ_regeneration_multiplier) / (20*owner.number_wounds+1)) // sync the organ's damage with its wounds src.update_damages() + proc/bandage() + status |= ORGAN_BANDAGED + for(var/datum/wound/W in wounds) + W.bandaged = 1 + proc/get_damage() //returns total damage return max(brute_dam + burn_dam - perma_injury, perma_injury) //could use health? @@ -204,7 +202,7 @@ process() // process wounds, doing healing etc., only do this every 4 ticks to save processing power - if(owner.life_tick % 4 == 0) + if(owner.life_tick % wound_update_accuracy == 0) update_wounds() if(status & ORGAN_DESTROYED) if(!destspawn && config.limbs_can_break) @@ -373,14 +371,15 @@ var/size = min( max( 1, damage/10 ) , 6) // first check whether we can widen an existing wound - if(wounds.len > 0 && prob(25)) + if(wounds.len > 0 && prob(max(50+owner.number_wounds*10,100))) if((type == CUT || type == BRUISE) && damage >= 5) var/datum/wound/W = pick(wounds) if(W.amount == 1 && W.started_healing()) - W.open_wound() - owner.visible_message("\red The wound on [owner.name]'s [display_name] widens with a nasty ripping voice.",\ - "\red The wound on your [display_name] widens with a nasty ripping voice.",\ - "You hear a nasty ripping noise, as if flesh is being torn apart.") + W.open_wound(damage) + if(prob(25)) + owner.visible_message("\red The wound on [owner.name]'s [display_name] widens with a nasty ripping voice.",\ + "\red The wound on your [display_name] widens with a nasty ripping voice.",\ + "You hear a nasty ripping noise, as if flesh is being torn apart.") return @@ -585,7 +584,7 @@ obj/item/weapon/organ/head/proc/transfer_identity(var/mob/living/carbon/human/H) if(H.mind) H.mind.transfer_to(brainmob) brainmob.container = src - + obj/item/weapon/organ/head/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W,/obj/item/weapon/scalpel)) switch(brain_op_stage) diff --git a/code/datums/organs/wound.dm b/code/datums/organs/wound.dm index 1caf45b7587..38100d78567 100644 --- a/code/datums/organs/wound.dm +++ b/code/datums/organs/wound.dm @@ -90,42 +90,46 @@ while(src.damage / src.amount < damage_list[current_stage] && current_stage < src.desc_list.len) current_stage++ desc = desc_list[current_stage] + src.min_damage = damage_list[current_stage] // return amount of healing still leftover, can be used for other wounds return amount // opens the wound again - proc/open_wound() - if(current_stage > 1) - // e.g. current_stage is 2, then reset it to 0 and do next_stage(), bringing it to 1 - src.current_stage -= 2 - next_stage() - src.damage = src.min_damage + 5 + proc/open_wound(damage) + src.damage += damage + + while(src.current_stage > 1 && src.damage_list[current_stage-1] <= src.damage) + src.current_stage-- + + src.desc = desc_list[current_stage] + src.min_damage = damage_list[current_stage] + + proc/bleeding() + return (!bandaged && damage > 4) /** CUTS **/ /datum/wound/cut // link wound descriptions to amounts of damage - stages = list("cut" = 5, "healing cut" = 2, "small scab" = 0) + stages = list("ugly ripped cut" = 20, "ripped cut" = 10, "cut" = 5, "healing cut" = 2, "small scab" = 0) /datum/wound/deep_cut - stages = list("deep cut" = 15, "clotted cut" = 8, "scab" = 2, "fresh skin" = 0) + stages = list("ugly deep ripped cut" = 25, "deep ripped cut" = 20, "deep cut" = 15, "clotted cut" = 8, "scab" = 2, "fresh skin" = 0) /datum/wound/flesh_wound - stages = list("flesh wound" = 25, "blood soaked clot" = 15, "large scab" = 5, "fresh skin" = 0) + stages = list("ugly ripped flesh wound" = 35, "ugly flesh wound" = 30, "flesh wound" = 25, "blood soaked clot" = 15, "large scab" = 5, "fresh skin" = 0) /datum/wound/gaping_wound stages = list("gaping wound" = 50, "large blood soaked clot" = 25, "large clot" = 15, "small angry scar" = 5, \ "small straight scar" = 0) /datum/wound/big_gaping_wound - stages = list("big gaping wound" = 60, "gauze wrapped wound" = 50, "blood soaked bandage" = 25,\ - "large angry scar" = 10, "large straight scar" = 0) + stages = list("big gaping wound" = 60, "healing gaping wound" = 40, "large angry scar" = 10, "large straight scar" = 0) needs_treatment = 1 // this only heals when bandaged /datum/wound/massive_wound - stages = list("massive wound" = 70, "massive blood soaked bandage" = 40, "huge bloody mess" = 20,\ - "massive angry scar" = 10, "massive jagged scar" = 0) + stages = list("massive wound" = 70, "massive healing wound" = 50, "massive angry scar" = 10, "massive jagged scar" = 0) needs_treatment = 1 // this only heals when bandaged @@ -160,28 +164,28 @@ /** BURNS **/ /datum/wound/moderate_burn - stages = list("moderate burn" = 5, "moderate salved burn" = 2, "fresh skin" = 0) + stages = list("ripped burn" = 10, "moderate burn" = 5, "moderate salved burn" = 2, "fresh skin" = 0) needs_treatment = 1 // this only heals when bandaged damage_type = BURN /datum/wound/large_burn - stages = list("large burn" = 15, "large salved burn" = 5, "fresh skin" = 0) + stages = list("ripped large burn" = 20, "large burn" = 15, "large salved burn" = 5, "fresh skin" = 0) needs_treatment = 1 // this only heals when bandaged damage_type = BURN /datum/wound/severe_burn - stages = list("severe burn" = 30, "severe salved burn" = 10, "burn scar" = 0) + stages = list("ripped severe burn" = 35, "severe burn" = 30, "severe salved burn" = 10, "burn scar" = 0) needs_treatment = 1 // this only heals when bandaged damage_type = BURN /datum/wound/deep_burn - stages = list("deep burn" = 40, "deep salved burn" = 15, "large burn scar" = 0) + stages = list("ripped deep burn" = 45, "deep burn" = 40, "deep salved burn" = 15, "large burn scar" = 0) needs_treatment = 1 // this only heals when bandaged diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 30fde75d9ef..a7bbd38abff 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -264,6 +264,7 @@ verbs += /client/proc/Set_Holiday //Force-set a Holiday verbs += /client/proc/admin_memo verbs += /client/proc/ToRban //ToRban frontend to access its features. + verbs += /client/proc/game_panel //verbs += /client/proc/cmd_mass_modify_object_variables --Merged with view variables //verbs += /client/proc/cmd_admin_explosion --Merged with view variables //verbs += /client/proc/cmd_admin_emp --Merged with view variables diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 593192da1bc..39136deb07b 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -298,10 +298,13 @@ else if(temp.wounds.len > 0) var/list/wound_descriptors = list() for(var/datum/wound/W in temp.wounds) - if(W.desc in wound_descriptors) - wound_descriptors[W.desc] += W.amount + var/this_wound_desc = W.desc + if(W.bleeding()) this_wound_desc = "bleeding [this_wound_desc]" + else if(W.bandaged) this_wound_desc = "bandaged [this_wound_desc]" + if(this_wound_desc in wound_descriptors) + wound_descriptors[this_wound_desc] += W.amount continue - wound_descriptors[W.desc] = W.amount + wound_descriptors[this_wound_desc] = W.amount var/list/flavor_text = list() var/list/no_exclude = list("gaping wound", "big gaping wound", "massive wound", "large bruise",\ "huge bruise", "massive bruise", "severe burn", "large burn", "deep burn", "carbonised area") diff --git a/config/game_options.txt b/config/game_options.txt index 55bb346aca0..b8a6b52d488 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -19,7 +19,7 @@ ORGAN_HEALTH_MULTIPLIER 100 ## multiplier which influences how fast organs regenerate naturally ## 100 means normal, 50 means half -ORGAN_REGENERATION_MULTIPLIER 100 +ORGAN_REGENERATION_MULTIPLIER 200 ### REVIVAL ###