Merge pull request #3819 from Kilakk/dev

Added the ability to send faxes between departments
This commit is contained in:
Mloc
2013-10-26 13:59:06 -07:00
3 changed files with 58 additions and 21 deletions

View File

@@ -1,19 +1,35 @@
var/list/obj/machinery/faxmachine/allfaxes = list()
var/list/alldepartments = list("Central Command")
/obj/machinery/faxmachine
name = "fax machine"
icon = 'icons/obj/library.dmi'
icon_state = "fax"
req_access = list(access_lawyer)
req_one_access = list(access_lawyer, access_heads)
anchored = 1
density = 1
use_power = 1
idle_power_usage = 30
active_power_usage = 200
power_channel = EQUIP
var/obj/item/weapon/card/id/scan = null // identification
var/authenticated = 0
var/obj/item/weapon/paper/tofax = null // what we're sending to central
var/obj/item/weapon/paper/tofax = null // what we're sending
var/sendcooldown = 0 // to avoid spamming fax messages
var/department = "Unknown" // our department
var/dpt = "Central Command" // the department we're sending to
/obj/machinery/faxmachine/New()
..()
allfaxes += src
if( !("[department]" in alldepartments) )
alldepartments += department
/obj/machinery/faxmachine/process()
return 0
@@ -26,7 +42,7 @@
/obj/machinery/faxmachine/attack_hand(mob/user as mob)
user.set_machine(src)
var/dat = "Central Command Fax Machine<BR>"
var/dat = "Fax Machine<BR>"
var/scan_name
if(scan)
@@ -54,14 +70,15 @@
else
dat += "<a href='byond://?src=\ref[src];send=1'>Send</a><br>"
dat += "<b>Currently sending:</b> [tofax.name]"
dat += "<b>Currently sending:</b> [tofax.name]<br>"
dat += "<b>Sending to:</b> <a href='byond://?src=\ref[src];dept=1'>[dpt]</a><br>"
else
if(sendcooldown)
dat += "Please insert paper to send to Central Command via secure connection.<br><br>"
dat += "Please insert paper to send via secure connection.<br><br>"
dat += "<b>Transmitter arrays realigning. Please stand by.</b><br>"
else
dat += "Please insert paper to send to Central Command via secure connection.<br><br>"
dat += "Please insert paper to send via secure connection.<br><br>"
else
dat += "Proper authentication is required to use this device.<br><br>"
@@ -76,10 +93,18 @@
/obj/machinery/faxmachine/Topic(href, href_list)
if(href_list["send"])
if(tofax)
if(dpt == "Central Command")
Centcomm_fax(tofax.info, tofax.name, usr)
usr << "Message transmitted."
sendcooldown = 1
spawn(3000) // three minute cooldown. might mess with this number a bit as time goes on
sendcooldown = 1800
else
SendFax(tofax.info, tofax.name, usr, dpt)
sendcooldown = 600
usr << "Message transmitted successfully."
spawn(sendcooldown) // cooldown time
sendcooldown = 0
if(href_list["remove"])
@@ -107,6 +132,9 @@
scan = I
authenticated = 0
if(href_list["dept"])
dpt = input(usr, "Which department?", "Choose a department", "") as null|anything in alldepartments
if(href_list["auth"])
if ( (!( authenticated ) && (scan)) )
if (check_access(scan))
@@ -148,3 +176,20 @@
var/msg = "\blue <b><font color='orange'>CENTCOMM FAX: </font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<a href='?_src_=holder;CentcommFaxReply=\ref[Sender]'>RPLY</a>)</b>: Receiving '[sentname]' via secure connection ... <a href='?_src_=holder;CentcommFaxView=\ref[sent]'>view message</a>"
admins << msg
proc/SendFax(var/sent, var/sentname, var/mob/Sender, var/dpt)
for(var/obj/machinery/faxmachine/F in allfaxes)
if( F.department == dpt )
if(! (F.stat & (BROKEN|NOPOWER) ) )
flick("faxreceive", F)
// give the sprite some time to flick
spawn(20)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( F.loc )
P.name = "[sentname]"
P.info = "[sent]"
P.update_icon()
playsound(F.loc, "sound/items/polaroid1.ogg", 50, 1)

View File

@@ -74,14 +74,6 @@ should be listed in the changelog upon commit though. Thanks. -->
<li class='rscadd'>Return of dreaded side effects. They now manifest well after their cause disappears, so curing them should be possible without them reappearing immediately. They also lost last stage damaging effects.</li>
</ul>
</div>
<div class='commit sansserif'>
<h2 class='date'>18 September 2013</h2>
<h3 class='author'>Kilakk updated:</h3>
<ul class='changes bgimages16'>
<li class='rscadd'>Fax machines! The Captain and IA agents can use the fax machine to send properly formatted messages to Central Command.</li>
<li class='imageadd'>Gave the fax machine a fancy animated sprite. Thanks Cajoes!</li>
</ul>
</div>
<div class="commit sansserif">
<h2 class="date">September 24th, 2013</h2>

View File

@@ -2373,7 +2373,7 @@
"aTG" = (/obj/machinery/atmospherics/pipe/manifold{pipe_color = "blue"; dir = 1; icon_state = "manifold-b-f"; level = 1; name = "pipe manifold"},/turf/simulated/wall,/area/crew_quarters/sleep{name = "Cabin Two"})
"aTH" = (/obj/structure/table/woodentable,/obj/item/weapon/storage/fancy/donut_box,/obj/machinery/newscaster{pixel_x = 32; pixel_y = 0},/turf/simulated/floor/wood,/area/crew_quarters/sleep{name = "Security Wing Dormitories"})
"aTI" = (/obj/structure/stool,/obj/machinery/atmospherics/pipe/simple/supply/hidden,/turf/simulated/floor/wood,/area/crew_quarters/sleep{name = "Security Wing Dormitories"})
"aTJ" = (/obj/structure/table/reinforced,/obj/machinery/faxmachine,/turf/simulated/floor{icon_state = "cult"; dir = 2},/area/lawoffice)
"aTJ" = (/obj/structure/table/reinforced,/obj/machinery/faxmachine{department = "Internal Affairs"},/turf/simulated/floor{icon_state = "cult"; dir = 2},/area/lawoffice)
"aTK" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 8},/obj/machinery/door/poddoor{density = 0; icon_state = "pdoor0"; id = "lawyer_blast"; name = "Privacy Shutters"; opacity = 0},/turf/simulated/floor/plating,/area/lawoffice)
"aTL" = (/obj/structure/closet/lawcloset,/turf/simulated/floor{icon_state = "cult"; dir = 2},/area/lawoffice)
"aTM" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden,/obj/machinery/door/firedoor/border_only,/turf/simulated/floor{icon_state = "redcorner"; dir = 4},/area/hallway/primary/fore)
@@ -4736,7 +4736,7 @@
"bNd" = (/obj/structure/table/woodentable,/obj/item/weapon/book/manual/security_space_law,/turf/simulated/floor/wood,/area/crew_quarters/captain)
"bNe" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"},/turf/simulated/floor/wood,/area/crew_quarters/captain)
"bNf" = (/obj/machinery/atmospherics/unary/vent_pump{on = 1},/turf/simulated/floor/wood,/area/crew_quarters/captain)
"bNg" = (/obj/machinery/faxmachine,/obj/structure/table/woodentable,/turf/simulated/floor/wood,/area/crew_quarters/captain)
"bNg" = (/obj/machinery/faxmachine{department = "Captain's Office"},/obj/structure/table/woodentable,/turf/simulated/floor/wood,/area/crew_quarters/captain)
"bNh" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden{dir = 6},/turf/simulated/wall/r_wall,/area/crew_quarters/captain)
"bNi" = (/obj/machinery/hologram/holopad,/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"},/turf/simulated/floor/bluegrid,/area/turret_protected/ai)
"bNj" = (/obj/machinery/status_display{density = 0; layer = 4; pixel_x = 0; pixel_y = -32},/turf/simulated/floor/bluegrid,/area/turret_protected/ai)
@@ -4823,7 +4823,7 @@
"bOM" = (/obj/structure/cable{d1 = 1; d2 = 4; icon_state = "1-4"},/turf/simulated/floor{icon_state = "dark"},/area/turret_protected/ai)
"bON" = (/obj/machinery/turret{dir = 4},/obj/machinery/light/small{dir = 8},/turf/simulated/floor/bluegrid,/area/turret_protected/ai)
"bOO" = (/obj/machinery/camera{c_tag = "Central Hallway West"; dir = 8},/turf/simulated/floor{icon_state = "bluecorner"},/area/hallway/primary/central)
"bOP" = (/obj/machinery/computer/security/telescreen/entertainment{pixel_x = 0; pixel_y = -32},/obj/machinery/faxmachine,/obj/structure/table/woodentable,/turf/simulated/floor/wood,/area/bridge/meeting_room)
"bOP" = (/obj/machinery/computer/security/telescreen/entertainment{pixel_x = 0; pixel_y = -32},/obj/machinery/faxmachine{department = "Bridge"},/obj/structure/table/woodentable,/turf/simulated/floor/wood,/area/bridge/meeting_room)
"bOQ" = (/obj/structure/reagent_dispensers/water_cooler,/turf/simulated/floor/wood,/area/bridge/meeting_room)
"bOR" = (/obj/machinery/door/window/eastright{dir = 1; name = "Bridge Delivery"; req_access_txt = "19"},/turf/simulated/floor{icon_state = "delivery"},/area/bridge/meeting_room)
"bOS" = (/obj/machinery/atmospherics/pipe/manifold{pipe_color = "red"; dir = 1; icon_state = "manifold-r-f"; level = 1; name = "pipe manifold"},/obj/structure/disposalpipe/segment{dir = 8; icon_state = "pipe-c"},/turf/simulated/wall,/area/quartermaster/office)