mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
Adds new type of wounds - piercing.
Unlike cuts they do not merge, so many small-damage stabs will create many small stab wounds instead of one megahole. Also cleans up checks in wound code a bit with power of OOP
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#define CUT "cut"
|
||||
#define BRUISE "bruise"
|
||||
#define PIERCE "pierce"
|
||||
|
||||
#define STUN "stun"
|
||||
#define WEAKEN "weaken"
|
||||
|
||||
@@ -82,11 +82,12 @@
|
||||
if(!do_mob(user, M, W.damage/5))
|
||||
user << "<span class='notice'>You must stand still to bandage wounds.</span>"
|
||||
break
|
||||
|
||||
if (W.current_stage <= W.max_bleeding_stage)
|
||||
user.visible_message("<span class='notice'>\The [user] bandages \a [W.desc] on [M]'s [affecting.name].</span>", \
|
||||
"<span class='notice'>You bandage \a [W.desc] on [M]'s [affecting.name].</span>" )
|
||||
//H.add_side_effect("Itch")
|
||||
else if (istype(W,/datum/wound/bruise))
|
||||
else if (W.damage_type == BRUISE)
|
||||
user.visible_message("<span class='notice'>\The [user] places a bruise patch over \a [W.desc] on [M]'s [affecting.name].</span>", \
|
||||
"<span class='notice'>You place a bruise patch over \a [W.desc] on [M]'s [affecting.name].</span>" )
|
||||
else
|
||||
@@ -183,8 +184,7 @@
|
||||
if (W.current_stage <= W.max_bleeding_stage)
|
||||
user.visible_message("<span class='notice'>\The [user] cleans \a [W.desc] on [M]'s [affecting.name] and seals the edges with bioglue.</span>", \
|
||||
"<span class='notice'>You clean and seal \a [W.desc] on [M]'s [affecting.name].</span>" )
|
||||
//H.add_side_effect("Itch")
|
||||
else if (istype(W,/datum/wound/bruise))
|
||||
else if (W.damage_type == BRUISE)
|
||||
user.visible_message("<span class='notice'>\The [user] places a medical patch over \a [W.desc] on [M]'s [affecting.name].</span>", \
|
||||
"<span class='notice'>You place a medical patch over \a [W.desc] on [M]'s [affecting.name].</span>" )
|
||||
else
|
||||
|
||||
@@ -255,6 +255,9 @@
|
||||
if(is_damageable(brute + burn) || !config.limbs_can_break)
|
||||
if(brute)
|
||||
if(can_cut)
|
||||
if(sharp && !edge)
|
||||
createwound( PIERCE, brute )
|
||||
else
|
||||
createwound( CUT, brute )
|
||||
else
|
||||
createwound( BRUISE, brute )
|
||||
@@ -269,6 +272,9 @@
|
||||
if (brute > 0)
|
||||
//Inflict all burte damage we can
|
||||
if(can_cut)
|
||||
if(sharp && !edge)
|
||||
createwound( PIERCE, min(brute,can_inflict) )
|
||||
else
|
||||
createwound( CUT, min(brute,can_inflict) )
|
||||
else
|
||||
createwound( BRUISE, min(brute,can_inflict) )
|
||||
@@ -332,10 +338,10 @@
|
||||
break
|
||||
|
||||
// heal brute damage
|
||||
if(W.damage_type == CUT || W.damage_type == BRUISE)
|
||||
brute = W.heal_damage(brute)
|
||||
else if(W.damage_type == BURN)
|
||||
if(W.damage_type == BURN)
|
||||
burn = W.heal_damage(burn)
|
||||
else
|
||||
brute = W.heal_damage(brute)
|
||||
|
||||
if(internal)
|
||||
status &= ~ORGAN_BROKEN
|
||||
@@ -659,10 +665,10 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
//update damage counts
|
||||
for(var/datum/wound/W in wounds)
|
||||
if(!W.internal) //so IB doesn't count towards crit/paincrit
|
||||
if(W.damage_type == CUT || W.damage_type == BRUISE)
|
||||
brute_dam += W.damage
|
||||
else if(W.damage_type == BURN)
|
||||
if(W.damage_type == BURN)
|
||||
burn_dam += W.damage
|
||||
else
|
||||
brute_dam += W.damage
|
||||
|
||||
if(!(status & ORGAN_ROBOT) && W.bleeding() && (H && H.should_have_organ(O_HEART)))
|
||||
W.bleed_timer--
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
var/internal = 0
|
||||
// maximum stage at which bleeding should still happen. Beyond this stage bleeding is prevented.
|
||||
var/max_bleeding_stage = 0
|
||||
// one of CUT, BRUISE, BURN
|
||||
// one of CUT, PIERCE, BRUISE, BURN
|
||||
var/damage_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
|
||||
@@ -211,7 +211,7 @@
|
||||
if (wound_damage() <= 30 && bleed_timer <= 0)
|
||||
return 0 //Bleed timer has run out. Wounds with more than 30 damage don't stop bleeding on their own.
|
||||
|
||||
return (damage_type == BRUISE && wound_damage() >= 20 || damage_type == CUT && wound_damage() >= 5)
|
||||
return 1
|
||||
|
||||
/** WOUND DEFINITIONS **/
|
||||
|
||||
@@ -235,6 +235,18 @@
|
||||
return /datum/wound/cut/deep
|
||||
if(0 to 15)
|
||||
return /datum/wound/cut/small
|
||||
if(PIERCE)
|
||||
switch(damage)
|
||||
if(60 to INFINITY)
|
||||
return /datum/wound/puncture/massive
|
||||
if(50 to 60)
|
||||
return /datum/wound/puncture/gaping_big
|
||||
if(30 to 50)
|
||||
return /datum/wound/puncture/gaping
|
||||
if(15 to 30)
|
||||
return /datum/wound/puncture/flesh
|
||||
if(0 to 15)
|
||||
return /datum/wound/puncture/small
|
||||
if(BRUISE)
|
||||
return /datum/wound/bruise
|
||||
if(BURN)
|
||||
@@ -252,6 +264,9 @@
|
||||
return null //no wound
|
||||
|
||||
/** CUTS **/
|
||||
/datum/wound/cut/bleeding()
|
||||
return ..() && wound_damage() >= 5
|
||||
|
||||
/datum/wound/cut/small
|
||||
// link wound descriptions to amounts of damage
|
||||
// Minor cuts have max_bleeding_stage set to the stage that bears the wound type's name.
|
||||
@@ -285,7 +300,43 @@ datum/wound/cut/massive
|
||||
stages = list("massive wound" = 70, "massive healing wound" = 50, "massive blood soaked clot" = 25, "massive angry scar" = 10, "massive jagged scar" = 0)
|
||||
damage_type = CUT
|
||||
|
||||
/** PUNCTURES **/
|
||||
/datum/wound/puncture/can_worsen(damage_type, damage)
|
||||
return 0
|
||||
/datum/wound/puncture/can_merge(var/datum/wound/other)
|
||||
return 0
|
||||
/datum/wound/puncture/bleeding()
|
||||
return ..() && wound_damage() >= 5
|
||||
|
||||
/datum/wound/puncture/small
|
||||
max_bleeding_stage = 2
|
||||
stages = list("puncture" = 5, "healing puncture" = 2, "small scab" = 0)
|
||||
damage_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
|
||||
|
||||
/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
|
||||
|
||||
/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
|
||||
|
||||
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
|
||||
|
||||
/** BRUISES **/
|
||||
/datum/wound/bruise/bleeding()
|
||||
return ..() && wound_damage() >= 20
|
||||
|
||||
/datum/wound/bruise
|
||||
stages = list("monumental bruise" = 80, "huge bruise" = 50, "large bruise" = 30,
|
||||
"moderate bruise" = 20, "small bruise" = 10, "tiny bruise" = 5)
|
||||
@@ -294,6 +345,11 @@ datum/wound/cut/massive
|
||||
damage_type = BRUISE
|
||||
|
||||
/** BURNS **/
|
||||
/datum/wound/burn
|
||||
max_bleeding_stage = 0
|
||||
/datum/wound/burn/bleeding()
|
||||
return 0
|
||||
|
||||
/datum/wound/burn/moderate
|
||||
stages = list("ripped burn" = 10, "moderate burn" = 5, "healing moderate burn" = 2, "fresh skin" = 0)
|
||||
damage_type = BURN
|
||||
|
||||
Reference in New Issue
Block a user