From 39a5e2863ea7e7cc2e997fb18b8cd8ea582bacb6 Mon Sep 17 00:00:00 2001 From: QuoteFox <49098813+quotefox@users.noreply.github.com> Date: Fri, 29 Jan 2021 01:08:23 +0000 Subject: [PATCH] final touches to part 1 final touches to part 1 --- code/controllers/subsystem/job.dm | 3 +- code/game/machinery/computer/card.dm | 23 +++++++++ code/modules/jobs/job_types/job.dm | 4 +- hyperstation/code/__DEFINES/economy.dm | 31 +----------- .../code/controllers/subsystem/economy.dm | 7 --- hyperstation/code/modules/economy/account.dm | 1 + hyperstation/code/obj/economy.dm | 47 +++++++++++------- hyperstation/icons/obj/economy.dmi | Bin 780 -> 817 bytes 8 files changed, 58 insertions(+), 58 deletions(-) diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index 494a6568..9048d77b 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -444,7 +444,8 @@ SUBSYSTEM_DEF(job) if(ishuman(H)) var/mob/living/carbon/human/wageslave = H - to_chat(M, "Your account ID is [wageslave.account_id].") + to_chat(M, "Your account ID is [wageslave.account_id]") + to_chat(M, "You do not have a pin, can set your pin at a ATM.") H.add_memory("Your account ID is [wageslave.account_id].") if(job && H) diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 99f8035e..99b7c577 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -19,6 +19,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) var/mode = 0 var/printing = null var/target_dept = 0 //Which department this computer has access to. 0=all departments + var/datum/bank_account/account/selectedbank //Cooldown for closing positions in seconds //if set to -1: No cooldown... probably a bad idea @@ -250,6 +251,16 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) dat += "" dat += "" + // Bank management + else if(mode == 4) + dat += {"Return +
| Bank Accounts | [account.account_holder] - [account.account_id]"} + dat += "Assign to ID | " + dat += "
Error, this account number does not exsist, please contact your local administration." - if(!idcard.registered_account.account_pin || pin == idcard.registered_account.account_pin) - dat += "
Balance: $[idcard.registered_account.account_balance]" - dat += "
" - dat += "Withdraw" - dat += "Change Pin" - dat += "Account Settings" - dat += "Eject" - else - dat += "
Please enter your bank pin to continue!" - dat += "
"
- dat += "[pin ? pin : "----"]
"
+ if(idcard.registered_account)
+ if(!idcard.registered_account.account_pin || pin == idcard.registered_account.account_pin)
+ dat += "
Balance: $[idcard.registered_account.account_balance]" + //dat += "
Offstation Balance: " + dat += "
" + dat += "Withdraw" + dat += "Change Pin" + //dat += "Account Settings" + dat += "Eject" + else + dat += "
Please enter your bank pin to continue!" + dat += "
"
+ dat += "[pin ? pin : "----"]
"
dat += "
"
@@ -61,7 +63,7 @@
popup.open()
/obj/machinery/atm/attackby(obj/item/I, mob/living/user)
- if(istype(I, /obj/item/card))
+ if(istype(I, /obj/item/card)) //input id!
if(!held_card)
var/obj/item/card/id/idcard = I
if(!user.transferItemToLoc(I, src)) //check if you can put it in
@@ -72,6 +74,15 @@
playsound(src, 'sound/machines/button.ogg', 50, FALSE)
src.ui_interact(usr)
+ if(istype(I, /obj/item/stack/credits)) //feed money back into the machine! dont need a pin to donate stuff.
+ if(held_card)
+ var/obj/item/stack/credits/cred = I
+ var/obj/item/card/id/idcard = held_card
+ idcard.registered_account.account_balance = (idcard.registered_account.account_balance+cred.amount)
+ to_chat(usr, "You insert [cred] into the ATM.")
+ src.ui_interact(usr)
+ del(cred)
+
/obj/machinery/atm/Topic(href, href_list)
. = ..()
if(..())
@@ -126,13 +137,14 @@
var/obj/item/card/id/idcard = held_card
if(idcard.registered_account)
var/amount = input(user, "Choose amount", "Withdraw") as num|null
- if(amount)
+ if(amount>0)
amount = max(min( round(text2num(amount)), idcard.registered_account.account_balance),0) //make sure they aint taking out more then what they have
to_chat(usr, "The machine prints out [amount] credits.")
idcard.registered_account.account_balance = (idcard.registered_account.account_balance-amount) //subtract the amount they took out.
var/obj/item/stack/credits/C = new /obj/item/stack/credits/(loc)
C.amount = amount
- C.update_desc()
+ if(usr.put_in_hands(C))
+ to_chat(usr, "You take [C] out of the ATM.")
src.ui_interact(usr)
@@ -143,10 +155,11 @@
/obj/item/stack/credits
name = "credits"
singular_name = "credit"
+ desc = "Legal tender, a bundle of shiny metalic looking notes."
icon = 'hyperstation/icons/obj/economy.dmi'
icon_state = "cash"
amount = 1
- max_amount = 100
+ max_amount = 99999999
throwforce = 0
throw_speed = 2
throw_range = 2
@@ -154,7 +167,3 @@
full_w_class = WEIGHT_CLASS_TINY
resistance_flags = FLAMMABLE
var/value = 1
-
-/obj/item/stack/credits/proc/update_desc()
- var/total_worth = amount*value
- desc = "Legal tender, It's worth [total_worth] credit[( total_worth > 1 ) ? "s" : ""]"
\ No newline at end of file
diff --git a/hyperstation/icons/obj/economy.dmi b/hyperstation/icons/obj/economy.dmi
index 6e6dec04dc64dd1425a4adc471ce201e05cc14fc..7f2db7b114dfb6260c995ae5a92a8f8ac9e62c3d 100644
GIT binary patch
delta 647
zcmV;20(kw52C)WBiBL{Q4GJ0x0000DNk~Le0000$0000$2m=5B0G+pi>;M1&giuUW
zMF0Q*WMpKsv$MayzuVi}pP!#iUPW7eOkZDLbFNu&zfWV3PmxDIHo?Kc-rnBr*cRpG
z<;JTa!=@hp|NphMwUN5I0RQ~Jq8rkVhEV_j00DGTPE!Ct=GbNc004%O*L#0&$fc~{
z>gNJ>6ab>2DrPlpMd|