Skip to content

Commit

Permalink
Merge pull request tgstation#7239 from paprka/ointmentandshit
Browse files Browse the repository at this point in the history
BLOOD FOR THE BLOOD GOD
  • Loading branch information
Cheridan committed Feb 3, 2015
2 parents 784766e + d6dce06 commit 80913f1
Show file tree
Hide file tree
Showing 33 changed files with 893 additions and 254 deletions.
56 changes: 29 additions & 27 deletions _maps/map_files/TgStation/tgstation.2.1.3.dmm

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions code/datums/supplypacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
/obj/item/weapon/reagent_containers/glass/bottle/toxin,
/obj/item/weapon/reagent_containers/glass/beaker/large,
/obj/item/weapon/reagent_containers/glass/beaker/large,
/obj/item/stack/medical/gauze,
/obj/item/weapon/storage/box/beakers,
/obj/item/weapon/storage/box/syringes,
/obj/item/weapon/storage/box/bodybags)
Expand Down Expand Up @@ -607,6 +608,28 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
access = access_cmo


/datum/supply_packs/medical/bloodpacks
name = "Blood Pack Variety Crate"
contains = list(/obj/item/weapon/reagent_containers/blood/empty,
/obj/item/weapon/reagent_containers/blood/empty,
/obj/item/weapon/reagent_containers/blood/APlus,
/obj/item/weapon/reagent_containers/blood/AMinus,
/obj/item/weapon/reagent_containers/blood/BPlus,
/obj/item/weapon/reagent_containers/blood/BMinus,
/obj/item/weapon/reagent_containers/blood/OPlus,
/obj/item/weapon/reagent_containers/blood/OMinus)
cost = 35
containertype = /obj/structure/closet/crate/freezer
containername = "blood pack crate"

/datum/supply_packs/medical/iv_drip
name = "IV Drip Crate"
contains = list(/obj/machinery/iv_drip)
cost = 30
containertype = /obj/structure/closet/crate/secure
containername = "iv drip crate"
access = access_cmo

//////////////////////////////////////////////////////////////////////////////
//////////////////////////// Science /////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Expand Down
10 changes: 7 additions & 3 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,13 @@ var/list/blood_splatter_icons = list()
bloody_hands_mob = M
return 1

/turf/simulated/add_blood(mob/living/carbon/M)
/turf/simulated/add_blood(mob/living/carbon/human/M)
if(..() == 0) return 0

var/obj/effect/decal/cleanable/blood/B = locate() in contents //check for existing blood splatter
if(!B) B = new /obj/effect/decal/cleanable/blood(src) //make a bloood splatter if we couldn't find one
if(!B)
blood_splatter(src,M.get_blood(M.vessel),1)
B = locate(/obj/effect/decal/cleanable/blood) in contents
B.add_blood_list(M)
return 1 //we bloodied the floor

Expand Down Expand Up @@ -366,7 +368,9 @@ var/list/blood_splatter_icons = list()
if(istype(src, /turf/simulated))
if(check_dna_integrity(M)) //mobs with dna = (monkeys + humans at time of writing)
var/obj/effect/decal/cleanable/blood/B = locate() in contents
if(!B) B = new(src)
if(!B)
blood_splatter(src,M,1)
B = locate(/obj/effect/decal/cleanable/blood) in contents
B.blood_DNA[M.dna.unique_enzymes] = M.dna.blood_type
else if(istype(M, /mob/living/carbon/alien))
var/obj/effect/decal/cleanable/xenoblood/B = locate() in contents
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/bots/cleanbot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ text("<A href='?src=\ref[src];power=1'>[on ? "On" : "Off"]</A>"))
target_types += /obj/effect/decal/cleanable/xenoblood/xgibs
target_types += /obj/effect/decal/cleanable/blood/
target_types += /obj/effect/decal/cleanable/blood/gibs/
target_types += /obj/effect/decal/cleanable/blood/drip/
target_types += /obj/effect/decal/cleanable/trail_holder

/obj/machinery/bot/cleanbot/proc/clean(var/obj/effect/decal/cleanable/target)
Expand Down
6 changes: 0 additions & 6 deletions code/game/machinery/computer/HolodeckControl.dm
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,6 @@
for(var/item in holographic_items)
derez(item)

for(var/obj/effect/decal/cleanable/blood/B in linkedholodeck)
qdel(B)

for(var/mob/living/simple_animal/hostile/carp/C in linkedholodeck)
qdel(C)

holographic_items = A.copy_contents_to(linkedholodeck , 1)

if(emagged)
Expand Down
164 changes: 164 additions & 0 deletions code/game/machinery/iv_drip.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
/obj/machinery/iv_drip
name = "\improper IV drip"
icon = 'icons/obj/iv_drip.dmi'
anchored = 0
density = 1


/obj/machinery/iv_drip/var/mob/living/carbon/human/attached = null
/obj/machinery/iv_drip/var/mode = 1 // 1 is injecting, 0 is taking blood.
/obj/machinery/iv_drip/var/obj/item/weapon/reagent_containers/beaker = null

/obj/machinery/iv_drip/update_icon()
if(src.attached)
icon_state = "hooked"
else
icon_state = ""

overlays = null

if(beaker)
var/datum/reagents/reagents = beaker.reagents
if(reagents.total_volume)
var/image/filling = image('icons/obj/iv_drip.dmi', src, "reagent")

var/percent = round((reagents.total_volume / beaker.volume) * 100)
switch(percent)
if(0 to 9) filling.icon_state = "reagent0"
if(10 to 24) filling.icon_state = "reagent10"
if(25 to 49) filling.icon_state = "reagent25"
if(50 to 74) filling.icon_state = "reagent50"
if(75 to 79) filling.icon_state = "reagent75"
if(80 to 90) filling.icon_state = "reagent80"
if(91 to INFINITY) filling.icon_state = "reagent100"

filling.icon += mix_color_from_reagents(reagents.reagent_list)
overlays += filling

/obj/machinery/iv_drip/MouseDrop(over_object, src_location, over_location)
..()

if(attached)
visible_message("[src.attached] is detached from \the [src]")
src.attached = null
src.update_icon()
return

if(in_range(src, usr) && ishuman(over_object) && get_dist(over_object, src) <= 1)
visible_message("[usr] attaches \the [src] to \the [over_object].")
src.attached = over_object
src.update_icon()


/obj/machinery/iv_drip/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/reagent_containers))
if(!isnull(src.beaker))
user << "There is already a reagent container loaded!"
return

user.drop_item()
W.loc = src
src.beaker = W
user << "You attach \the [W] to \the [src]."
src.update_icon()
return
else
return ..()


/obj/machinery/iv_drip/process()
set background = 1

if(src.attached)

if(!(get_dist(src, src.attached) <= 1 && isturf(src.attached.loc)))
attached << ("<span class='warning'>The IV drip needle is ripped out of you, doesn't that hurt?</span")
src.attached:apply_damage(3, BRUTE, pick("r_arm", "l_arm"))
src.attached = null
src.update_icon()
return

if(src.attached && src.beaker)
// Give blood
if(mode)
if(src.beaker.volume > 0)
var/transfer_amount = REAGENTS_METABOLISM
if(istype(src.beaker, /obj/item/weapon/reagent_containers/blood))
// speed up transfer on blood packs
transfer_amount = 4
src.beaker.reagents.trans_to(src.attached, transfer_amount)
update_icon()

// Take blood
else
var/amount = beaker.reagents.maximum_volume - beaker.reagents.total_volume
amount = min(amount, 4)
// If the beaker is full, ping
if(amount == 0)
if(prob(5)) visible_message("\The [src] pings.")
return

var/mob/living/carbon/human/T = attached

if(!istype(T)) return
if(!T.dna)
return
if(NOCLONE in T.mutations)
return

if(NOBLOOD in T.dna.species.specflags)
return

// If the human is losing too much blood, beep.
if(T.vessel.get_reagent_amount("blood") < BLOOD_VOLUME_SAFE) if(prob(5))
visible_message("\The [src] beeps loudly.")
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1)
var/datum/reagent/B = T.take_blood(beaker,amount)

if (B)
beaker.reagents.reagent_list |= B
beaker.reagents.update_total()
beaker.on_reagent_change()
beaker.reagents.handle_reactions()
update_icon()

/obj/machinery/iv_drip/attack_hand(mob/user as mob)
if(src.beaker)
src.beaker.loc = get_turf(src)
src.beaker = null
update_icon()
else
toggle_mode()


/obj/machinery/iv_drip/verb/toggle_mode()
set category = "Object"
set name = "Toggle Mode"
set src in view(1)

if(!istype(usr, /mob/living))
usr << "<span class='notice'>You can't do that.</span>"
return

if(usr.stat)
return

mode = !mode
usr << "The IV drip is now [mode ? "injecting" : "taking blood"]."

/obj/machinery/iv_drip/examine()
set src in view()
..()
if (!(usr in view(2)) && usr!=src.loc) return

usr << "The IV drip is [mode ? "injecting" : "taking blood"]."

if(beaker)
if(beaker.reagents && beaker.reagents.reagent_list.len)
usr << "<span class='notice'>Attached is \a [beaker] with [beaker.reagents.total_volume] units of liquid.</span"
else
usr << "<span class='notice'>Attached is an empty [beaker].</span"
else
usr << "<span class='notice'>No chemicals are attached.</span"

usr << "<span class='notice'>[attached ? attached : "No one"] is attached.</span"
2 changes: 1 addition & 1 deletion code/game/machinery/vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@
icon_deny = "med-deny"
product_ads = "Go save some lives!;The best stuff for your medbay.;Only the finest tools.;Natural chemicals!;This stuff saves lives.;Don't you want some?;Ping!"
req_access_txt = "5"
products = list(/obj/item/weapon/reagent_containers/syringe = 12,/obj/item/weapon/reagent_containers/pill/patch/styptic = 10,
products = list(/obj/item/weapon/reagent_containers/syringe = 12,/obj/item/stack/medical/gauze = 8,/obj/item/weapon/reagent_containers/pill/patch/styptic = 10,
/obj/item/weapon/reagent_containers/pill/patch/silver_sulf = 10,/obj/item/weapon/reagent_containers/glass/bottle/charcoal = 4,
/obj/item/weapon/reagent_containers/glass/bottle/epinephrine = 4,/obj/item/weapon/reagent_containers/glass/bottle/morphine = 4,
/obj/item/weapon/reagent_containers/glass/bottle/diphenhydramine = 4,/obj/item/weapon/reagent_containers/glass/bottle/potass_iodide = 3, /obj/item/weapon/reagent_containers/glass/bottle/salglu_solution = 5,/obj/item/weapon/reagent_containers/glass/bottle/atropine = 3,/obj/item/weapon/reagent_containers/syringe/antiviral = 6,/obj/item/weapon/reagent_containers/syringe/calomel = 10,/obj/item/weapon/reagent_containers/pill/salbutamol = 10,/obj/item/weapon/reagent_containers/pill/mannitol = 10,/obj/item/weapon/reagent_containers/pill/mutadone = 5,/obj/item/device/healthanalyzer = 4, /obj/item/device/sensor_device = 2)
Expand Down
34 changes: 22 additions & 12 deletions code/game/objects/effects/decals/Cleanable/humans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

/obj/effect/decal/cleanable/blood/New()
..()
remove_ex_blood()

/obj/effect/decal/cleanable/blood/proc/remove_ex_blood() //removes existant blood on the turf
if(src.loc && isturf(src.loc))
for(var/obj/effect/decal/cleanable/blood/B in src.loc)
if(B != src)
qdel(B)
if(src.type == /obj/effect/decal/cleanable/blood)
if(src.loc && isturf(src.loc))
for(var/obj/effect/decal/cleanable/blood/B in src.loc)
if(B != src)
if (B.blood_DNA)
blood_DNA |= B.blood_DNA.Copy()
qdel(B)

/obj/effect/decal/cleanable/blood/splatter
random_icon_states = list("gibbl1", "gibbl2", "gibbl3", "gibbl4", "gibbl5")
Expand Down Expand Up @@ -61,9 +61,6 @@
/obj/effect/decal/cleanable/blood/gibs/ex_act(severity, target)
return

/obj/effect/decal/cleanable/blood/gibs/remove_ex_blood()
return

/obj/effect/decal/cleanable/blood/gibs/up
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6","gibup1","gibup1","gibup1")

Expand Down Expand Up @@ -91,6 +88,19 @@
var/datum/disease/ND = D.Copy(1)
b.viruses += ND
ND.holder = b

if (step_to(src, get_step(src, direction), 0))
break
break

/obj/effect/decal/cleanable/blood/drip
name = "drips of blood"
desc = "It's red."
gender = PLURAL
icon = 'icons/effects/drip.dmi'
icon_state = "1"
random_icon_states = list("1","2","3","4","5")
var/list/drips = list()

/obj/effect/decal/cleanable/blood/drip/New()
..()
spawn(1)
drips |= icon_state
20 changes: 19 additions & 1 deletion code/game/objects/items/devices/scanners.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ MASS SPECTROMETER

// Damage descriptions

user.show_message(text("<span class='notice'>[] | [] | [] | []</span>", oxy_loss > 50 ? "<span class='warning'> Severe oxygen deprivation detected</span>" : "<span class='info'>Subject bloodstream oxygen level normal</span>", tox_loss > 50 ? "<span class='warning'> Dangerous amount of toxins detected</span>" : "<span class='info'>Subject bloodstream toxin level minimal</span>", fire_loss > 50 ? "<span class='warning'> Severe burn damage detected</span>" : "<span class='info'>Subject burn injury status O.K</span>", brute_loss > 50 ? "<span class='warning'> Severe anatomical damage detected</span>" : "<span class='info'>Subject brute-force injury status O.K</span>"), 1)
user.show_message(text("<span class='notice'>[] | [] | [] | []</span>", oxy_loss > 50 ? "<span class='warning'> Severe oxygen deprivation detected</span>" : "<span class='info'>Subject bloodstream oxygen level normal</span>", tox_loss > 50 ? "<span class='warning'> Dangerous amount of toxins detected</span>" : "<span class='info'>Subject bloodstream toxin level minimal</span>", fire_loss > 50 ? "<span class='warning'> Severe burn damage detected</span>" : "<span class='info'>Subject burn injury status O.K</span>", brute_loss > 50 ? "<span class='warning'> Severe tissue damage detected</span>" : "<span class='info'>Subject brute-force injury status O.K</span>"), 1)

if(M.getStaminaLoss())
user.show_message("<span class='info'>Subject appears to be suffering from fatigue.</span>", 1)
Expand All @@ -160,6 +160,24 @@ MASS SPECTROMETER
else if (M.getBrainLoss() >= 10)
user.show_message("<span class='warning'>Significant brain damage detected. Subject may have had a concussion.</span>", 1)

// Blood Level
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.vessel)
if(H.blood_max)
user.show_message("<span class='danger'>Subject is bleeding!</span>")
var/blood_volume = round(H.vessel.get_reagent_amount("blood"))
var/blood_percent = blood_volume / 560
var/blood_type = H.dna.blood_type
blood_percent *= 100
if(blood_volume <= 500 && blood_volume > 336)
user.show_message("<span class='danger'>Warning: Blood Level LOW: [blood_percent]% [blood_volume]cl.</span> <span class='notice'>Type: [blood_type]</span>")
else if(blood_volume <= 336)
user.show_message("<span class='danger'>Warning: Blood Level CRITICAL: [blood_percent]% [blood_volume]cl.</span> <span class='notice'>Type: [blood_type]</span>")
else
user.show_message("<span class='notice'>Blood Level Normal: [blood_percent]% [blood_volume]cl. Type: [blood_type]</span>")


/obj/item/device/healthanalyzer/verb/toggle_mode()
set name = "Switch Verbosity"
set category = "Object"
Expand Down
Loading

0 comments on commit 80913f1

Please sign in to comment.