diff --git a/code/game/machinery/computer/camera_console.dm b/code/game/machinery/computer/camera_console.dm index 1e2cb427cab4..df26cbea3409 100644 --- a/code/game/machinery/computer/camera_console.dm +++ b/code/game/machinery/computer/camera_console.dm @@ -211,6 +211,35 @@ 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 = tgui_input_text(user, "What would you like to message the streamer? (48 Characters MAX)", "What?", max_length = 48) + !broadcastingcamera.donationsaccount.money += spacecash.worth + streamer.play_screen_text("You've received a new donation!
" + message, /atom/movable/screen/text/screen_text/command_order, pick("#FF0000", "#008000", "#C71585", "#0000FF")) + playsound(broadcastingcamera, 'sound/machines/ping.ogg', 25) + + var/datum/transaction/T = new() + T.target_name = acc.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..a39dff19b3e7 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -358,6 +358,15 @@ 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 + +/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, ...) . = ..()