Converts Economy to a Subsystem (#5253)

Converts Economy to a Subsystem and cleans it up a bit
This commit is contained in:
Werner
2018-11-03 14:34:22 +01:00
committed by Erki
parent 866da21d57
commit a42e6a118b
19 changed files with 361 additions and 327 deletions
+4 -5
View File
@@ -7,8 +7,8 @@
/datum/event/money_hacker/setup()
end_time = world.time + 6000
if(all_money_accounts.len)
affected_account = pick(all_money_accounts)
if(SSeconomy.all_money_accounts.len)
affected_account = pick(SSeconomy.all_money_accounts)
account_hack_attempted = 1
else
@@ -48,13 +48,12 @@
T.amount = pick("","([rand(0,99999)])","alla money","9001$","HOLLA HOLLA GET DOLLA","([lost])")
var/date1 = "31 December, 1999"
var/date2 = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], [rand(1000,3000)]"
T.date = pick("", current_date_string, date1, date2)
T.date = pick("", worlddate2text(), date1, date2)
var/time1 = rand(0, 99999999)
var/time2 = "[round(time1 / 36000)+12]:[(time1 / 600 % 60) < 10 ? add_zero(time1 / 600 % 60, 1) : time1 / 600 % 60]"
T.time = pick("", worldtime2text(), time2)
T.source_terminal = pick("","[pick("Biesel","New Gibson")] GalaxyNet Terminal #[rand(111,999)]","your mums place","nantrasen high CommanD")
affected_account.transaction_log.Add(T)
SSeconomy.add_transaction_log(affected_account,T)
else
//crew wins
+4 -4
View File
@@ -5,8 +5,8 @@
/datum/event/money_lotto/start()
winner_sum = pick(1, 50, 100, 500, 1000, 2000, 5000)
if(all_money_accounts.len)
var/datum/money_account/D = pick(all_money_accounts)
if(SSeconomy.all_money_accounts.len)
var/datum/money_account/D = pick(SSeconomy.all_money_accounts)
winner_name = D.owner_name
if(!D.suspended)
D.money += winner_sum
@@ -15,10 +15,10 @@
T.target_name = "Tau Ceti Daily Grand Slam -Stellar- Lottery"
T.purpose = "Winner!"
T.amount = winner_sum
T.date = current_date_string
T.date = worlddate2text()
T.time = worldtime2text()
T.source_terminal = "Biesel TCD Terminal #[rand(111,333)]"
D.transaction_log.Add(T)
SSeconomy.add_transaction_log(D,T)
deposit_success = 1