miscellaneous tweaks to finance machines

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2013-02-26 02:59:04 +10:00
parent c1eda324b8
commit 02ace92b04
4 changed files with 50 additions and 2 deletions

View File

@@ -63,6 +63,7 @@ var/global/obj/machinery/account_database/centcomm_account_db
var/access_level = 0
var/datum/money_account/detailed_account_view
var/creating_new_account = 0
var/activated = 1
/obj/machinery/account_database/New()
..()
@@ -81,6 +82,7 @@ var/global/obj/machinery/account_database/centcomm_account_db
dat += "Confirm identity: <a href='?src=\ref[src];choice=insert_card'>[held_card ? held_card : "-----"]</a><br>"
if(access_level > 0)
dat += "<a href='?src=\ref[src];toggle_activated=1'>Toggle remote access to this database (warning!)</a>"
dat += "You may not edit accounts at this terminal, only create and view them.<br>"
if(creating_new_account)
dat += "<br>"
@@ -151,6 +153,10 @@ var/global/obj/machinery/account_database/centcomm_account_db
..()
/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("sync_accounts")
@@ -283,6 +289,8 @@ var/global/obj/machinery/account_database/centcomm_account_db
return M
/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 accounts)
if(D.account_number == attempt_account_number)
D.money += amount
@@ -306,6 +314,8 @@ var/global/obj/machinery/account_database/centcomm_account_db
//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 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) )

View File

@@ -14,6 +14,17 @@
#define ANIMAL_RIGHTS_RAID 13
#define FESTIVAL 14
#define RESEARCH_BREAKTHROUGH 15
#define BARGAINS 16
#define SONG_DEBUT 17
#define MOVIE_RELEASE 18
#define BIG_GAME_HUNTERS 19
#define ELECTION 20
#define GOSSIP 21
#define TOURISM 22
#define CELEBRITY_DEATH 23
#define RESIGNATION 24
#define DEFAULT 1
#define ADMINISTRATIVE 2
@@ -54,10 +65,25 @@
var/setup_economy = 0
/proc/setup_economy()
if(setup_economy)
return
var/datum/feed_channel/newChannel = new /datum/feed_channel
newChannel.channel_name = "Tau Ceti Daily"
newChannel.author = "CentComm Minister of Information"
newChannel.locked = 1
newChannel.is_admin_channel = 1
news_network.network_channels += newChannel
setup_economy = 1
newChannel = new /datum/feed_channel
newChannel.channel_name = "The Gibson Gazette"
newChannel.author = "Editor Mike Hammers"
newChannel.locked = 1
newChannel.is_admin_channel = 1
news_network.network_channels += newChannel
for(var/loc_type in typesof(/datum/trade_destination) - /datum/trade_destination)
var/datum/trade_destination/D = new loc_type
weighted_randomevent_locations[D] = D.viable_random_events.len
weighted_mundaneevent_locations[D] = D.viable_mundane_events.len
setup_economy = 1

View File

@@ -40,6 +40,15 @@ log transactions
machine_id = "[station_name()] RT #[num_financial_terminals++]"
/obj/machinery/atm/process()
if(stat & NOPOWER)
return
if(linked_db && linked_db.stat & NOPOWER)
linked_db = null
authenticated_account = null
src.visible_message("\red \icon[src] [src] buzzes rudely, \"Connection to remote database lost.\"")
updateDialog()
if(ticks_left_timeout > 0)
ticks_left_timeout--
if(ticks_left_timeout <= 0)
@@ -59,7 +68,7 @@ log transactions
/obj/machinery/atm/proc/reconnect_database()
for(var/obj/machinery/account_database/DB in world)
if(DB.z == src.z)
if(DB.z == src.z && !DB.stat & NOPOWER)
linked_db = DB
break