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 + "} + for(var/datum/bank_account/account in SSeconomy.bank_accounts) + dat += {"" + dat += "" + + dat += "
Bank Accounts
[account.account_holder] - [account.account_id]"} + dat += "Assign to ID
" else var/list/header = list() var/scan_name = inserted_scan_id ? html_encode(inserted_scan_id.name) : "--------" @@ -266,6 +277,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) Target: Remove [target_name] || Confirm Identity: Remove [scan_name]
Access Crew Manifest
+ Access Bank Accounts
[!target_dept ? "Job Management
" : ""] Log Out"} @@ -443,6 +455,17 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) if(access_allowed == 1) inserted_modify_id.access += access_type playsound(src, "terminal_type", 50, FALSE) + if ("bankassign") + if (authenticated == 2) + var/datum/bank_account/account = locate(href_list["assign_bank"]) + if (inserted_modify_id && account) + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) + to_chat(usr, "Bank account: [account.account_id], has been assigned to the ID.") + inserted_modify_id.registered_account = account + else + to_chat(usr, "There is no id inserted to modify.") + + if ("assign") if (authenticated == 2) var/t1 = href_list["assign_target"] diff --git a/code/modules/jobs/job_types/job.dm b/code/modules/jobs/job_types/job.dm index 5390f9f9..30d3d1ed 100644 --- a/code/modules/jobs/job_types/job.dm +++ b/code/modules/jobs/job_types/job.dm @@ -94,7 +94,9 @@ var/datum/bank_account/bank_account = new(H.real_name, src) bank_account.account_holder = H.real_name bank_account.account_job = src - bank_account.account_id = rand(111111,999999) + bank_account.account_id = rand(111111,999999) //give account ID! + //bank_account.account_pin = rand(1000,9999) //give random pin! + bank_account.account_balance = 50 H.account_id = bank_account.account_id if(CONFIG_GET(flag/enforce_human_authority) && (title in GLOB.command_positions)) diff --git a/hyperstation/code/__DEFINES/economy.dm b/hyperstation/code/__DEFINES/economy.dm index 428ea3a0..7cb6fc6a 100644 --- a/hyperstation/code/__DEFINES/economy.dm +++ b/hyperstation/code/__DEFINES/economy.dm @@ -1,33 +1,4 @@ -#define STARTING_PAYCHECKS 5 - -#define PAYCHECK_ASSISTANT 25 -#define PAYCHECK_MINIMAL 75 -#define PAYCHECK_EASY 125 -#define PAYCHECK_MEDIUM 175 -#define PAYCHECK_HARD 200 -#define PAYCHECK_COMMAND 250 - -#define MAX_GRANT_CIV 2500 -#define MAX_GRANT_ENG 3000 -#define MAX_GRANT_SCI 5000 -#define MAX_GRANT_SECMEDSRV 3000 - -#define ACCOUNT_CIV "CIV" -#define ACCOUNT_CIV_NAME "Civil Budget" -#define ACCOUNT_ENG "ENG" -#define ACCOUNT_ENG_NAME "Engineering Budget" -#define ACCOUNT_SCI "SCI" -#define ACCOUNT_SCI_NAME "Scientific Budget" -#define ACCOUNT_MED "MED" -#define ACCOUNT_MED_NAME "Medical Budget" -#define ACCOUNT_SRV "SRV" -#define ACCOUNT_SRV_NAME "Service Budget" -#define ACCOUNT_CAR "CAR" -#define ACCOUNT_CAR_NAME "Cargo Budget" -#define ACCOUNT_SEC "SEC" -#define ACCOUNT_SEC_NAME "Defense Budget" - -#define NO_FREEBIES "commies go home" +#define STARTING_PAYCHECK 50 //ID bank account support defines. #define ID_NO_BANK_ACCOUNT 0 diff --git a/hyperstation/code/controllers/subsystem/economy.dm b/hyperstation/code/controllers/subsystem/economy.dm index 73e51dc2..b69e29c8 100644 --- a/hyperstation/code/controllers/subsystem/economy.dm +++ b/hyperstation/code/controllers/subsystem/economy.dm @@ -5,12 +5,5 @@ SUBSYSTEM_DEF(economy) runlevels = RUNLEVEL_GAME var/roundstart_paychecks = 5 var/budget_pool = 35000 - var/list/department_accounts = list(ACCOUNT_CIV = ACCOUNT_CIV_NAME, - ACCOUNT_ENG = ACCOUNT_ENG_NAME, - ACCOUNT_SCI = ACCOUNT_SCI_NAME, - ACCOUNT_MED = ACCOUNT_MED_NAME, - ACCOUNT_SRV = ACCOUNT_SRV_NAME, - ACCOUNT_CAR = ACCOUNT_CAR_NAME, - ACCOUNT_SEC = ACCOUNT_SEC_NAME) var/list/generated_accounts = list() var/list/bank_accounts = list() //List of normal accounts (not department accounts) \ No newline at end of file diff --git a/hyperstation/code/modules/economy/account.dm b/hyperstation/code/modules/economy/account.dm index e2f3d0cb..039ab448 100644 --- a/hyperstation/code/modules/economy/account.dm +++ b/hyperstation/code/modules/economy/account.dm @@ -3,6 +3,7 @@ /datum/bank_account var/account_holder = "Some pleb" var/account_balance = 0 + var/account_offstation_balance = 0 var/account_pin = 0 var/account_dna = "" var/datum/job/account_job diff --git a/hyperstation/code/obj/economy.dm b/hyperstation/code/obj/economy.dm index 87224590..d5e4deb3 100644 --- a/hyperstation/code/obj/economy.dm +++ b/hyperstation/code/obj/economy.dm @@ -37,17 +37,19 @@ else 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|cVSovneix~Moi!rp64y#XwOA`M_qYBmqt)mo=|24b>%^@>Vh%l z-!riDO5oqIV#@%q>={`3S`dG7pGVyHBM`6{(67J`VJXl?zI_7cwP4)Vl_yVmPt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