Revert "12/21 modernizations from TG live"

This commit is contained in:
LetterJay
2016-12-22 22:35:44 -06:00
committed by GitHub
parent cf59ac1c3d
commit ae40d4134e
2215 changed files with 86928 additions and 707332 deletions
+30 -4
View File
@@ -7,10 +7,12 @@
var/logged_in = "Cargo Department"
var/vmode = 1
clockwork = TRUE //it'd look weird
light_color = LIGHT_COLOR_GREEN
light_range_on = 2
/obj/machinery/computer/stockexchange/New()
..()
logged_in = "[station_name()] Cargo Department"
logged_in = "[world.name] Cargo Department"
/obj/machinery/computer/stockexchange/proc/balance()
if (!logged_in)
@@ -83,6 +85,25 @@ a.updated {
dat += "<b>Prominent products:</b><br>"
for (var/prod in S.products)
dat += "<i>[prod]</i><br>"
dat += "<br><b>Borrow options:</b><br>"
if (S.borrow_brokers.len)
for (var/datum/borrow/B in S.borrow_brokers)
dat += "<b>[B.broker]</b> offers <i>[B.share_amount] shares</i> for borrowing, for a deposit of <i>[B.deposit * 100]%</i> of the shares' value.<br>"
dat += "The broker expects the return of the shares after <i>[B.lease_time / 600] minutes</i>, with a grace period of <i>[B.grace_time / 600]</i> minute(s).<br>"
dat += "<i>This offer expires in [(B.offer_expires - world.time) / 600] minutes.</i><br>"
dat += "<b>Note:</b> If you do not return all shares by the end of the grace period, you will lose your deposit and the value of all unreturned shares at current value from your account!<br>"
dat += "<b>Note:</b> You cannot withdraw or transfer money off your account while a borrow is active.<br>"
dat += "<a href='?src=\ref[src];take=\ref[B]'>Take offer</a> (Estimated deposit: [B.deposit * S.current_value * B.share_amount] credits)<br><br>"
else
dat += "<i>No borrow options available</i><br><br>"
for (var/datum/borrow/B in S.borrows)
if (B.borrower == logged_in)
dat += "You are borrowing <i>[B.share_amount] shares</i> from <b>[B.broker]</b>.<br>"
dat += "Your deposit riding on the deal is <i>[B.deposit] credits</i>.<br>"
if (world.time < B.lease_expires)
dat += "You are expected to return the borrowed shares in [(B.lease_expires - world.time) / 600] minutes.<br><br>"
else
dat += "The brokering agency is collecting. You still owe them <i>[B.share_debt]</i> shares, which you have [(B.grace_expires - world.time) / 600] minutes to present.<br><br>"
var/news = 0
if (logged_in)
var/list/LR = stockExchange.last_read[S]
@@ -248,7 +269,7 @@ a.updated {
usr.machine = src
if (href_list["viewhistory"])
var/datum/stock/S = locate(href_list["viewhistory"]) in stockExchange.stocks
var/datum/stock/S = locate(href_list["viewhistory"])
if (S)
S.displayValues(usr)
@@ -256,15 +277,20 @@ a.updated {
logged_in = null
if (href_list["buyshares"])
var/datum/stock/S = locate(href_list["buyshares"]) in stockExchange.stocks
var/datum/stock/S = locate(href_list["buyshares"])
if (S)
buy_some_shares(S, usr)
if (href_list["sellshares"])
var/datum/stock/S = locate(href_list["sellshares"]) in stockExchange.stocks
var/datum/stock/S = locate(href_list["sellshares"])
if (S)
sell_some_shares(S, usr)
if (href_list["take"])
var/datum/borrow/B = locate(href_list["take"])
if (B && !B.lease_expires)
do_borrowing_deal(B, usr)
if (href_list["show_logs"])
var/dat = "<html><head><title>Stock Transaction Logs</title></head><body><h2>Stock Transaction Logs</h2><div><a href='?src=\ref[src];show_logs=1'>Refresh</a></div><br>"
for(var/D in stockExchange.logs)