Fixes large amounts of damage being carried by minor wound types

This commit is contained in:
unknown
2014-06-16 18:42:17 -04:00
parent 6dee9cf65d
commit 7b59cbec5c
2 changed files with 34 additions and 9 deletions
+15 -9
View File
@@ -232,16 +232,22 @@ This function completely restores a damaged organ to perfect condition.
owner.custom_pain("You feel something rip in your [display_name]!", 1)
// first check whether we can widen an existing wound
if(wounds.len > 0 && prob(max(50+(owner.number_wounds-1)*10,90)))
if(wounds.len > 0 && prob(max(50+(number_wounds-1)*10,90)))
if((type == CUT || type == BRUISE) && damage >= 5)
var/datum/wound/W = pick(wounds)
if(W.amount == 1)
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
//we need to make sure that the wound we are going to worsen is compatible with the type of damage...
var/list/compatible_wounds = list()
for (var/datum/wound/W in wounds)
if (W.can_worsen(type, damage))
compatible_wounds += W
var/datum/wound/W = pick(compatible_wounds)
W.open_wound(damage)
if(prob(25))
//maybe have a separate message for BRUISE type damage?
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
//Creating wound
var/wound_type = get_wound_type(type, damage)
+19
View File
@@ -161,6 +161,25 @@
src.desc = desc_list[current_stage]
src.min_damage = damage_list[current_stage]
// returns whether this wound can absorb the given amount of damage.
// this will prevent large amounts of damage being trapped in less severe wound types
proc/can_worsen(damage_type, damage)
if (src.damage_type != damage_type)
return 0 //incompatible damage types
if (src.amount > 1)
return 0
//with 1.5*, a shallow cut will be able to carry at most 30 damage,
//37.5 for a deep cut
//52.5 for a flesh wound, etc.
var/max_wound_damage = 1.5*src.damage_list[1]
if (src.damage + damage > max_wound_damage)
return 0
return 1
proc/bleeding()
// internal wounds don't bleed in the sense of this function
return ((damage > 30 || bleed_timer > 0) && !(bandaged||clamped) && (damage_type == BRUISE && damage >= 20 || damage_type == CUT && damage >= 5) && current_stage <= max_bleeding_stage && !src.internal)