From 6ca73039fb56dafd4031346d59ed3d3b3c8f71e0 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 15 Oct 2012 15:27:10 +0200 Subject: [PATCH] Wounds now bleed only until a certain stage. --- code/datums/organs/wound.dm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/code/datums/organs/wound.dm b/code/datums/organs/wound.dm index 2c0fa8db25..c72d5bcecb 100644 --- a/code/datums/organs/wound.dm +++ b/code/datums/organs/wound.dm @@ -34,6 +34,10 @@ // number of wounds of this type var/tmp/amount = 1 + // maximum stage at which bleeding should still happen, counted from the right rather than the left of the list + // 1 means all stages except the last should bleed + var/max_bleeding_stage = 1 + // helper lists var/tmp/list/desc_list = list() var/tmp/list/damage_list = list() @@ -55,6 +59,10 @@ // this will ensure the size of the wound matches the damage src.heal_damage(0) + // make the max_bleeding_stage count from the end of the list rather than the start + // this is more robust to changes to the list + max_bleeding_stage = src.desc_list.len - max_bleeding_stage + // returns 1 if there's a next stage, 0 otherwise proc/next_stage() if(current_stage + 1 > src.desc_list.len) @@ -106,29 +114,35 @@ src.min_damage = damage_list[current_stage] proc/bleeding() - return (!bandaged && (damage_type == BRUISE && damage >= 20 || damage_type == CUT)) + return (!bandaged && (damage_type == BRUISE && damage >= 20 || damage_type == CUT) && current_stage <= max_bleeding_stage) /** CUTS **/ /datum/wound/cut // link wound descriptions to amounts of damage + max_bleeding_stage = 2 stages = list("ugly ripped cut" = 20, "ripped cut" = 10, "cut" = 5, "healing cut" = 2, "small scab" = 0) /datum/wound/deep_cut + max_bleeding_stage = 3 stages = list("ugly deep ripped cut" = 25, "deep ripped cut" = 20, "deep cut" = 15, "clotted cut" = 8, "scab" = 2, "fresh skin" = 0) /datum/wound/flesh_wound + max_bleeding_stage = 3 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 + max_bleeding_stage = 2 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 + max_bleeding_stage = 2 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 + max_bleeding_stage = 2 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