From e775ce3f358782ae9380ddddf2d2668238306bb4 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sat, 29 Apr 2017 16:58:04 -0500 Subject: [PATCH] Bank Machine now uses the radio rather than announcements --- code/game/machinery/bank_machine.dm | 37 +++++++++++++++++++---------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/code/game/machinery/bank_machine.dm b/code/game/machinery/bank_machine.dm index 35f7babe1e..ace9b543d1 100644 --- a/code/game/machinery/bank_machine.dm +++ b/code/game/machinery/bank_machine.dm @@ -4,7 +4,21 @@ icon = 'goon/icons/obj/goon_terminals.dmi' idle_power_usage = 100 var/siphoning = FALSE - var/last_warning = 0 + var/next_warning = 0 + var/obj/item/device/radio/radio + var/radio_channel = "Common" + var/minimum_time_between_warnings = 400 + +/obj/machinery/computer/bank_machine/Initialize(mapload) + ..() + radio = new(src) + radio.subspace_transmission = TRUE + radio.canhear_range = 0 + radio.recalculateChannels() + +/obj/machinery/computer/bank_machine/Destroy() + QDEL_NULL(radio) + . = ..() /obj/machinery/computer/bank_machine/attackby(obj/item/I, mob/user) var/value = 0 @@ -32,18 +46,17 @@ say("Station funds depleted. Halting siphon.") siphoning = FALSE else - var/obj/item/stack/spacecash/c200/on_turf = locate() in src.loc - if(on_turf && on_turf.amount < on_turf.max_amount) - on_turf.amount++ - else - new /obj/item/stack/spacecash/c200(get_turf(src)) + new /obj/item/stack/spacecash/c200(get_turf(src)) // will autostack playsound(src.loc, 'sound/items/poster_being_created.ogg', 100, 1) SSshuttle.points -= 200 - if(last_warning < world.time && prob(15)) + if(next_warning < world.time && prob(15)) var/area/A = get_area(loc) - minor_announce("Unauthorized credit withdrawal underway in [A.map_name]." , "Network Breach", TRUE) - last_warning = world.time + 400 + var/message = "Unauthorized credit withdrawal underway in [A.map_name]!!" + radio.talk_into(src, message, radio_channel, get_spans()) + next_warning = world.time + minimum_time_between_warnings +/obj/machinery/computer/bank_machine/get_spans() + . = ..() | SPAN_ROBOT /obj/machinery/computer/bank_machine/attack_hand(mob/user) if(..()) @@ -67,8 +80,8 @@ if(..()) return if(href_list["siphon"]) - say("Siphon of station credits has begun!") + say("Siphon of station credits has begun!") siphoning = TRUE if(href_list["halt"]) - say("Station credit withdrawal halted.") - siphoning = FALSE \ No newline at end of file + say("Station credit withdrawal halted.") + siphoning = FALSE