Fixing blood spreading too much during surgery (#26266)

* bloody blood

* ehhhh

* here too

* bloodwrite fix

* a

* review changes

* max blood amount to argument

* Update code/game/atoms.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com>

* Update code/modules/mob/living/carbon/human/human_defense.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com>

* tab

---------

Signed-off-by: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
HMBGERDO
2024-08-15 23:51:48 +00:00
committed by GitHub
co-authored by DGamerL Burzah
parent 6032712fab
commit fbe49dabbc
9 changed files with 53 additions and 23 deletions
@@ -616,14 +616,27 @@ emp_act
visible_message("<span class='danger'>[I] embeds itself in [src]'s [L.name]!</span>","<span class='userdanger'>[I] embeds itself in your [L.name]!</span>")
return TRUE
/mob/living/carbon/human/proc/make_bloody_hands(list/blood_dna, b_color)
/*
* This proc makes human hands bloody, if you touch something, you will leave a blood trace
* blood_dna: list of blood DNAs stored in each atom in blood_DNA variable or in get_blood_dna_list() on carbons
* b_color: blood color, simple. If there will be null, the blood will be red, otherwise the color you pass
* amount: amount of "blood charges" you want to give, that will be used to make items/walls bloody.
You can make something bloody this amount - 1 times.
If this variable will be null, amount will be set randomly from 2 to max_amount
* max_amount: if amount is not set, amount will be random from 2 to this value, default 4
*/
/mob/living/carbon/human/proc/make_bloody_hands(list/blood_dna, b_color, amount, max_amount = 4)
if(isnull(b_color))
b_color = "#A10808"
if(gloves)
gloves.add_blood(blood_dna, blood_color)
gloves.add_blood(blood_dna, blood_color, amount, max_amount)
else
hand_blood_color = b_color
bloody_hands = rand(2, 4)
if(isnull(amount))
bloody_hands = rand(2, max_amount)
else
bloody_hands = max(1, amount)
transfer_blood_dna(blood_dna)
add_verb(src, /mob/living/carbon/human/proc/bloody_doodle)
update_inv_gloves() //updates on-mob overlays for bloody hands and/or bloody gloves
@@ -1281,7 +1281,7 @@
if(incapacitated())
to_chat(src, "<span class='warning'>You can't write on the floor in your current state!</span>")
return
if(!bloody_hands)
if(bloody_hands <= 1)
remove_verb(src, /mob/living/carbon/human/proc/bloody_doodle)
if(gloves)
@@ -1310,7 +1310,7 @@
to_chat(src, "<span class='warning'>There is no space to write on!</span>")
return
var/max_length = bloody_hands * 30 //tweeter style
var/max_length = (bloody_hands - 1) * 30 //tweeter style
var/message = tgui_input_text(src, "Write a message. It cannot be longer than [max_length] characters.", "Blood writing", max_length = max_length)
if(origin != loc)
@@ -1318,7 +1318,7 @@
return
if(message)
var/used_blood_amount = round(length(message) / 30, 1)
bloody_hands = max(0, bloody_hands - used_blood_amount) //use up some blood
bloody_hands = max(1, bloody_hands - used_blood_amount) //use up some blood
if(length(message) > max_length)
message += "-"