Revert "12/21 modernizations from TG live"
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/proc/consonant()
|
||||
proc/consonant()
|
||||
return pick("B","C","D","F","G","H","J","K","L","M","N","P","Q","R","S","T","V","W","X","Y","Z")
|
||||
|
||||
/proc/vowel()
|
||||
proc/vowel()
|
||||
return pick("A", "E", "I", "O", "U")
|
||||
|
||||
/proc/ucfirst(var/S)
|
||||
proc/ucfirst(var/S)
|
||||
return "[uppertext(ascii2text(text2ascii(S, 1)))][copytext(S, 2)]"
|
||||
|
||||
/proc/ucfirsts(var/S)
|
||||
proc/ucfirsts(var/S)
|
||||
var/list/L = splittext(S, " ")
|
||||
var/list/M = list()
|
||||
for (var/P in L)
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
var/global/list/FrozenAccounts = list()
|
||||
|
||||
/proc/list_frozen()
|
||||
proc/list_frozen()
|
||||
for (var/A in FrozenAccounts)
|
||||
usr << "[A]: [length(FrozenAccounts[A])] borrows"
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
"public indecency", "public intoxication", "trespassing", "loitering", "littering", "vigilantism", "squatting", "panhandling", "arson", "spacepodjacking", "shuttlejacking", "carjacking", "singularityjacking",
|
||||
"dereliction of duty", "spacecraft piracy", "music piracy", "tabletop game piracy", "software piracy", "escaping from space prison", "seniornapping", "clownnapping", "corginapping", "catnapping",
|
||||
"sleeping on the job", "terrorism", "counterterrorism", "drug distribution", "insubordination", "jaywalking", "owning a computer", "owning a cellphone", "owning a PDA", "owning a pAI", "adultery",
|
||||
"committing an unnatural act with another person", "corrupting public morals", "skateboarding without a license", "shitcurity", "bestiality", "erotic roleplay", "accidentally strangling a prostitute")
|
||||
"committing an unnatural act with another person", "corrupting public morals", "skateboarding without a license", "shitcurity", "bestiality", "erotic roleplay")
|
||||
while (prob(60) && O.len > 2)
|
||||
var/offense = pick(O)
|
||||
O -= offense
|
||||
@@ -225,4 +225,4 @@
|
||||
else
|
||||
article += "[tname] has a prior history of similar misdeeds and we're confident the charges will stand. For investors, now would be an ideal time to %sell%"
|
||||
A.article = A.detokenize(article, company.industry.tokens)
|
||||
return A
|
||||
return A
|
||||
@@ -90,7 +90,7 @@
|
||||
/datum/stock/proc/frc(amt)
|
||||
var/shares = available_shares + outside_shareholders * average_shares
|
||||
var/fr = amt / 100 / shares * fluctuational_coefficient * fluctuation_rate * max(-(current_trend / 100), 1)
|
||||
if ((fr < 0 && speculation < 0) || (fr > 0 && speculation > 0))
|
||||
if (fr < 0 && speculation < 0 || fr > 0 && speculation > 0)
|
||||
fr *= max(abs(speculation) / 5, 1)
|
||||
else
|
||||
fr /= max(abs(speculation) / 5, 1)
|
||||
@@ -139,11 +139,8 @@
|
||||
speculation += rand(-400, 0) / 1000 * speculation
|
||||
if (prob(1) && prob(5)) // pop that bubble
|
||||
speculation += rand(-4000, 0) / 1000 * speculation
|
||||
var/fucking_stock_spikes = current_value + 500
|
||||
var/piece_of_shit_fuck = current_value - 500
|
||||
var/i_hate_this_code = (speculation / rand(25000, 50000) + performance / rand(100, 800)) * current_value
|
||||
if(i_hate_this_code < fucking_stock_spikes || i_hate_this_code > piece_of_shit_fuck)
|
||||
current_value += i_hate_this_code
|
||||
|
||||
current_value += (speculation / rand(25000, 50000) + performance / rand(100, 800)) * current_value
|
||||
if (current_value < 5)
|
||||
current_value = 5
|
||||
|
||||
@@ -309,4 +306,4 @@
|
||||
return 0
|
||||
|
||||
/datum/stock/proc/displayValues(var/mob/user)
|
||||
user << browse(plotBarGraph(values, "[name] share value per share"), "window=stock_[name];size=450x450")
|
||||
user << browse(plotBarGraph(values, "[name] share value per share"), "window=stock_[name];size=450x450")
|
||||
Reference in New Issue
Block a user