mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-23 07:17:07 +01:00
regexes damage and wound types (#6735)
Different semantics demand different defines. It's hard to tell what's being used where and for what reason right now. Staging for combat PR.
This commit is contained in:
+17
-17
@@ -398,11 +398,11 @@
|
||||
if(can_inflict_brute >= brute)
|
||||
if(can_cut)
|
||||
if(sharp && !edge)
|
||||
create_wound( PIERCE, brute )
|
||||
create_wound( WOUND_TYPE_PIERCE, brute )
|
||||
else
|
||||
create_wound( CUT, brute )
|
||||
create_wound( WOUND_TYPE_CUT, brute )
|
||||
else
|
||||
create_wound( BRUISE, brute )
|
||||
create_wound( WOUND_TYPE_BRUISE, brute )
|
||||
else if(!(damage_mode & DAMAGE_MODE_NO_OVERFLOW))
|
||||
var/overflow_brute = brute - can_inflict_brute
|
||||
// keep allowing it, but, diminishing returns
|
||||
@@ -412,24 +412,24 @@
|
||||
overflow_brute -= damage_anyways_brute
|
||||
if(can_cut)
|
||||
if(sharp && !edge)
|
||||
create_wound( PIERCE, damage_anyways_brute )
|
||||
create_wound( WOUND_TYPE_PIERCE, damage_anyways_brute )
|
||||
else
|
||||
create_wound( CUT, damage_anyways_brute )
|
||||
create_wound( WOUND_TYPE_CUT, damage_anyways_brute )
|
||||
else
|
||||
create_wound( BRUISE, damage_anyways_brute )
|
||||
create_wound( WOUND_TYPE_BRUISE, damage_anyways_brute )
|
||||
// rest goes into shock
|
||||
owner.shock_stage += overflow_brute * 0.33
|
||||
if(burn)
|
||||
var/can_inflict_burn = max(0, max_damage - burn_dam)
|
||||
if(can_inflict_burn >= burn)
|
||||
create_wound( BURN, burn )
|
||||
create_wound( WOUND_TYPE_BURN, burn )
|
||||
else
|
||||
var/overflow_burn = burn - can_inflict_burn
|
||||
var/damage_anyways_burn = !(damage_mode & DAMAGE_MODE_NO_OVERFLOW) && ( \
|
||||
overflow_burn * min(1, 1 / ((max(burn_dam, max_damage) + damage_softcap_intensifier) / (damage_softcap_intensifier + max_damage))) \
|
||||
)
|
||||
overflow_burn -= damage_anyways_burn
|
||||
create_wound(BURN, damage_anyways_burn + can_inflict_burn)
|
||||
create_wound(WOUND_TYPE_BURN, damage_anyways_burn + can_inflict_burn)
|
||||
// rest goes into shock
|
||||
owner.shock_stage += overflow_burn * 0.33
|
||||
|
||||
@@ -504,7 +504,7 @@
|
||||
break
|
||||
|
||||
// heal brute damage
|
||||
if(W.damage_type == BURN)
|
||||
if(W.wound_type == WOUND_TYPE_BURN)
|
||||
burn = W.heal_damage(burn)
|
||||
else
|
||||
brute = W.heal_damage(brute)
|
||||
@@ -527,9 +527,9 @@
|
||||
|
||||
var/damage_amount
|
||||
switch(damage_type)
|
||||
if(BRUTE)
|
||||
if(DAMAGE_TYPE_BRUTE)
|
||||
damage_amount = brute_dam
|
||||
if(BURN)
|
||||
if(DAMAGE_TYPE_BURN)
|
||||
damage_amount = burn_dam
|
||||
if("omni")
|
||||
damage_amount = max(brute_dam,burn_dam)
|
||||
@@ -562,9 +562,9 @@
|
||||
return FALSE
|
||||
|
||||
switch(damage_type)
|
||||
if(BRUTE)
|
||||
if(DAMAGE_TYPE_BRUTE)
|
||||
src.heal_damage(repair_amount, 0, 0, 1)
|
||||
if(BURN)
|
||||
if(DAMAGE_TYPE_BURN)
|
||||
src.heal_damage(0, repair_amount, 0, 1)
|
||||
if("omni")
|
||||
src.heal_damage(repair_amount, repair_amount, 0, 1)
|
||||
@@ -849,7 +849,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
//update damage counts
|
||||
for(var/datum/wound/W as anything in wounds)
|
||||
if(!W.internal) //so IB doesn't count towards crit/paincrit
|
||||
if(W.damage_type == BURN)
|
||||
if(W.wound_type == WOUND_TYPE_BURN)
|
||||
burn_dam += W.damage
|
||||
else
|
||||
brute_dam += W.damage
|
||||
@@ -862,7 +862,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
|
||||
wound_tally += W.amount
|
||||
|
||||
//things tend to bleed if they are CUT OPEN
|
||||
//things tend to bleed if they are WOUND_TYPE_CUT OPEN
|
||||
if (open && !clamped && (H && H.should_have_organ(O_HEART)))
|
||||
status |= ORGAN_BLEEDING
|
||||
|
||||
@@ -1270,7 +1270,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if(!owner || loc != owner)
|
||||
return
|
||||
if(owner.species.reagent_tag == IS_SLIME)
|
||||
create_wound( CUT, 15 ) //fixes proms being bugged into paincrit;instead whatever would embed now just takes a chunk out
|
||||
create_wound( WOUND_TYPE_CUT, 15 ) //fixes proms being bugged into paincrit;instead whatever would embed now just takes a chunk out
|
||||
src.visible_message("<font color='red'>[owner] has been seriously wounded by [W]!</font>")
|
||||
W.add_blood(owner)
|
||||
return 0
|
||||
@@ -1429,7 +1429,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if(W.internal && !open) continue // can't see internal wounds
|
||||
var/this_wound_desc = W.desc
|
||||
|
||||
if(W.damage_type == BURN && W.salved)
|
||||
if(W.wound_type == WOUND_TYPE_BURN && W.salved)
|
||||
this_wound_desc = "salved [this_wound_desc]"
|
||||
|
||||
if(W.bleeding())
|
||||
|
||||
+21
-21
@@ -3,26 +3,26 @@
|
||||
*
|
||||
* todo: better documentation
|
||||
*/
|
||||
/obj/item/organ/external/proc/create_wound(var/type = CUT, var/damage)
|
||||
/obj/item/organ/external/proc/create_wound(var/type = WOUND_TYPE_CUT, var/damage)
|
||||
if(damage == 0)
|
||||
return
|
||||
|
||||
//moved this before the open_wound check so that having many small wounds for example doesn't somehow protect you from taking internal damage (because of the return)
|
||||
//Possibly trigger an internal wound, too.
|
||||
var/local_damage = brute_dam + burn_dam + damage
|
||||
if((damage > 15) && (type != BURN) && (local_damage > 30) && prob(damage) && (robotic < ORGAN_ROBOT) && !(species.species_flags & NO_BLOOD))
|
||||
if((damage > 15) && (type != WOUND_TYPE_BURN) && (local_damage > 30) && prob(damage) && (robotic < ORGAN_ROBOT) && !(species.species_flags & NO_BLOOD))
|
||||
create_specific_wound(/datum/wound/internal_bleeding, min(damage - 15, 15))
|
||||
owner.custom_pain("You feel something rip in your [name]!", 50)
|
||||
|
||||
//Burn damage can cause fluid loss due to blistering and cook-off
|
||||
|
||||
if((damage > 5 || damage + burn_dam >= 15) && type == BURN && (robotic < ORGAN_ROBOT) && !(species.species_flags & NO_BLOOD))
|
||||
if((damage > 5 || damage + burn_dam >= 15) && type == WOUND_TYPE_BURN && (robotic < ORGAN_ROBOT) && !(species.species_flags & NO_BLOOD))
|
||||
var/fluid_loss = 0.4 * (damage/(owner.getMaxHealth() - config_legacy.health_threshold_dead)) * owner.species.blood_volume*(1 - owner.species.blood_level_fatal)
|
||||
owner.remove_blood(fluid_loss)
|
||||
|
||||
// first check whether we can widen an existing wound
|
||||
if(length(wounds) > 0 && prob(max(50+(wound_tally-1)*10,90)))
|
||||
if((type == CUT || type == BRUISE) && damage >= 5)
|
||||
if((type == WOUND_TYPE_CUT || type == WOUND_TYPE_BRUISE) && damage >= 5)
|
||||
//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 as anything in wounds)
|
||||
@@ -188,8 +188,8 @@
|
||||
var/internal = FALSE
|
||||
// maximum stage at which bleeding should still happen. Beyond this stage bleeding is prevented.
|
||||
var/max_bleeding_stage = 0
|
||||
// one of CUT, PIERCE, BRUISE, BURN
|
||||
var/damage_type = CUT
|
||||
// one of WOUND_TYPE_CUT, WOUND_TYPE_PIERCE, WOUND_TYPE_BRUISE, WOUND_TYPE_BURN
|
||||
var/wound_type = WOUND_TYPE_CUT
|
||||
// whether this wound needs a bandage/salve to heal at all
|
||||
// the maximum amount of damage that this wound can have and still autoheal
|
||||
var/autoheal_cutoff = 10
|
||||
@@ -243,9 +243,9 @@
|
||||
|
||||
// checks whether the wound has been appropriately treated
|
||||
/datum/wound/proc/is_treated()
|
||||
if(damage_type == BRUISE || damage_type == CUT || damage_type == PIERCE)
|
||||
if(wound_type == WOUND_TYPE_BRUISE || wound_type == WOUND_TYPE_CUT || wound_type == WOUND_TYPE_PIERCE)
|
||||
return bandaged
|
||||
else if(damage_type == BURN)
|
||||
else if(wound_type == WOUND_TYPE_BURN)
|
||||
return salved
|
||||
|
||||
// Checks whether other other can be merged into src.
|
||||
@@ -254,7 +254,7 @@
|
||||
return 0
|
||||
if (other.current_stage != src.current_stage)
|
||||
return 0
|
||||
if (other.damage_type != src.damage_type)
|
||||
if (other.wound_type != src.wound_type)
|
||||
return 0
|
||||
if (!(other.can_autoheal()) != !(src.can_autoheal()))
|
||||
return 0
|
||||
@@ -295,7 +295,7 @@
|
||||
return FALSE
|
||||
if (is_treated() && damage < 25) //anything less than a flesh wound (or equivalent) isn't infectable if treated properly
|
||||
return FALSE
|
||||
if (damage_type == BRUISE && !bleeding()) //bruises only infectable if bleeding
|
||||
if (wound_type == WOUND_TYPE_BRUISE && !bleeding()) //bruises only infectable if bleeding
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -303,12 +303,12 @@
|
||||
return TRUE
|
||||
|
||||
var/dam_coef = round(damage/10)
|
||||
switch (damage_type)
|
||||
if (BRUISE)
|
||||
switch (wound_type)
|
||||
if (WOUND_TYPE_BRUISE)
|
||||
return prob(dam_coef*5)
|
||||
if (BURN)
|
||||
if (WOUND_TYPE_BURN)
|
||||
return prob(dam_coef*10)
|
||||
if (CUT)
|
||||
if (WOUND_TYPE_CUT)
|
||||
return prob(dam_coef*20)
|
||||
|
||||
return FALSE
|
||||
@@ -355,8 +355,8 @@
|
||||
|
||||
// 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
|
||||
/datum/wound/proc/can_worsen(damage_type, damage)
|
||||
if (src.damage_type != damage_type)
|
||||
/datum/wound/proc/can_worsen(woud_type, damage)
|
||||
if (src.wound_type != woud_type)
|
||||
return 0 //incompatible damage types
|
||||
|
||||
if (src.amount > 1)
|
||||
@@ -392,9 +392,9 @@
|
||||
//the damage amount for the stage with the same name as the wound.
|
||||
//e.g. /datum/wound/cut/deep should only be applied for 15 damage and up,
|
||||
//because in it's stages list, "deep cut" = 15.
|
||||
/proc/get_wound_type(type = CUT, damage)
|
||||
/proc/get_wound_type(type = WOUND_TYPE_CUT, damage)
|
||||
switch(type)
|
||||
if(CUT)
|
||||
if(WOUND_TYPE_CUT)
|
||||
switch(damage)
|
||||
if(70 to INFINITY)
|
||||
return /datum/wound/cut/massive
|
||||
@@ -408,7 +408,7 @@
|
||||
return /datum/wound/cut/deep
|
||||
if(0 to 15)
|
||||
return /datum/wound/cut/small
|
||||
if(PIERCE)
|
||||
if(WOUND_TYPE_PIERCE)
|
||||
switch(damage)
|
||||
if(60 to INFINITY)
|
||||
return /datum/wound/puncture/massive
|
||||
@@ -420,9 +420,9 @@
|
||||
return /datum/wound/puncture/flesh
|
||||
if(0 to 15)
|
||||
return /datum/wound/puncture/small
|
||||
if(BRUISE)
|
||||
if(WOUND_TYPE_BRUISE)
|
||||
return /datum/wound/bruise
|
||||
if(BURN)
|
||||
if(WOUND_TYPE_BURN)
|
||||
switch(damage)
|
||||
if(50 to INFINITY)
|
||||
return /datum/wound/burn/carbonised
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
|
||||
switch(losstype)
|
||||
if(DROPLIMB_EDGE, DROPLIMB_BLUNT)
|
||||
damage_type = CUT
|
||||
wound_type = WOUND_TYPE_CUT
|
||||
max_bleeding_stage = 3 //clotted stump and above can bleed.
|
||||
stages = list(
|
||||
"ripped stump" = damage_amt*1.3,
|
||||
@@ -16,7 +16,7 @@
|
||||
"scarred stump" = 0
|
||||
)
|
||||
if(DROPLIMB_BURN)
|
||||
damage_type = BURN
|
||||
wound_type = WOUND_TYPE_BURN
|
||||
stages = list(
|
||||
"ripped charred stump" = damage_amt*1.3,
|
||||
"charred stump" = damage_amt,
|
||||
|
||||
+9
-9
@@ -1,7 +1,7 @@
|
||||
/** CUTS **/
|
||||
/datum/wound/cut
|
||||
bleed_threshold = 5
|
||||
damage_type = CUT
|
||||
wound_type = WOUND_TYPE_CUT
|
||||
|
||||
/datum/wound/cut/small
|
||||
// link wound descriptions to amounts of damage
|
||||
@@ -33,35 +33,35 @@
|
||||
/** PUNCTURES **/
|
||||
/datum/wound/puncture
|
||||
bleed_threshold = 5
|
||||
damage_type = PIERCE
|
||||
wound_type = WOUND_TYPE_PIERCE
|
||||
|
||||
/datum/wound/puncture/can_worsen(damage_type, damage)
|
||||
/datum/wound/puncture/can_worsen(woud_type, damage)
|
||||
return 0 //puncture wounds cannot be enlargened
|
||||
|
||||
/datum/wound/puncture/small
|
||||
max_bleeding_stage = 2
|
||||
stages = list("puncture" = 5, "healing puncture" = 2, "small scab" = 0)
|
||||
damage_type = PIERCE
|
||||
wound_type = WOUND_TYPE_PIERCE
|
||||
|
||||
/datum/wound/puncture/flesh
|
||||
max_bleeding_stage = 2
|
||||
stages = list("puncture wound" = 15, "blood soaked clot" = 5, "large scab" = 2, "small round scar" = 0)
|
||||
damage_type = PIERCE
|
||||
wound_type = WOUND_TYPE_PIERCE
|
||||
|
||||
/datum/wound/puncture/gaping
|
||||
max_bleeding_stage = 3
|
||||
stages = list("gaping hole" = 30, "large blood soaked clot" = 15, "blood soaked clot" = 10, "small angry scar" = 5, "small round scar" = 0)
|
||||
damage_type = PIERCE
|
||||
wound_type = WOUND_TYPE_PIERCE
|
||||
|
||||
/datum/wound/puncture/gaping_big
|
||||
max_bleeding_stage = 3
|
||||
stages = list("big gaping hole" = 50, "healing gaping hole" = 20, "large blood soaked clot" = 15, "large angry scar" = 10, "large round scar" = 0)
|
||||
damage_type = PIERCE
|
||||
wound_type = WOUND_TYPE_PIERCE
|
||||
|
||||
/datum/wound/puncture/massive
|
||||
max_bleeding_stage = 3
|
||||
stages = list("massive wound" = 60, "massive healing wound" = 30, "massive blood soaked clot" = 25, "massive angry scar" = 10, "massive jagged scar" = 0)
|
||||
damage_type = PIERCE
|
||||
wound_type = WOUND_TYPE_PIERCE
|
||||
|
||||
/** BRUISES **/
|
||||
/datum/wound/bruise
|
||||
@@ -69,4 +69,4 @@
|
||||
"moderate bruise" = 20, "small bruise" = 10, "tiny bruise" = 5)
|
||||
bleed_threshold = 20
|
||||
max_bleeding_stage = 2 //only huge bruise and above can bleed.
|
||||
damage_type = BRUISE
|
||||
wound_type = WOUND_TYPE_BRUISE
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/** BURNS **/
|
||||
/datum/wound/burn
|
||||
damage_type = BURN
|
||||
wound_type = WOUND_TYPE_BURN
|
||||
max_bleeding_stage = 0
|
||||
|
||||
/datum/wound/burn/bleeding()
|
||||
|
||||
Reference in New Issue
Block a user