Files
CHOMPStation2/code/game/machinery/requests_console.dm
Spades 7e84419866 September Polaris Sync (#545)
* Removes Captain as a title, sets default to Station Administrator, and adds a new title, Site Manager

* Fix atmo_control interface temperature reading

* Adds Multiple Alternative Titles

* Removed Supply Assistant

* Removed Sergeant

* Removed Computer Scientist

* Revert "Revert "Frame Cleanup""

This reverts commit 82722ba42f.

* Changed Supply Officer to Requisitions Officer

* Changed Requisitions Officer to Supply Chief and Removed Courier

* Removed Life Support Technician

* Removed Brig Officer

* Tweaks the lowest level of heat damage to be less insane

* Corrects damage amount for heat_damage_level_1

* Maybe Perhaps Last Major Technomancer PR
Adds ability to sort the spells section of the catalog into categories.  The categories available are 'All', 'Offensive', 'Defensive', 'Utility', and 'Support'.
Removes preset section on catalog as it was unused.
Projectile spells now have a sound when fired.
Haste lasts five seconds instead of three.
Repel Missiles lasts for five minutes instead of two.
All healing spells work five times as fast, healing in five seconds instead of twenty five seconds.  The amount of instability and healing done has been multiplied to remain consistent.
Passwall can now be used on more than just walls, if there's something dense on the same tile.
Force Missile is now 25% cheaper to cast, and has a cooldown of .5 seconds instead of one second, and does 5 more damage.
Beam's damage is increased by 10, and energy cost decreased by 25%.
Lightning's warm-up time is now one second instead of two.
Overload now costs 10% of total energy instead of 15%, and damage scaled with 4% of their current energy reserves, and 5% with the Scepter, instead of 3%/4%.  Additionally, instability per shot is lowered to 12 from 15.
Track now costs 25 points instead of 30 in the catalog, because roundness.
Fire Aura should look more impressive without a Scepter.
Fixes bug where shooting Lightning made you motionless for twenty seconds.

* Adds Multiple New Clothing Items

* Makes Loincloths only Availiable to Taj and Unathi

* Tweaks the contents of the captain's closet

* Smokables now give an approximation of how much longer they'll burn once lit

* make teshari not bad to play

* Tea Tweaks

- Minor changes to the color of some of the drinks such as tea and iced tea. Still not happy with the colors, but they seem better than before.
- Modification to the British cup sprite.
- Addition of a tea sprite for the coffee cups.

* fixes exception handling runtiming

* Adds missing error handler that made it difficult to debug runtimes.

* Corrects error handling proc

* Adds missing runtime viewer Topic calls.

Relocates them to the datum itself rather than it being an admin topic for maximum self-containment.
Also adds 'adminplayerobservefollow', making it possible for admins to not only jump to mobs but also follow them with a single click.
Misc tweaks from Paradise.

* gib population

* Adds the ash() mob proc, preps ninja suit

* Fixes #2352

* Changelog

* alt title

* Rigs now have suit coolers

* Map edit

- Fixes lighting in Security. Again.
- Fixes lighting in Library.
- Adds a new maint tunnel between engineering solars and atmos, now
outside the blast radius of SME explosions.

* Almost forgot emergency shutters.

* Examine Cigarette Lore

* Fixes Capitalization

* Eliminates colon

* Should clear up the usr issue

* Fixes cryopods of all types not setting occupant correctly.

* updates changelog

* Fixes runtime that occured if someone touched a blast door with an empty hand.

* Fixes check_rights() runtime.

* Adds magboots to ling spacesuits

* Adds Changelog

* Turret Fix
Turrets can now deploy properly and not be stuck in a state of deploying forever if a target is in range.

* Revert "Adds hub passwordu"

* Makes changeling recursive enhancement a passive power

* Corrects a description

* Adss changelog

* Add files via upload

* Changeling/Wizard/Future Stuff Hud Button Fix
Hopefully this stops the roundstop changeling hud wonkiness.

* Changes Mining Hardsuit slowdown to 1, from 3

* Widened hallway

* Speeds up arm_guard and leg_guard wearers slightly

* Forgot to use map cleanup tool.

* Adds changelog

* Adds changelog

* Minor Emitter Tweaks
Emitters no longer die by shooting a taser or laser tag gun at it.
Emitters don't explode if they are not on a powered wire with sufficient electricity in it.  They will just crumple away instead if integrity is reduced to zero.
Taking any damage to the emitter no longer results in instant death due to me being an idiot awhile ago.
Emitters can be examined to see if they are damaged, and can be repaired by applying metal sheets to it.

* Github, stop being stupid!

* Tweaks Sec Voidsuit values

* Fixes external airlocks

* Elevator-MMI fix

* Shoveling Snow

* Laptop ID Computer Fix
The manifest should now be updated correctly when using laptops.

* do_after is more immersive

* Fixes second bug involving inability to change title to station admin.

* Adds more unathi hair and facial options

* Adds the changelog

* Retweaks secret player requirements

* Updates changelog

* Fixes sprite not updating to not be floating when leaving non-gravity

* Adds changelog

* Fixes changeling revive not working when you're missing a limb

* Fixes #860

* Adds changelog

* Makes flash confused duration the same length as the flash blurry eyes

* Increases the change of lung rupturing

* Adds vomit as an emote

* Adds changelog

* Removes revolution shuttle delay

* Adds changelog

* Projectile flash rounds will now do the same as a flash when hitting a target

* Adds changelog

* Fixes dna-lockable gun explosion security level

* Drink Container Lore

* Decapitalizes 'Sleeper'  Because Why

* Fixes Grammatical/Flow/Sarcasm Errors

* Completes dna lockable guns implementation by adding a dna chip that can be added to guns

* Fixes + forgotten file

* Moves DNA locking stuff down to the item level rather than gun, also adds the ability to emag to remove the lock

* Adds changelog

* Adds the ability to wear ponchos as an accessory, also adds the ability to have ponchos as a suit accessory

* Adds changelog

* Closes 2 missing spans

* Adds secure briefcase to custom loadout

* Adds changelog

* Headgear Additions, and an Undershirt

* Medical splint buff and new ghetto splints.
Adds hands and feet to splint-splintable organs.
Also adds ghetto splints that can't do hands and feet.

* Fixed Sleeper... Again

* Renames "poncho" slot to "over"

* Speeds Hyperzine metabolism

* 1.5.8 Map bug fixes
-Fixed brit cup sprite.
- Replaced a maintenance door leading into atmospherics with one with the proper access.
- Fixed Missing Disposals pipe next to atmos.
- Tweaked some light placement in the main hallways.
- AI core redesign.
- Turned off medbay lobby intercom.
- Cyborg charging station added to prison wing.
- Cyborg charging station added to the research outpost.
- Medical rig suit added to medical.
- EVA rig suit for engineering added to EVA.
- Second  residential elevator installed. Due to budget cuts the size of the elevators has been reduced.

* Updates changelog

* Sombrero Code

* Fixes #2365

* Adds changelog

* Sleeper is evil.

* no message

* Changelog

* Stops observers from leaving prints on the ground.

No more spooking the mortals, ghosts.

* Allows autotraitor in secret to start with 0 players

* Adds changelog

* Makes diona slightly less slow

* Adds changelog

* Bowling Shirts

* Updates changelog

* Adds a missing description

* Flat Cap Changes and Hair Bow

* Fixed Error

* Adds an in-hand

* Lower Torso cannot be amputated

* Smoke works, adds changelog

* Updates changelog

* Makes Unathi Voidsuits Less Fat

* Medical related fixes

* Fuzzy Cuffs

* Tube Top

* Made Icons for Security Suit Less Gaunt

* Revert "Medical related fixes"

This reverts commit d7c59520e6.

* Just the fix to random med item now

* Fixes Evening Glove Coloring

* HAZMAT Suits

* Changes Unathi sprite slightly

* Tweaks skirt pathing

* Corrects changelog

* Adds changelog

* Construction Voidsuits

* makes people bleed real good

* adderino changeling

* Revert "Revert "Adds hub passwordu""

* Explosive implants should no longer gib on limbs.

* I still have no idea what I am doing.

* Resolves #331
2016-09-11 19:52:40 -04:00

268 lines
9.1 KiB
Plaintext

/******************** Requests Console ********************/
/** Originally written by errorage, updated by: Carn, needs more work though. I just added some security fixes */
//Request Console Department Types
#define RC_ASSIST 1 //Request Assistance
#define RC_SUPPLY 2 //Request Supplies
#define RC_INFO 4 //Relay Info
//Request Console Screens
#define RCS_MAINMENU 0 // Main menu
#define RCS_RQASSIST 1 // Request supplies
#define RCS_RQSUPPLY 2 // Request assistance
#define RCS_SENDINFO 3 // Relay information
#define RCS_SENTPASS 4 // Message sent successfully
#define RCS_SENTFAIL 5 // Message sent unsuccessfully
#define RCS_VIEWMSGS 6 // View messages
#define RCS_MESSAUTH 7 // Authentication before sending
#define RCS_ANNOUNCE 8 // Send announcement
var/req_console_assistance = list()
var/req_console_supplies = list()
var/req_console_information = list()
var/list/obj/machinery/requests_console/allConsoles = list()
/obj/machinery/requests_console
name = "Requests Console"
desc = "A console intended to send requests to different departments on the station."
anchored = 1
icon = 'icons/obj/terminals.dmi'
icon_state = "req_comp0"
circuit = /obj/item/weapon/circuitboard/request
var/department = "Unknown" //The list of all departments on the station (Determined from this variable on each unit) Set this to the same thing if you want several consoles in one department
var/list/message_log = list() //List of all messages
var/departmentType = 0 //Bitflag. Zero is reply-only. Map currently uses raw numbers instead of defines.
var/newmessagepriority = 0
// 0 = no new message
// 1 = normal priority
// 2 = high priority
var/screen = RCS_MAINMENU
var/silent = 0 // set to 1 for it not to beep all the time
// var/hackState = 0
// 0 = not hacked
// 1 = hacked
var/announcementConsole = 0
// 0 = This console cannot be used to send department announcements
// 1 = This console can send department announcementsf
var/open = 0 // 1 if open
var/announceAuth = 0 //Will be set to 1 when you authenticate yourself for announcements
var/msgVerified = "" //Will contain the name of the person who varified it
var/msgStamped = "" //If a message is stamped, this will contain the stamp name
var/message = "";
var/recipient = ""; //the department which will be receiving the message
var/priority = -1 ; //Priority of the message being sent
light_range = 0
var/datum/announcement/announcement = new
/obj/machinery/requests_console/power_change()
..()
update_icon()
/obj/machinery/requests_console/update_icon()
if(stat & NOPOWER)
if(icon_state != "req_comp_off")
icon_state = "req_comp_off"
else
if(icon_state == "req_comp_off")
icon_state = "req_comp[newmessagepriority]"
/obj/machinery/requests_console/New()
..()
announcement.title = "[department] announcement"
announcement.newscast = 1
name = "[department] Requests Console"
allConsoles += src
if(departmentType & RC_ASSIST)
req_console_assistance |= department
if(departmentType & RC_SUPPLY)
req_console_supplies |= department
if(departmentType & RC_INFO)
req_console_information |= department
set_light(1)
/obj/machinery/requests_console/Destroy()
allConsoles -= src
var/lastDeptRC = 1
for (var/obj/machinery/requests_console/Console in allConsoles)
if(Console.department == department)
lastDeptRC = 0
break
if(lastDeptRC)
if(departmentType & RC_ASSIST)
req_console_assistance -= department
if(departmentType & RC_SUPPLY)
req_console_supplies -= department
if(departmentType & RC_INFO)
req_console_information -= department
..()
/obj/machinery/requests_console/attack_hand(user as mob)
if(..(user))
return
ui_interact(user)
/obj/machinery/requests_console/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/data[0]
data["department"] = department
data["screen"] = screen
data["message_log"] = message_log
data["newmessagepriority"] = newmessagepriority
data["silent"] = silent
data["announcementConsole"] = announcementConsole
data["assist_dept"] = req_console_assistance
data["supply_dept"] = req_console_supplies
data["info_dept"] = req_console_information
data["message"] = message
data["recipient"] = recipient
data["priortiy"] = priority
data["msgStamped"] = msgStamped
data["msgVerified"] = msgVerified
data["announceAuth"] = announceAuth
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "request_console.tmpl", "[department] Request Console", 520, 410)
ui.set_initial_data(data)
ui.open()
/obj/machinery/requests_console/Topic(href, href_list)
if(..()) return
usr.set_machine(src)
add_fingerprint(usr)
if(reject_bad_text(href_list["write"]))
recipient = href_list["write"] //write contains the string of the receiving department's name
var/new_message = sanitize(input("Write your message:", "Awaiting Input", ""))
if(new_message)
message = new_message
screen = RCS_MESSAUTH
switch(href_list["priority"])
if("1") priority = 1
if("2") priority = 2
else priority = 0
else
reset_message(1)
if(href_list["writeAnnouncement"])
var/new_message = sanitize(input("Write your message:", "Awaiting Input", ""))
if(new_message)
message = new_message
else
reset_message(1)
if(href_list["sendAnnouncement"])
if(!announcementConsole) return
announcement.Announce(message, msg_sanitized = 1)
reset_message(1)
if(href_list["department"] && message)
var/log_msg = message
var/pass = 0
screen = RCS_SENTFAIL
for (var/obj/machinery/message_server/MS in world)
if(!MS.active) continue
MS.send_rc_message(ckey(href_list["department"]),department,log_msg,msgStamped,msgVerified,priority)
pass = 1
if(pass)
screen = RCS_SENTPASS
message_log += "<B>Message sent to [recipient]</B><BR>[message]"
else
audible_message(text("\icon[src] *The Requests Console beeps: 'NOTICE: No server detected!'"),,4)
//Handle printing
if (href_list["print"])
var/msg = message_log[text2num(href_list["print"])];
if(msg)
msg = replacetext(msg, "<BR>", "\n")
msg = strip_html_properly(msg)
var/obj/item/weapon/paper/R = new(src.loc)
R.name = "[department] Message"
R.info = "<H3>[department] Requests Console</H3><div>[msg]</div>"
//Handle screen switching
if(href_list["setScreen"])
var/tempScreen = text2num(href_list["setScreen"])
if(tempScreen == RCS_ANNOUNCE && !announcementConsole)
return
if(tempScreen == RCS_VIEWMSGS)
for (var/obj/machinery/requests_console/Console in allConsoles)
if(Console.department == department)
Console.newmessagepriority = 0
Console.icon_state = "req_comp0"
Console.set_light(1)
if(tempScreen == RCS_MAINMENU)
reset_message()
screen = tempScreen
//Handle silencing the console
if(href_list["toggleSilent"])
silent = !silent
updateUsrDialog()
return
//err... hacking code, which has no reason for existing... but anyway... it was once supposed to unlock priority 3 messanging on that console (EXTREME priority...), but the code for that was removed.
/obj/machinery/requests_console/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob)
if(computer_deconstruction_screwdriver(user, O))
return
if(istype(O, /obj/item/device/multitool))
if(panel_open)
var/input = sanitize(input(usr, "What Department id would you like to give this Request Console?", "Multitool-Request Console interface", department))
if(!input)
usr << "No input found please hang up and try your call again."
return
department = input
announcement.title = "[department] announcement"
announcement.newscast = 1
name = "[department] Requests Console"
allConsoles += src
if(departmentType & RC_ASSIST)
req_console_assistance |= department
if(departmentType & RC_SUPPLY)
req_console_supplies |= department
if(departmentType & RC_INFO)
req_console_information |= department
return
if(istype(O, /obj/item/weapon/card/id))
if(inoperable(MAINT)) return
if(screen == RCS_MESSAUTH)
var/obj/item/weapon/card/id/T = O
msgVerified = text("<font color='green'><b>Verified by [T.registered_name] ([T.assignment])</b></font>")
updateUsrDialog()
if(screen == RCS_ANNOUNCE)
var/obj/item/weapon/card/id/ID = O
if(access_RC_announce in ID.GetAccess())
announceAuth = 1
announcement.announcer = ID.assignment ? "[ID.assignment] [ID.registered_name]" : ID.registered_name
else
reset_message()
user << "<span class='warning'>You are not authorized to send announcements.</span>"
updateUsrDialog()
if(istype(O, /obj/item/weapon/stamp))
if(inoperable(MAINT)) return
if(screen == RCS_MESSAUTH)
var/obj/item/weapon/stamp/T = O
msgStamped = text("<font color='blue'><b>Stamped with the [T.name]</b></font>")
updateUsrDialog()
return
/obj/machinery/requests_console/proc/reset_message(var/mainmenu = 0)
message = ""
recipient = ""
priority = 0
msgVerified = ""
msgStamped = ""
announceAuth = 0
announcement.announcer = ""
if(mainmenu)
screen = RCS_MAINMENU