Printing Fixes (#1476)

Refactors machines to use /obj/machinery/proc/print() to print things to reduce redundant code.
Fixes #1433.
Fixes #1454.
This commit is contained in:
Lohikar
2017-01-09 00:44:42 +02:00
committed by skull132
parent b96f954762
commit 465b982eeb
29 changed files with 299 additions and 253 deletions
+2
View File
@@ -418,4 +418,6 @@ proc/TextPreview(var/string,var/len=40)
t = replacetext(t, "\[row\]", "</td><tr>")
t = replacetext(t, "\[cell\]", "<td>")
t = replacetext(t, "\[logo\]", "<img src = ntlogo.png>")
t = replacetext(t, "\[time\]", "[worldtime2text()]")
t = replacetext(t, "\[date\]", "[worlddate2text()]")
return t
+1 -2
View File
@@ -74,8 +74,7 @@
if(paper_spawn_loc)
// Create and pass on the bomb code paper.
var/obj/item/weapon/paper/P = new(paper_spawn_loc)
P.info = "The nuclear authorization code is: <b>[code]</b>"
P.name = "nuclear bomb code"
P.set_content_unsafe("nuclear bomb code", "The nuclear authorization code is: <b>[code]</b>")
if(leader && leader.current)
if(get_turf(P) == get_turf(leader.current) && !(leader.current.l_hand && leader.current.r_hand))
leader.current.put_in_hands(P)
@@ -30,8 +30,8 @@
if( !cracked && istype(target,/mob/living/carbon/human) && (target.stat == CONSCIOUS) && !target.get_active_hand() )
target.visible_message("<span class='notice'>[user] and [target] pop \an [src]! *pop*</span>", "<span class='notice'>You pull \an [src] with [target]! *pop*</span>", "<span class='notice'>You hear a *pop*.</span>")
var/obj/item/weapon/paper/Joke = new /obj/item/weapon/paper(user.loc)
Joke.name = "[pick("awful","terrible","unfunny")] joke"
Joke.info = pick("What did one snowman say to the other?\n\n<i>'Is it me or can you smell carrots?'</i>",
var/title = "[pick("awful","terrible","unfunny")] joke"
var/content = pick("What did one snowman say to the other?\n\n<i>'Is it me or can you smell carrots?'</i>",
"Why couldn't the snowman get laid?\n\n<i>He was frigid!</i>",
"Where are santa's helpers educated?\n\n<i>Nowhere, they're ELF-taught.</i>",
"What happened to the man who stole advent calanders?\n\n<i>He got 25 days.</i>",
@@ -40,7 +40,8 @@
"What do you get from eating tree decorations?\n\n<i>Tinsilitis!</i>",
"What do snowmen wear on their heads?\n\n<i>Ice caps!</i>",
"Why is Christmas just like life on ss13?\n\n<i>You do all the work and the fat guy gets all the credit.</i>",
"Why doesnt Santa have any children?\n\n<i>Because he only comes down the chimney.</i>")
"Why doesnt Santa have any children?\n\n<i>Because he only comes down the chimney.</i>")
Joke.set_content_unsafe(title, content)
new /obj/item/clothing/head/festive(target.loc)
user.update_icons()
cracked = 1
+1 -2
View File
@@ -300,8 +300,7 @@
usr << "\icon[src]<span class='warning'>The body scanner cannot scan that lifeform.</span>"
return
var/obj/item/weapon/paper/R = new(src.loc)
R.name = "Scan ([occupant])"
R.info = format_occupant_data(src.connected.get_occupant_data())
R.set_content_unsafe("Scan ([occupant])", format_occupant_data(src.connected.get_occupant_data()))
/obj/machinery/bodyscanner/proc/get_occupant_data()
+1 -2
View File
@@ -165,8 +165,7 @@
//usr << "Printing the log, standby..."
//sleep(50)
var/obj/item/weapon/paper/P = new/obj/item/weapon/paper( loc )
P.name = "activity log"
P.info = dat
P.set_content_unsafe("activity log", dat)
if ("issue")
if (giver)
+27 -27
View File
@@ -493,33 +493,33 @@
src.screen = 4
if (href_list["print_p"])
if (!( src.printing ))
src.printing = 1
var/datum/data/record/record1 = null
var/datum/data/record/record2 = null
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
record1 = active1
if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
record2 = active2
sleep(50)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.loc )
P.info = "<CENTER><B>Medical Record</B></CENTER><BR>"
if (record1)
P.info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", record1.fields["name"], record1.fields["id"], record1.fields["sex"], record1.fields["age"], record1.fields["fingerprint"], record1.fields["p_stat"], record1.fields["m_stat"])
P.name = text("Medical Record ([])", record1.fields["name"])
else
P.info += "<B>General Record Lost!</B><BR>"
P.name = "Medical Record"
if (record2)
P.info += text("<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: []<BR>\nDNA: []<BR>\n<BR>\nMinor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nMajor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nAllergies: []<BR>\nDetails: []<BR>\n<BR>\nCurrent Diseases: [] (per disease info placed in log/comment section)<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", record2.fields["b_type"], record2.fields["b_dna"], record2.fields["mi_dis"], record2.fields["mi_dis_d"], record2.fields["ma_dis"], record2.fields["ma_dis_d"], record2.fields["alg"], record2.fields["alg_d"], record2.fields["cdi"], record2.fields["cdi_d"], decode(record2.fields["notes"]))
var/counter = 1
while(record2.fields[text("com_[]", counter)])
P.info += text("[]<BR>", record2.fields[text("com_[]", counter)])
counter++
else
P.info += "<B>Medical Record Lost!</B><BR>"
P.info += "</TT>"
src.printing = null
var/datum/data/record/record1 = null
var/datum/data/record/record2 = null
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
record1 = active1
if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
record2 = active2
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper()
var/info = "<CENTER><B>Medical Record</B></CENTER><BR>"
var/rname
if (record1)
info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", record1.fields["name"], record1.fields["id"], record1.fields["sex"], record1.fields["age"], record1.fields["fingerprint"], record1.fields["p_stat"], record1.fields["m_stat"])
rname = text("Medical Record ([])", record1.fields["name"])
else
info += "<B>General Record Lost!</B><BR>"
rname = "Medical Record"
if (record2)
info += text("<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: []<BR>\nDNA: []<BR>\n<BR>\nMinor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nMajor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nAllergies: []<BR>\nDetails: []<BR>\n<BR>\nCurrent Diseases: [] (per disease info placed in log/comment section)<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", record2.fields["b_type"], record2.fields["b_dna"], record2.fields["mi_dis"], record2.fields["mi_dis_d"], record2.fields["ma_dis"], record2.fields["ma_dis_d"], record2.fields["alg"], record2.fields["alg_d"], record2.fields["cdi"], record2.fields["cdi_d"], decode(record2.fields["notes"]))
var/counter = 1
while(record2.fields[text("com_[]", counter)])
info += text("[]<BR>", record2.fields[text("com_[]", counter)])
counter++
else
info += "<B>Medical Record Lost!</B><BR>"
info += "</TT>"
P.set_content_unsafe(rname, info)
print(P)
src.add_fingerprint(usr)
src.updateUsrDialog()
+29 -28
View File
@@ -364,34 +364,35 @@ What a mess.*/
screen = 3 */
if ("Print Record")
if (!( printing ))
printing = 1
var/datum/data/record/record1 = null
var/datum/data/record/record2 = null
if ((istype(active1, /datum/data/record) && data_core.general.Find(active1)))
record1 = active1
if ((istype(active2, /datum/data/record) && data_core.security.Find(active2)))
record2 = active2
sleep(50)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( loc )
P.info = "<CENTER><B>Security Record</B></CENTER><BR>"
if (record1)
P.info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", record1.fields["name"], record1.fields["id"], record1.fields["sex"], record1.fields["age"], record1.fields["fingerprint"], record1.fields["p_stat"], record1.fields["m_stat"])
P.name = text("Security Record ([])", record1.fields["name"])
else
P.info += "<B>General Record Lost!</B><BR>"
P.name = "Security Record"
if (record2)
P.info += text("<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: []<BR>\n<BR>\nMinor Crimes: []<BR>\nDetails: []<BR>\n<BR>\nMajor Crimes: []<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", record2.fields["criminal"], record2.fields["mi_crim"], record2.fields["mi_crim_d"], record2.fields["ma_crim"], record2.fields["ma_crim_d"], decode(record2.fields["notes"]))
var/counter = 1
while(record2.fields[text("com_[]", counter)])
P.info += text("[]<BR>", record2.fields[text("com_[]", counter)])
counter++
else
P.info += "<B>Security Record Lost!</B><BR>"
P.info += "</TT>"
printing = null
updateUsrDialog()
var/datum/data/record/record1 = null
var/datum/data/record/record2 = null
if ((istype(active1, /datum/data/record) && data_core.general.Find(active1)))
record1 = active1
if ((istype(active2, /datum/data/record) && data_core.security.Find(active2)))
record2 = active2
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper()
var/info = ""
var/pname
P.info = "<CENTER><B>Security Record</B></CENTER><BR>"
if (record1)
info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", record1.fields["name"], record1.fields["id"], record1.fields["sex"], record1.fields["age"], record1.fields["fingerprint"], record1.fields["p_stat"], record1.fields["m_stat"])
pname = text("Security Record ([])", record1.fields["name"])
else
info += "<B>General Record Lost!</B><BR>"
pname = "Security Record"
if (record2)
info += text("<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: []<BR>\n<BR>\nMinor Crimes: []<BR>\nDetails: []<BR>\n<BR>\nMajor Crimes: []<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", record2.fields["criminal"], record2.fields["mi_crim"], record2.fields["mi_crim_d"], record2.fields["ma_crim"], record2.fields["ma_crim_d"], decode(record2.fields["notes"]))
var/counter = 1
while(record2.fields[text("com_[]", counter)])
info += text("[]<BR>", record2.fields[text("com_[]", counter)])
counter++
else
info += "<B>Security Record Lost!</B><BR>"
info += "</TT>"
P.set_content_unsafe(pname, info)
updateUsrDialog()
print(P)
//RECORD DELETE
if ("Delete All Records")
temp = ""
+15 -16
View File
@@ -307,22 +307,21 @@ What a mess.*/
screen = 3 */
if ("Print Record")
if (!( printing ))
printing = 1
sleep(50)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( loc )
P.info = "<CENTER><B>Employment Record</B></CENTER><BR>"
if ((istype(active1, /datum/data/record) && data_core.general.Find(active1)))
P.info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>\nEmployment/Skills Summary:<BR>\n[]<BR><br>CCIA Actions / Records: <br>This terminal is not authorized to print CCIA records and/or notes", active1.fields["name"], active1.fields["id"], active1.fields["sex"], active1.fields["age"], active1.fields["fingerprint"], active1.fields["p_stat"], active1.fields["m_stat"], decode(active1.fields["notes"]))
else
P.info += "<B>General Record Lost!</B><BR>"
P.info += "</TT>"
if(active1)
P.name = "Employment Record ([active1.fields["name"]])"
else
P.name = "Employment Record (Unknown/Invald Entry)"
log_debug("[usr] ([usr.ckey]) attempted to print a null employee record, this should be investigated.")
printing = null
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper()
var/info = "<CENTER><B>Employment Record</B></CENTER><BR>"
var/pname
if ((istype(active1, /datum/data/record) && data_core.general.Find(active1)))
info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>\nEmployment/Skills Summary:<BR>\n[]<BR><br>CCIA Actions / Records: <br>This terminal is not authorized to print CCIA records and/or notes", active1.fields["name"], active1.fields["id"], active1.fields["sex"], active1.fields["age"], active1.fields["fingerprint"], active1.fields["p_stat"], active1.fields["m_stat"], decode(active1.fields["notes"]))
else
info += "<B>General Record Lost!</B><BR>"
info += "</TT>"
if(active1)
pname = "Employment Record ([active1.fields["name"]])"
else
pname = "Employment Record (Unknown/Invald Entry)"
log_debug("[usr] ([usr.ckey]) attempted to print a null employee record, this should be investigated.")
P.set_content_unsafe(pname, info)
print(P)
//RECORD DELETE
if ("Delete All Records")
temp = ""
+5 -3
View File
@@ -370,16 +370,18 @@ Class Procs:
qdel(src)
return 1
/obj/machinery/proc/print( var/obj/paper )
/obj/machinery/proc/print(var/obj/paper, var/play_sound = 1, var/print_sfx = 'sound/items/polaroid1.ogg', var/print_delay = 10)
if( printing )
return 0
printing = 1
playsound(src.loc, 'sound/items/poster_being_created.ogg', 50, 1)
if (play_sound)
playsound(src.loc, print_sfx, 50, 1)
visible_message("<span class='notice'>[src] rattles to life and spits out a paper titled [paper].</span>")
spawn(40)
spawn(print_delay)
paper.loc = src.loc
printing = 0
+1 -2
View File
@@ -73,8 +73,7 @@ obj/machinery/scanner/attack_hand(mob/living/carbon/human/user)
user << "<span class='notice'>You feel a sting as the scanner extracts some of your blood.</span>"
var/turf/T = get_step(src,outputdir)
var/obj/item/weapon/paper/print = new(T)
print.name = "[mname] Report"
print.info = text
print.set_content_unsafe("[mname] Report", text)
print.stamped = 1
for(var/datum/data/record/test in data_core.general)
+10 -13
View File
@@ -275,17 +275,14 @@ var/list/obj/machinery/requests_console/allConsoles = list()
var/id = query.item[1]
var/name = query.item[2]
var/data = query.item[3]
var/obj/item/weapon/paper/C = new(src.loc)
var/obj/item/weapon/paper/C = new()
//Let's start the BB >> HTML conversion!
data = html_encode(data)
data = replacetext(data, "\n", "<BR>")
C.set_content("NFC-[id] - [name]", data)
print(C)
C.info += data
C.info = C.parsepencode(C.info)
C.updateinfolinks()
C.name = "NFC-[id] - [name]"
paperstock--
// Get extra information about the form.
@@ -399,14 +396,14 @@ var/list/obj/machinery/requests_console/allConsoles = list()
if(!sent)
sent = 1
var/obj/item/weapon/paper/C = O
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(Console.loc)
P.info = "<font color = #101010>"
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper()
var/info = "<font color = #101010>"
var/copied = html_decode(C.info)
copied = replacetext(copied, "<font face=\"[P.deffont]\" color=", "<font face=\"[P.deffont]\" nocolor=") //state of the art techniques in action
copied = replacetext(copied, "<font face=\"[P.crayonfont]\" color=", "<font face=\"[P.crayonfont]\" nocolor=") //This basically just breaks the existing color tag, which we need to do because the innermost tag takes priority.
P.info += copied
P.info += "</font>"
P.name = C.name
info += copied
info += "</font>"
var/pname = C.name
P.fields = C.fields
P.stamps = C.stamps
P.stamped = C.stamped
@@ -425,8 +422,8 @@ var/list/obj/machinery/requests_console/allConsoles = list()
img.pixel_x = C.offset_x[j]
img.pixel_y = C.offset_y[j]
P.overlays += img
P.updateinfolinks()
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
P.set_content_unsafe(pname, info)
Console.print(P, 0, 'sound/machines/twobeep.ogg')
for (var/mob/player in hearers(4, Console.loc))
player.show_message(text("\icon[Console] *The Requests Console beeps: 'Fax received'"))
Console.paperstock--
+2 -3
View File
@@ -556,9 +556,8 @@
nanomanager.update_uis(src)
/obj/machinery/vending/proc/stock(var/datum/data/vending_product/R, var/mob/user)
if(src.panel_open)
user << "<span class='notice'>You insert \the [src] in the product receptor.</span>"
R.amount++
user << "<span class='notice'>You insert \the [src] in the product receptor.</span>"
R.amount++
nanomanager.update_uis(src)
+3 -3
View File
@@ -201,9 +201,9 @@
dat += "[line]<br>"
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src)
P.name = "[firstLine]"
P.info = "[dat]"
P.update_icon()
var/pname = "[firstLine]"
var/info = "[dat]"
P.set_content_unsafe(pname, info)
P.loc = get_turf(src.loc)
return
@@ -102,8 +102,9 @@
src.visible_message("<span class='notice'>\icon[src] makes an insistent chime.</span>", 2)
update_icon()
if(bloodsamp)
var/obj/item/weapon/paper/P = new(src)
P.name = "[src] report #[++report_num]: [bloodsamp.name]"
var/obj/item/weapon/paper/P = new()
var/pname = "[src] report #[++report_num]: [bloodsamp.name]"
var/info
P.stamped = list(/obj/item/weapon/stamp)
P.overlays = list("paper_stamped")
//dna data itself
@@ -114,10 +115,10 @@
data += "\blue Blood type: [bloodsamp.dna[blood]]<br>\nDNA: [blood]<br><br>"
else
data += "No DNA found.<br>"
P.info = "<b>[src] analysis report #[report_num]</b><br>"
P.info += "<b>Scanned item:</b><br>[bloodsamp.name]<br>[bloodsamp.desc]<br><br>" + data
P.forceMove(src.loc)
P.update_icon()
info = "<b>[src] analysis report #[report_num]</b><br>"
info += "<b>Scanned item:</b><br>[bloodsamp.name]<br>[bloodsamp.desc]<br><br>" + data
P.set_content_unsafe(pname, info)
print(P)
scanning = 0
update_icon()
return
@@ -36,7 +36,9 @@
return
user << "<span class='notice'>Printing findings now...</span>"
var/obj/item/weapon/paper/report = new(get_turf(src))
var/obj/item/weapon/paper/report = new()
var/pname
var/info
report.stamped = list(/obj/item/weapon/stamp)
report.overlays = list("paper_stamped")
report_num++
@@ -46,48 +48,50 @@
if(slide.has_swab)
var/obj/item/weapon/forensics/swab/swab = slide.has_swab
report.name = "GSR report #[++report_num]: [swab.name]"
report.info = "<b>Scanned item:</b><br>[swab.name]<br><br>"
pname = "GSR report #[++report_num]: [swab.name]"
info = "<b>Scanned item:</b><br>[swab.name]<br><br>"
if(swab.gsr)
report.info += "Residue from a [swab.gsr] bullet detected."
info += "Residue from a [swab.gsr] bullet detected."
else
report.info += "No gunpowder residue found."
info += "No gunpowder residue found."
else if(slide.has_sample)
var/obj/item/weapon/sample/fibers/fibers = slide.has_sample
report.name = "Fiber report #[++report_num]: [fibers.name]"
report.info = "<b>Scanned item:</b><br>[fibers.name]<br><br>"
pname = "Fiber report #[++report_num]: [fibers.name]"
info = "<b>Scanned item:</b><br>[fibers.name]<br><br>"
if(fibers.evidence)
report.info = "Molecular analysis on provided sample has determined the presence of unique fiber strings.<br><br>"
info = "Molecular analysis on provided sample has determined the presence of unique fiber strings.<br><br>"
for(var/fiber in fibers.evidence)
report.info += "<span class='notice'>Most likely match for fibers: [fiber]</span><br><br>"
info += "<span class='notice'>Most likely match for fibers: [fiber]</span><br><br>"
else
report.info += "No fibers found."
info += "No fibers found."
else
report.name = "Empty slide report #[report_num]"
report.info = "Evidence suggests that there's nothing in this slide."
pname = "Empty slide report #[report_num]"
info = "Evidence suggests that there's nothing in this slide."
else if(istype(sample, /obj/item/weapon/sample/print))
report.name = "Fingerprint report #[report_num]: [sample.name]"
report.info = "<b>Fingerprint analysis report #[report_num]</b>: [sample.name]<br>"
pname = "Fingerprint report #[report_num]: [sample.name]"
info = "<b>Fingerprint analysis report #[report_num]</b>: [sample.name]<br>"
var/obj/item/weapon/sample/print/card = sample
if(card.evidence && card.evidence.len)
report.info += "Surface analysis has determined unique fingerprint strings:<br><br>"
info += "Surface analysis has determined unique fingerprint strings:<br><br>"
for(var/prints in card.evidence)
report.info += "<span class='notice'>Fingerprint string: </span>"
info += "<span class='notice'>Fingerprint string: </span>"
if(!is_complete_print(prints))
report.info += "INCOMPLETE PRINT"
info += "INCOMPLETE PRINT"
else
report.info += "[prints]"
report.info += "<br>"
info += "[prints]"
info += "<br>"
else
report.info += "No information available."
info += "No information available."
report.set_content_unsafe(pname, info)
if(report)
report.update_icon()
if(report.info)
user << report.info
return
print(report)
/obj/machinery/microscope/proc/remove_sample(var/mob/living/remover)
if(!istype(remover) || remover.incapacitated() || !Adjacent(remover))
+38 -33
View File
@@ -348,14 +348,15 @@ log transactions
usr << "\icon[src]<span class='warning'>You don't have enough funds to do that!</span>"
if("balance_statement")
if(authenticated_account)
var/obj/item/weapon/paper/R = new(src.loc)
R.name = "Account balance: [authenticated_account.owner_name]"
R.info = "<b>NT Automated Teller Account Statement</b><br><br>"
R.info += "<i>Account holder:</i> [authenticated_account.owner_name]<br>"
R.info += "<i>Account number:</i> [authenticated_account.account_number]<br>"
R.info += "<i>Balance:</i> $[authenticated_account.money]<br>"
R.info += "<i>Date and time:</i> [worldtime2text()], [current_date_string]<br><br>"
R.info += "<i>Service terminal ID:</i> [machine_id]<br>"
var/obj/item/weapon/paper/R = new()
var/pname = "Account balance: [authenticated_account.owner_name]"
var/info = "<b>NT Automated Teller Account Statement</b><br><br>"
info += "<i>Account holder:</i> [authenticated_account.owner_name]<br>"
info += "<i>Account number:</i> [authenticated_account.account_number]<br>"
info += "<i>Balance:</i> $[authenticated_account.money]<br>"
info += "<i>Date and time:</i> [worldtime2text()], [current_date_string]<br><br>"
info += "<i>Service terminal ID:</i> [machine_id]<br>"
R.set_content_unsafe(pname, info)
//stamp the paper
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
@@ -365,6 +366,7 @@ log transactions
R.stamped += /obj/item/weapon/stamp
R.overlays += stampoverlay
R.stamps += "<HR><i>This paper has been stamped by the Automatic Teller Machine.</i>"
print(R)
release_held_id(usr) // printing ends the ATM session similar to real life + prevents spam
@@ -374,32 +376,34 @@ log transactions
playsound(loc, 'sound/items/polaroid2.ogg', 50, 1)
if ("print_transaction")
if(authenticated_account)
var/obj/item/weapon/paper/R = new(src.loc)
R.name = "Transaction logs: [authenticated_account.owner_name]"
R.info = "<b>Transaction logs</b><br>"
R.info += "<i>Account holder:</i> [authenticated_account.owner_name]<br>"
R.info += "<i>Account number:</i> [authenticated_account.account_number]<br>"
R.info += "<i>Date and time:</i> [worldtime2text()], [current_date_string]<br><br>"
R.info += "<i>Service terminal ID:</i> [machine_id]<br>"
R.info += "<table border=1 style='width:100%'>"
R.info += "<tr>"
R.info += "<td><b>Date</b></td>"
R.info += "<td><b>Time</b></td>"
R.info += "<td><b>Target</b></td>"
R.info += "<td><b>Purpose</b></td>"
R.info += "<td><b>Value</b></td>"
R.info += "<td><b>Source terminal ID</b></td>"
R.info += "</tr>"
var/obj/item/weapon/paper/R = new()
var/pname = "Transaction logs: [authenticated_account.owner_name]"
var/info = "<b>Transaction logs</b><br>"
info += "<i>Account holder:</i> [authenticated_account.owner_name]<br>"
info += "<i>Account number:</i> [authenticated_account.account_number]<br>"
info += "<i>Date and time:</i> [worldtime2text()], [current_date_string]<br><br>"
info += "<i>Service terminal ID:</i> [machine_id]<br>"
info += "<table border=1 style='width:100%'>"
info += "<tr>"
info += "<td><b>Date</b></td>"
info += "<td><b>Time</b></td>"
info += "<td><b>Target</b></td>"
info += "<td><b>Purpose</b></td>"
info += "<td><b>Value</b></td>"
info += "<td><b>Source terminal ID</b></td>"
info += "</tr>"
for(var/datum/transaction/T in authenticated_account.transaction_log)
R.info += "<tr>"
R.info += "<td>[T.date]</td>"
R.info += "<td>[T.time]</td>"
R.info += "<td>[T.target_name]</td>"
R.info += "<td>[T.purpose]</td>"
R.info += "<td>$[T.amount]</td>"
R.info += "<td>[T.source_terminal]</td>"
R.info += "</tr>"
R.info += "</table>"
info += "<tr>"
info += "<td>[T.date]</td>"
info += "<td>[T.time]</td>"
info += "<td>[T.target_name]</td>"
info += "<td>[T.purpose]</td>"
info += "<td>$[T.amount]</td>"
info += "<td>[T.source_terminal]</td>"
info += "</tr>"
info += "</table>"
R.set_content_unsafe(pname, info)
//stamp the paper
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
@@ -409,6 +413,7 @@ log transactions
R.stamped += /obj/item/weapon/stamp
R.overlays += stampoverlay
R.stamps += "<HR><i>This paper has been stamped by the Automatic Teller Machine.</i>"
print(R)
if(prob(50))
playsound(loc, 'sound/items/polaroid1.ogg', 50, 1)
+11 -9
View File
@@ -51,15 +51,17 @@
var/obj/item/weapon/paper/R = new /obj/item/weapon/paper(P)
P.wrapped = R
R.name = "Account information: [M.owner_name]"
R.info = "<b>Account details (confidential)</b><br><hr><br>"
R.info += "<i>Account holder:</i> [M.owner_name]<br>"
R.info += "<i>Account number:</i> [M.account_number]<br>"
R.info += "<i>Account pin:</i> [M.remote_access_pin]<br>"
R.info += "<i>Starting balance:</i> $[M.money]<br>"
R.info += "<i>Date and time:</i> [worldtime2text()], [current_date_string]<br><br>"
R.info += "<i>Creation terminal ID:</i> [source_db.machine_id]<br>"
R.info += "<i>Authorised NT officer overseeing creation:</i> [source_db.held_card.registered_name]<br>"
var/pname = "Account information: [M.owner_name]"
var/info = "<b>Account details (confidential)</b><br><hr><br>"
info += "<i>Account holder:</i> [M.owner_name]<br>"
info += "<i>Account number:</i> [M.account_number]<br>"
info += "<i>Account pin:</i> [M.remote_access_pin]<br>"
info += "<i>Starting balance:</i> $[M.money]<br>"
info += "<i>Date and time:</i> [worldtime2text()], [current_date_string]<br><br>"
info += "<i>Creation terminal ID:</i> [source_db.machine_id]<br>"
info += "<i>Authorised NT officer overseeing creation:</i> [source_db.held_card.registered_name]<br>"
R.set_content_unsafe(pname, info)
//stamp the paper
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
+6 -5
View File
@@ -199,9 +199,10 @@
if("print")
var/text
var/obj/item/weapon/paper/P = new(loc)
var/obj/item/weapon/paper/P = new()
var/pname
if (detailed_account_view)
P.name = "account #[detailed_account_view.account_number] details"
pname = "account #[detailed_account_view.account_number] details"
var/title = "Account #[detailed_account_view.account_number] Details"
text = {"
[accounting_letterhead(title)]
@@ -239,7 +240,7 @@
"}
else
P.name = "financial account list"
pname = "financial account list"
text = {"
[accounting_letterhead("Financial Account List")]
@@ -271,7 +272,7 @@
</table>
"}
P.info = text
state("The terminal prints out a report.")
P.set_content_unsafe(pname, text)
print(P)
return 1
+5 -4
View File
@@ -64,10 +64,11 @@
/obj/item/device/eftpos/proc/print_reference()
var/obj/item/weapon/paper/R = new(src.loc)
R.name = "Reference: [eftpos_name]"
R.info = "<b>[eftpos_name] reference</b><br><br>"
R.info += "Access code: [access_code]<br><br>"
R.info += "<b>Do not lose or misplace this code.</b><br>"
var/pname = "Reference: [eftpos_name]"
var/info = "<b>[eftpos_name] reference</b><br><br>"
info += "Access code: [access_code]<br><br>"
info += "<b>Do not lose or misplace this code.</b><br>"
R.set_content_unsafe(pname, info)
//stamp the paper
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
+1 -2
View File
@@ -32,8 +32,7 @@
user << "There is no scan data to print."
return
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(get_turf(src))
P.name = "paper - [form_title]"
P.info = "[last_data]"
P.set_content_unsafe("paper - [form_title]", "[last_data]")
if(istype(user,/mob/living/carbon/human) && !(user.l_hand && user.r_hand))
user.put_in_hands(P)
user.visible_message("\The [src] spits out a piece of paper.")
+7 -6
View File
@@ -149,16 +149,17 @@
break
if(M)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src)
P.info = "<CENTER><B>Medical Record</B></CENTER><BR>"
P.info += "Name: [G.fields["name"]] ID: [G.fields["id"]]<BR>\nSex: [G.fields["sex"]]<BR>\nAge: [G.fields["age"]]<BR>\nFingerprint: [G.fields["fingerprint"]]<BR>\nPhysical Status: [G.fields["p_stat"]]<BR>\nMental Status: [G.fields["m_stat"]]<BR>"
var/info = "<CENTER><B>Medical Record</B></CENTER><BR>"
info += "Name: [G.fields["name"]] ID: [G.fields["id"]]<BR>\nSex: [G.fields["sex"]]<BR>\nAge: [G.fields["age"]]<BR>\nFingerprint: [G.fields["fingerprint"]]<BR>\nPhysical Status: [G.fields["p_stat"]]<BR>\nMental Status: [G.fields["m_stat"]]<BR>"
P.info += "<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: [M.fields["b_type"]]<BR>\nDNA: [M.fields["b_dna"]]<BR>\n<BR>\nMinor Disabilities: [M.fields["mi_dis"]]<BR>\nDetails: [M.fields["mi_dis_d"]]<BR>\n<BR>\nMajor Disabilities: [M.fields["ma_dis"]]<BR>\nDetails: [M.fields["ma_dis_d"]]<BR>\n<BR>\nAllergies: [M.fields["alg"]]<BR>\nDetails: [M.fields["alg_d"]]<BR>\n<BR>\nCurrent Diseases: [M.fields["cdi"]] (per disease info placed in log/comment section)<BR>\nDetails: [M.fields["cdi_d"]]<BR>\n<BR>\nImportant Notes:<BR>\n\t[M.fields["notes"]]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>"
info += "<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: [M.fields["b_type"]]<BR>\nDNA: [M.fields["b_dna"]]<BR>\n<BR>\nMinor Disabilities: [M.fields["mi_dis"]]<BR>\nDetails: [M.fields["mi_dis_d"]]<BR>\n<BR>\nMajor Disabilities: [M.fields["ma_dis"]]<BR>\nDetails: [M.fields["ma_dis_d"]]<BR>\n<BR>\nAllergies: [M.fields["alg"]]<BR>\nDetails: [M.fields["alg_d"]]<BR>\n<BR>\nCurrent Diseases: [M.fields["cdi"]] (per disease info placed in log/comment section)<BR>\nDetails: [M.fields["cdi_d"]]<BR>\n<BR>\nImportant Notes:<BR>\n\t[M.fields["notes"]]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>"
var/counter = 1
while(M.fields["com_[counter]"])
P.info += "[M.fields["com_[counter]"]]<BR>"
info += "[M.fields["com_[counter]"]]<BR>"
counter++
P.info += "</TT>"
P.name = "Medical Record ([G.fields["name"]])"
info += "</TT>"
var/pname = "Medical Record ([G.fields["name"]])"
P.set_content_unsafe(pname, info)
virgin = 0 //tabbing here is correct- it's possible for people to try and use it
//before the records have been generated, so we do this inside the loop.
..()
+20 -2
View File
@@ -37,9 +37,14 @@
/obj/item/weapon/paper/New(loc, text,title)
..(loc)
set_content(text ? text : info, title)
set_content(title, text ? text : info)
/obj/item/weapon/paper/proc/set_content(text,title)
// needed for subtyped papers with pre-defined content
/obj/item/weapon/paper/New()
..()
update_icon()
/obj/item/weapon/paper/proc/set_content(title, text)
if(title)
name = title
if (text && length(text))
@@ -52,6 +57,19 @@
update_space(info)
updateinfolinks()
// DO NOT USE THIS FOR UNTRUSTED PLAYER INPUT. IT DOES NOT SANITIZE.
/obj/item/weapon/paper/proc/set_content_unsafe(title, text)
if (title)
name = title
if (text && length(text))
info = text
else
info = ""
update_icon()
update_space()
updateinfolinks()
/obj/item/weapon/paper/update_icon()
if(icon_state == "paper_talisman")
return
+14 -9
View File
@@ -147,17 +147,19 @@
return
/obj/machinery/photocopier/proc/copy(var/obj/item/weapon/paper/copy)
var/obj/item/weapon/paper/c = new /obj/item/weapon/paper (loc)
if(toner > 10) //lots of toner, make it dark
c.info = "<font color = #101010>"
var/obj/item/weapon/paper/c = new /obj/item/weapon/paper()
var/info
var/pname
if (toner > 10) //lots of toner, make it dark
info = "<font color = #101010>"
else //no toner? shitty copies for you!
c.info = "<font color = #808080>"
info = "<font color = #808080>"
var/copied = html_decode(copy.info)
copied = replacetext(copied, "<font face=\"[c.deffont]\" color=", "<font face=\"[c.deffont]\" nocolor=") //state of the art techniques in action
copied = replacetext(copied, "<font face=\"[c.crayonfont]\" color=", "<font face=\"[c.crayonfont]\" nocolor=") //This basically just breaks the existing color tag, which we need to do because the innermost tag takes priority.
c.info += copied
c.info += "</font>"//</font>
c.name = copy.name // -- Doohl
info += copied
info += "</font>"//</font>
pname = copy.name // -- Doohl
c.fields = copy.fields
c.stamps = copy.stamps
c.stamped = copy.stamped
@@ -176,11 +178,14 @@
img.pixel_x = copy.offset_x[j]
img.pixel_y = copy.offset_y[j]
c.overlays += img
c.updateinfolinks()
toner--
if(toner == 0)
visible_message("<span class='notice'>A red light on \the [src] flashes, indicating that it is out of toner.</span>")
return c
return
c.set_content_unsafe(pname, info)
print(c, 1, 'sound/items/poster_being_created.ogg', 20)
/obj/machinery/photocopier/proc/photocopy(var/obj/item/weapon/photo/photocopy)
+9 -9
View File
@@ -417,17 +417,17 @@ won't update every console in existence) but it's more of a hassle to do. Also,
screen = 0.5
spawn(20)
var/obj/item/weapon/paper/PR = new/obj/item/weapon/paper
PR.name = "list of researched technologies"
PR.info = "<center><b>[station_name()] Science Laboratories</b>"
PR.info += "<h2>[ (text2num(href_list["print"]) == 2) ? "Detailed" : ] Research Progress Report</h2>"
PR.info += "<i>report prepared at [worldtime2text()] station time</i></center><br>"
var/pname = "list of researched technologies"
var/info = "<center><b>[station_name()] Science Laboratories</b>"
info += "<h2>[ (text2num(href_list["print"]) == 2) ? "Detailed" : ] Research Progress Report</h2>"
info += "<i>report prepared at [worldtime2text()] station time</i></center><br>"
if(text2num(href_list["print"]) == 2)
PR.info += GetResearchListInfo()
info += GetResearchListInfo()
else
PR.info += GetResearchLevelsInfo()
PR.info_links = PR.info
PR.icon_state = "paper_words"
PR.loc = src.loc
info += GetResearchLevelsInfo()
PR.set_content_unsafe(pname, info)
print(PR)
spawn(10)
screen = ((text2num(href_list["print"]) == 2) ? 5.0 : 1.1)
updateUsrDialog()
@@ -74,12 +74,14 @@
src.visible_message("<b>[name]</b> states, \"Scanning complete.\"")
var/obj/item/weapon/paper/P = new(src.loc)
P.name = "[src] report #[++report_num]"
P.info = "<b>[src] analysis report #[report_num]</b><br>"
P.info += "<br>"
P.info += "\icon[scanned_object] [results]"
var/pname = "[src] report #[++report_num]"
var/info = "<b>[src] analysis report #[report_num]</b><br>"
info += "<br>"
info += "\icon[scanned_object] [results]"
P.stamped = list(/obj/item/weapon/stamp)
P.overlays = list("paper_stamped")
P.set_content_unsafe(pname, info)
print(P)
if(scanned_object && istype(scanned_object, /obj/machinery/artifact))
var/obj/machinery/artifact/A = scanned_object
+5 -3
View File
@@ -34,10 +34,11 @@
ping("\The [src] pings, \"New pathogen added to data bank.\"")
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src.loc)
P.name = "paper - [dish.virus2.name()]"
var/pname = "paper - [dish.virus2.name()]"
var/info
var/r = dish.virus2.get_info()
P.info = {"
info = {"
[virology_letterhead("Post-Analysis Memo")]
[r]
<hr>
@@ -51,7 +52,8 @@
dish = null
icon_state = "analyser"
src.state("\The [src] prints a sheet of paper.")
P.set_content_unsafe(pname, info)
print(P)
else if(dish && !scanning && !pause)
if(dish.virus2 && dish.growth > 50)
+18 -17
View File
@@ -105,7 +105,7 @@
return 0
if (href_list["print"])
print(user)
do_print(user)
return 1
if(href_list["isolate"])
@@ -171,44 +171,45 @@
update_icon()
ping("\The [src] pings, \"Pathogen isolated.\"")
/obj/machinery/computer/centrifuge/print(var/mob/user)
/obj/machinery/computer/centrifuge/proc/do_print(var/mob/user)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(loc)
P.name = "paper - Pathology Report"
P.info = {"
var/pname = "paper - Pathology Report"
var/info = {"
[virology_letterhead("Pathology Report")]
<large><u>Sample:</u></large> [sample.name]<br>
"}
if (user)
P.info += "<u>Generated By:</u> [user.name]<br>"
info += "<u>Generated By:</u> [user.name]<br>"
P.info += "<hr>"
info += "<hr>"
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in sample.reagents.reagent_list
if (B)
P.info += "<u>Antibodies:</u> "
P.info += antigens2string(B.data["antibodies"])
P.info += "<br>"
info += "<u>Antibodies:</u> "
info += antigens2string(B.data["antibodies"])
info += "<br>"
var/list/virus = B.data["virus2"]
P.info += "<u>Pathogens:</u> <br>"
info += "<u>Pathogens:</u> <br>"
if (virus.len > 0)
for (var/ID in virus)
var/datum/disease2/disease/V = virus[ID]
P.info += "[V.name()]<br>"
info += "[V.name()]<br>"
else
P.info += "None<br>"
info += "None<br>"
else
var/datum/reagent/antibodies/A = locate(/datum/reagent/antibodies) in sample.reagents.reagent_list
if (A)
P.info += "The following antibodies have been isolated from the blood sample: "
P.info += antigens2string(A.data["antibodies"])
P.info += "<br>"
info += "The following antibodies have been isolated from the blood sample: "
info += antigens2string(A.data["antibodies"])
info += "<br>"
P.info += {"
info += {"
<hr>
<u>Additional Notes:</u> <field>
"}
state("The nearby computer prints out a pathology report.")
P.set_content_unsafe(pname, info)
print(P)
+22 -19
View File
@@ -148,7 +148,7 @@
return 1
if (href_list["print"])
print(user)
do_print(user)
return 1
if(!sample) return 1
@@ -167,45 +167,47 @@
update_icon()
return 1
/obj/machinery/disease2/isolator/print(var/mob/user)
/obj/machinery/disease2/isolator/proc/do_print(var/mob/user)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(loc)
var/pname
var/info = ""
switch (state)
if (HOME)
if (!sample) return
P.name = "paper - Patient Diagnostic Report"
P.info = {"
pname = "paper - Patient Diagnostic Report"
info = {"
[virology_letterhead("Patient Diagnostic Report")]
<center><small><font color='red'><b>CONFIDENTIAL MEDICAL REPORT</b></font></small></center><br>
<large><u>Sample:</u></large> [sample.name]<br>
"}
if (user)
P.info += "<u>Generated By:</u> [user.name]<br>"
info += "<u>Generated By:</u> [user.name]<br>"
P.info += "<hr>"
info += "<hr>"
for(var/datum/reagent/blood/B in sample.reagents.reagent_list)
var/mob/living/carbon/human/D = B.data["donor"]
P.info += "<large><u>[D.get_species()] [B.name]:</u></large><br>[B.data["blood_DNA"]]<br>"
info += "<large><u>[D.get_species()] [B.name]:</u></large><br>[B.data["blood_DNA"]]<br>"
var/list/virus = B.data["virus2"]
P.info += "<u>Pathogens:</u> <br>"
info += "<u>Pathogens:</u> <br>"
if (virus.len > 0)
for (var/ID in virus)
var/datum/disease2/disease/V = virus[ID]
P.info += "[V.name()]<br>"
info += "[V.name()]<br>"
else
P.info += "None<br>"
info += "None<br>"
P.info += {"
info += {"
<hr>
<u>Additional Notes:</u>&nbsp;
"}
if (LIST)
P.name = "paper - Virus List"
P.info = {"
pname = "paper - Virus List"
info = {"
[virology_letterhead("Virus List")]
"}
@@ -213,21 +215,22 @@
for (var/ID in virusDB)
i++
var/datum/data/record/r = virusDB[ID]
P.info += "[i]. " + r.fields["name"]
P.info += "<br>"
info += "[i]. " + r.fields["name"]
info += "<br>"
P.info += {"
info += {"
<hr>
<u>Additional Notes:</u>&nbsp;
"}
if (ENTRY)
P.name = "paper - Viral Profile"
P.info = {"
pname = "paper - Viral Profile"
info = {"
[virology_letterhead("Viral Profile")]
[entry.fields["description"]]
<hr>
<u>Additional Notes:</u>&nbsp;
"}
state("The nearby computer prints out a report.")
P.set_content_unsafe(pname, info)
print(P)