diff --git a/baystation12.dme b/baystation12.dme
index f545de5b16e..c4051199740 100644
--- a/baystation12.dme
+++ b/baystation12.dme
@@ -815,6 +815,16 @@
#include "code\modules\DetectiveWork\evidence.dm"
#include "code\modules\DetectiveWork\footprints_and_rag.dm"
#include "code\modules\DetectiveWork\scanner.dm"
+#include "code\modules\economy\Accounts.dm"
+#include "code\modules\economy\Accounts_DB.dm"
+#include "code\modules\economy\ATM.dm"
+#include "code\modules\economy\cash.dm"
+#include "code\modules\economy\economy_misc.dm"
+#include "code\modules\economy\EFTPOS.dm"
+#include "code\modules\economy\Events.dm"
+#include "code\modules\economy\Events_Mundane.dm"
+#include "code\modules\economy\Job_Departments.dm"
+#include "code\modules\economy\TradeDestinations.dm"
#include "code\modules\events\blob.dm"
#include "code\modules\events\carp_migration.dm"
#include "code\modules\events\comms_blackout.dm"
@@ -1325,13 +1335,6 @@
#include "code\WorkInProgress\explosion_particles.dm"
#include "code\WorkInProgress\periodic_news.dm"
#include "code\WorkInProgress\Apples\artifacts.dm"
-#include "code\WorkInProgress\Cael_Aislinn\Economy\Accounts.dm"
-#include "code\WorkInProgress\Cael_Aislinn\Economy\Economy.dm"
-#include "code\WorkInProgress\Cael_Aislinn\Economy\Economy_Events.dm"
-#include "code\WorkInProgress\Cael_Aislinn\Economy\Economy_Events_Mundane.dm"
-#include "code\WorkInProgress\Cael_Aislinn\Economy\Economy_TradeDestinations.dm"
-#include "code\WorkInProgress\Cael_Aislinn\Economy\EFTPOS.dm"
-#include "code\WorkInProgress\Cael_Aislinn\Economy\Job_Departments.dm"
#include "code\WorkInProgress\Cael_Aislinn\Jungle\falsewall.dm"
#include "code\WorkInProgress\Cael_Aislinn\Jungle\jungle.dm"
#include "code\WorkInProgress\Cael_Aislinn\Jungle\jungle_animals.dm"
@@ -1395,7 +1398,6 @@
#include "code\WorkInProgress\computer3\computers\power.dm"
#include "code\WorkInProgress\computer3\computers\robot.dm"
#include "code\WorkInProgress\kilakk\fax.dm"
-#include "code\WorkInProgress\Mini\ATM.dm"
#include "code\WorkInProgress\Mini\atmos_control.dm"
#include "code\WorkInProgress\Ported\policetape.dm"
#include "code\WorkInProgress\Sayu\belt.dm"
diff --git a/code/WorkInProgress/Cael_Aislinn/Economy/Accounts.dm b/code/WorkInProgress/Cael_Aislinn/Economy/Accounts.dm
deleted file mode 100644
index a786e84872f..00000000000
--- a/code/WorkInProgress/Cael_Aislinn/Economy/Accounts.dm
+++ /dev/null
@@ -1,349 +0,0 @@
-var/global/current_date_string
-var/global/num_financial_terminals = 1
-var/global/datum/money_account/station_account
-var/global/list/datum/money_account/department_accounts = list()
-var/global/next_account_number = 0
-var/global/obj/machinery/account_database/centcomm_account_db
-var/global/datum/money_account/vendor_account
-var/global/list/all_money_accounts = list()
-
-/proc/create_station_account()
- if(!station_account)
- next_account_number = rand(111111, 999999)
-
- station_account = new()
- station_account.owner_name = "[station_name()] Station Account"
- station_account.account_number = rand(111111, 999999)
- station_account.remote_access_pin = rand(1111, 111111)
- station_account.money = 75000
-
- //create an entry in the account transaction log for when it was created
- var/datum/transaction/T = new()
- T.target_name = station_account.owner_name
- T.purpose = "Account creation"
- T.amount = 75000
- T.date = "2nd April, 2555"
- T.time = "11:24"
- T.source_terminal = "Biesel GalaxyNet Terminal #277"
-
- //add the account
- station_account.transaction_log.Add(T)
- all_money_accounts.Add(station_account)
-
-/proc/create_department_account(department)
- 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 = 5000
-
- //create an entry in the account transaction log for when it was created
- var/datum/transaction/T = new()
- T.target_name = department_account.owner_name
- T.purpose = "Account creation"
- T.amount = department_account.money
- T.date = "2nd April, 2555"
- T.time = "11:24"
- T.source_terminal = "Biesel GalaxyNet Terminal #277"
-
- //add the account
- department_account.transaction_log.Add(T)
- all_money_accounts.Add(department_account)
-
- department_accounts[department] = department_account
-
-//the current ingame time (hh:mm) can be obtained by calling:
-//worldtime2text()
-
-/proc/create_account(var/new_owner_name = "Default user", var/starting_funds = 0, var/obj/machinery/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("January","February","March","April","May","June","July","August","September","October","November","December")], 25[rand(10,56)]"
- T.time = "[rand(0,24)]:[rand(11,59)]"
- T.source_terminal = "NTGalaxyNet Terminal #[rand(111,1111)]"
-
- M.account_number = rand(111111, 999999)
- else
- T.date = current_date_string
- T.time = worldtime2text()
- T.source_terminal = source_db.machine_id
-
- M.account_number = next_account_number
- 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/weapon/paper/R = new /obj/item/weapon/paper(P)
- P.wrapped = R
- R.name = "Account information: [M.owner_name]"
- R.info = "Account details (confidential)
"
- R.info += "Account holder: [M.owner_name]
"
- R.info += "Account number: [M.account_number]
"
- R.info += "Account pin: [M.remote_access_pin]
"
- R.info += "Starting balance: $[M.money]
"
- R.info += "Date and time: [worldtime2text()], [current_date_string]
"
- R.info += "Creation terminal ID: [source_db.machine_id]
"
- R.info += "Authorised NT officer overseeing creation: [source_db.held_card.registered_name]
"
-
- //stamp the paper
- var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
- stampoverlay.icon_state = "paper_stamp-cent"
- if(!R.stamped)
- R.stamped = new
- R.stamped += /obj/item/weapon/stamp
- R.overlays += stampoverlay
- R.stamps += "
This paper has been stamped by the Accounts Database."
-
- //add the account
- M.transaction_log.Add(T)
- all_money_accounts.Add(M)
-
- return M
-
-/datum/money_account
- var/owner_name = ""
- var/account_number = 0
- var/remote_access_pin = 0
- var/money = 0
- var/list/transaction_log = list()
- var/security_level = 1 //0 - auto-identify from worn ID, require only account number
- //1 - require manual login / account number and pin
- //2 - require card and manual login
-
-/datum/transaction
- var/target_name = ""
- var/purpose = ""
- var/amount = 0
- var/date = ""
- var/time = ""
- var/source_terminal = ""
-
-/obj/machinery/account_database
- name = "Accounts database"
- desc = "Holds transaction logs, account data and all kinds of other financial records."
- icon = 'icons/obj/virology.dmi'
- icon_state = "analyser"
- density = 1
- req_one_access = list(access_hop, access_captain)
- var/receipt_num
- var/machine_id = ""
- var/obj/item/weapon/card/id/held_card
- var/access_level = 0
- var/datum/money_account/detailed_account_view
- var/creating_new_account = 0
- var/activated = 1
-
-/obj/machinery/account_database/New()
- ..()
- if(!station_account)
- create_station_account()
-
- if(department_accounts.len == 0)
- for(var/department in station_departments)
- create_department_account(department)
- if(!vendor_account)
- create_department_account("Vendor")
- vendor_account = department_accounts["Vendor"]
-
- if(!current_date_string)
- current_date_string = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], 2557"
-
- machine_id = "[station_name()] Acc. DB #[num_financial_terminals++]"
-
-/obj/machinery/account_database/attack_hand(mob/user as mob)
- if(get_dist(src,user) <= 1)
- var/dat = "Accounts Database
"
- dat += "[machine_id]
"
- dat += "Confirm identity: [held_card ? held_card : "-----"]
"
-
- if(access_level > 0)
- dat += "[activated ? "Disable" : "Enable"] remote access
"
- dat += "You may not edit accounts at this terminal, only create and view them.
"
- if(creating_new_account)
- dat += "
"
- dat += "Return to accounts list"
- dat += ""
- else
- if(detailed_account_view)
- dat += "
"
- dat += "Return to accounts list
"
- dat += "Account number: #[detailed_account_view.account_number]
"
- dat += "Account holder: [detailed_account_view.owner_name]
"
- dat += "Account balance: $[detailed_account_view.money]
"
- dat += ""
- dat += ""
- dat += "| Date | "
- dat += "Time | "
- dat += "Target | "
- dat += "Purpose | "
- dat += "Value | "
- dat += "Source terminal ID | "
- dat += "
"
- for(var/datum/transaction/T in detailed_account_view.transaction_log)
- dat += ""
- dat += "| [T.date] | "
- dat += "[T.time] | "
- dat += "[T.target_name] | "
- dat += "[T.purpose] | "
- dat += "$[T.amount] | "
- dat += "[T.source_terminal] | "
- dat += "
"
- dat += "
"
- else
- dat += "Create new account
"
- dat += ""
- for(var/i=1, i<=all_money_accounts.len, i++)
- var/datum/money_account/D = all_money_accounts[i]
- dat += ""
- dat += "| #[D.account_number] | "
- dat += "[D.owner_name] | "
- dat += "View in detail | "
- dat += "
"
- dat += "
"
-
- user << browse(dat,"window=account_db;size=700x650")
- else
- user << browse(null,"window=account_db")
-
-/obj/machinery/account_database/attackby(O as obj, user as mob)//TODO:SANITY
- if(istype(O, /obj/item/weapon/card))
- var/obj/item/weapon/card/id/idcard = O
- if(!held_card)
- usr.drop_item()
- idcard.loc = src
- held_card = idcard
-
- if(access_cent_captain in idcard.access)
- access_level = 2
- else if(access_hop in idcard.access || access_captain in idcard.access)
- access_level = 1
- else
- ..()
-
-/obj/machinery/account_database/Topic(var/href, var/href_list)
-
- if(href_list["toggle_activated"])
- activated = !activated
-
- if(href_list["choice"])
- switch(href_list["choice"])
- if("create_account")
- creating_new_account = 1
- if("finalise_create_account")
- var/account_name = href_list["holder_name"]
- var/starting_funds = max(text2num(href_list["starting_funds"]), 0)
- create_account(account_name, starting_funds, src)
- if(starting_funds > 0)
- //subtract the money
- station_account.money -= starting_funds
-
- //create a transaction log entry
- var/datum/transaction/T = new()
- T.target_name = account_name
- T.purpose = "New account funds initialisation"
- T.amount = "([starting_funds])"
- T.date = current_date_string
- T.time = worldtime2text()
- T.source_terminal = machine_id
- station_account.transaction_log.Add(T)
-
- creating_new_account = 0
- if("insert_card")
- if(held_card)
- held_card.loc = src.loc
-
- if(ishuman(usr) && !usr.get_active_hand())
- usr.put_in_hands(held_card)
- held_card = null
- access_level = 0
-
- else
- var/obj/item/I = usr.get_active_hand()
- if (istype(I, /obj/item/weapon/card/id))
- var/obj/item/weapon/card/id/C = I
- usr.drop_item()
- C.loc = src
- held_card = C
-
- if(access_cent_captain in C.access)
- access_level = 2
- else if(access_hop in C.access || access_captain in C.access)
- access_level = 1
- if("view_account_detail")
- var/index = text2num(href_list["account_index"])
- if(index && index <= all_money_accounts.len)
- detailed_account_view = all_money_accounts[index]
- if("view_accounts_list")
- detailed_account_view = null
- creating_new_account = 0
-
- src.attack_hand(usr)
-
-/obj/machinery/account_database/proc/charge_to_account(var/attempt_account_number, var/source_name, var/purpose, var/terminal_id, var/amount)
- if(!activated)
- return 0
- for(var/datum/money_account/D in all_money_accounts)
- if(D.account_number == attempt_account_number)
- D.money += amount
-
- //create a transaction log entry
- var/datum/transaction/T = new()
- T.target_name = source_name
- T.purpose = purpose
- if(amount < 0)
- T.amount = "([amount])"
- else
- T.amount = "[amount]"
- T.date = current_date_string
- T.time = worldtime2text()
- T.source_terminal = terminal_id
- D.transaction_log.Add(T)
-
- return 1
-
- return 0
-
-//this returns the first account datum that matches the supplied accnum/pin combination, it returns null if the combination did not match any account
-/obj/machinery/account_database/proc/attempt_account_access(var/attempt_account_number, var/attempt_pin_number, var/security_level_passed = 0)
- if(!activated)
- return 0
- for(var/datum/money_account/D in all_money_accounts)
- if(D.account_number == attempt_account_number)
- if( D.security_level <= security_level_passed && (!D.security_level || D.remote_access_pin == attempt_pin_number) )
- return D
-
-/obj/machinery/account_database/proc/attempt_account_access_nosec(var/attempt_account_number)
- if(!activated)
- return 0
- for(var/datum/money_account/D in all_money_accounts)
- if(D.account_number == attempt_account_number)
- return D
-
-/obj/machinery/account_database/proc/get_account(var/account_number)
- for(var/datum/money_account/D in all_money_accounts)
- if(D.account_number == account_number)
- return D
-/obj/machinery/account_database/process()
- return 0
\ No newline at end of file
diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm
index c9e09ebeda4..d5afad47f58 100644
--- a/code/_onclick/hud/human.dm
+++ b/code/_onclick/hud/human.dm
@@ -448,27 +448,28 @@
client.screen -= hud_used.item_action_list
+ hud_used.item_action_list = list()
for(var/obj/item/I in src)
- if(I.action_button_name)
- if(hud_used.item_action_list.len < num)
- var/obj/screen/item_action/N = new(hud_used)
- hud_used.item_action_list += N
-
- var/obj/screen/item_action/A = hud_used.item_action_list[num]
+ if(I.icon_action_button)
+ var/obj/screen/item_action/A = new(hud_used)
+ //A.icon = 'icons/mob/screen1_action.dmi'
+ //A.icon_state = I.icon_action_button
A.icon = ui_style2icon(client.prefs.UI_style)
A.icon_state = "template"
- A.overlays = list()
var/image/img = image(I.icon, A, I.icon_state)
img.pixel_x = 0
img.pixel_y = 0
A.overlays += img
- A.name = I.action_button_name
+ if(I.action_button_name)
+ A.name = I.action_button_name
+ else
+ A.name = "Use [I.name]"
A.owner = I
- client.screen += hud_used.item_action_list[num]
+ hud_used.item_action_list += A
switch(num)
if(1)
@@ -483,3 +484,4 @@
A.screen_loc = ui_action_slot5
break //5 slots available, so no more can be added.
num++
+ src.client.screen += src.hud_used.item_action_list
\ No newline at end of file
diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm
index 04ac6729587..55e5012d06c 100644
--- a/code/defines/obj/weapon.dm
+++ b/code/defines/obj/weapon.dm
@@ -25,75 +25,6 @@
flags = TABLEPASS
w_class = 3.0
-
-/obj/item/weapon/spacecash
- name = "1 credit chip"
- desc = "It's worth 1 credit."
- gender = PLURAL
- icon = 'icons/obj/items.dmi'
- icon_state = "spacecash"
- opacity = 0
- density = 0
- anchored = 0.0
- force = 1.0
- throwforce = 1.0
- throw_speed = 1
- throw_range = 2
- w_class = 1.0
- var/access = list()
- access = access_crate_cash
- var/worth = 1
-
-/obj/item/weapon/spacecash/c10
- name = "10 credit chip"
- icon_state = "spacecash10"
- access = access_crate_cash
- desc = "It's worth 10 credits."
- worth = 10
-
-/obj/item/weapon/spacecash/c20
- name = "20 credit chip"
- icon_state = "spacecash20"
- access = access_crate_cash
- desc = "It's worth 20 credits."
- worth = 20
-
-/obj/item/weapon/spacecash/c50
- name = "50 credit chip"
- icon_state = "spacecash50"
- access = access_crate_cash
- desc = "It's worth 50 credits."
- worth = 50
-
-/obj/item/weapon/spacecash/c100
- name = "100 credit chip"
- icon_state = "spacecash100"
- access = access_crate_cash
- desc = "It's worth 100 credits."
- worth = 100
-
-/obj/item/weapon/spacecash/c200
- name = "200 credit chip"
- icon_state = "spacecash200"
- access = access_crate_cash
- desc = "It's worth 200 credits."
- worth = 200
-
-/obj/item/weapon/spacecash/c500
- name = "500 credit chip"
- icon_state = "spacecash500"
- access = access_crate_cash
- desc = "It's worth 500 credits."
- worth = 500
-
-/obj/item/weapon/spacecash/c1000
- name = "1000 credit chip"
- icon_state = "spacecash1000"
- access = access_crate_cash
- desc = "It's worth 1000 credits."
- worth = 1000
-
-
/obj/item/weapon/bananapeel
name = "banana peel"
desc = "A peel from a banana."
diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm
index 49e7e36c438..0fc89e14dec 100644
--- a/code/game/gamemodes/gameticker.dm
+++ b/code/game/gamemodes/gameticker.dm
@@ -118,13 +118,6 @@ var/global/datum/controller/gameticker/ticker
else
src.mode.announce()
- //setup the money accounts
- if(!centcomm_account_db)
- for(var/obj/machinery/account_database/check_db in machines)
- if(check_db.z == 2)
- centcomm_account_db = check_db
- break
-
create_characters() //Create player characters and transfer them
collect_minds()
equip_characters()
diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm
index bfb3bf5909f..540d1987938 100644
--- a/code/game/jobs/job_controller.dm
+++ b/code/game/jobs/job_controller.dm
@@ -381,37 +381,35 @@ var/global/datum/controller/occupations/job_master
if(istype(S, /obj/effect/landmark/start) && istype(S.loc, /turf))
H.loc = S.loc
- //give them an account in the station database
- if(centcomm_account_db)
- var/balance = round(rand(1,5))*100 // Between $100 and $500
- var/datum/money_account/M = create_account(H.real_name, balance , null)
- if(H.mind)
- var/remembered_info = ""
- remembered_info += "Your account number is: #[M.account_number]
"
- remembered_info += "Your account pin is: [M.remote_access_pin]
"
- remembered_info += "Your account funds are: $[M.money]
"
+ var/datum/money_account/M = create_account(H.real_name, rand(50,500)*10, null)
+ if(H.mind)
+ var/remembered_info = ""
- if(M.transaction_log.len)
- var/datum/transaction/T = M.transaction_log[1]
- remembered_info += "Your account was created: [T.time], [T.date] at [T.source_terminal]
"
- H.mind.store_memory(remembered_info)
+ remembered_info += "Your account number is: #[M.account_number]
"
+ remembered_info += "Your account pin is: [M.remote_access_pin]
"
+ remembered_info += "Your account funds are: $[M.money]
"
- H.mind.initial_account = M
+ if(M.transaction_log.len)
+ var/datum/transaction/T = M.transaction_log[1]
+ remembered_info += "Your account was created: [T.time], [T.date] at [T.source_terminal]
"
+ H.mind.store_memory(remembered_info)
- // If they're head, give them the account info for their department
- if(H.mind && job.head_position)
- var/remembered_info = ""
- var/datum/money_account/department_account = department_accounts[job.department]
+ H.mind.initial_account = M
- if(department_account)
- remembered_info += "Your department's account number is: #[department_account.account_number]
"
- remembered_info += "Your department's account pin is: [department_account.remote_access_pin]
"
- remembered_info += "Your department's account funds are: $[department_account.money]
"
+ // If they're head, give them the account info for their department
+ if(H.mind && job.head_position)
+ var/remembered_info = ""
+ var/datum/money_account/department_account = department_accounts[job.department]
- H.mind.store_memory(remembered_info)
+ if(department_account)
+ remembered_info += "Your department's account number is: #[department_account.account_number]
"
+ remembered_info += "Your department's account pin is: [department_account.remote_access_pin]
"
+ remembered_info += "Your department's account funds are: $[department_account.money]
"
- spawn(0)
- H << "\blueYour account number is: [M.account_number], your account pin is: [M.remote_access_pin]"
+ H.mind.store_memory(remembered_info)
+
+ spawn(0)
+ H << "\blueYour account number is: [M.account_number], your account pin is: [M.remote_access_pin]"
var/alt_title = null
if(H.mind)
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index f28f1832545..09e7ceff8d4 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -53,8 +53,7 @@
var/datum/wires/vending/wires = null
var/scan_id = 1
- var/obj/machinery/account_database/linked_db
- var/datum/money_account/linked_account
+
/obj/machinery/vending/New()
..()
@@ -73,18 +72,13 @@
src.build_inventory(premium, 0, 1)
power_change()
- reconnect_database()
- linked_account = vendor_account
+
return
return
-/obj/machinery/vending/proc/reconnect_database()
- for(var/obj/machinery/account_database/DB in world)
- if(DB.z == 1) //Hardcoded to the main station for now.
- linked_db = DB
- break
+
/obj/machinery/vending/ex_act(severity)
switch(severity)
@@ -167,17 +161,8 @@
del(W)
else if(istype(W, /obj/item/weapon/card) && currently_vending)
- //attempt to connect to a new db, and if that doesn't work then fail
- if(!linked_db)
- reconnect_database()
- if(linked_db)
- if(linked_account)
- var/obj/item/weapon/card/I = W
- scan_card(I)
- else
- usr << "\icon[src]Unable to connect to linked account."
- else
- usr << "\icon[src]Unable to connect to accounts database."
+ var/obj/item/weapon/card/I = W
+ scan_card(I)
@@ -189,19 +174,19 @@
if (istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
visible_message("[usr] swipes a card through [src].")
- if(linked_account)
- var/datum/money_account/D = linked_db.attempt_account_access_nosec(C.associated_account_number)
+ if(vendor_account)
+ var/datum/money_account/D = attempt_account_access_nosec(C.associated_account_number)
if(D)
var/transaction_amount = currently_vending.price
if(transaction_amount <= D.money)
//transfer the money
D.money -= transaction_amount
- linked_account.money += transaction_amount
+ vendor_account.money += transaction_amount
//create entries in the two account transaction logs
var/datum/transaction/T = new()
- T.target_name = "[linked_account.owner_name] (via [src.name])"
+ T.target_name = "[vendor_account.owner_name] (via [src.name])"
T.purpose = "Purchase of [currently_vending.product_name]"
if(transaction_amount > 0)
T.amount = "([transaction_amount])"
@@ -219,7 +204,7 @@
T.source_terminal = src.name
T.date = current_date_string
T.time = worldtime2text()
- linked_account.transaction_log.Add(T)
+ vendor_account.transaction_log.Add(T)
// Vend the item
src.vend(src.currently_vending, usr)
@@ -229,7 +214,7 @@
else
usr << "\icon[src]Unable to access account. Check security settings and try again."
else
- usr << "\icon[src]EFTPOS is not connected to an account."
+ usr << "\icon[src]Unable to access vendor account. Please record the machine ID and call CentComm Support."
/obj/machinery/vending/attack_paw(mob/user as mob)
return attack_hand(user)
diff --git a/code/WorkInProgress/Mini/ATM.dm b/code/modules/economy/ATM.dm
similarity index 100%
rename from code/WorkInProgress/Mini/ATM.dm
rename to code/modules/economy/ATM.dm
diff --git a/code/modules/economy/Accounts.dm b/code/modules/economy/Accounts.dm
new file mode 100644
index 00000000000..0bc5c18431d
--- /dev/null
+++ b/code/modules/economy/Accounts.dm
@@ -0,0 +1,118 @@
+
+/datum/money_account
+ var/owner_name = ""
+ var/account_number = 0
+ var/remote_access_pin = 0
+ var/money = 0
+ var/list/transaction_log = list()
+ var/suspended = 0
+ var/security_level = 0 //0 - auto-identify from worn ID, require only account number
+ //1 - require manual login / account number and pin
+ //2 - require card and manual login
+
+/datum/transaction
+ var/target_name = ""
+ var/purpose = ""
+ var/amount = 0
+ var/date = ""
+ var/time = ""
+ var/source_terminal = ""
+
+/proc/create_account(var/new_owner_name = "Default user", var/starting_funds = 0, var/obj/machinery/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("January","February","March","April","May","June","July","August","September","October","November","December")], 25[rand(10,56)]"
+ T.time = "[rand(0,24)]:[rand(11,59)]"
+ T.source_terminal = "NTGalaxyNet Terminal #[rand(111,1111)]"
+
+ M.account_number = rand(111111, 999999)
+ else
+ T.date = current_date_string
+ T.time = worldtime2text()
+ T.source_terminal = source_db.machine_id
+
+ M.account_number = next_account_number
+ 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/weapon/paper/R = new /obj/item/weapon/paper(P)
+ P.wrapped = R
+ R.name = "Account information: [M.owner_name]"
+ R.info = "Account details (confidential)
"
+ R.info += "Account holder: [M.owner_name]
"
+ R.info += "Account number: [M.account_number]
"
+ R.info += "Account pin: [M.remote_access_pin]
"
+ R.info += "Starting balance: $[M.money]
"
+ R.info += "Date and time: [worldtime2text()], [current_date_string]
"
+ R.info += "Creation terminal ID: [source_db.machine_id]
"
+ R.info += "Authorised NT officer overseeing creation: [source_db.held_card.registered_name]
"
+
+ //stamp the paper
+ var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
+ stampoverlay.icon_state = "paper_stamp-cent"
+ if(!R.stamped)
+ R.stamped = new
+ R.stamped += /obj/item/weapon/stamp
+ R.overlays += stampoverlay
+ R.stamps += "
This paper has been stamped by the Accounts Database."
+
+ //add the account
+ M.transaction_log.Add(T)
+ all_money_accounts.Add(M)
+
+ return M
+
+/proc/charge_to_account(var/attempt_account_number, var/source_name, var/purpose, var/terminal_id, var/amount)
+ for(var/datum/money_account/D in all_money_accounts)
+ if(D.account_number == attempt_account_number && !D.suspended)
+ D.money += amount
+
+ //create a transaction log entry
+ var/datum/transaction/T = new()
+ T.target_name = source_name
+ T.purpose = purpose
+ if(amount < 0)
+ T.amount = "([amount])"
+ else
+ T.amount = "[amount]"
+ T.date = current_date_string
+ T.time = worldtime2text()
+ T.source_terminal = terminal_id
+ D.transaction_log.Add(T)
+
+ return 1
+ break
+
+ return 0
+
+//this returns the first account datum that matches the supplied accnum/pin combination, it returns null if the combination did not match any account
+/proc/attempt_account_access(var/attempt_account_number, var/attempt_pin_number, var/security_level_passed = 0)
+ for(var/datum/money_account/D in all_money_accounts)
+ if(D.account_number == attempt_account_number)
+ if( D.security_level <= security_level_passed && (!D.security_level || D.remote_access_pin == attempt_pin_number) )
+ return D
+ break
+
+/proc/get_account(var/account_number)
+ for(var/datum/money_account/D in all_money_accounts)
+ if(D.account_number == account_number)
+ return D
+
+/proc/attempt_account_access_nosec(var/attempt_account_number)
+ for(var/datum/money_account/D in all_money_accounts)
+ if(D.account_number == attempt_account_number)
+ return D
diff --git a/code/modules/economy/Accounts_DB.dm b/code/modules/economy/Accounts_DB.dm
new file mode 100644
index 00000000000..70bf8ee125f
--- /dev/null
+++ b/code/modules/economy/Accounts_DB.dm
@@ -0,0 +1,169 @@
+
+/obj/machinery/account_database
+ name = "Accounts uplink console"
+ desc = "Access transaction logs, account data and all kinds of other financial records."
+ icon = 'icons/obj/computer.dmi'
+ icon_state = "aiupload"
+ density = 1
+ req_one_access = list(access_hop, access_captain, access_cent_captain)
+ var/receipt_num
+ var/machine_id = ""
+ var/obj/item/weapon/card/id/held_card
+ var/access_level = 0
+ var/datum/money_account/detailed_account_view
+ var/creating_new_account = 0
+
+/obj/machinery/account_database/New()
+ ..()
+ machine_id = "[station_name()] Acc. DB #[num_financial_terminals++]"
+
+/obj/machinery/account_database/attack_hand(mob/user as mob)
+ if(get_dist(src,user) <= 1)
+ var/dat = "Accounts Database
"
+ dat += "[machine_id]
"
+ dat += "Confirm identity: [held_card ? held_card : "-----"]
"
+
+ if(access_level > 0)
+ dat += "You may not edit accounts at this terminal, only create and view them.
"
+ if(creating_new_account)
+ dat += "
"
+ dat += "Return to accounts list"
+ dat += ""
+ else
+ if(detailed_account_view)
+ dat += "
"
+ dat += "Return to accounts list
"
+ dat += "Account number: #[detailed_account_view.account_number]
"
+ dat += "Account holder: [detailed_account_view.owner_name]
"
+ dat += "Account balance: $[detailed_account_view.money]
"
+ if(access_level > 1)
+ dat += "Silently add funds (no transaction log)
"
+ dat += "Silently remove funds (no transaction log)
"
+ dat += "[detailed_account_view.suspended ? "Unsuspend account" : "Suspend account"]
"
+ dat += ""
+ dat += ""
+ dat += "| Date | "
+ dat += "Time | "
+ dat += "Target | "
+ dat += "Purpose | "
+ dat += "Value | "
+ dat += "Source terminal ID | "
+ dat += "
"
+ for(var/datum/transaction/T in detailed_account_view.transaction_log)
+ dat += ""
+ dat += "| [T.date] | "
+ dat += "[T.time] | "
+ dat += "[T.target_name] | "
+ dat += "[T.purpose] | "
+ dat += "$[T.amount] | "
+ dat += "[T.source_terminal] | "
+ dat += "
"
+ dat += "
"
+ else
+ dat += "Create new account
"
+ dat += ""
+ for(var/i=1, i<=all_money_accounts.len, i++)
+ var/datum/money_account/D = all_money_accounts[i]
+ dat += ""
+ dat += "| #[D.account_number] | "
+ dat += "[D.owner_name] | "
+ dat += "[D.suspended ? "SUSPENDED" : ""] | "
+ dat += "View in detail | "
+ dat += "
"
+ dat += "
"
+
+ user << browse(dat,"window=account_db;size=700x650")
+ else
+ user << browse(null,"window=account_db")
+
+/obj/machinery/account_database/attackby(O as obj, user as mob)//TODO:SANITY
+ if(istype(O, /obj/item/weapon/card))
+ var/obj/item/weapon/card/id/idcard = O
+ if(!held_card)
+ usr.drop_item()
+ idcard.loc = src
+ held_card = idcard
+
+ if(access_cent_captain in idcard.access)
+ access_level = 2
+ else if(access_hop in idcard.access || access_captain in idcard.access)
+ access_level = 1
+ else
+ ..()
+
+/obj/machinery/account_database/Topic(var/href, var/href_list)
+
+ if(href_list["choice"])
+ switch(href_list["choice"])
+ if("create_account")
+ creating_new_account = 1
+ if("add_funds")
+ var/amount = input("Enter the amount you wish to add", "Silently add funds") as num
+ if(detailed_account_view)
+ detailed_account_view.money += amount
+ if("remove_funds")
+ var/amount = input("Enter the amount you wish to remove", "Silently remove funds") as num
+ if(detailed_account_view)
+ detailed_account_view.money -= amount
+ if("toggle_suspension")
+ if(detailed_account_view)
+ if(detailed_account_view.suspended)
+ detailed_account_view.suspended = 0
+ else
+ detailed_account_view.suspended = 1
+ if("finalise_create_account")
+ var/account_name = href_list["holder_name"]
+ var/starting_funds = max(text2num(href_list["starting_funds"]), 0)
+ create_account(account_name, starting_funds, src)
+ if(starting_funds > 0)
+ //subtract the money
+ station_account.money -= starting_funds
+
+ //create a transaction log entry
+ var/datum/transaction/T = new()
+ T.target_name = account_name
+ T.purpose = "New account funds initialisation"
+ T.amount = "([starting_funds])"
+ T.date = current_date_string
+ T.time = worldtime2text()
+ T.source_terminal = machine_id
+ station_account.transaction_log.Add(T)
+
+ creating_new_account = 0
+ if("insert_card")
+ if(held_card)
+ held_card.loc = src.loc
+
+ if(ishuman(usr) && !usr.get_active_hand())
+ usr.put_in_hands(held_card)
+ held_card = null
+ access_level = 0
+
+ else
+ var/obj/item/I = usr.get_active_hand()
+ if (istype(I, /obj/item/weapon/card/id))
+ var/obj/item/weapon/card/id/C = I
+ usr.drop_item()
+ C.loc = src
+ held_card = C
+
+ if(access_cent_captain in C.access)
+ access_level = 2
+ else if(access_hop in C.access || access_captain in C.access)
+ access_level = 1
+ if("view_account_detail")
+ var/index = text2num(href_list["account_index"])
+ if(index && index <= all_money_accounts.len)
+ detailed_account_view = all_money_accounts[index]
+ if("view_accounts_list")
+ detailed_account_view = null
+ creating_new_account = 0
+
+ src.attack_hand(usr)
diff --git a/code/WorkInProgress/Cael_Aislinn/Economy/EFTPOS.dm b/code/modules/economy/EFTPOS.dm
similarity index 74%
rename from code/WorkInProgress/Cael_Aislinn/Economy/EFTPOS.dm
rename to code/modules/economy/EFTPOS.dm
index 27d8533c59d..12f941bd1cf 100644
--- a/code/WorkInProgress/Cael_Aislinn/Economy/EFTPOS.dm
+++ b/code/modules/economy/EFTPOS.dm
@@ -10,14 +10,12 @@
var/transaction_amount = 0
var/transaction_purpose = "Default charge"
var/access_code = 0
- var/obj/machinery/account_database/linked_db
var/datum/money_account/linked_account
/obj/item/device/eftpos/New()
..()
machine_id = "[station_name()] EFTPOS #[num_financial_terminals++]"
access_code = rand(1111,111111)
- reconnect_database()
spawn(0)
print_reference()
@@ -69,16 +67,6 @@
D.wrapped = R
D.name = "small parcel - 'EFTPOS access code'"
-/obj/item/device/eftpos/proc/reconnect_database()
- var/turf/location = get_turf(src)
- if(!location)
- return
-
- for(var/obj/machinery/account_database/DB in machines) //Hotfix until someone finds out why it isn't in 'machines'
- if(DB.z == location.z)
- linked_db = DB
- break
-
/obj/item/device/eftpos/attack_self(mob/user as mob)
if(get_dist(src,user) <= 1)
var/dat = "[eftpos_name]
"
@@ -109,17 +97,11 @@
/obj/item/device/eftpos/attackby(O as obj, user as mob)
if(istype(O, /obj/item/weapon/card))
- //attempt to connect to a new db, and if that doesn't work then fail
- if(!linked_db)
- reconnect_database()
- if(linked_db)
- if(linked_account)
- var/obj/item/weapon/card/I = O
- scan_card(I)
- else
- usr << "\icon[src]Unable to connect to linked account."
+ if(linked_account)
+ var/obj/item/weapon/card/I = O
+ scan_card(I)
else
- usr << "\icon[src]Unable to connect to accounts database."
+ usr << "\icon[src]Unable to connect to linked account."
else
..()
@@ -145,14 +127,12 @@
else
usr << "\icon[src]Incorrect code entered."
if("link_account")
- if(!linked_db)
- reconnect_database()
- if(linked_db)
- var/attempt_account_num = input("Enter account number to pay EFTPOS charges into", "New account number") as num
- var/attempt_pin = input("Enter pin code", "Account pin") as num
- linked_account = linked_db.attempt_account_access(attempt_account_num, attempt_pin, 1)
- else
- usr << "\icon[src]Unable to connect to accounts database."
+ var/attempt_account_num = input("Enter account number to pay EFTPOS charges into", "New account number") as num
+ var/attempt_pin = input("Enter pin code", "Account pin") as num
+ linked_account = attempt_account_access(attempt_account_num, attempt_pin, 1)
+ if(linked_account.suspended)
+ linked_account = null
+ usr << "\icon[src]Account has been suspended."
if("trans_purpose")
transaction_purpose = input("Enter reason for EFTPOS transaction", "Transaction purpose")
if("trans_value")
@@ -172,10 +152,7 @@
else
usr << "\icon[src] No account connected to send transactions to."
if("scan_card")
- //attempt to connect to a new db, and if that doesn't work then fail
- if(!linked_db)
- reconnect_database()
- if(linked_db && linked_account)
+ if(linked_account)
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card))
scan_card(I)
@@ -201,46 +178,63 @@
visible_message("[usr] swipes a card through [src].")
if(transaction_locked && !transaction_paid)
if(linked_account)
- var/attempt_pin = input("Enter pin code", "EFTPOS transaction") as num
- var/datum/money_account/D = linked_db.attempt_account_access(C.associated_account_number, attempt_pin, 2)
- if(D)
- if(transaction_amount <= D.money)
- playsound(src, 'sound/machines/chime.ogg', 50, 1)
- src.visible_message("\icon[src] The [src] chimes.")
- transaction_paid = 1
+ if(!linked_account.suspended)
+ var/attempt_pin = input("Enter pin code", "EFTPOS transaction") as num
+ var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
+ if(D)
+ if(!D.suspended)
+ if(transaction_amount <= D.money)
+ playsound(src, 'sound/machines/chime.ogg', 50, 1)
+ src.visible_message("\icon[src] The [src] chimes.")
+ transaction_paid = 1
- //transfer the money
- D.money -= transaction_amount
- linked_account.money += transaction_amount
+ //transfer the money
+ D.money -= transaction_amount
+ linked_account.money += transaction_amount
- //create entries in the two account transaction logs
- var/datum/transaction/T = new()
- T.target_name = "[linked_account.owner_name] (via [eftpos_name])"
- T.purpose = transaction_purpose
- if(transaction_amount > 0)
- T.amount = "([transaction_amount])"
+ //create entries in the two account transaction logs
+ var/datum/transaction/T = new()
+ T.target_name = "[linked_account.owner_name] (via [eftpos_name])"
+ T.purpose = transaction_purpose
+ if(transaction_amount > 0)
+ T.amount = "([transaction_amount])"
+ else
+ T.amount = "[transaction_amount]"
+ T.source_terminal = machine_id
+ T.date = current_date_string
+ T.time = worldtime2text()
+ D.transaction_log.Add(T)
+ //
+ T = new()
+ T.target_name = D.owner_name
+ T.purpose = transaction_purpose
+ T.amount = "[transaction_amount]"
+ T.source_terminal = machine_id
+ T.date = current_date_string
+ T.time = worldtime2text()
+ linked_account.transaction_log.Add(T)
+ else
+ usr << "\icon[src]You don't have that much money!"
else
- T.amount = "[transaction_amount]"
- T.source_terminal = machine_id
- T.date = current_date_string
- T.time = worldtime2text()
- D.transaction_log.Add(T)
- //
- T = new()
- T.target_name = D.owner_name
- T.purpose = transaction_purpose
- T.amount = "[transaction_amount]"
- T.source_terminal = machine_id
- T.date = current_date_string
- T.time = worldtime2text()
- linked_account.transaction_log.Add(T)
+ usr << "\icon[src]Your account has been suspended."
else
- usr << "\icon[src]You don't have that much money!"
+ usr << "\icon[src]Unable to access account. Check security settings and try again."
else
- usr << "\icon[src]Unable to access account. Check security settings and try again."
+ usr << "\icon[src]Connected account has been suspended."
else
usr << "\icon[src]EFTPOS is not connected to an account."
+ else if (istype(I, /obj/item/weapon/card/emag))
+ if(transaction_locked)
+ if(transaction_paid)
+ usr << "\icon[src]You stealthily swipe [I] through [src]."
+ transaction_locked = 0
+ transaction_paid = 0
+ else
+ visible_message("[usr] swipes a card through [src].")
+ playsound(src, 'sound/machines/chime.ogg', 50, 1)
+ src.visible_message("\icon[src] The [src] chimes.")
+ transaction_paid = 1
else
..()
- //emag?
\ No newline at end of file
+ //emag?
diff --git a/code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events.dm b/code/modules/economy/Events.dm
similarity index 99%
rename from code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events.dm
rename to code/modules/economy/Events.dm
index 2aa5cc42d1e..bd5e3c0a1e6 100644
--- a/code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events.dm
+++ b/code/modules/economy/Events.dm
@@ -8,9 +8,6 @@
var/datum/trade_destination/affected_dest
/datum/event/economic_event/start()
- if(!setup_economy)
- setup_economy()
-
affected_dest = pickweight(weighted_randomevent_locations)
if(affected_dest.viable_random_events.len)
endWhen = rand(60,300)
diff --git a/code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events_Mundane.dm b/code/modules/economy/Events_Mundane.dm
similarity index 100%
rename from code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events_Mundane.dm
rename to code/modules/economy/Events_Mundane.dm
diff --git a/code/WorkInProgress/Cael_Aislinn/Economy/Job_Departments.dm b/code/modules/economy/Job_Departments.dm
similarity index 90%
rename from code/WorkInProgress/Cael_Aislinn/Economy/Job_Departments.dm
rename to code/modules/economy/Job_Departments.dm
index 7eacc8c727a..64abe66acc1 100644
--- a/code/WorkInProgress/Cael_Aislinn/Economy/Job_Departments.dm
+++ b/code/modules/economy/Job_Departments.dm
@@ -1,4 +1,4 @@
-var/list/station_departments = list("Command", "Medical", "Engineering", "Science", "Security", "Cargo", "Civilian", "Trade")
+var/list/station_departments = list("Command", "Medical", "Engineering", "Science", "Security", "Cargo", "Civilian")
// The department the job belongs to.
/datum/job/var/department = null
@@ -67,7 +67,4 @@ var/list/station_departments = list("Command", "Medical", "Engineering", "Scienc
/datum/job/detective/department = "Security"
-/datum/job/officer/department = "Security"
-
-/datum/job/trader/department = "Trade"
-/datum/job/trader/head_position = 1
\ No newline at end of file
+/datum/job/officer/department = "Security"
\ No newline at end of file
diff --git a/code/WorkInProgress/Cael_Aislinn/Economy/Economy_TradeDestinations.dm b/code/modules/economy/TradeDestinations.dm
similarity index 100%
rename from code/WorkInProgress/Cael_Aislinn/Economy/Economy_TradeDestinations.dm
rename to code/modules/economy/TradeDestinations.dm
diff --git a/code/modules/economy/cash.dm b/code/modules/economy/cash.dm
new file mode 100644
index 00000000000..c352caa88d4
--- /dev/null
+++ b/code/modules/economy/cash.dm
@@ -0,0 +1,74 @@
+/obj/item/weapon/spacecash
+ name = "0 credit chip"
+ desc = "It's worth 0 credits."
+ gender = PLURAL
+ icon = 'icons/obj/items.dmi'
+ icon_state = "spacecash"
+ opacity = 0
+ density = 0
+ anchored = 0.0
+ force = 1.0
+ throwforce = 1.0
+ throw_speed = 1
+ throw_range = 2
+ w_class = 1.0
+ var/access = list()
+ access = access_crate_cash
+ var/worth = 0
+
+/obj/item/weapon/spacecash/c1
+ name = "1 credip chip"
+ icon_state = "spacecash"
+ desc = "It's worth 1 credit."
+ worth = 1
+
+/obj/item/weapon/spacecash/c10
+ name = "10 credit chip"
+ icon_state = "spacecash10"
+ desc = "It's worth 10 credits."
+ worth = 10
+
+/obj/item/weapon/spacecash/c20
+ name = "20 credit chip"
+ icon_state = "spacecash20"
+ desc = "It's worth 20 credits."
+ worth = 20
+
+/obj/item/weapon/spacecash/c50
+ name = "50 credit chip"
+ icon_state = "spacecash50"
+ desc = "It's worth 50 credits."
+ worth = 50
+
+/obj/item/weapon/spacecash/c100
+ name = "100 credit chip"
+ icon_state = "spacecash100"
+ desc = "It's worth 100 credits."
+ worth = 100
+
+/obj/item/weapon/spacecash/c200
+ name = "200 credit chip"
+ icon_state = "spacecash200"
+ desc = "It's worth 200 credits."
+ worth = 200
+
+/obj/item/weapon/spacecash/c500
+ name = "500 credit chip"
+ icon_state = "spacecash500"
+ desc = "It's worth 500 credits."
+ worth = 500
+
+/obj/item/weapon/spacecash/c1000
+ name = "1000 credit chip"
+ icon_state = "spacecash1000"
+ desc = "It's worth 1000 credits."
+ worth = 1000
+
+proc/spawn_money(var/sum, spawnloc)
+ var/cash_type
+ for(var/i in list(1000,500,200,100,50,20,10,1))
+ cash_type = text2path("/obj/item/weapon/spacecash/c[i]")
+ while(sum >= i)
+ sum -= i
+ new cash_type(spawnloc)
+ return
\ No newline at end of file
diff --git a/code/WorkInProgress/Cael_Aislinn/Economy/Economy.dm b/code/modules/economy/economy_misc.dm
similarity index 60%
rename from code/WorkInProgress/Cael_Aislinn/Economy/Economy.dm
rename to code/modules/economy/economy_misc.dm
index 84000d1b46f..ffe8a114717 100644
--- a/code/WorkInProgress/Cael_Aislinn/Economy/Economy.dm
+++ b/code/modules/economy/economy_misc.dm
@@ -44,7 +44,7 @@
#define ROBOTICS 13
#define BIOMEDICAL 14
-#define EVA 15
+#define GEAR_EVA 15
//---- The following corporations are friendly with NanoTrasen and loosely enable trade and travel:
//Corporation NanoTrasen - Generalised / high tech research and plasma exploitation.
@@ -63,10 +63,20 @@
//Destroyers are medium sized vessels, often used for escorting larger ships but able to go toe-to-toe with them if need be.
//Frigates are medium sized vessels, often used for escorting larger ships. They will rapidly find themselves outclassed if forced to face heavy warships head on.
-var/setup_economy = 0
+var/global/current_date_string
+
+var/global/datum/money_account/vendor_account
+var/global/datum/money_account/station_account
+var/global/list/datum/money_account/department_accounts = list()
+var/global/num_financial_terminals = 1
+var/global/next_account_number = 0
+var/global/list/all_money_accounts = list()
+var/global/economy_init = 0
+
/proc/setup_economy()
- if(setup_economy)
- return
+ if(economy_init)
+ return 2
+
var/datum/feed_channel/newChannel = new /datum/feed_channel
newChannel.channel_name = "Tau Ceti Daily"
newChannel.author = "CentComm Minister of Information"
@@ -86,4 +96,61 @@ var/setup_economy = 0
weighted_randomevent_locations[D] = D.viable_random_events.len
weighted_mundaneevent_locations[D] = D.viable_mundane_events.len
- setup_economy = 1
\ No newline at end of file
+ create_station_account()
+
+ for(var/department in station_departments)
+ create_department_account(department)
+ create_department_account("Vendor")
+ vendor_account = department_accounts["Vendor"]
+
+ current_date_string = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], 2557"
+
+ economy_init = 1
+ return 1
+
+/proc/create_station_account()
+ if(!station_account)
+ next_account_number = rand(111111, 999999)
+
+ station_account = new()
+ station_account.owner_name = "[station_name()] Station Account"
+ station_account.account_number = rand(111111, 999999)
+ station_account.remote_access_pin = rand(1111, 111111)
+ station_account.money = 75000
+
+ //create an entry in the account transaction log for when it was created
+ var/datum/transaction/T = new()
+ T.target_name = station_account.owner_name
+ T.purpose = "Account creation"
+ T.amount = 75000
+ T.date = "2nd April, 2555"
+ T.time = "11:24"
+ T.source_terminal = "Biesel GalaxyNet Terminal #277"
+
+ //add the account
+ station_account.transaction_log.Add(T)
+ all_money_accounts.Add(station_account)
+
+/proc/create_department_account(department)
+ 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 = 5000
+
+ //create an entry in the account transaction log for when it was created
+ var/datum/transaction/T = new()
+ T.target_name = department_account.owner_name
+ T.purpose = "Account creation"
+ T.amount = department_account.money
+ T.date = "2nd April, 2555"
+ T.time = "11:24"
+ T.source_terminal = "Biesel GalaxyNet Terminal #277"
+
+ //add the account
+ department_account.transaction_log.Add(T)
+ all_money_accounts.Add(department_account)
+
+ department_accounts[department] = department_account
diff --git a/code/modules/events/money_hacker.dm b/code/modules/events/money_hacker.dm
index 5171f22fe8f..754ec0c6579 100644
--- a/code/modules/events/money_hacker.dm
+++ b/code/modules/events/money_hacker.dm
@@ -10,7 +10,7 @@
/datum/event/money_hacker/setup()
if(all_money_accounts.len)
for(var/obj/machinery/account_database/DB in world)
- if( DB.z == 1 && !(DB.stat&NOPOWER) && DB.activated )
+ if( DB.z == 1 && !(DB.stat&NOPOWER))
affected_db = DB
break
if(affected_db)
@@ -60,7 +60,7 @@
/datum/event/money_hacker/tick()
if(world.time > time_start + time_duration)
var/message
- if(affected_account && affected_db && affected_db.activated && !(affected_db.stat & (NOPOWER|BROKEN)) )
+ if(affected_account && affected_db && !(affected_db.stat & (NOPOWER|BROKEN)) )
//hacker wins
message = "The hack attempt has succeeded."
diff --git a/icons/mob/screen1_Midnight.dmi b/icons/mob/screen1_Midnight.dmi
index 187ee616370..65b9f235337 100644
Binary files a/icons/mob/screen1_Midnight.dmi and b/icons/mob/screen1_Midnight.dmi differ