diff --git a/code/game/machinery/computer/camera_console.dm b/code/game/machinery/computer/camera_console.dm index 1e2cb427cab4..e2155a162528 100644 --- a/code/game/machinery/computer/camera_console.dm +++ b/code/game/machinery/computer/camera_console.dm @@ -205,12 +205,50 @@ /obj/structure/machinery/computer/cameras/wooden_tv/broadcast name = "Television Set" - desc = "An old TV hooked up to a video cassette recorder, you can even use it to time shift WOW." + desc = "An old TV hooked up to a video cassette recorder, which has been modified to function as... money slot?" network = list(CAMERA_NET_CORRESPONDENT) stay_connected = TRUE circuit = /obj/item/circuitboard/computer/cameras/tv var/obj/item/device/camera/broadcasting/broadcastingcamera = null +/obj/structure/machinery/computer/cameras/wooden_tv/broadcast/attackby(obj/item/I, mob/user) + if(!broadcastingcamera) + return + + if(istype(I, /obj/item/spacecash)) + var/obj/item/spacecash/spacecash = I + if(spacecash.counterfeit) + return + + + if(!broadcastingcamera.donationsaccount) + to_chat(user, SPAN_WARNING("Streamer is not accepting donations at this time.")) + return + + var/message = "Thanks for your donation!" + if(spacecash.worth >= 10) + message = tgui_input_text(user, "What would you like to message the streamer? (48 Characters MAX)", "Message", max_length = 48) + + var/nickname = tgui_input_text(user, "What would you like your displayed name to be? (20 Characters MAX)", "Name", max_length = 20) + + broadcastingcamera.donationsaccount.money += spacecash.worth + if(ishuman(broadcastingcamera.loc)) + var/mob/living/carbon/human/streamer = broadcastingcamera.loc + streamer.play_screen_text("You've received a new donation of [spacecash.worth]$ from [nickname]!
" + message, /atom/movable/screen/text/screen_text/command_order, pick("#FF0000", "#008000", "#C71585", "#0000FF")) + broadcastingcamera.latestmessage = "[nickname], [spacecash.worth]$, \"[message]\"" + playsound(broadcastingcamera, 'sound/machines/ping.ogg', 25) + + var/datum/transaction/T = new() + T.target_name = broadcastingcamera.donationsaccount.owner_name + T.purpose = "Donation" + T.amount = spacecash:worth + T.date = GLOB.current_date_string + T.time = worldtime2text() + broadcastingcamera.donationsaccount.transaction_log.Add(T) + qdel(spacecash) + + ..() + /obj/structure/machinery/computer/cameras/wooden_tv/broadcast/Destroy() broadcastingcamera = null return ..() diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index df39248e343a..f1d4b5cd072c 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -358,6 +358,22 @@ w_class = SIZE_HUGE flags_equip_slot = NO_FLAGS //cannot be equiped var/obj/structure/machinery/camera/correspondent/linked_cam + var/datum/money_account/donationsaccount + var/latestmessage + +/obj/item/device/camera/broadcasting/get_examine_text(mob/user) + . = ..() + . += "Linked account: [donationsaccount ? "[donationsaccount.account_number]" : "None, swipe your ID-card to link it"]." + if(latestmessage) + . += "Latest donation: [latestmessage]" + +/obj/item/device/camera/broadcasting/attackby(obj/item/I, mob/user) + if(istype(I, /obj/item/card/id)) + var/obj/item/card/id/id = I + if(!id.associated_account_number) + return + donationsaccount = get_account(id.associated_account_number) + to_chat(user, SPAN_NOTICE("Account linked for donations!")) /obj/item/device/camera/broadcasting/Initialize(mapload, ...) . = ..()