Skip to content

Commit

Permalink
Touching bloody objects will make your hands/gloves bloody. (Paradise…
Browse files Browse the repository at this point in the history
…SS13#25730)

* bloody blood

* no restrictions of item blood

* PR reviews

* comment
  • Loading branch information
HMBGERDO committed Jun 25, 2024
1 parent 457f9ff commit d88ddea
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 10 deletions.
3 changes: 3 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

var/list/blood_DNA
var/blood_color
/// Wont gloves/hands spend blood spill points to make this bloody
var/easy_to_spill_blood = FALSE
var/pass_flags = 0
/// The higher the germ level, the more germ on the atom.
var/germ_level = GERM_LEVEL_AMBIENT
Expand Down Expand Up @@ -896,6 +898,7 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons)
return FALSE

/obj/add_blood(list/blood_dna, b_color)
blood_color = b_color
return transfer_blood_dna(blood_dna)

/obj/item/add_blood(list/blood_dna, b_color)
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons

can_be_hit = FALSE
suicidal_hands = TRUE
easy_to_spill_blood = TRUE

/// Sound played when you hit something with the item
var/hitsound
Expand Down
3 changes: 2 additions & 1 deletion code/modules/clothing/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@
var/safe_from_poison = FALSE
strip_delay = 20
put_on_delay = 40
var/transfer_blood = FALSE
///Amount of times touching something with these gloves will spill blood on it
var/transfer_blood = 0

sprite_sheets = list(
"Vox" = 'icons/mob/clothing/species/vox/gloves.dmi',
Expand Down
1 change: 0 additions & 1 deletion code/modules/clothing/gloves/colored_gloves.dm
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,3 @@
icon_state = "furglovesico"
item_state = "furgloves"
transfer_prints = TRUE
transfer_blood = TRUE
27 changes: 22 additions & 5 deletions code/modules/detective_work/detective_work.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,29 @@
/atom/proc/add_fibers(mob/living/carbon/human/M)
if(M.gloves && isclothing(M.gloves))
var/obj/item/clothing/gloves/G = M.gloves
if(G.transfer_blood > 1) //bloodied gloves transfer blood to touched objects
if(add_blood(G.blood_DNA, G.blood_color)) //only reduces the bloodiness of our gloves if the item wasn't already bloody
G.transfer_blood--
else if(M.bloody_hands > 1)
if(add_blood(M.blood_DNA, M.hand_blood_color))
if(easy_to_spill_blood && G.blood_DNA)
add_blood(G.blood_DNA, G.blood_color)
else if(G.transfer_blood > 1 && add_blood(G.blood_DNA, G.blood_color))
G.transfer_blood--

if(blood_DNA)
var/old_transfer_blood = G.transfer_blood
G.add_blood(blood_DNA, blood_color)
G.transfer_blood = old_transfer_blood
M.update_inv_gloves()

else
if(easy_to_spill_blood && M.blood_DNA)
add_blood(M.blood_DNA, M.hand_blood_color)
else if(M.bloody_hands > 1 && add_blood(M.blood_DNA, M.hand_blood_color))
M.bloody_hands--

if(blood_DNA)
var/old_bloody_hands = M.bloody_hands
M.add_blood(blood_DNA, blood_color)
M.bloody_hands = old_bloody_hands
M.update_inv_gloves()

if(!suit_fibers) suit_fibers = list()
var/fibertext
var/item_multiplier = isitem(src)?1.2:1
Expand Down
7 changes: 4 additions & 3 deletions code/modules/mob/living/carbon/human/human_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -617,13 +617,10 @@ emp_act
return TRUE

/mob/living/carbon/human/proc/bloody_hands(mob/living/source, amount = 2)

if(gloves)
gloves.add_mob_blood(source)
gloves:transfer_blood = amount
else
add_mob_blood(source)
bloody_hands = amount
update_inv_gloves() //updates on-mob overlays for bloody hands and/or bloody gloves

/mob/living/carbon/human/proc/bloody_body(mob/living/source)
Expand Down Expand Up @@ -658,6 +655,10 @@ emp_act
var/mob/living/carbon/human/H = user
dna.species.spec_attack_hand(H, src)

if(bleed_rate && ishuman(user))
var/mob/living/carbon/human/attacker = user
attacker.bloody_hands(src)

/mob/living/carbon/human/attack_larva(mob/living/carbon/alien/larva/L)
if(..()) //successful larva bite.
var/damage = rand(1, 3)
Expand Down

0 comments on commit d88ddea

Please sign in to comment.