From 9d47d2c98e36abbed6b25ffc9982d52801747cd1 Mon Sep 17 00:00:00 2001 From: scoopscoop Date: Thu, 7 Aug 2014 18:38:09 +0300 Subject: [PATCH] Now uses a proc that generates messages on target console Basically gutted topic code. --- code/game/machinery/requests_console.dm | 62 +++++++++++++++++++++++-- code/modules/mining/equipment_locker.dm | 14 ++---- 2 files changed, 61 insertions(+), 15 deletions(-) diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 851fd8c7055..1819ea14e26 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -8,14 +8,14 @@ var/list/obj/machinery/requests_console/allConsoles = list() /obj/machinery/requests_console name = "requests console" - desc = "A console intended to send requests to diferent departments on the station." + desc = "A console intended to send requests to different departments on the station." anchored = 1 icon = 'icons/obj/terminals.dmi' icon_state = "req_comp0" 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/messages = list() //List of all messages var/departmentType = 0 - // 0 = none (not listed, can only repeplied to) + // 0 = none (not listed, can only replied to) // 1 = assistance // 2 = supplies // 3 = info @@ -46,10 +46,10 @@ var/list/obj/machinery/requests_console/allConsoles = list() // 1 = hacked var/announcementConsole = 0 // 0 = This console cannot be used to send department announcements - // 1 = This console can send department announcementsf + // 1 = This console can send department announcements 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/msgVerified = "" //Will contain the name of the person who verified it var/msgStamped = "" //If a message is stamped, this will contain the stamp name var/message = ""; var/dpt = ""; //the department which will be receiving the message @@ -409,6 +409,60 @@ var/list/obj/machinery/requests_console/allConsoles = list() updateUsrDialog() return + +/obj/machinery/requests_console/proc/createmessage(source, title, message, priority, paper) //generate one-way message, from 'source' + var/obj/machinery/requests_console/Console = src + var/sending = message + capitalize(source) + capitalize(title) + sending += "
" + switch(priority) + if(2) //High priority + if(Console.newmessagepriority < 2) + Console.newmessagepriority = 2 + Console.update_icon() + if(!Console.silent) + playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1) + for (var/mob/O in hearers(5, Console.loc)) + O.show_message("\icon[Console] *The Requests Console beeps: '[title]'") + Console.messages += "High Priority
From: [source]>
[sending]" + if(paper) + var/obj/item/weapon/paper/slip = new /obj/item/weapon/paper(Console.loc) + slip.info = "High Priority
From: [source]
[sending]" + slip.name = "Important Message - [source]" + + if(3) // Extreme Priority + if(Console.newmessagepriority < 3) + Console.newmessagepriority = 3 + Console.update_icon() + if(1) + playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1) + for (var/mob/O in hearers(7, Console.loc)) + O.show_message("\icon[Console] *The Requests Console yells: '[title]'") + Console.messages += "!!!Extreme Priority!!!
From: [source]
[sending]" + var/obj/item/weapon/paper/slip = new /obj/item/weapon/paper(Console.loc) + if(paper) + slip.info = "!!!Extreme Priority!!!
From: [source]
[sending]" + slip.name = "URGENT message - [source]" + var/mob/living/target = locate() in view(7,Console) + if(target) + Console.visible_message("[Console] launches [slip] at [target]!") + slip.throw_at(target, 16, 3) + + else // Normal priority + if(Console.newmessagepriority < 1) + Console.newmessagepriority = 1 + Console.update_icon() + if(!Console.silent) + playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1) + for (var/mob/O in hearers(4, Console.loc)) + O.show_message("\icon[Console] *The Requests Console beeps: '[title]'") + Console.messages += "From: [source]
[sending]" + if(paper) + var/obj/item/weapon/paper/slip = new /obj/item/weapon/paper(Console.loc) + slip.info = "From: [source]
[sending]" + slip.name = "Message - [source]" + Console.luminosity = 2 /obj/machinery/requests_console/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob) if (istype(O, /obj/item/weapon/crowbar)) diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index 12ab117e71e..f2a7fedcae4 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -35,21 +35,13 @@ s.amount = 0 stack_list[processed_sheet] = s if(s.name != "glass" && s.name != "metal") //we can get these from cargo anyway + var/msg = "[capitalize(s.name)] sheets are now available in the Cargo Bay." for(var/obj/machinery/requests_console/D in world) //this will only happen a few times per round - if(D.department == "Science" || D.department == "Robotics") - announce_mats(D, s.name) + if(D.department == "Science" || D.department == "Robotics" || D.department == "Research Director's Desk") + D.createmessage("Ore Redemption Machine", "New minerals available!", msg, 1, 0) var/obj/item/stack/sheet/storage = stack_list[processed_sheet] storage.amount += 1 //Stack the sheets O.loc = null //Let the old sheet garbage collect - -/obj/machinery/mineral/ore_redemption/proc/announce_mats(obj/machinery/requests_console/T, N) //announce the availability of string N to request console T - T.newmessagepriority = 1 - T.update_icon() -// if(!T.silent) -// playsound(T.loc, 'sound/machines/twobeep.ogg', 50, 1) - for (var/mob/O in hearers(4, T.loc)) - O.show_message("\icon[T] *The Requests Console flashes: 'New minerals available!'") - T.messages += "From: Ore Redemption Machine
[capitalize(N)] sheets are now available in the Cargo Bay." /obj/machinery/mineral/ore_redemption/process() if(!panel_open) //If the machine is partially dissassembled, it should not process minerals