Skip to content

Commit

Permalink
* Fixes warnings related to add_reagent when trying to inject blood c…
Browse files Browse the repository at this point in the history
…ontaining reagents

* Fixes sleepers showing reagent id instead of name
* Some formatting adjustments to the mass spectrometer output

* Make the "Saline-Glucose Solution" name fit in one line.
  • Loading branch information
Menshin committed Feb 7, 2015
1 parent b936324 commit e154d69
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
6 changes: 3 additions & 3 deletions code/game/machinery/Sleeper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
var/dat
dat += "<h3>Injector</h3>"
if(occupant)
dat += "<A href='?src=\ref[src];inject=epinephrine'>Inject epinephrine</A>"
dat += "<A href='?src=\ref[src];inject=epinephrine'>Inject Epinephrine</A>"
else
dat += "<span class='linkOff'>Inject Epinephrine</span>"
if(occupant && occupant.health > min_health)
Expand Down Expand Up @@ -168,7 +168,7 @@
dat += "<div class='line'><span class='average'>Significant brain damage detected.</span></div>"
if(occupant.reagents.reagent_list.len)
for(var/datum/reagent/R in occupant.reagents.reagent_list)
dat += text("<div class='line'><div class='statusLabel'>[R.name]:</div><div class='statusValue'>[] units</div></div>", round(R.volume, 0.1))
dat += "<div class='line'><div style='width: 170px;' class='statusLabel'>[R.name]:</div><div class='statusValue'>[round(R.volume, 0.1)] units</div></div>"
dat += "</div>"

var/datum/browser/popup = new(user, "sleeper", "Sleeper Console", 520, 540) //Set up the popup browser window
Expand Down Expand Up @@ -221,7 +221,7 @@
if(occupant.reagents.get_reagent_amount(chem) + 10 <= 20 * efficiency)
occupant.reagents.add_reagent(chem, 10)
var/units = round(occupant.reagents.get_reagent_amount(chem))
user << "<span class='notice'>Occupant now has [units] unit\s of [chem] in their bloodstream.</span>"
user << "<span class='notice'>Occupant now has [units] unit\s of [chemical_reagents_list[chem]] in their bloodstream.</span>"

/obj/machinery/sleeper/update_icon()
if(state_open)
Expand Down
35 changes: 20 additions & 15 deletions code/game/objects/items/devices/scanners.dm
Original file line number Diff line number Diff line change
Expand Up @@ -306,22 +306,27 @@ MASS SPECTROMETER
else
blood_traces = params2list(R.data["trace_chem"])
break
var/dat = "Trace Chemicals Found: "
for(var/R in blood_traces)
if(prob(reliability))
if(details)
dat += "[R] ([blood_traces[R]] units) "
else
dat += "[R] "
recent_fail = 0
else
if(recent_fail)
crit_fail = 1
reagents.clear_reagents()
return
var/dat = "<i><b>Trace Chemicals Found:</b>"
if(!blood_traces.len)
dat += "<br>None"
else
for(var/R in blood_traces)
if(prob(reliability))
dat += "<br>[chemical_reagents_list[R]]"

if(details)
dat += " ([blood_traces[R]] units)"

recent_fail = 0
else
recent_fail = 1
user << "[dat]"
if(recent_fail)
crit_fail = 1
reagents.clear_reagents()
return
else
recent_fail = 1
dat += "</i>"
user << dat
reagents.clear_reagents()
return

Expand Down
5 changes: 2 additions & 3 deletions code/modules/mob/living/carbon/human/blood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
B.data["resistances"] = src.resistances.Copy()
var/list/temp_chem = list()
for(var/datum/reagent/R in src.reagents.reagent_list)
temp_chem += R.name
temp_chem[R.name] = R.volume
temp_chem[R.id] = R.volume
B.data["trace_chem"] = list2params(temp_chem)
if(mind)
B.data["mind"] = src.mind
Expand Down Expand Up @@ -206,7 +205,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122

container.reagents.remove_reagent("blood", amount)

//Transfers blood from container to vessels, respecting blood types compatability.
//Transfers blood from container to vessels, respecting blood types compatibility.
/mob/living/carbon/human/inject_blood(obj/item/weapon/reagent_containers/container, var/amount)

var/datum/reagent/blood/injected = get_blood(container.reagents)
Expand Down

0 comments on commit e154d69

Please sign in to comment.