From 3759112ad6a5053761065c40698fa0266c1bdb66 Mon Sep 17 00:00:00 2001 From: MMMiracles Date: Sun, 18 Nov 2018 15:52:52 -0500 Subject: [PATCH 1/4] paystands now take a custom input instead of a static price at setup --- code/modules/economy/pay_stand.dm | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/code/modules/economy/pay_stand.dm b/code/modules/economy/pay_stand.dm index e703477ab3f2f8..d7d38891270630 100644 --- a/code/modules/economy/pay_stand.dm +++ b/code/modules/economy/pay_stand.dm @@ -5,7 +5,6 @@ icon_state = "card_scanner" density = TRUE anchored = TRUE - var/price = 0 var/obj/item/card/id/my_card /obj/machinery/paystand/attackby(obj/item/W, mob/user, params) @@ -16,35 +15,36 @@ var/msg = stripped_input(user, "Name of pay stand:", "Paystand Naming", "[user]'s Awesome Paystand") if(!msg) return - var/price2 = input(user, "Enter price.", "Paystand Pricing", 25) as num - if(!price2 || price2 < 0) - return - name = "[msg] ($[price2])" - desc = "Owned by [assistant_mains_need_to_die.registered_account.account_holder]. Pays directly into [user.p_their()] account when swiped with an ID card." - price = price2 + name = "[msg]" + desc = "Owned by [assistant_mains_need_to_die.registered_account.account_holder]. Pays directly into [user.p_their()] account." my_card = assistant_mains_need_to_die to_chat(user, "You link the stand to your account.") return var/obj/item/card/id/vbucks = W if(vbucks.registered_account) - if(vbucks.registered_account.adjust_money(-price)) - purchase(vbucks.registered_account.account_holder) + var/momsdebitcard = input(user, "How much would you like to deposit?", "Money Deposit") as null|num + if(momsdebitcard < 1) + to_chat(user, "ERROR: Invalid amount designated.") + return + if(vbucks.registered_account.adjust_money(-momsdebitcard)) + purchase(vbucks.registered_account.account_holder, momsdebitcard) to_chat(user, "Thanks for purchasing! The vendor has been informed.") return else - to_chat(user, "You trying to punk me, kid? Come back when you have the cash.") + to_chat(user, "ERROR: Account has insufficent funds to make transaction.") return else - to_chat(user, "You're going to need an actual bank account for that one, buddy.") + to_chat(user, "ERROR: No bank account assigned to identification card.") return if(istype(W, /obj/item/holochip)) var/obj/item/holochip/H = W - if(H.spend(price, FALSE)) - purchase(user) + var/cashmoney = input(user, "How much would you like to deposit?", "Money Deposit") as null|num + if(H.spend(cashmoney, FALSE)) + purchase(user, cashmoney) to_chat(user, "Thanks for purchasing! The vendor has been informed.") return else - to_chat(user, "You trying to punk me, kid? Come back when you have the cash.") + to_chat(user, "ERROR: Account has insufficent funds to make transaction.") return if(istype(W, /obj/item/stack/spacecash)) to_chat(user, "What is this, the 2000s? We only take card here.") @@ -67,7 +67,7 @@ else return ..() -/obj/machinery/paystand/proc/purchase(buyer) +/obj/machinery/paystand/proc/purchase(buyer, price) my_card.registered_account.adjust_money(price) my_card.registered_account.bank_card_talk("Purchase made at your vendor by [buyer] for [price] credits.") \ No newline at end of file From a8c83aaf44ae0ea2de6667953c0eb30938039cf4 Mon Sep 17 00:00:00 2001 From: MMMiracles Date: Sun, 18 Nov 2018 20:29:57 -0500 Subject: [PATCH 2/4] allows signaler attaching --- code/modules/economy/pay_stand.dm | 35 +++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/code/modules/economy/pay_stand.dm b/code/modules/economy/pay_stand.dm index d7d38891270630..c799cf69d326e0 100644 --- a/code/modules/economy/pay_stand.dm +++ b/code/modules/economy/pay_stand.dm @@ -6,6 +6,9 @@ density = TRUE anchored = TRUE var/obj/item/card/id/my_card + var/obj/item/assembly/signaler/signaler = null //attached signaler, let people attach signalers that get activated if the user's transaction limit is achieved. + var/signaler_threshold = 0 //signaler threshold amount + var/amount_deposited = 0 //keep track of the amount deposited over time so you can pay multiple times to reach the signaler threshold /obj/machinery/paystand/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/card/id)) @@ -16,7 +19,7 @@ if(!msg) return name = "[msg]" - desc = "Owned by [assistant_mains_need_to_die.registered_account.account_holder]. Pays directly into [user.p_their()] account." + desc = "Owned by [assistant_mains_need_to_die.registered_account.account_holder], pays directly into [user.p_their()] account." my_card = assistant_mains_need_to_die to_chat(user, "You link the stand to your account.") return @@ -31,7 +34,7 @@ to_chat(user, "Thanks for purchasing! The vendor has been informed.") return else - to_chat(user, "ERROR: Account has insufficent funds to make transaction.") + to_chat(user, "ERROR: Account has insufficient funds to make transaction.") return else to_chat(user, "ERROR: No bank account assigned to identification card.") @@ -44,7 +47,7 @@ to_chat(user, "Thanks for purchasing! The vendor has been informed.") return else - to_chat(user, "ERROR: Account has insufficent funds to make transaction.") + to_chat(user, "ERROR: Account has insufficient funds to make transaction.") return if(istype(W, /obj/item/stack/spacecash)) to_chat(user, "What is this, the 2000s? We only take card here.") @@ -52,7 +55,27 @@ if(istype(W, /obj/item/coin)) to_chat(user, "What is this, the 1800s? We only take card here.") return - + if(istype(W, /obj/item/assembly/signaler)) + if(signaler.secured) + to_chat(user, "The signaler needs to be in attachable mode to add it to the paystand!") + return + if(!my_card) + to_chat(user, "ERROR: No identification card has been assigned to this paystand yet!") + return + if(!signaler) + var/cash_limit = input(user, "Enter the minium amount of cash needed to deposit before the signaler is activated.", "Signaler Activation Threshold") as null|num + if(cash_limit < 1) + to_chat(user, "ERROR: Invalid amount designated.") + return + if(cash_limit) + W.forceMove(src) + signaler = W + signaler_threshold = cash_limit + to_chat(user, "You attach the signaler to the paystand.") + desc += " A signaler appears to be attached to the scanner." + else + to_chat(user, "A signaler is already attached to this unit!") + if(default_deconstruction_screwdriver(user, "card_scanner", "card_scanner", W)) return @@ -70,4 +93,8 @@ /obj/machinery/paystand/proc/purchase(buyer, price) my_card.registered_account.adjust_money(price) my_card.registered_account.bank_card_talk("Purchase made at your vendor by [buyer] for [price] credits.") + amount_deposited = amount_deposited + price + if(signaler && amount_deposited >= signaler_threshold) + signaler.activate() + amount_deposited = 0 \ No newline at end of file From cc2778839d056d3c76d965af37edb73ea3c82eb2 Mon Sep 17 00:00:00 2001 From: MMMiracles Date: Mon, 19 Nov 2018 10:48:38 -0500 Subject: [PATCH 3/4] adds bolt locking + delayed unwrenching --- code/modules/economy/pay_stand.dm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/modules/economy/pay_stand.dm b/code/modules/economy/pay_stand.dm index c799cf69d326e0..dc8827e66a1431 100644 --- a/code/modules/economy/pay_stand.dm +++ b/code/modules/economy/pay_stand.dm @@ -5,6 +5,7 @@ icon_state = "card_scanner" density = TRUE anchored = TRUE + var/locked = FALSE var/obj/item/card/id/my_card var/obj/item/assembly/signaler/signaler = null //attached signaler, let people attach signalers that get activated if the user's transaction limit is achieved. var/signaler_threshold = 0 //signaler threshold amount @@ -12,6 +13,10 @@ /obj/machinery/paystand/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/card/id)) + if(W == my_card) + locked = !locked + to_chat(user, "You [src.locked ? "lock" : "unlock"] the bolts on the paystand.") + return if(!my_card) var/obj/item/card/id/assistant_mains_need_to_die = W if(assistant_mains_need_to_die.registered_account) @@ -97,4 +102,10 @@ if(signaler && amount_deposited >= signaler_threshold) signaler.activate() amount_deposited = 0 + +/obj/machinery/paystand/default_unfasten_wrench(mob/user, obj/item/I, time = 20) + if(locked) + to_chat(user, "The anchored bolts on this paystand are currently locked!") + return + . = ..() \ No newline at end of file From 45f151f4654ed677befa5745c9ca68da7ff9465e Mon Sep 17 00:00:00 2001 From: MMMiracles Date: Mon, 19 Nov 2018 14:46:52 -0500 Subject: [PATCH 4/4] spelling stuff --- code/modules/economy/pay_stand.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/economy/pay_stand.dm b/code/modules/economy/pay_stand.dm index dc8827e66a1431..550dce39232d64 100644 --- a/code/modules/economy/pay_stand.dm +++ b/code/modules/economy/pay_stand.dm @@ -7,7 +7,7 @@ anchored = TRUE var/locked = FALSE var/obj/item/card/id/my_card - var/obj/item/assembly/signaler/signaler = null //attached signaler, let people attach signalers that get activated if the user's transaction limit is achieved. + var/obj/item/assembly/signaler/signaler //attached signaler, let people attach signalers that get activated if the user's transaction limit is achieved. var/signaler_threshold = 0 //signaler threshold amount var/amount_deposited = 0 //keep track of the amount deposited over time so you can pay multiple times to reach the signaler threshold @@ -23,7 +23,7 @@ var/msg = stripped_input(user, "Name of pay stand:", "Paystand Naming", "[user]'s Awesome Paystand") if(!msg) return - name = "[msg]" + name = msg desc = "Owned by [assistant_mains_need_to_die.registered_account.account_holder], pays directly into [user.p_their()] account." my_card = assistant_mains_need_to_die to_chat(user, "You link the stand to your account.") @@ -52,7 +52,7 @@ to_chat(user, "Thanks for purchasing! The vendor has been informed.") return else - to_chat(user, "ERROR: Account has insufficient funds to make transaction.") + to_chat(user, "ERROR: Insufficient funds to make transaction.") return if(istype(W, /obj/item/stack/spacecash)) to_chat(user, "What is this, the 2000s? We only take card here.") @@ -68,7 +68,7 @@ to_chat(user, "ERROR: No identification card has been assigned to this paystand yet!") return if(!signaler) - var/cash_limit = input(user, "Enter the minium amount of cash needed to deposit before the signaler is activated.", "Signaler Activation Threshold") as null|num + var/cash_limit = input(user, "Enter the minimum amount of cash needed to deposit before the signaler is activated.", "Signaler Activation Threshold") as null|num if(cash_limit < 1) to_chat(user, "ERROR: Invalid amount designated.") return