mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-01-02 13:34:49 +00:00
Merge branch 'master' of https://github.com/Baystation12/Baystation12
This commit is contained in:
@@ -35,6 +35,14 @@
|
||||
HELMET_TYPE = /obj/item/clothing/head/helmet/space
|
||||
MASK_TYPE = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/captain_unit
|
||||
name = "Captain's Suit Storage Unit"
|
||||
SUIT_TYPE = /obj/item/clothing/suit/armor/captain
|
||||
HELMET_TYPE = /obj/item/clothing/head/helmet/space/capspace
|
||||
MASK_TYPE = /obj/item/clothing/mask/breath
|
||||
req_access = list(ACCESS_CAPTAIN)
|
||||
islocked = 1 // otherwise anyone can grab it
|
||||
|
||||
|
||||
/obj/machinery/suit_storage_unit/New()
|
||||
src.update_icon()
|
||||
@@ -300,6 +308,9 @@
|
||||
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/toggle_lock(mob/user as mob)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
if(src.OCCUPANT && src.safetieson)
|
||||
user << "<font color='red'>The Unit's safety protocols disallow locking when a biological form is detected inside its compartments.</font>"
|
||||
return
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
//
|
||||
new /obj/item/device/pda/captain(src)
|
||||
new /obj/item/weapon/storage/id_kit(src)
|
||||
new /obj/item/clothing/suit/armor/captain(src)
|
||||
new /obj/item/clothing/head/helmet/cap(src)
|
||||
new /obj/item/clothing/glasses/sunglasses(src)
|
||||
new /obj/item/clothing/suit/armor/vest(src)
|
||||
|
||||
@@ -118,9 +118,21 @@ MEDICAL
|
||||
if (!ointment && (affecting.status & ORGAN_BLEEDING))
|
||||
affecting.status &= ~ORGAN_BLEEDING
|
||||
|
||||
if (affecting.heal_damage(src.heal_brute, src.heal_burn))
|
||||
H.UpdateDamageIcon()
|
||||
// handle wound stuff
|
||||
if(ointment)
|
||||
for(var/datum/wound/W in affecting.wounds)
|
||||
W.salved = 1
|
||||
else
|
||||
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()
|
||||
//else
|
||||
H.UpdateDamage()
|
||||
|
||||
M.updatehealth()
|
||||
|
||||
@@ -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 <B>LEADER</B>"] 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 <B>LEADER</B>"] 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 << "<b>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 << "<b>As member of the Emergency Response Team, you answer only to your leader and CentComm officials.</b>"
|
||||
else
|
||||
new_commando << "<b>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
|
||||
|
||||
@@ -227,23 +227,12 @@
|
||||
|
||||
msg += "<span class='warning'>"
|
||||
|
||||
/* if (src.getBruteLoss())
|
||||
if (src.getBruteLoss() < 30)
|
||||
usr << "\red [src.name] looks slightly injured!"
|
||||
else
|
||||
usr << "\red <B>[src.name] looks severely injured!</B>"*/
|
||||
|
||||
if (src.cloneloss)
|
||||
if (src.cloneloss < 30)
|
||||
msg += "[t_He] looks slightly... unfinished?\n"
|
||||
else
|
||||
msg += "<B>[t_He] looks very... unfinished?</B>\n"
|
||||
|
||||
/* if (src.getFireLoss())
|
||||
if (src.getFireLoss() < 30)
|
||||
usr << "\red [src.name] looks slightly burned!"
|
||||
else
|
||||
usr << "\red <B>[src.name] looks severely burned!</B>"*/
|
||||
msg += "<span class='warning'>"
|
||||
if (src.nutrition < 100)
|
||||
msg += "[t_He] [t_is] severely malnourished.\n"
|
||||
@@ -294,14 +283,13 @@
|
||||
if(21 to INFINITY)
|
||||
wound_flavor_text["[temp.display_name]"] += pick(" a lot of burns"," severe melting")
|
||||
wound_flavor_text["[temp.display_name]"] += "!</span>\n"
|
||||
else if(temp.wound_descs && temp.wound_descs.len)
|
||||
else if(temp.wounds.len > 0)
|
||||
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]++
|
||||
for(var/datum/wound/W in temp.wounds)
|
||||
if(W.desc in wound_descriptors)
|
||||
wound_descriptors[W.desc] += W.amount
|
||||
continue
|
||||
wound_descriptors[wound] = 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")
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
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
|
||||
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
|
||||
@@ -44,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()
|
||||
@@ -906,6 +909,12 @@
|
||||
handle_organs()
|
||||
// take care of organ related updates, such as broken and missing limbs
|
||||
|
||||
// recalculate number of wounds
|
||||
number_wounds = 0
|
||||
for(var/name in organs)
|
||||
var/datum/organ/external/E = organs[name]
|
||||
number_wounds += E.number_wounds
|
||||
|
||||
var/leg_tally = 2
|
||||
for(var/name in organs)
|
||||
var/datum/organ/external/E = organs[name]
|
||||
@@ -962,6 +971,7 @@
|
||||
paralysis = 10
|
||||
|
||||
|
||||
|
||||
handle_blood()
|
||||
// take care of blood and blood loss
|
||||
if(stat < 2)
|
||||
@@ -974,14 +984,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.
|
||||
B.volume = max(min(B.volume + 560/blood_volume,560), 0) //Less blood = More blood generated per tick
|
||||
var/blood_regen = 0.3
|
||||
if(B.volume < 400)
|
||||
blood_regen = 0.6
|
||||
if(B.volume < 200)
|
||||
blood_regen = 1
|
||||
B.volume = max(min(B.volume + blood_regen,560), 0)
|
||||
|
||||
|
||||
if(blood_volume > 448)
|
||||
@@ -1110,9 +1125,9 @@
|
||||
var/datum/organ/external/temp = organs[name]
|
||||
if(!(temp.status & ORGAN_BLEEDING) || temp.status & ORGAN_ROBOT)
|
||||
continue
|
||||
blood_max += 2
|
||||
blood_max += round(0.5 * (temp.brute_dam + temp.burn_dam) / 4)
|
||||
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--
|
||||
|
||||
@@ -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]"] += "!</span>\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]++
|
||||
for(var/datum/wound/W in temp.wounds)
|
||||
if(W.desc in wound_descriptors)
|
||||
wound_descriptors[W.desc] += W.amount
|
||||
continue
|
||||
wound_descriptors[wound] = 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")
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -184,7 +184,7 @@
|
||||
affecting.status &= ~ORGAN_BROKEN
|
||||
affecting.status &= ~ORGAN_SPLINTED
|
||||
affecting.status &= ~ORGAN_DESTROYED
|
||||
affecting.wound_descs.Cut()
|
||||
affecting.wounds.Cut()
|
||||
H.UpdateDamageIcon()
|
||||
H.update_body()
|
||||
//src.fireloss = 0
|
||||
@@ -218,7 +218,7 @@
|
||||
e.status &= ~ORGAN_DESTROYED
|
||||
e.perma_injury = 0
|
||||
e.update_icon()
|
||||
e.wound_descs.Cut()
|
||||
e.wounds.Cut()
|
||||
del(H.vessel)
|
||||
H.vessel = new/datum/reagents(560)
|
||||
H.vessel.my_atom = H
|
||||
@@ -286,3 +286,6 @@
|
||||
set category = "OOC"
|
||||
|
||||
src.update_flavor_text()
|
||||
|
||||
|
||||
/mob/living/var/life_tick = 0
|
||||
|
||||
@@ -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,203 @@ 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 CUT, BRUISE, BURN
|
||||
var/damage_type = CUT
|
||||
|
||||
// whether this wound needs a bandage/salve to heal at all
|
||||
var/needs_treatment = 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
|
||||
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()
|
||||
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)
|
||||
desc_list += V
|
||||
damage_list += stages[V]
|
||||
|
||||
src.damage = damage
|
||||
|
||||
// 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 / src.amount < damage_list[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
|
||||
src.current_stage -= 2
|
||||
next_stage()
|
||||
src.damage = src.min_damage + 5
|
||||
|
||||
/** 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 +245,8 @@ 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/number_wounds = 0 // cache the number of wounds, which is NOT wounds.len!
|
||||
|
||||
var/tmp/perma_injury = 0
|
||||
var/tmp/perma_dmg = 0
|
||||
@@ -103,7 +257,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 +273,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 & ORGAN_DESTROYED)
|
||||
@@ -200,35 +355,84 @@ var/list/wound_progressions = list(
|
||||
|
||||
owner.updatehealth()
|
||||
|
||||
// sync the organ's damage with its wounds
|
||||
src.update_damages()
|
||||
|
||||
var/result = update_icon()
|
||||
return result
|
||||
|
||||
|
||||
|
||||
proc/heal_damage(brute, burn, internal = 0, robo_repair = 0)
|
||||
if(status & ORGAN_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)
|
||||
brute = 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 &= ~ORGAN_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()
|
||||
|
||||
// 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
|
||||
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.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
|
||||
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
|
||||
if(W.bandaged) amount++
|
||||
if(W.salved) amount++
|
||||
if(W.disinfected) amount++
|
||||
// amount of healing is spread over all the wounds
|
||||
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]
|
||||
if(!W)
|
||||
@@ -253,7 +457,8 @@ var/list/wound_progressions = list(
|
||||
return burn_dam
|
||||
|
||||
process()
|
||||
if(next_wound_update && world.time > next_wound_update)
|
||||
// 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)
|
||||
@@ -268,7 +473,6 @@ var/list/wound_progressions = list(
|
||||
return
|
||||
if(brute_dam > min_broken_damage && !(status & ORGAN_ROBOT))
|
||||
if(!(status & ORGAN_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 <b>Something feels like it shattered in your [display_name]!</b>","You hear a sickening crack.")
|
||||
owner.emote("scream")
|
||||
status |= ORGAN_BROKEN
|
||||
@@ -411,62 +615,59 @@ 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(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())
|
||||
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
|
||||
|
||||
// the wound we will create
|
||||
var/datum/wound/W
|
||||
|
||||
switch(type)
|
||||
if(CUT)
|
||||
src.status |= ORGAN_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
|
||||
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]
|
||||
|
||||
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]
|
||||
|
||||
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))
|
||||
|
||||
@@ -307,7 +307,7 @@
|
||||
|
||||
var/datum/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_arm")
|
||||
|
||||
affecting.take_damage( 0, 5 ) // 5 burn damage
|
||||
affecting.take_damage( 0, 2 ) // 5 burn damage
|
||||
|
||||
H.updatehealth()
|
||||
H.UpdateDamageIcon()
|
||||
|
||||
@@ -474,3 +474,4 @@ var/list/liftable_structures = list(\
|
||||
#define ORGAN_DESTROYED 64
|
||||
#define ORGAN_ROBOT 128
|
||||
#define ORGAN_SPLINTED 256
|
||||
#define SALVED 512
|
||||
@@ -58,6 +58,16 @@ should be listed in the changelog upon commit though. Thanks. -->
|
||||
|
||||
<!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here -->
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">7th August 2012</h2>
|
||||
<h3 class="author">CIB updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class="tweak">Wound descriptions now again are in sync with actual damage.</li>
|
||||
<li class="tweak">Bandages no longer are instant, but rather only stop bleeding and speed up the healing process.</li>
|
||||
<li class="tweak">Bleeding and regeneration speeds have been balanced, so that now it is possible to bleed out.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">4 August 2012</h2>
|
||||
<h3 class="author">Cael_Aislinn updated:</h3>
|
||||
|
||||
17429
maps/tgstation.2.0.8.dmm
17429
maps/tgstation.2.0.8.dmm
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user