diff --git a/code/controllers/subsystem/economy.dm b/code/controllers/subsystem/economy.dm
index 8433e666e705..22eb9e1b45b9 100644
--- a/code/controllers/subsystem/economy.dm
+++ b/code/controllers/subsystem/economy.dm
@@ -45,9 +45,6 @@ SUBSYSTEM_DEF(economy)
var/list/balances = list()
var/list/last_read = list()
var/list/stock_brokers = list()
- var/list/logs
- var/list/frozen_accounts = list()
-
/datum/controller/subsystem/economy/Initialize(timeofday)
var/budget_to_hand_out = round(budget_pool / department_accounts.len)
@@ -128,10 +125,6 @@ SUBSYSTEM_DEF(economy)
return inflation_value
//STOCK MARKET PROCS
-/datum/controller/subsystem/economy/proc/list_frozen()
- for(var/A in frozen_accounts)
- to_chat(usr, "[A]: [length(frozen_accounts[A])] borrows")
-
/datum/controller/subsystem/economy/proc/balanceLog(whose, net)
if (!(whose in balances))
balances[whose] = net
@@ -190,7 +183,7 @@ SUBSYSTEM_DEF(economy)
switch (rand(1,6))
if(1)
if(sname == "" || sname == "FAG") // honestly it's a 0.6% chance per round this happens - or once in 166 rounds - so i'm accounting for it before someone yells at me
- sname = "[CONSONANTS][VOWELS][CONSONANTS]"
+ sname = "[pick(CONSONANTS)][pick(VOWELS)]E"
if (2)
sname = "[pick(tech_prefix)][pick(tech_short)][prob(20) ? " " + pick(company) : null]"
if (3 to 4)
@@ -226,13 +219,3 @@ SUBSYSTEM_DEF(economy)
S.generateEvents()
stocks += S
last_read[S] = list()
-
-/datum/controller/subsystem/economy/proc/add_log(log_type, user, company_name, stocks, shareprice, money)
- var/datum/stock_log/L = new log_type
- L.user_name = user
- L.company_name = company_name
- L.stocks = stocks
- L.shareprice = shareprice
- L.money = money
- L.time = time2text(world.timeofday, "hh:mm")
- logs += L
diff --git a/code/modules/stock_market/articles.dm b/code/modules/stock_market/articles.dm
index be3500f969ad..36c9016ee958 100644
--- a/code/modules/stock_market/articles.dm
+++ b/code/modules/stock_market/articles.dm
@@ -84,9 +84,9 @@
/datum/article/proc/generateAuthorName()
switch(rand(1,3))
if (1)
- return "[CONSONANTS]. [pick(GLOB.last_names)]"
+ return "[pick(CONSONANTS)]. [pick(GLOB.last_names)]"
if (2)
- return "[prob(50) ? pick(GLOB.first_names_male) : pick(GLOB.first_names_female)] [CONSONANTS].[prob(50) ? "[CONSONANTS]. " : null] [pick(GLOB.last_names)]"
+ return "[prob(50) ? pick(GLOB.first_names_male) : pick(GLOB.first_names_female)] [pick(CONSONANTS)].[prob(50) ? "[pick(CONSONANTS)]. " : null] [pick(GLOB.last_names)]"
if (3)
return "[prob(50) ? pick(GLOB.first_names_male) : pick(GLOB.first_names_female)] \"[prob(50) ? pick(GLOB.first_names_male) : pick(GLOB.first_names_female)]\" [pick(GLOB.last_names)]"
diff --git a/code/modules/stock_market/computer.dm b/code/modules/stock_market/computer.dm
index a06d7d557a5b..20f65d8fd322 100644
--- a/code/modules/stock_market/computer.dm
+++ b/code/modules/stock_market/computer.dm
@@ -12,6 +12,7 @@
interaction_flags_atom = INTERACT_ATOM_REQUIRES_DEXTERITY | INTERACT_ATOM_UI_INTERACT | INTERACT_ATOM_ATTACK_HAND | INTERACT_ATOM_REQUIRES_ANCHORED
light_color = LIGHT_COLOR_GREEN
+ var/list/logs = list()
/obj/machinery/computer/stockexchange/Initialize()
. = ..()
@@ -193,8 +194,9 @@ a.updated {
if (!S.sellShares(logged_in, amt))
to_chat(user, "Could not complete transaction.")
return
- to_chat(user, "Sold [amt] shares of [S.name] at [S.current_value] a share for [total] ahn.")
- SSeconomy.add_log(/datum/stock_log/sell, user.name, S.name, amt, S.current_value, total)
+ var/feedback = "Sold [amt] shares of [S.name] at [S.current_value] a share for [total] ahn."
+ to_chat(user, feedback)
+ logs += feedback
/obj/machinery/computer/stockexchange/proc/buy_some_shares(datum/stock/S, mob/user)
if (!user || !S)
@@ -228,15 +230,9 @@ a.updated {
return
var/total = amt * S.current_value
- to_chat(user, "Bought [amt] shares of [S.name] at [S.current_value] a share for [total] ahn.")
- SSeconomy.add_log(/datum/stock_log/buy, user.name, S.name, amt, S.current_value, total)
-
-/obj/machinery/computer/stockexchange/proc/do_borrowing_deal(datum/borrow/B, mob/user)
- if (B.stock.borrow(B, logged_in))
- to_chat(user, "You successfully borrowed [B.share_amount] shares. Deposit: [B.deposit].")
- SSeconomy.add_log(/datum/stock_log/borrow, user.name, B.stock.name, B.share_amount, B.deposit)
- else
- to_chat(user, "Could not complete transaction. Check your account balance.")
+ var/feedback = "Bought [amt] shares of [S.name] at [S.current_value] a share for [total] ahn."
+ to_chat(user, feedback)
+ logs += feedback
/obj/machinery/computer/stockexchange/Topic(href, href_list)
if (..())
@@ -265,17 +261,8 @@ a.updated {
if (href_list["show_logs"])
var/dat = "
Stock Transaction LogsStock Transaction Logs
"
- for(var/D in SSeconomy.logs)
- var/datum/stock_log/L = D
- if(istype(L, /datum/stock_log/buy))
- dat += "[L.time] | [L.user_name] bought [L.stocks] stocks at [L.shareprice] a share for [L.money] total ahn in [L.company_name].
"
- continue
- if(istype(L, /datum/stock_log/sell))
- dat += "[L.time] | [L.user_name] sold [L.stocks] stocks at [L.shareprice] a share for [L.money] total ahn from [L.company_name].
"
- continue
- if(istype(L, /datum/stock_log/borrow))
- dat += "[L.time] | [L.user_name] borrowed [L.stocks] stocks with a deposit of [L.money] ahn in [L.company_name].
"
- continue
+ for(var/D in logs)
+ dat += "[D]
"
var/datum/browser/popup = new(usr, "stock_logs", "Stock Transaction Logs", 600, 400)
popup.set_content(dat)
popup.open()
@@ -308,7 +295,7 @@ a.updated {
popup.open()
if (href_list["cycleview"])
- if(vmode = TRUE)
+ if(vmode == TRUE)
vmode = 0
else
vmode = 1
diff --git a/code/modules/stock_market/events.dm b/code/modules/stock_market/events.dm
index 36a306317079..c63e199a96be 100644
--- a/code/modules/stock_market/events.dm
+++ b/code/modules/stock_market/events.dm
@@ -120,7 +120,10 @@
/datum/stockEvent/bankruptcy/proc/generateBankruptcyArticle()
var/datum/article/A = new
- var/list/bankrupt_reason = list("investor pessimism", "failure of product lines", "economic recession", "overblown inflation", "overblown deflation", "collapsed pyramid schemes", "a Ponzi scheme", "economic terrorism", "extreme hedonism", "unfavourable economic climate", "rampant government corruption", "divine conspiracy", "some total bullshit", "volatile plans")
+ var/list/bankrupt_reason = list("investor pessimism", "failure of product lines", "economic recession", "overblown inflation", "overblown deflation",
+ "collapsed pyramid schemes", "a Ponzi scheme", "economic terrorism", "extreme hedonism", "unfavourable economic climate", "rampant government corruption",
+ "divine conspiracy", "some total bullshit", "volatile plans"
+ )
A.about = company
A.headline = pick( "[company.name] filing for bankruptcy", \
"[company.name] unable to pay, investors run", \
@@ -129,7 +132,8 @@
A.subtitle = "Investors panic, bailout pending"
if (prob(15))
A.opinion = rand(-1, 1)
- var/article = "Another one might bite the dust: [company.current_trend > 0 ? "despite their positive trend" : "in line with their failing model"], [company.name] files for bankruptcy citing [pick(bankrupt_reason)]. The director of District [rand(4,24)] has been asked to bail the company out, "
+ var/article = "Another one might bite the dust: [company.current_trend > 0 ? "despite their positive trend" : "in line with their failing model"], [company.name] \
+ files for bankruptcy citing [pick(bankrupt_reason)]. The director of District [rand(4,24)] has been asked to bail the company out, "
if (!A.opinion)
article += "but no answer has been given by the administration to date. Our tip to stay safe is: %sell%"
else if (A.opinion > 0)
@@ -156,17 +160,20 @@
current_desc = ""
female = prob(50)
if (prob(50))
- position = "C[prob(20) ? VOWELS : CONSONANTS]O"
+ position = "C[prob(20) ? pick(VOWELS) : pick(CONSONANTS)]O"
else
position = ucfirsts(company.industry.detokenize("Lead %industrial% Engineer"))
offenses = ""
var/list/O = list("corruption", "murder", "grand theft", "assault", "battery", "drug possession", "burglary", "theft", "grand sabotage", "bribery",
"disorderly conduct", "treason", "sedition", "shoplifting", "tax evasion", "tax fraud", "insurance fraud", "perjury", "kidnapping", "manslaughter", "vandalism", "forgery", "extortion", "embezzlement",
"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",
+ "dereliction of duty", "spacecraft piracy", "music piracy", "tabletop game piracy", "software piracy", "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", "erotic roleplay", "accidentally strangling a prostitute")
- if(prob(60) && O.len > 2)
+ "committing an unnatural act with another person", "corrupting public morals", "skateboarding without a license", "shitcurity", "erotic roleplay", "accidentally strangling a prostitute",
+ "gnome conspiracy", "Artificial Intelligence Ethics Amendment violation", "cloning", "full restoration necromancy", "owning a gun that can damage property",
+ "smuggling of sentient non-humans into the city", "erasure of a VIP", "imperfect erasure of a crime from reality", "deicide", "being an ass",
+ "conspiracy", "lycanthropy", "distortion cultivation", "cognitohazard breach", "soul stealing", "prosthetic ownership", "district taboo violation")
+ if(prob(60))
var/offense = pick(O)
O -= offense
offense = "[prob(20) ? "attempted " : (prob(20) ? "being accessory to " : null)][offense][prob(5) ? " of the [pick("first", "second", "third", "fourth", "fifth", "sixth")] degree" : null]"
@@ -217,7 +224,9 @@
A.subtitle = "[A.author] reporting directly from the courtroom"
if (prob(15))
A.opinion = rand(-1, 1)
- var/article = "[pick("Security", "Law enforcement")] forces issued a statement that [tname], the [position] of [company.name], the %famous% %industrial% %company% was arrested %this_time%. The trial has been scheduled and the statement reports that the arrested individual is being charged with [offenses]. "
+ var/article = "[pick("Security", "Law enforcement")] forces issued a statement that [tname], the [position] of [company.name], \
+ the %famous% %industrial% %company% was arrested %this_time%. The trial has been scheduled and the statement reports that \
+ the arrested individual is being charged with [offenses]. "
if (!A.opinion)
article += "While we cannot predict the outcome of this trial, our tip to stay safe is: %sell%"
else if (A.opinion > 0)
diff --git a/code/modules/stock_market/industries.dm b/code/modules/stock_market/industries.dm
index c77409b8fa93..0b2edfcd7ada 100644
--- a/code/modules/stock_market/industries.dm
+++ b/code/modules/stock_market/industries.dm
@@ -88,7 +88,7 @@
/datum/industry/agriculture/generateProductName(company_name)
var/list/products = list("water tank", "cattle prod", "scythe", "plough", "sickle", "cultivator", "loy", "spade", "hoe", "daisy grubber", "cotton gin")
var/list/prefix = list("[company_name]'s ", "the [company_name] ", "the fully automatic ", "the full-duplex ", "the semi-automatic ", "the drone-mounted ", "the industry-leading ", "the world-class ")
- var/list/suffix = list(" of farming", " multiplex", " +[rand(1,15)]", " [CONSONANTS][rand(1000, 9999)]", " hybrid", " maximus", " extreme")
+ var/list/suffix = list(" of farming", " multiplex", " +[rand(1,15)]", " [pick(CONSONANTS)][rand(1000, 9999)]", " hybrid", " maximus", " extreme")
return "[pick(prefix)][pick(products)][pick(suffix)]"
@@ -166,7 +166,8 @@
/datum/industry/it/generateProductName(company_name)
var/list/products = list("generator", "laptop", "keyboard", "memory card", "display", "operating system", "processor", "graphics card", "nanobots", "power supply", "pAI", "mech", "capacitor", "cell")
var/list/prefix = list("the [company_name] ", "the high performance ", "the mobile ", "the portable ", "the professional ", "the extreme ", "the incredible ", "the blazing fast ", "the bleeding edge ", "the bluespace-powered ", null)
- var/L = pick(CONSONANTS, "Seed ", "Radiant ", "Robust ", "Pentathon ", "Athlete ", "Phantom ", "Semper Fi ")
+ var/list/l_list = CONSONANTS + list("Seed ", "Radiant ", "Robust ", "Pentathon ", "Athlete ", "Phantom ", "Semper Fi ")
+ var/L = l_list
var/N = rand(1, 99)
var/prefix2 = "[L][N][prob(5) ? " " + latin_number(N) : null]"
return "[pick(prefix)][prefix2] [pick(products)]"
@@ -182,7 +183,7 @@
/datum/industry/communications/generateProductName(company_name)
var/list/products = list("mobile phone", "PDA", "tablet computer", "newscaster", "social network")
var/list/prefix = list("the [company_name] ", "the high performance ", "the mobile ", "the portable ", "the professional ", "the extreme ", "the incredible ", "the blazing fast ", "the bleeding edge ", null)
- var/L = pick("[lowertext(CONSONANTS)]Phone ", "Universe ", "Xperience ", "Next ", "Engin Y ", "Cyborg ", "[CONSONANTS]")
+ var/L = pick("Phone ", "Universe ", "Xperience ", "Next ", "Engin Y ", "Cyborg ")
var/N = rand(1,99)
var/prefix2 = "[L][N][prob(25) ? pick(" Tiny", " Mini", " Micro", " Slim", " Water", " Air", " Fire", " Earth", " Nano", " Pico", " Femto", " Planck") : null]"
return "[pick(prefix)][prefix2] [pick(products)]"
diff --git a/code/modules/stock_market/logs.dm b/code/modules/stock_market/logs.dm
deleted file mode 100644
index a089602bd2aa..000000000000
--- a/code/modules/stock_market/logs.dm
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-* Code made specifically for record
-* keeping purposes.
-*/
-/datum/stock_log
- var/user_name = ""
- var/company_name = ""
- var/shareprice
- var/money
- var/stocks
- var/time
-
-
-/datum/stock_log/buy
-
-/datum/stock_log/sell
-
-/datum/stock_log/borrow
diff --git a/code/modules/stock_market/stocks.dm b/code/modules/stock_market/stocks.dm
index 2773fe748445..232bfb588a6b 100644
--- a/code/modules/stock_market/stocks.dm
+++ b/code/modules/stock_market/stocks.dm
@@ -1,16 +1,3 @@
-/datum/borrow
- var/broker = ""
- var/borrower = ""
- var/datum/stock/stock = null
- var/lease_expires = 0
- var/lease_time = 0
- var/grace_time = 0
- var/grace_expires = 0
- var/share_amount = 0
- var/share_debt = 0
- var/deposit = 0
- var/offer_expires = 0
-
/datum/stock
var/name = "Stock"
var/short_name = "STK"
@@ -46,6 +33,17 @@
var/fluctuation_counter = 0
var/datum/industry/industry = null
+/datum/stock/process()
+ if (bankrupt)
+ return
+ fluctuation_counter++
+ if (fluctuation_counter >= fluctuation_rate)
+ for (var/E in events)
+ var/datum/stockEvent/EV = E
+ EV.process()
+ fluctuation_counter = 0
+ fluctuate()
+
/datum/stock/proc/addEvent(datum/stockEvent/E)
events |= E
@@ -169,76 +167,11 @@
shareholders[I] /= 2
if (!shareholders[I])
shareholders -= I
- for (var/datum/borrow/B in borrow_brokers)
- B.share_amount = round(B.share_amount / 2)
- B.share_debt = round(B.share_debt / 2)
- for (var/datum/borrow/B in borrows)
- B.share_amount = round(B.share_amount / 2)
- B.share_debt = round(B.share_debt / 2)
average_shares /= 2
available_shares /= 2
current_value *= 2
last_unification = world.time
-/datum/stock/process()
- for (var/B in borrows)
- var/datum/borrow/borrow = B
- if (world.time > borrow.grace_expires)
- modifyAccount(borrow.borrower, -max(current_value * borrow.share_debt, 0), 1)
- borrows -= borrow
- if (borrow.borrower in SSeconomy.frozen_accounts)
- SSeconomy.frozen_accounts[borrow.borrower] -= borrow
- if (length(SSeconomy.frozen_accounts[borrow.borrower]) == 0)
- SSeconomy.frozen_accounts -= borrow.borrower
- qdel(borrow)
- else if (world.time > borrow.lease_expires)
- if (borrow.borrower in shareholders)
- var/amt = shareholders[borrow.borrower]
- if (amt > borrow.share_debt)
- shareholders[borrow.borrower] -= borrow.share_debt
- borrows -= borrow
- if (borrow.borrower in SSeconomy.frozen_accounts)
- SSeconomy.frozen_accounts[borrow.borrower] -= borrow
- if (length(SSeconomy.frozen_accounts[borrow.borrower]) == 0)
- SSeconomy.frozen_accounts -= borrow.borrower
- qdel(borrow)
- else
- shareholders -= borrow.borrower
- borrow.share_debt -= amt
- if (bankrupt)
- return
- for (var/B in borrow_brokers)
- var/datum/borrow/borrow = B
- if (borrow.offer_expires < world.time)
- borrow_brokers -= borrow
- qdel(borrow)
- if (prob(5))
- generateBrokers()
- fluctuation_counter++
- if (fluctuation_counter >= fluctuation_rate)
- for (var/E in events)
- var/datum/stockEvent/EV = E
- EV.process()
- fluctuation_counter = 0
- fluctuate()
-
-/datum/stock/proc/generateBrokers()
- if (borrow_brokers.len > 2)
- return
- if (!SSeconomy.stock_brokers.len)
- SSeconomy.generateBrokers()
- var/broker = pick(SSeconomy.stock_brokers)
- var/datum/borrow/B = new
- B.broker = broker
- B.stock = src
- B.lease_time = rand(4, 7) * 600
- B.grace_time = rand(1, 3) * 600
- B.share_amount = rand(1, 10) * 100
- B.deposit = rand(20, 70) / 100
- B.share_debt = B.share_amount
- B.offer_expires = rand(5, 10) * 600 + world.time
- borrow_brokers += B
-
/datum/stock/proc/modifyAccount(whose, by, force=0)
if (SSshuttle.points)
if (by < 0 && SSshuttle.points + by < 0 && !force)
@@ -248,31 +181,6 @@
return 1
return 0
-/datum/stock/proc/borrow(datum/borrow/B, who)
- if (B.lease_expires)
- return 0
- B.lease_expires = world.time + B.lease_time
- var/old_d = B.deposit
- var/d_amt = B.deposit * current_value * B.share_amount
- if (!modifyAccount(who, -d_amt))
- B.lease_expires = 0
- B.deposit = old_d
- return 0
- B.deposit = d_amt
- if (!(who in shareholders))
- shareholders[who] = B.share_amount
- else
- shareholders[who] += B.share_amount
- borrow_brokers -= B
- borrows += B
- B.borrower = who
- B.grace_expires = B.lease_expires + B.grace_time
- if (!(who in SSeconomy.frozen_accounts))
- SSeconomy.frozen_accounts[who] = list(B)
- else
- SSeconomy.frozen_accounts[who] += B
- return 1
-
/datum/stock/proc/buyShares(who, howmany)
if (howmany <= 0)
return
diff --git a/lobotomy-corp13.dme b/lobotomy-corp13.dme
index 0199619ffc52..36af297ab139 100644
--- a/lobotomy-corp13.dme
+++ b/lobotomy-corp13.dme
@@ -3707,7 +3707,6 @@
#include "code\modules\stock_market\computer.dm"
#include "code\modules\stock_market\events.dm"
#include "code\modules\stock_market\industries.dm"
-#include "code\modules\stock_market\logs.dm"
#include "code\modules\stock_market\stocks.dm"
#include "code\modules\suppressions\_core_suppression.dm"
#include "code\modules\suppressions\command.dm"