mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
tweaks to finances (added feedback to atms, made accounts synced to station account db at round start)
Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
@@ -161,7 +161,7 @@ var/global/obj/machinery/account_database/centcomm_account_db
|
||||
for(var/datum/money_account/M in A.accounts)
|
||||
if(!src.accounts.Find(M))
|
||||
src.accounts.Add(M)
|
||||
usr << "\icon[src] <span class='info'>Accounts synched across all databases in range.</span>"
|
||||
usr << "\icon[src] <span class='info'>Accounts synched across all NanoTrasen financial databases.</span>"
|
||||
|
||||
if("create_account")
|
||||
creating_new_account = 1
|
||||
@@ -215,6 +215,15 @@ var/global/obj/machinery/account_database/centcomm_account_db
|
||||
|
||||
src.attack_hand(usr)
|
||||
|
||||
/obj/machinery/account_database/proc/add_account_across_all(var/new_owner_name = "Default user", var/starting_funds = 0, var/pre_existing = 0)
|
||||
var/datum/money_account/M = add_account(new_owner_name, starting_funds, pre_existing)
|
||||
for(var/obj/machinery/account_database/D in world)
|
||||
if(D == src)
|
||||
continue
|
||||
D.accounts.Add(M)
|
||||
|
||||
return M
|
||||
|
||||
/obj/machinery/account_database/proc/add_account(var/new_owner_name = "Default user", var/starting_funds = 0, var/pre_existing = 0)
|
||||
|
||||
//create a new account
|
||||
|
||||
@@ -46,6 +46,8 @@ log transactions
|
||||
authenticated_account = null
|
||||
if(ticks_left_locked_down > 0)
|
||||
ticks_left_locked_down--
|
||||
if(ticks_left_locked_down <= 0)
|
||||
number_incorrect_tries = 0
|
||||
|
||||
for(var/obj/item/weapon/spacecash/S in src)
|
||||
S.loc = src.loc
|
||||
@@ -223,7 +225,7 @@ log transactions
|
||||
var/new_sec_level = max( min(text2num(href_list["new_security_level"]), 2), 0)
|
||||
authenticated_account.security_level = new_sec_level
|
||||
if("attempt_auth")
|
||||
if(linked_db)
|
||||
if(linked_db && !ticks_left_locked_down)
|
||||
var/tried_account_num = text2num(href_list["account_num"])
|
||||
if(!tried_account_num)
|
||||
tried_account_num = held_card.associated_account_number
|
||||
@@ -231,11 +233,11 @@ log transactions
|
||||
|
||||
authenticated_account = linked_db.attempt_account_access(tried_account_num, tried_pin, held_card && held_card.associated_account_number == tried_account_num ? 2 : 1)
|
||||
if(!authenticated_account)
|
||||
number_incorrect_tries++
|
||||
if(previous_account_number == tried_account_num)
|
||||
if(++number_incorrect_tries > max_pin_attempts)
|
||||
if(number_incorrect_tries > max_pin_attempts)
|
||||
//lock down the atm
|
||||
number_incorrect_tries = 0
|
||||
ticks_left_locked_down = 10
|
||||
ticks_left_locked_down = 30
|
||||
playsound(src, 'buzz-two.ogg', 50, 1)
|
||||
|
||||
//create an entry in the account transaction log
|
||||
@@ -247,9 +249,12 @@ log transactions
|
||||
T.time = worldtime2text()
|
||||
authenticated_account.transaction_log.Add(T)
|
||||
else
|
||||
usr << "\red \icon[src] incorrect pin/account combination entered, [max_pin_attempts - number_incorrect_tries] attempts remaining."
|
||||
previous_account_number = tried_account_num
|
||||
number_incorrect_tries = 1
|
||||
playsound(src, 'buzz-sigh.ogg', 50, 1)
|
||||
else
|
||||
usr << "\red \icon[src] incorrect pin/account combination entered."
|
||||
number_incorrect_tries = 0
|
||||
else
|
||||
playsound(src, 'twobeep.ogg', 50, 1)
|
||||
ticks_left_timeout = 120
|
||||
@@ -263,6 +268,8 @@ log transactions
|
||||
T.date = current_date_string
|
||||
T.time = worldtime2text()
|
||||
authenticated_account.transaction_log.Add(T)
|
||||
|
||||
previous_account_number = tried_account_num
|
||||
if("withdrawal")
|
||||
var/amount = max(text2num(href_list["funds_amount"]),0)
|
||||
if(authenticated_account && amount > 0)
|
||||
|
||||
Reference in New Issue
Block a user