From f6c9c5378e054c6fe3ee26dcbb15ed1c67e982a0 Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Sun, 28 Apr 2024 22:38:39 +0300 Subject: [PATCH 01/10] 1 --- .../game/machinery/computer/camera_console.dm | 29 +++++++++++++++++++ code/modules/paperwork/photography.dm | 9 ++++++ 2 files changed, 38 insertions(+) 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, ...) . = ..() From 9d2375bdeb51135e922d1ec357bd2cc3bf7498dc Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Sun, 28 Apr 2024 22:48:22 +0300 Subject: [PATCH 02/10] 2 --- code/game/machinery/computer/camera_console.dm | 13 ++++++++----- code/modules/paperwork/photography.dm | 4 ++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/code/game/machinery/computer/camera_console.dm b/code/game/machinery/computer/camera_console.dm index df26cbea3409..336d0160fd21 100644 --- a/code/game/machinery/computer/camera_console.dm +++ b/code/game/machinery/computer/camera_console.dm @@ -205,7 +205,7 @@ /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 @@ -220,22 +220,25 @@ 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")) + 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!
" + 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.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) + broadcastingcamera.donationsaccount.transaction_log.Add(T) qdel(spacecash) ..() diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index a39dff19b3e7..c27da9a1f28c 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -360,6 +360,10 @@ var/obj/structure/machinery/camera/correspondent/linked_cam var/datum/money_account/donationsaccount +/obj/item/device/camera/broadcasting/get_examine_text(mob/user) + . = ..() + . += "Linked account: [donationsaccount ? "account_number" : "None, swipe your ID-card to link it."]." + /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 From 838fc03b541eb59f4c03b5e7b88535d175a845ff Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Sun, 28 Apr 2024 22:56:44 +0300 Subject: [PATCH 03/10] 3 --- code/game/machinery/computer/camera_console.dm | 1 + code/modules/paperwork/photography.dm | 3 +++ 2 files changed, 4 insertions(+) diff --git a/code/game/machinery/computer/camera_console.dm b/code/game/machinery/computer/camera_console.dm index 336d0160fd21..eda2719f39ba 100644 --- a/code/game/machinery/computer/camera_console.dm +++ b/code/game/machinery/computer/camera_console.dm @@ -230,6 +230,7 @@ if(ishuman(broadcastingcamera.loc)) var/mob/living/carbon/human/streamer = broadcastingcamera.loc streamer.play_screen_text("You've received a new donation!
" + message, /atom/movable/screen/text/screen_text/command_order, pick("#FF0000", "#008000", "#C71585", "#0000FF")) + broadcastingcamera.latestmessage = message playsound(broadcastingcamera, 'sound/machines/ping.ogg', 25) var/datum/transaction/T = new() diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index c27da9a1f28c..02d9035de588 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -359,10 +359,13 @@ 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 ? "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)) From a6b46a3e2d209bbcae976bdaecb54cd616e486c7 Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Sun, 28 Apr 2024 23:04:04 +0300 Subject: [PATCH 04/10] 4 --- code/modules/paperwork/photography.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 02d9035de588..276ecece347d 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -363,7 +363,7 @@ /obj/item/device/camera/broadcasting/get_examine_text(mob/user) . = ..() - . += "Linked account: [donationsaccount ? "account_number" : "None, swipe your ID-card to link it."]." + . += "Linked account: [donationsaccount ? "[donationsaccount.account_number]" : "None, swipe your ID-card to link it."]." if(latestmessage) . += "Latest donation: [latestmessage]." From b5edf526b6c2a6c56827b5f56fb287cfda2502a4 Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Sun, 28 Apr 2024 23:04:16 +0300 Subject: [PATCH 05/10] erm --- code/modules/paperwork/photography.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 276ecece347d..ae4e2f24c4b5 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -363,7 +363,7 @@ /obj/item/device/camera/broadcasting/get_examine_text(mob/user) . = ..() - . += "Linked account: [donationsaccount ? "[donationsaccount.account_number]" : "None, swipe your ID-card to link it."]." + . += "Linked account: [donationsaccount ? "[donationsaccount.account_number]" : "None, swipe your ID-card to link it"]." if(latestmessage) . += "Latest donation: [latestmessage]." From 58c3e17eb38d433afe2f2041525efc3ab8a631ad Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Sun, 28 Apr 2024 23:08:14 +0300 Subject: [PATCH 06/10] $$$ --- code/game/machinery/computer/camera_console.dm | 3 ++- code/modules/paperwork/photography.dm | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/computer/camera_console.dm b/code/game/machinery/computer/camera_console.dm index eda2719f39ba..906179f54f07 100644 --- a/code/game/machinery/computer/camera_console.dm +++ b/code/game/machinery/computer/camera_console.dm @@ -229,8 +229,9 @@ 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!
" + message, /atom/movable/screen/text/screen_text/command_order, pick("#FF0000", "#008000", "#C71585", "#0000FF")) + streamer.play_screen_text("You've received a new donation of [spacecash.worth]$!
" + message, /atom/movable/screen/text/screen_text/command_order, pick("#FF0000", "#008000", "#C71585", "#0000FF")) broadcastingcamera.latestmessage = message + broadcastingcamera.latestsum = spacecash.worth playsound(broadcastingcamera, 'sound/machines/ping.ogg', 25) var/datum/transaction/T = new() diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index ae4e2f24c4b5..970db8aa19d2 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -360,12 +360,13 @@ var/obj/structure/machinery/camera/correspondent/linked_cam var/datum/money_account/donationsaccount var/latestmessage + var/latestsum /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]." + . += "Latest donation: [latestmessage], [latestsum]$." /obj/item/device/camera/broadcasting/attackby(obj/item/I, mob/user) if(istype(I, /obj/item/card/id)) From 3eebbb87d4089f8393fe51c34388a5f4dd790ea0 Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Sun, 28 Apr 2024 23:22:30 +0300 Subject: [PATCH 07/10] 5 --- code/game/machinery/computer/camera_console.dm | 9 +++++---- code/modules/paperwork/photography.dm | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/game/machinery/computer/camera_console.dm b/code/game/machinery/computer/camera_console.dm index 906179f54f07..8ab21a5d7d9c 100644 --- a/code/game/machinery/computer/camera_console.dm +++ b/code/game/machinery/computer/camera_console.dm @@ -225,13 +225,14 @@ 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) + var/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]$!
" + message, /atom/movable/screen/text/screen_text/command_order, pick("#FF0000", "#008000", "#C71585", "#0000FF")) - broadcastingcamera.latestmessage = message - broadcastingcamera.latestsum = spacecash.worth + 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() diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 970db8aa19d2..f1d4b5cd072c 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -360,13 +360,12 @@ var/obj/structure/machinery/camera/correspondent/linked_cam var/datum/money_account/donationsaccount var/latestmessage - var/latestsum /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], [latestsum]$." + . += "Latest donation: [latestmessage]" /obj/item/device/camera/broadcasting/attackby(obj/item/I, mob/user) if(istype(I, /obj/item/card/id)) From 7e261d73cece7fafa70fcd061da89b27eaadfa0e Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Sun, 28 Apr 2024 23:22:53 +0300 Subject: [PATCH 08/10] $ --- code/game/machinery/computer/camera_console.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/computer/camera_console.dm b/code/game/machinery/computer/camera_console.dm index 8ab21a5d7d9c..445604ba18ac 100644 --- a/code/game/machinery/computer/camera_console.dm +++ b/code/game/machinery/computer/camera_console.dm @@ -232,7 +232,7 @@ 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]\"" + broadcastingcamera.latestmessage = "[nickname], [spacecash.worth]$, \"[message]\"" playsound(broadcastingcamera, 'sound/machines/ping.ogg', 25) var/datum/transaction/T = new() From 17b1d6d0b278afcccfdc7c2d4f8c2951c70d1186 Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Sun, 28 Apr 2024 23:23:41 +0300 Subject: [PATCH 09/10] guh --- code/game/machinery/computer/camera_console.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/computer/camera_console.dm b/code/game/machinery/computer/camera_console.dm index 445604ba18ac..72caf1224539 100644 --- a/code/game/machinery/computer/camera_console.dm +++ b/code/game/machinery/computer/camera_console.dm @@ -226,7 +226,7 @@ return var/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) + 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)) From cf02f47ab576c75081ae5dc584f2b87449b811fd Mon Sep 17 00:00:00 2001 From: AndroBetel <44546836+AndroBetel@users.noreply.github.com> Date: Mon, 29 Apr 2024 00:39:42 +0300 Subject: [PATCH 10/10] prevents spamming --- code/game/machinery/computer/camera_console.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/computer/camera_console.dm b/code/game/machinery/computer/camera_console.dm index 72caf1224539..e2155a162528 100644 --- a/code/game/machinery/computer/camera_console.dm +++ b/code/game/machinery/computer/camera_console.dm @@ -225,7 +225,10 @@ 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)", "Message", max_length = 48) + 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