From aa3a9ba062b5d3b6a5b4a5fcae64226a56435aa3 Mon Sep 17 00:00:00 2001 From: cib Date: Tue, 10 Jul 2012 19:11:48 +0200 Subject: [PATCH 01/25] Minor fix to bleeding. --- code/modules/mob/living/carbon/human/life.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 72afe3247fd..1d6f37e8a8a 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1097,7 +1097,8 @@ var/blood_max = 0 for(var/name in organs) var/datum/organ/external/temp = organs[name] - if(!(temp.status & BLEEDING) || temp.status & ROBOT) + // temp.amputated means it's cleanly healed but the limb is still missing + if(!(temp.status & BLEEDING) || temp.status & ROBOT || temp.amputated) continue blood_max += 2 if(temp.status & DESTROYED && !(temp.status & GAUZED)) From 7be97d0d9fb1f9fc6574cd733bb154282ed247ea Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 13:28:59 +0200 Subject: [PATCH 02/25] Updated response team fluff --- code/game/response_team.dm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/game/response_team.dm b/code/game/response_team.dm index fb413c85579..a62fa7dbc2c 100644 --- a/code/game/response_team.dm +++ b/code/game/response_team.dm @@ -18,6 +18,7 @@ client/verb/JoinResponseTeam() var/leader_selected = (response_team_members.len == 0) + for (var/obj/effect/landmark/L in world) if (L.name == "Commando") var/new_name = input(usr, "Pick a name","Name") as null|text @@ -27,8 +28,12 @@ client/verb/JoinResponseTeam() new_commando.mind.key = usr.key new_commando.key = usr.key - new_commando << "\blue You are [!leader_selected?"a member":"the LEADER"] of an Emergency Response Team under CentComm's service. There is a code red alert on [station_name()], you are tasked to go and fix the problem." + new_commando << "\blue You are [!leader_selected?"a member":"the LEADER"] of an Emergency Response Team, a type of military division, under CentComm's service. There is a code red alert on [station_name()], you are tasked to go and fix the problem." new_commando << "You should first gear up and discuss a plan with your team. More members may be joining, don't move out before you're ready." + if(!leader_selected) + new_commando << "As member of the Emergency Response Team, you answer only to your leader and CentComm officials." + else + new_commando << "As leader of the Emergency Response Team, you answer only to CentComm, and have authority to override the Captain where it is necessary to achieve your mission goals. It is recommended that you attempt to cooperate with the captain where possible, however." del(L) else @@ -240,4 +245,4 @@ proc/trigger_armed_response_team(var/force = 0) W.registered_name = real_name equip_if_possible(W, slot_wear_id) - return 1 \ No newline at end of file + return 1 From 0c67bc7439d92adcc74295890ed28731ecc7dcf1 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 12:51:18 -0700 Subject: [PATCH 03/25] Restructured the organ wound system. Wounds are now datums rather than pure text, which means wound descriptions in examine will now always be in line with the actual damage of the mob. --- code/game/objects/items/weapons/medical.dm | 14 +- .../mob/living/carbon/human/examine.dm | 24 +- code/modules/mob/living/carbon/human/life.dm | 7 +- .../mob/living/carbon/monkey/examine.dm | 13 +- code/modules/mob/living/living.dm | 4 +- code/modules/mob/organ/organ.dm | 376 +++++++++++++----- code/setup.dm | 3 +- 7 files changed, 302 insertions(+), 139 deletions(-) diff --git a/code/game/objects/items/weapons/medical.dm b/code/game/objects/items/weapons/medical.dm index 5752ef8601a..5ad5aec0d25 100644 --- a/code/game/objects/items/weapons/medical.dm +++ b/code/game/objects/items/weapons/medical.dm @@ -118,10 +118,18 @@ MEDICAL if (!ointment && (affecting.status & BLEEDING)) affecting.status &= ~BLEEDING - if (affecting.heal_damage(src.heal_brute, src.heal_burn)) - H.UpdateDamageIcon() + if(ointment) + for(var/datum/wound/W in affecting.wounds) + W.salved = 1 else - H.UpdateDamage() + for(var/datum/wound/W in affecting.wounds) + W.bandaged = 1 + + // Don't do direct healing + //if (affecting.heal_damage(src.heal_brute, src.heal_burn)) + // H.UpdateDamageIcon() + //else + H.UpdateDamage() M.updatehealth() diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 4c1413ba5ef..110bb3a3073 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -223,23 +223,12 @@ msg += "" -/* if (src.getBruteLoss()) - if (src.getBruteLoss() < 30) - usr << "\red [src.name] looks slightly injured!" - else - usr << "\red [src.name] looks severely injured!"*/ - if (src.cloneloss) if (src.cloneloss < 30) msg += "[t_He] looks slightly... unfinished?\n" else msg += "[t_He] looks very... unfinished?\n" -/* if (src.getFireLoss()) - if (src.getFireLoss() < 30) - usr << "\red [src.name] looks slightly burned!" - else - usr << "\red [src.name] looks severely burned!"*/ msg += "" if (src.nutrition < 100) msg += "[t_He] [t_is] severely malnourished.\n" @@ -290,14 +279,13 @@ if(21 to INFINITY) wound_flavor_text["[temp.display_name]"] += pick(" a lot of burns"," severe melting") wound_flavor_text["[temp.display_name]"] += "!\n" - else if(temp.wound_descs.len) + else if(temp.wounds.len) var/list/wound_descriptors = list() - for(var/time in temp.wound_descs) - for(var/wound in temp.wound_descs[time]) - if(wound in wound_descriptors) - wound_descriptors[wound]++ - continue - wound_descriptors[wound] = 1 + for(var/datum/wound/W in temp.wounds) + if(W.desc in wound_descriptors) + wound_descriptors[W.desc]++ + continue + wound_descriptors[W.desc] = 1 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/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 1d6f37e8a8a..a1b18596ede 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -971,7 +971,12 @@ break //At this point, we dun care which blood we are adding to, as long as they get more blood. - B.volume = max(min(B.volume + 560/blood_volume,560), 0) //Less blood = More blood generated per tick + var/blood_regen = 0.5 + if(B.volume < 400) + blood_regen = 1 + if(B.volume < 200) + blood_regen = 1.5 + B.volume = max(min(B.volume + blood_regen,560), 0) //Less blood = More blood generated per tick if(blood_volume > 448) if(pale) diff --git a/code/modules/mob/living/carbon/monkey/examine.dm b/code/modules/mob/living/carbon/monkey/examine.dm index 5ab18f0a61e..0d0eec8a4f4 100644 --- a/code/modules/mob/living/carbon/monkey/examine.dm +++ b/code/modules/mob/living/carbon/monkey/examine.dm @@ -50,14 +50,13 @@ if(21 to INFINITY) wound_flavor_text["[temp.display_name]"] += pick(" a lot of burns"," severe melting") wound_flavor_text["[temp.display_name]"] += "!\n" - else if(temp.wound_descs) + else if(temp.wounds.len) var/list/wound_descriptors = list() - for(var/time in temp.wound_descs) - for(var/wound in temp.wound_descs[time]) - if(wound in wound_descriptors) - wound_descriptors[wound]++ - continue - wound_descriptors[wound] = 1 + for(var/datum/wound/W in temp.wounds) + if(W.desc in wound_descriptors) + wound_descriptors[W.desc]++ + continue + wound_descriptors[W.desc] = 1 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/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 5f0ad20254e..0a68f7523e8 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -184,7 +184,7 @@ affecting.status &= ~BROKEN affecting.status &= ~SPLINTED affecting.status &= ~DESTROYED - del affecting.wound_descs + affecting.wounds.Cut() H.UpdateDamageIcon() H.update_body() //src.fireloss = 0 @@ -218,7 +218,7 @@ e.status &= ~DESTROYED e.perma_injury = 0 e.update_icon() - del e.wound_descs + e.wounds.Cut() del(H.vessel) H.vessel = new/datum/reagents(560) H.vessel.my_atom = H diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 3d9844c625b..7beb047b609 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -2,43 +2,6 @@ //CONTAINS: ORGANS AND WOUNDS// /////////////////////////////// -var/list/wound_progressions = list( -//cut healing path" -"cut" = "healing cut", "healing cut" = "small scab",\ - -//deep cut healing path -"deep cut" = "clotted cut", "clotted cut" = "scab", "scab" = "fresh skin",\ - -//flesh wound healing path -"flesh wound" = "blood soaked clot", "blood soaked clot" = "large scab", "large scab" = "fresh skin",\ - -//gaping wound healing path -"gaping wound" = "large blood soaked clot", "large blood soaked clot" = "large clot", "large clot" = "small angry scar",\ -"small angry scar" = "small straight scar",\ - -//big gaping wound healing path -"big gaping wound" = "gauze wrapped wound", "gauze wrapped wound" = "blood soaked bandage", "blood soaked bandage" = "large angry scar",\ -"large angry scar" = "large straight scar",\ - -//massive wound healing path -"massive wound" = "massive blood soaked bandage", "massive blood soaked bandage" = "huge bloody mess", "huge bloody mess" = "massive angry scar",\ -"massive angry scar" = "massive jagged scar",\ - -//bruise healing path -"monumental bruise" = "large bruise", "huge bruise" = "large bruise", "large bruise" = "moderate bruise",\ -"moderate bruise" = "small bruise", "small bruise" = "tiny bruise",\ - -//moderate burn healing path -"moderate burn" = "moderate salved burn", "moderate salved burn" = "fresh skin",\ - -"large burn" = "large salved burn", "large salved burn" = "moderate salved burn",\ - -"severe burn" = "severe salved burn", "severe salved burn" = "burn scar",\ - -"deep burn" = "deep salved burn", "deep salved burn" = "large burn scar",\ - -"carbonised area" = "treated carbonised area", "treated carbonised area" = "massive burn scar") - /datum/organ var/name = "organ" var/mob/living/carbon/human/owner = null @@ -69,11 +32,196 @@ var/list/wound_progressions = list( W.hits = hits W.time_inflicted = time_inflicted return W -/* fuckign double defines -#define CUT 0 -#define BRUISE 1 -#define BURN 2 -*/ + +/**************************************************** + WOUNDS +****************************************************/ +/datum/wound + // stages such as "cut", "deep cut", etc. + var/list/stages + // number representing the current stage + var/current_stage = 0 + + // description of the wound + var/desc = "" + + // amount of damage this wound causes + var/damage = 0 + + // amount of damage the current wound type requires(less means we need to apply the next healing stage) + var/min_damage = 0 + + // one of CUTE, BRUISE, BURN + var/damage_type = BRUTE + + // whether this wound needs a bandage/salve to heal at all + var/needs_treatment = 0 + + // is the wound bleeding? + var/tmp/bleeding = 0 + // is the wound bandaged? + var/tmp/bandaged = 0 + // is the wound salved? + var/tmp/salved = 0 + // is the wound disinfected? + var/tmp/disinfected = 0 + + // helper lists + var/tmp/list/desc_list = list() + var/tmp/list/damage_list = list() + New(var/damage) + + // reading from a list("stage" = damage) is pretty difficult, so build two separate + // lists from them instead + for(var/V in stages) + desc_list += V + damage_list += stages[V] + + // initialize with the first stage + next_stage() + + // this will ensure the size of the wound matches the damage + src.heal_damage(0) + + // returns 1 if there's a next stage, 0 otherwise + proc/next_stage() + if(current_stage + 1 > src.desc_list.len) + return 0 + + current_stage++ + + src.min_damage = damage_list[current_stage] + src.desc = desc_list[current_stage] + return 1 + + // returns 1 if the wound has started healing + proc/started_healing() + return (current_stage > 1) + + // checks whether the wound has been appropriately treated + // always returns 1 for wounds that don't need to be treated + proc/is_treated() + if(!needs_treatment) return 1 + + if(damage_type == BRUISE || damage_type == CUT) + return bandaged + else if(damage_type == BURN) + return salved + + // 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 + proc/heal_damage(amount) + var/healed_damage = min(src.damage, amount) + amount -= healed_damage + src.damage -= healed_damage + + while(src.damage > damage[current_stage] && current_stage < src.desc_list.len) + current_stage++ + desc = desc_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 + current_stage -= 2 + next_stage() + +/** CUTS **/ +/datum/wound/cut + // link wound descriptions to amounts of damage + stages = list("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) + +/datum/wound/flesh_wound + stages = list("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) + + 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) + + needs_treatment = 1 // this only heals when bandaged + +/** BRUISES **/ +/datum/wound/bruise + stages = list("monumental bruise" = 80, "huge bruise" = 50, "large bruise" = 30,\ + "moderate bruise" = 20, "small bruise" = 10, "tiny bruise" = 5) + + needs_treatment = 1 // this only heals when bandaged + damage_type = BRUISE + +/datum/wound/bruise/monumental_bruise + +// implement sub-paths by starting at a later stage +/datum/wound/bruise/huge_bruise + current_stage = 1 + +/datum/wound/bruise/large_bruise + current_stage = 2 + +/datum/wound/bruise/moderate_bruise + current_stage = 3 + needs_treatment = 0 + +/datum/wound/bruise/small_bruise + current_stage = 4 + needs_treatment = 0 + +/datum/wound/bruise/tiny_bruise + current_stage = 5 + needs_treatment = 0 + +/** BURNS **/ +/datum/wound/moderate_burn + stages = list("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) + + 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) + + 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) + + needs_treatment = 1 // this only heals when bandaged + + damage_type = BURN + +/datum/wound/carbonised_area + stages = list("carbonised area" = 50, "treated carbonised area" = 20, "massive burn scar" = 0) + + needs_treatment = 1 // this only heals when bandaged + + damage_type = BURN + + /**************************************************** EXTERNAL ORGANS ****************************************************/ @@ -90,9 +238,7 @@ var/list/wound_progressions = list( var/tmp/list/obj/item/weapon/implant/implant var/display_name - - var/tmp/list/wound_descs = list() - var/tmp/next_wound_update = 0 + var/list/wounds = list() var/tmp/perma_injury = 0 var/tmp/perma_dmg = 0 @@ -103,7 +249,7 @@ var/list/wound_progressions = list( var/datum/organ/external/parent var/list/datum/organ/external/children - var/damage_msg = "\red You feel a intense pain" + var/damage_msg = "\red You feel an intense pain" var/status = 0 var/broken_description @@ -119,6 +265,7 @@ var/list/wound_progressions = list( H.organs[name] = src 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)) return 0 if(status & DESTROYED) @@ -204,31 +351,63 @@ var/list/wound_progressions = list( return result + proc/heal_damage(brute, burn, internal = 0, robo_repair = 0) if(status & ROBOT && !robo_repair) return - // var/brute_to_heal = 0 - // var/brute_wounds = list() - // var/burn_to_heal = 0 - // var/burn_wounds = list() - // for(var/datum/organ/wound/W in brute_wounds) - brute_dam = max(0, brute_dam-brute) - burn_dam = max(0, burn_dam-burn) + // heal damage on the individual wounds + for(var/datum/wound/W in wounds) + if(brute == 0 && burn == 0) + break + + // heal brute damage + if(W.damage_type == CUT || W.damage_type == BRUISE) + burn = W.heal_damage(brute) + else if(W.damage_type == BURN) + burn = W.heal_damage(burn) + + // sync organ damage with wound damages + update_damages() if(internal) status &= ~BROKEN perma_injury = 0 + // if all damage is healed, replace the wounds with scars if(brute_dam + burn_dam == 0) for(var/V in autopsy_data) var/datum/autopsy_data/W = autopsy_data[V] del W autopsy_data = list() + owner.updatehealth() var/result = update_icon() return result + proc/update_damages() + brute_dam = 0 + burn_dam = 0 + status &= ~BLEEDING + for(var/datum/wound/W in wounds) + if(W.damage_type == CUT || W.damage_type == BRUISE) + brute_dam += W.damage + else if(W.damage_type == BURN) + burn_dam += W.damage + + if(W.bleeding && !W.bandaged) + status |= BLEEDING + + proc/update_wounds() + for(var/datum/wound/W in wounds) + if(W.is_treated()) + // slow healing + var/amount = 0.5 + if(W.bandaged) amount++ + if(W.salved) amount++ + if(W.disinfected) amount++ + W.heal_damage(amount / 10) + proc/add_wound(var/used_weapon, var/damage) var/datum/autopsy_data/W = autopsy_data[used_weapon] if(!W) @@ -253,8 +432,10 @@ var/list/wound_progressions = list( return burn_dam process() - if(next_wound_update && world.time > next_wound_update) - update_wounds() + // process wounds, doing healing etc. + update_wounds() + // update damages from wounds + update_damages() if(status & DESTROYED) if(!destspawn) droplimb() @@ -268,7 +449,6 @@ var/list/wound_progressions = list( return if(brute_dam > min_broken_damage && !(status & ROBOT)) if(!(status & BROKEN)) - //owner.unlock_medal("Broke Yarrr Bones!", 0, "Break a bone.", "easy") owner.visible_message("\red You hear a loud cracking sound coming from \the [owner].","\red Something feels like it shattered in your [display_name]!","You hear a sickening crack.") owner.emote("scream") status |= BROKEN @@ -411,62 +591,44 @@ var/list/wound_progressions = list( proc/createwound(var/type = CUT, var/damage) if(hasorgans(owner)) - var/wound_name - var/update_time = world.time + damage*100 + var/wound_type var/size = min( max( 1, damage/10 ) , 6) + + // first check whether we can widen an existing wound + if((type == CUT || type == BRUISE) && damage >= 5) + var/datum/wound/W = pick(wounds) + if(W.started_healing()) + damage -= 5 + 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.") + + if(damage == 0) return + switch(type) if(CUT) src.status |= BLEEDING - var/list/size_names = list("cut", "deep cut", "flesh wound", "gaping wound", "big gaping wound", "massive wound") - wound_name = size_names[size] - if(wound_descs["[update_time]"]) - var/list/update_next = wound_descs["[update_time]"] - update_next += wound_name - else - if (next_wound_update > update_time) - next_wound_update = update_time - wound_descs["[update_time]"] = list(wound_name) - if(BRUISE) - var/list/size_names = list("tiny bruise", "small bruise", "moderate bruise", "large bruise", "huge bruise", "monumental bruise") - wound_name = size_names[size] - if(wound_descs["[update_time]"]) - var/list/update_next = wound_descs["[update_time]"] - update_next += wound_name - else - if (next_wound_update > update_time) - next_wound_update = update_time - wound_descs["[update_time]"] = list(wound_name) - if(BURN) - var/list/size_names = list("small burn", "moderate burn", "large burn", "severe burn", "deep burn", "carbonised area") - wound_name = size_names[size] - update_time += damage*300 - if(wound_descs["[update_time]"]) - var/list/update_next = wound_descs["[update_time]"] - update_next += wound_name - else - if (next_wound_update > update_time) - next_wound_update = update_time - wound_descs["[update_time]"] = list(wound_name) + var/list/size_names = list(/datum/wound/cut, /datum/wound/deep_cut, /datum/wound/flesh_wound, /datum/wound/gaping_wound, /datum/wound/big_gaping_wound, /datum/wound/massive_wound) + wound_type = size_names[size] - proc/update_wounds() - var/list/wounds_to_update = wound_descs["[next_wound_update]"] - for(var/wound in wounds_to_update) - if(wound_progressions[wound]) - var/wound_name = wound_progressions[wound] - var/next_update = world.time + 600*rand(5,13) - if(wound_descs["[next_update]"]) - var/list/update_next = wound_descs["[next_update]"] - update_next += wound_name - else - wound_descs["[next_update]"] = list(wound_name) - wound_descs.Remove("[next_wound_update]") - if(wound_descs.len) - var/next_update = text2num(wound_descs[1]) - for(var/wound in wound_descs) - next_update = min(next_update, text2num(wound)) - next_wound_update = next_update - else - next_wound_update = 0 + var/datum/wound/W = new wound_type() + W.damage = damage + wounds += W + if(BRUISE) + var/list/size_names = list(/datum/wound/bruise/tiny_bruise, /datum/wound/bruise/small_bruise, /datum/wound/bruise/moderate_bruise, /datum/wound/bruise/large_bruise, /datum/wound/bruise/huge_bruise, /datum/wound/bruise/monumental_bruise) + wound_type = size_names[size] + + var/datum/wound/W = new wound_type() + W.damage = damage + wounds += W + if(BURN) + var/list/size_names = list(/datum/wound/moderate_burn, /datum/wound/large_burn, /datum/wound/severe_burn, /datum/wound/deep_burn, /datum/wound/carbonised_area) + wound_type = size_names[size] + + var/datum/wound/W = new wound_type() + W.damage = damage + wounds += W proc/emp_act(severity) if(!(status & ROBOT)) diff --git a/code/setup.dm b/code/setup.dm index 92e06912af6..a060fbf04e7 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -473,4 +473,5 @@ var/list/liftable_structures = list(\ #define BROKEN 32 #define DESTROYED 64 #define ROBOT 128 -#define SPLINTED 256 \ No newline at end of file +#define SPLINTED 256 +#define SALVED 512 \ No newline at end of file From 2be19a15ba3b78e89dcc4d77d62a789b3ad00eaf Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 13:28:02 -0700 Subject: [PATCH 04/25] Minor bugfix to new organs. --- code/modules/mob/organ/organ.dm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 7beb047b609..1e01c655a2b 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -595,14 +595,15 @@ var/size = min( max( 1, damage/10 ) , 6) // first check whether we can widen an existing wound - if((type == CUT || type == BRUISE) && damage >= 5) - var/datum/wound/W = pick(wounds) - if(W.started_healing()) - damage -= 5 - 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.") + if(wounds.len > 0) + if((type == CUT || type == BRUISE) && damage >= 5) + var/datum/wound/W = pick(wounds) + if(W.started_healing()) + damage -= 5 + 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.") if(damage == 0) return From 9b9d541a259301747911b5f0734e987d135bc33a Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 13:43:39 -0700 Subject: [PATCH 05/25] Fixed response_team.dm indentation. --- code/game/response_team.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/response_team.dm b/code/game/response_team.dm index a62fa7dbc2c..8ba5da09996 100644 --- a/code/game/response_team.dm +++ b/code/game/response_team.dm @@ -31,9 +31,9 @@ client/verb/JoinResponseTeam() new_commando << "\blue You are [!leader_selected?"a member":"the LEADER"] of an Emergency Response Team, a type of military division, under CentComm's service. There is a code red alert on [station_name()], you are tasked to go and fix the problem." new_commando << "You should first gear up and discuss a plan with your team. More members may be joining, don't move out before you're ready." if(!leader_selected) - new_commando << "As member of the Emergency Response Team, you answer only to your leader and CentComm officials." + new_commando << "As member of the Emergency Response Team, you answer only to your leader and CentComm officials." else - new_commando << "As leader of the Emergency Response Team, you answer only to CentComm, and have authority to override the Captain where it is necessary to achieve your mission goals. It is recommended that you attempt to cooperate with the captain where possible, however." + new_commando << "As leader of the Emergency Response Team, you answer only to CentComm, and have authority to override the Captain where it is necessary to achieve your mission goals. It is recommended that you attempt to cooperate with the captain where possible, however." del(L) else From 1f6231c174788be93d84c23cd4cc7917b3499ad9 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 13:48:21 -0700 Subject: [PATCH 06/25] Fixes some more merge issues --- code/modules/mob/living/carbon/human/life.dm | 14 +++++++------- code/modules/mob/organ/organ.dm | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 88819c39cf2..364a0a75a7f 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -968,19 +968,19 @@ if(D.data["donor"] == src) B = D break + var/datum/reagent/nutriment/F = locate() in vessel.reagent_list if(F != null) if(F.volume >= 1) B.volume = max(min(10 + blood_volume,560), 0) F.volume -= 1 else - //At this point, we dun care which blood we are adding to, as long as they get more blood. - var/blood_regen = 0.5 - if(B.volume < 400) - blood_regen = 1 - if(B.volume < 200) - blood_regen = 1.5 - B.volume = max(min(B.volume + blood_regen,560), 0) + var/blood_regen = 0.5 + if(B.volume < 400) + blood_regen = 1 + if(B.volume < 200) + blood_regen = 1.5 + B.volume = max(min(B.volume + blood_regen,560), 0) if(blood_volume > 448) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 492146aea13..549172538ac 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -388,7 +388,7 @@ proc/update_damages() brute_dam = 0 burn_dam = 0 - status &= ~BLEEDING + status &= ~ORGAN_BLEEDING for(var/datum/wound/W in wounds) if(W.damage_type == CUT || W.damage_type == BRUISE) brute_dam += W.damage @@ -396,7 +396,7 @@ burn_dam += W.damage if(W.bleeding && !W.bandaged) - status |= BLEEDING + status |= ORGAN_BLEEDING proc/update_wounds() for(var/datum/wound/W in wounds) From 76c06283f4749fc17aa4321a147950a774df0d14 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 13:58:59 -0700 Subject: [PATCH 07/25] Fixed another derp with organs --- code/modules/mob/organ/organ.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 549172538ac..4fe26a76c35 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -115,7 +115,7 @@ amount -= healed_damage src.damage -= healed_damage - while(src.damage > damage[current_stage] && current_stage < src.desc_list.len) + while(src.damage > damage_list[current_stage] && current_stage < src.desc_list.len) current_stage++ desc = desc_list[current_stage] From b89e9134458c1fe5d568fe1c20ac8de7d2f71462 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 15:08:29 -0700 Subject: [PATCH 08/25] Slowed down healing a little. Also a minor fix to examine. --- code/modules/mob/living/carbon/human/examine.dm | 2 +- code/modules/mob/organ/organ.dm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index dc15d98a57a..39558df4912 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -283,7 +283,7 @@ if(21 to INFINITY) wound_flavor_text["[temp.display_name]"] += pick(" a lot of burns"," severe melting") wound_flavor_text["[temp.display_name]"] += "!\n" - else if(temp.wounds.len) + 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) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 4fe26a76c35..fd5aa530231 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -402,11 +402,11 @@ for(var/datum/wound/W in wounds) if(W.is_treated()) // slow healing - var/amount = 0.5 + var/amount = 0.2 if(W.bandaged) amount++ if(W.salved) amount++ if(W.disinfected) amount++ - W.heal_damage(amount / 10) + W.heal_damage(amount / 20) proc/add_wound(var/used_weapon, var/damage) var/datum/autopsy_data/W = autopsy_data[used_weapon] From bdffd60cc92abb0cd2e58a57196196f7931de180 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 15:21:03 -0700 Subject: [PATCH 09/25] Balanced out wound healing. --- code/modules/mob/living/carbon/human/life.dm | 9 +++++++++ code/modules/mob/organ/organ.dm | 8 +++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 364a0a75a7f..20c6cb99a73 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -16,6 +16,9 @@ var/lyingcheck = 0 var/buckle_check = 0 + // total amount of wounds on mob, used to spread out healing and the like over all wounds + var/number_wounds = 0 + /mob/living/carbon/human/Life() set invisibility = 0 set background = 1 @@ -900,10 +903,15 @@ handle_organs() // take care of organ related updates, such as broken and missing limbs + // recalculate number of wounds + number_wounds = 0 + var/leg_tally = 2 for(var/name in organs) var/datum/organ/external/E = organs[name] E.process() + for(var/datum/wound/W in E.wounds) + number_wounds++ if(E.status & ORGAN_ROBOT && prob(E.brute_dam + E.burn_dam)) if(E.name == "l_hand" || E.name == "l_arm") if(hand && equipped()) @@ -956,6 +964,7 @@ paralysis = 10 + handle_blood() // take care of blood and blood loss if(stat < 2) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index fd5aa530231..84274b923c0 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -126,8 +126,9 @@ 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 - current_stage -= 2 + src.current_stage -= 2 next_stage() + src.damage = src.min_damage /** CUTS **/ /datum/wound/cut @@ -406,7 +407,8 @@ if(W.bandaged) amount++ if(W.salved) amount++ if(W.disinfected) amount++ - W.heal_damage(amount / 20) + // amount of healing is spread over all the wounds + W.heal_damage(amount / (owner.number_wounds+1)) proc/add_wound(var/used_weapon, var/damage) var/datum/autopsy_data/W = autopsy_data[used_weapon] @@ -595,7 +597,7 @@ var/size = min( max( 1, damage/10 ) , 6) // first check whether we can widen an existing wound - if(wounds.len > 0) + if(wounds.len > 0 && prob(5)) if((type == CUT || type == BRUISE) && damage >= 5) var/datum/wound/W = pick(wounds) if(W.started_healing()) From 71e3d503994c5fb9cb830017d8c070356952a9c6 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 15:45:21 -0700 Subject: [PATCH 10/25] Bugfix to healing organs --- code/modules/mob/organ/organ.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 84274b923c0..673915946e3 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -115,7 +115,7 @@ amount -= healed_damage src.damage -= healed_damage - while(src.damage > damage_list[current_stage] && current_stage < src.desc_list.len) + while(src.damage < damage_list[current_stage] && current_stage < src.desc_list.len) current_stage++ desc = desc_list[current_stage] @@ -408,7 +408,7 @@ if(W.salved) amount++ if(W.disinfected) amount++ // amount of healing is spread over all the wounds - W.heal_damage(amount / (owner.number_wounds+1)) + W.heal_damage(amount / (10*owner.number_wounds+1)) proc/add_wound(var/used_weapon, var/damage) var/datum/autopsy_data/W = autopsy_data[used_weapon] From 2d751104ae95e55aa8213e602f759a8e762cfb48 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 13:00:43 -0700 Subject: [PATCH 11/25] Fixed an issue with wound creation --- code/modules/mob/organ/organ.dm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 673915946e3..dcadff54144 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -77,6 +77,8 @@ desc_list += V damage_list += stages[V] + src.damage = damage + // initialize with the first stage next_stage() @@ -615,21 +617,20 @@ var/list/size_names = list(/datum/wound/cut, /datum/wound/deep_cut, /datum/wound/flesh_wound, /datum/wound/gaping_wound, /datum/wound/big_gaping_wound, /datum/wound/massive_wound) wound_type = size_names[size] - var/datum/wound/W = new wound_type() - W.damage = damage + var/datum/wound/W = new wound_type(damage) wounds += W if(BRUISE) var/list/size_names = list(/datum/wound/bruise/tiny_bruise, /datum/wound/bruise/small_bruise, /datum/wound/bruise/moderate_bruise, /datum/wound/bruise/large_bruise, /datum/wound/bruise/huge_bruise, /datum/wound/bruise/monumental_bruise) wound_type = size_names[size] - var/datum/wound/W = new wound_type() + var/datum/wound/W = new wound_type(damage) W.damage = damage wounds += W if(BURN) var/list/size_names = list(/datum/wound/moderate_burn, /datum/wound/large_burn, /datum/wound/severe_burn, /datum/wound/deep_burn, /datum/wound/carbonised_area) wound_type = size_names[size] - var/datum/wound/W = new wound_type() + var/datum/wound/W = new wound_type(damage) W.damage = damage wounds += W From 35d82b37895cab22483160d0e3c6766a7117551b Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 13:11:48 -0700 Subject: [PATCH 12/25] Increased the chance of wounds ripping open. --- code/modules/mob/organ/organ.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index dcadff54144..0474a5becdd 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -599,7 +599,7 @@ var/size = min( max( 1, damage/10 ) , 6) // first check whether we can widen an existing wound - if(wounds.len > 0 && prob(5)) + if(wounds.len > 0 && prob(25)) if((type == CUT || type == BRUISE) && damage >= 5) var/datum/wound/W = pick(wounds) if(W.started_healing()) From 279bcc185118eaa2e21f1baacd20adb5cf861f4f Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 13:13:40 -0700 Subject: [PATCH 13/25] Reduced blood regen significantly. --- code/modules/mob/living/carbon/human/life.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 20c6cb99a73..153ad5d7a13 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -984,11 +984,11 @@ B.volume = max(min(10 + blood_volume,560), 0) F.volume -= 1 else - var/blood_regen = 0.5 + var/blood_regen = 0.1 if(B.volume < 400) - blood_regen = 1 + blood_regen = 0.2 if(B.volume < 200) - blood_regen = 1.5 + blood_regen = 0.3 B.volume = max(min(B.volume + blood_regen,560), 0) From 45a0eac4e7d9d5b754484cc9df1249af690411bf Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 13:19:45 -0700 Subject: [PATCH 14/25] Small fix to widening wounds. --- code/modules/mob/organ/organ.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 0474a5becdd..001e7ccf6d2 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -130,7 +130,7 @@ // 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 + src.damage = src.min_damage + 5 /** CUTS **/ /datum/wound/cut @@ -603,12 +603,13 @@ if((type == CUT || type == BRUISE) && damage >= 5) var/datum/wound/W = pick(wounds) if(W.started_healing()) - damage -= 5 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.") + return + if(damage == 0) return switch(type) From 22c627901b1abfd52e52dfd8e4e71f5a4067ef67 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 13:23:32 -0700 Subject: [PATCH 15/25] Fixed a very silly mistake with wound healing. --- code/modules/mob/organ/organ.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 001e7ccf6d2..138d034718c 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -366,7 +366,7 @@ // heal brute damage if(W.damage_type == CUT || W.damage_type == BRUISE) - burn = W.heal_damage(brute) + brute = W.heal_damage(brute) else if(W.damage_type == BURN) burn = W.heal_damage(burn) From b4f1c4ed9fc8a04e890c3a98d21176fa5f87249a Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 14:01:36 -0700 Subject: [PATCH 16/25] Fixed yet another derp with organs --- code/modules/mob/living/carbon/human/life.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 153ad5d7a13..3e9077e5e97 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -905,13 +905,15 @@ // recalculate number of wounds number_wounds = 0 + for(var/name in organs) + var/datum/organ/external/E = organs[name] + for(var/datum/wound/W in E.wounds) + number_wounds++ var/leg_tally = 2 for(var/name in organs) var/datum/organ/external/E = organs[name] E.process() - for(var/datum/wound/W in E.wounds) - number_wounds++ if(E.status & ORGAN_ROBOT && prob(E.brute_dam + E.burn_dam)) if(E.name == "l_hand" || E.name == "l_arm") if(hand && equipped()) From 02457fc55b0d37236b5ecf9c21fca9d943e2ab87 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 14:21:34 -0700 Subject: [PATCH 17/25] Fixed up bloodloss a bit more. --- code/modules/mob/living/carbon/human/life.dm | 10 +++++----- code/modules/mob/organ/organ.dm | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 3e9077e5e97..6cfc650cc53 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -986,11 +986,11 @@ B.volume = max(min(10 + blood_volume,560), 0) F.volume -= 1 else - var/blood_regen = 0.1 + var/blood_regen = 0.3 if(B.volume < 400) - blood_regen = 0.2 + blood_regen = 0.6 if(B.volume < 200) - blood_regen = 0.3 + blood_regen = 1 B.volume = max(min(B.volume + blood_regen,560), 0) @@ -1120,9 +1120,9 @@ var/datum/organ/external/temp = organs[name] if(!(temp.status & ORGAN_BLEEDING) || temp.status & ORGAN_ROBOT) continue - blood_max += 2 + blood_max += 0.5 * (temp.brute_dam + temp.burn_dam) / 5 if(temp.status & ORGAN_DESTROYED && !(temp.status & ORGAN_GAUZED)) - blood_max += 10 //Yer missing a fucking limb. + blood_max += 3 //Yer missing a fucking limb. drip(blood_max) if (eye_blind) eye_blind-- diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 138d034718c..8e2580908e2 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -57,8 +57,6 @@ // whether this wound needs a bandage/salve to heal at all var/needs_treatment = 0 - // is the wound bleeding? - var/tmp/bleeding = 0 // is the wound bandaged? var/tmp/bandaged = 0 // is the wound salved? @@ -398,7 +396,7 @@ else if(W.damage_type == BURN) burn_dam += W.damage - if(W.bleeding && !W.bandaged) + if(!W.bandaged && W.damage > 4) status |= ORGAN_BLEEDING proc/update_wounds() From 5b342bd2179a342d9ae7b4c4dbc155c34568b323 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 14:52:27 -0700 Subject: [PATCH 18/25] A few last balance fixes to wounds. --- code/modules/mob/living/carbon/human/life.dm | 2 +- code/modules/mob/organ/organ.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 6cfc650cc53..8a00a826895 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1120,7 +1120,7 @@ var/datum/organ/external/temp = organs[name] if(!(temp.status & ORGAN_BLEEDING) || temp.status & ORGAN_ROBOT) continue - blood_max += 0.5 * (temp.brute_dam + temp.burn_dam) / 5 + blood_max += round(0.5 * (temp.brute_dam + temp.burn_dam) / 4) if(temp.status & ORGAN_DESTROYED && !(temp.status & ORGAN_GAUZED)) blood_max += 3 //Yer missing a fucking limb. drip(blood_max) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 8e2580908e2..7d57854f06e 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -408,7 +408,7 @@ if(W.salved) amount++ if(W.disinfected) amount++ // amount of healing is spread over all the wounds - W.heal_damage(amount / (10*owner.number_wounds+1)) + W.heal_damage(amount / (20*owner.number_wounds+1)) proc/add_wound(var/used_weapon, var/damage) var/datum/autopsy_data/W = autopsy_data[used_weapon] From ddfdd47365dc41521b9e428f5551f42875d6adc1 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 15:20:30 -0700 Subject: [PATCH 19/25] Updated changelog. --- html/changelog.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/html/changelog.html b/html/changelog.html index d692ecde1dd..0ce93b34c74 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -58,6 +58,16 @@ should be listed in the changelog upon commit though. Thanks. --> +
+

7th August 2012

+

CIB updated:

+
    +
  • Wound descriptions now again are in sync with actual damage.
  • +
  • Bandages no longer are instant, but rather only stop bleeding and speed up the healing process.
  • +
  • Bleeding and regeneration speeds have been balanced, so that now it is possible to bleed out.
  • +
+
+

4 August 2012

Cael_Aislinn updated:

From bf82cc0023e500e259131b6c6943b889e1d17173 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 22:55:14 -0700 Subject: [PATCH 20/25] Healed wounds now disappear after a while. --- code/modules/mob/organ/organ.dm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 7d57854f06e..a32fa7ed1ae 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -63,12 +63,15 @@ var/tmp/salved = 0 // is the wound disinfected? var/tmp/disinfected = 0 + var/tmp/created = 0 // helper lists var/tmp/list/desc_list = list() var/tmp/list/damage_list = list() New(var/damage) + created = world.time + // reading from a list("stage" = damage) is pretty difficult, so build two separate // lists from them instead for(var/V in stages) @@ -401,6 +404,10 @@ proc/update_wounds() for(var/datum/wound/W in wounds) + // wounds can disappear after 10 minutes at the earliest + if(W.damage == 0 && W.created + 10 * 10 * 60 <= world.time) + wounds -= W + // let the GC handle the deletion of the wound if(W.is_treated()) // slow healing var/amount = 0.2 From 7bbc98e9dad683f9326ec85102300e54530cf204 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 23:04:47 -0700 Subject: [PATCH 21/25] Wounds of the same type are now handled in the same object. --- .../mob/living/carbon/monkey/examine.dm | 2 +- code/modules/mob/organ/organ.dm | 39 +++++++++++++------ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/code/modules/mob/living/carbon/monkey/examine.dm b/code/modules/mob/living/carbon/monkey/examine.dm index 5f533cb58ab..96a7af70981 100644 --- a/code/modules/mob/living/carbon/monkey/examine.dm +++ b/code/modules/mob/living/carbon/monkey/examine.dm @@ -54,7 +54,7 @@ var/list/wound_descriptors = list() for(var/datum/wound/W in temp.wounds) if(W.desc in wound_descriptors) - wound_descriptors[W.desc]++ + wound_descriptors[W.desc] += W.amount continue wound_descriptors[W.desc] = 1 var/list/flavor_text = list() diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index a32fa7ed1ae..0ab4af3078b 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -65,6 +65,9 @@ var/tmp/disinfected = 0 var/tmp/created = 0 + // number of wounds of this type + var/tmp/amount = 1 + // helper lists var/tmp/list/desc_list = list() var/tmp/list/damage_list = list() @@ -118,7 +121,7 @@ amount -= healed_damage src.damage -= healed_damage - while(src.damage < damage_list[current_stage] && current_stage < src.desc_list.len) + while(src.damage / amount < damage_list[current_stage] && current_stage < src.desc_list.len) current_stage++ desc = desc_list[current_stage] @@ -604,10 +607,10 @@ 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(50)) if((type == CUT || type == BRUISE) && damage >= 5) var/datum/wound/W = pick(wounds) - if(W.started_healing()) + 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.",\ @@ -617,28 +620,42 @@ if(damage == 0) return + // the wound we will create + var/datum/wound/W + switch(type) if(CUT) src.status |= ORGAN_BLEEDING var/list/size_names = list(/datum/wound/cut, /datum/wound/deep_cut, /datum/wound/flesh_wound, /datum/wound/gaping_wound, /datum/wound/big_gaping_wound, /datum/wound/massive_wound) wound_type = size_names[size] - var/datum/wound/W = new wound_type(damage) - wounds += W + W = new wound_type(damage) + if(BRUISE) var/list/size_names = list(/datum/wound/bruise/tiny_bruise, /datum/wound/bruise/small_bruise, /datum/wound/bruise/moderate_bruise, /datum/wound/bruise/large_bruise, /datum/wound/bruise/huge_bruise, /datum/wound/bruise/monumental_bruise) wound_type = size_names[size] - var/datum/wound/W = new wound_type(damage) - W.damage = damage - wounds += W + W = new wound_type(damage) if(BURN) var/list/size_names = list(/datum/wound/moderate_burn, /datum/wound/large_burn, /datum/wound/severe_burn, /datum/wound/deep_burn, /datum/wound/carbonised_area) wound_type = size_names[size] - var/datum/wound/W = new wound_type(damage) - W.damage = damage - wounds += W + W = new wound_type(damage) + + + + // check whether we can add the wound to an existing wound + for(var/datum/wound/other in wounds) + if(other.desc == W.desc) + // okay, add it! + other.damage += W.damage + other.amount += 1 + W = null // to signify that the wound was added + break + + // if we couldn't add the wound to another wound, ignore + if(W) + wounds += W proc/emp_act(severity) if(!(status & ORGAN_ROBOT)) From 8a2a1b58ca078a03a97eaa9114f24449311b87c8 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 23:17:07 -0700 Subject: [PATCH 22/25] Two fixes to joint wounds. --- code/modules/mob/living/carbon/human/examine.dm | 4 ++-- code/modules/mob/living/carbon/monkey/examine.dm | 2 +- code/modules/mob/organ/organ.dm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 39558df4912..fbf7a07f3b9 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -287,9 +287,9 @@ var/list/wound_descriptors = list() for(var/datum/wound/W in temp.wounds) if(W.desc in wound_descriptors) - wound_descriptors[W.desc]++ + wound_descriptors[W.desc] += W.amount continue - wound_descriptors[W.desc] = 1 + wound_descriptors[W.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/code/modules/mob/living/carbon/monkey/examine.dm b/code/modules/mob/living/carbon/monkey/examine.dm index 96a7af70981..f147d3b6f9b 100644 --- a/code/modules/mob/living/carbon/monkey/examine.dm +++ b/code/modules/mob/living/carbon/monkey/examine.dm @@ -56,7 +56,7 @@ if(W.desc in wound_descriptors) wound_descriptors[W.desc] += W.amount continue - wound_descriptors[W.desc] = 1 + wound_descriptors[W.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/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 0ab4af3078b..7d718d15131 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -121,7 +121,7 @@ amount -= healed_damage src.damage -= healed_damage - while(src.damage / amount < damage_list[current_stage] && current_stage < src.desc_list.len) + while(src.damage / src.amount < damage_list[current_stage] && current_stage < src.desc_list.len) current_stage++ desc = desc_list[current_stage] From 2a993ffee40062448032f5ab62c571ff7738a25d Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 23:24:56 -0700 Subject: [PATCH 23/25] Adjusted healing speed for the amount of wounds per wound object. --- code/modules/mob/living/carbon/human/life.dm | 2 +- code/modules/mob/organ/organ.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 3242a8a3d96..31612443601 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -914,7 +914,7 @@ for(var/name in organs) var/datum/organ/external/E = organs[name] for(var/datum/wound/W in E.wounds) - number_wounds++ + number_wounds+=W.amount var/leg_tally = 2 for(var/name in organs) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 7d718d15131..8f009531752 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -418,7 +418,7 @@ if(W.salved) amount++ if(W.disinfected) amount++ // amount of healing is spread over all the wounds - W.heal_damage(amount / (20*owner.number_wounds+1)) + W.heal_damage((amount * W.amount) / (20*owner.number_wounds+1)) proc/add_wound(var/used_weapon, var/damage) var/datum/autopsy_data/W = autopsy_data[used_weapon] From 5785c817f86a493ebdf3f69809422885320597b7 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 23:41:56 -0700 Subject: [PATCH 24/25] Added a few hacks to make wound processing happen less often. --- code/game/objects/items/weapons/medical.dm | 4 ++++ code/modules/mob/living/carbon/human/life.dm | 5 ++-- code/modules/mob/living/carbon/monkey/life.dm | 3 +++ code/modules/mob/living/living.dm | 3 +++ code/modules/mob/organ/organ.dm | 24 ++++++++++++++----- 5 files changed, 30 insertions(+), 9 deletions(-) diff --git a/code/game/objects/items/weapons/medical.dm b/code/game/objects/items/weapons/medical.dm index e3bccdedb8d..46c339d5742 100644 --- a/code/game/objects/items/weapons/medical.dm +++ b/code/game/objects/items/weapons/medical.dm @@ -118,6 +118,7 @@ MEDICAL if (!ointment && (affecting.status & ORGAN_BLEEDING)) affecting.status &= ~ORGAN_BLEEDING + // handle wound stuff if(ointment) for(var/datum/wound/W in affecting.wounds) W.salved = 1 @@ -125,6 +126,9 @@ MEDICAL for(var/datum/wound/W in affecting.wounds) W.bandaged = 1 + // make sure to apply the updates of the wound to the organ + affecting.update_damages() + // Don't do direct healing //if (affecting.heal_damage(src.heal_brute, src.heal_burn)) // H.UpdateDamageIcon() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 31612443601..62db4f1d02b 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -10,7 +10,6 @@ var/temperature_alert = 0 // used to do some stuff only on every X life tick - var/life_tick = 0 var/isbreathing = 1 var/holdbreath = 0 var/lyingcheck = 0 @@ -47,6 +46,7 @@ update_clothing() return + // update the current life tick, can be used to e.g. only do something every 4 ticks life_tick++ var/datum/gas_mixture/environment = loc.return_air() @@ -913,8 +913,7 @@ number_wounds = 0 for(var/name in organs) var/datum/organ/external/E = organs[name] - for(var/datum/wound/W in E.wounds) - number_wounds+=W.amount + number_wounds += E.number_wounds var/leg_tally = 2 for(var/name in organs) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index d439feddfca..41be4e88c09 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -26,6 +26,9 @@ ..() + // update the current life tick, can be used to e.g. only do something every 4 ticks + life_tick++ + var/datum/gas_mixture/environment // Added to prevent null location errors-- TLE if(src.loc) environment = loc.return_air() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 9759aa36487..ff4234fa61d 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -286,3 +286,6 @@ set category = "OOC" src.update_flavor_text() + + +/mob/living/var/life_tick = 0 diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index 8f009531752..e67eb4b6568 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -246,6 +246,7 @@ var/display_name var/list/wounds = list() + var/number_wounds = 0 // cache the number of wounds, which is NOT wounds.len! var/tmp/perma_injury = 0 var/tmp/perma_dmg = 0 @@ -354,6 +355,9 @@ owner.updatehealth() + // sync the organ's damage with its wounds + src.update_damages() + var/result = update_icon() return result @@ -388,11 +392,15 @@ del W autopsy_data = list() + // sync the organ's damage with its wounds + src.update_damages() + owner.updatehealth() var/result = update_icon() return result proc/update_damages() + number_wounds = 0 brute_dam = 0 burn_dam = 0 status &= ~ORGAN_BLEEDING @@ -405,6 +413,8 @@ if(!W.bandaged && W.damage > 4) status |= ORGAN_BLEEDING + number_wounds += W.amount + proc/update_wounds() for(var/datum/wound/W in wounds) // wounds can disappear after 10 minutes at the earliest @@ -418,7 +428,10 @@ if(W.salved) amount++ if(W.disinfected) amount++ // amount of healing is spread over all the wounds - W.heal_damage((amount * W.amount) / (20*owner.number_wounds+1)) + W.heal_damage((amount * W.amount) / (5*owner.number_wounds+1)) + + // sync the organ's damage with its wounds + src.update_damages() proc/add_wound(var/used_weapon, var/damage) var/datum/autopsy_data/W = autopsy_data[used_weapon] @@ -444,10 +457,9 @@ return burn_dam process() - // process wounds, doing healing etc. - update_wounds() - // update damages from wounds - update_damages() + // process wounds, doing healing etc., only do this every 4 ticks to save processing power + if(owner.life_tick % 4 == 0) + update_wounds() if(status & ORGAN_DESTROYED) if(!destspawn) droplimb() @@ -607,7 +619,7 @@ var/size = min( max( 1, damage/10 ) , 6) // first check whether we can widen an existing wound - if(wounds.len > 0 && prob(50)) + if(wounds.len > 0 && prob(25)) if((type == CUT || type == BRUISE) && damage >= 5) var/datum/wound/W = pick(wounds) if(W.amount == 1 && W.started_healing()) From c6054e06ecebcac8698a7c8c0e2124232fabae55 Mon Sep 17 00:00:00 2001 From: cib Date: Tue, 7 Aug 2012 00:18:53 -0700 Subject: [PATCH 25/25] Fixed a derp with damage types. --- code/modules/mob/organ/organ.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index e67eb4b6568..33516596e35 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -51,8 +51,8 @@ // amount of damage the current wound type requires(less means we need to apply the next healing stage) var/min_damage = 0 - // one of CUTE, BRUISE, BURN - var/damage_type = BRUTE + // one of CUT, BRUISE, BURN + var/damage_type = CUT // whether this wound needs a bandage/salve to heal at all var/needs_treatment = 0