diff --git a/code/modules/paperwork/ticketmachine.dm b/code/modules/paperwork/ticketmachine.dm index 0492d3da694..38120429312 100644 --- a/code/modules/paperwork/ticketmachine.dm +++ b/code/modules/paperwork/ticketmachine.dm @@ -21,6 +21,7 @@ var/list/ticket_holders = list() var/list/tickets = list() var/id = 1 + var/disabled = FALSE //used to ID card disable/enable ticket dispensing /obj/machinery/ticket_machine/Destroy() for(var/obj/item/ticket_machine_ticket/ticket in tickets) @@ -102,14 +103,17 @@ handle_maptext() /obj/machinery/ticket_machine/proc/handle_maptext() - switch(ticket_number) //This is here to handle maptext offsets so that the numbers align. - if(0 to 9) - maptext_x = 13 - if(10 to 99) - maptext_x = 10 - if(100) - maptext_x = 8 - maptext = "[ticket_number]" + if(disabled) + maptext = "" + else + switch(ticket_number) //This is here to handle maptext offsets so that the numbers align. + if(0 to 9) + maptext_x = 13 + if(10 to 99) + maptext_x = 10 + if(100) + maptext_x = 8 + maptext = "[ticket_number]" /obj/machinery/ticket_machine/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/hand_labeler_refill)) @@ -130,6 +134,15 @@ max_number = initial(max_number) update_icon() return + else if(istype(I, /obj/item/card/id)) + var/obj/item/card/id/heldID = I + if(ACCESS_HOP in heldID.access) + disabled = !disabled + to_chat(user, "You [disabled ? "disable" : "enable"] the ticket machine, it will [disabled ? "no longer" : "now"] dispense tickets!") + handle_maptext() + return + else + to_chat(user, "You do not have the required access to disable the ticket machine.") else return ..() @@ -141,6 +154,9 @@ if(!ready) to_chat(user,"You press the button, but nothing happens...") return + if(disabled) + to_chat(user, "The ticket machine has been disabled.") + return if(ticket_number >= max_number) to_chat(user,"Ticket supply depleted, please refill this unit with a hand labeller refill cartridge!") return @@ -172,6 +188,10 @@ /obj/machinery/ticket_machine/attack_ai(mob/user) return +/obj/machinery/ticket_machine/examine(mob/user) + . = ..() + . += "Use an ID card with HOP access on this machine to [disabled ? "enable":"disable"] ticket dispensing." + /obj/item/ticket_machine_ticket name = "Ticket" desc = "A ticket which shows your place in the Head of Personnel's line. Made from Nanotrasen patented NanoPaper. Though solid, its form seems to shimmer slightly. Feels (and burns) just like the real thing."