#define STATION_CREATION_DATE "2 April, 2555"
#define STATION_CREATION_TIME "11:24:30"
#define STATION_START_CASH 75000
#define STATION_SOURCE_TERMINAL "Biesel GalaxyNet Terminal #227"
#define DEPARTMENT_START_CASH 5000
GLOBAL_VAR_INIT(num_financial_terminals, 1)
GLOBAL_DATUM(station_account, /datum/money_account)
GLOBAL_LIST_EMPTY(department_accounts)
GLOBAL_VAR_INIT(next_account_number, 0)
GLOBAL_DATUM(centcomm_account_db, /obj/machinery/computer/account_database) // this being an object hurts me deeply on the inside
GLOBAL_DATUM(vendor_account, /datum/money_account)
GLOBAL_LIST_EMPTY(all_money_accounts)
/proc/create_station_account()
if(!GLOB.station_account)
GLOB.next_account_number = rand(111111, 999999)
GLOB.station_account = new()
GLOB.station_account.owner_name = "[station_name()] Station Account"
GLOB.station_account.account_number = rand(111111, 999999)
GLOB.station_account.remote_access_pin = rand(1111, 111111)
GLOB.station_account.money = STATION_START_CASH
//create an entry in the account transaction log for when it was created
GLOB.station_account.makeTransactionLog(STATION_START_CASH, "Account Creation", STATION_SOURCE_TERMINAL, GLOB.station_account.owner_name, FALSE,
STATION_CREATION_DATE, STATION_CREATION_TIME)
//add the account
GLOB.all_money_accounts.Add(GLOB.station_account)
/proc/create_department_account(department)
GLOB.next_account_number = rand(111111, 999999)
var/datum/money_account/department_account = new()
department_account.owner_name = "[department] Account"
department_account.account_number = rand(111111, 999999)
department_account.remote_access_pin = rand(1111, 111111)
department_account.money = DEPARTMENT_START_CASH
//create an entry in the account transaction log for when it was created
department_account.makeTransactionLog(DEPARTMENT_START_CASH, "Account Creation", STATION_SOURCE_TERMINAL, department_account.owner_name, FALSE,
STATION_CREATION_DATE, STATION_CREATION_TIME)
//add the account
GLOB.all_money_accounts.Add(department_account)
GLOB.department_accounts[department] = department_account
//the current ingame time (hh:mm:ss) can be obtained by calling:
//station_time_timestamp("hh:mm:ss")
/proc/create_account(var/new_owner_name = "Default user", var/starting_funds = 0, var/obj/machinery/computer/account_database/source_db)
//create a new account
var/datum/money_account/M = new()
M.owner_name = new_owner_name
M.remote_access_pin = rand(1111, 111111)
M.money = starting_funds
//create an entry in the account transaction log for when it was created
var/datum/transaction/T = new()
T.target_name = new_owner_name
T.purpose = "Account creation"
T.amount = starting_funds
if(!source_db)
//set a random date, time and location some time over the past few decades
T.date = "[num2text(rand(1,31))] [pick(GLOB.month_names)], [rand(GLOB.game_year - 20,GLOB.game_year - 1)]"
T.time = "[rand(0,23)]:[rand(0,59)]:[rand(0,59)]"
T.source_terminal = "NTGalaxyNet Terminal #[rand(111,1111)]"
M.account_number = rand(111111, 999999)
else
T.date = GLOB.current_date_string
T.time = station_time_timestamp()
T.source_terminal = source_db.machine_id
M.account_number = GLOB.next_account_number
GLOB.next_account_number += rand(1,25)
//create a sealed package containing the account details
var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(source_db.loc)
var/obj/item/paper/R = new /obj/item/paper(P)
playsound(source_db.loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1)
P.wrapped = R
R.name = "Account information: [M.owner_name]"
var/overseer = "Unknown"
var/datum/tgui_login/L = source_db.tgui_login_get()
if(L.id)
overseer = L.id.registered_name
R.info = {"Account details (confidential)