diff --git a/code/modules/stock_market/articles.dm b/code/modules/stock_market/articles.dm index 305fabff1f5fa..f5e3d2dce57dc 100644 --- a/code/modules/stock_market/articles.dm +++ b/code/modules/stock_market/articles.dm @@ -1,5 +1,5 @@ proc/consonant() - return pick("B","C","D","F","H","J","K","L","M","N","P","Q","R","S","T","V","W","X","Y","Z") + 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() return pick("A", "E", "I", "O", "U") diff --git a/code/modules/stock_market/computer.dm b/code/modules/stock_market/computer.dm index 9bc48b8c5a397..8defb75105ea8 100644 --- a/code/modules/stock_market/computer.dm +++ b/code/modules/stock_market/computer.dm @@ -50,7 +50,7 @@ a.updated { if (!(logged_in in LR)) LR[logged_in] = 0 dat += "View mode: [vmode ? "compact" : "full"]" - + dat += "Stock Transaction Log: Check" dat += "

Listed stocks

" if (vmode == 0) @@ -60,7 +60,7 @@ a.updated { mystocks = S.shareholders[logged_in] dat += "
[S.name] ([S.short_name])[S.bankrupt ? " BANKRUPT" : null]
" if (S.last_unification) - dat += "Unified shares [(ticker.times_fired - S.last_unification) / 600] minutes ago.
" + dat += "Unified shares [(world.time - S.last_unification) / 600] minutes ago.
" dat += "Current value per share: [S.current_value] | View history

" dat += "You currently own [mystocks] shares in this company. There are [S.available_shares] purchasable shares on the market currently.
" if (S.bankrupt) @@ -75,7 +75,7 @@ a.updated { for (var/datum/borrow/B in S.borrow_brokers) dat += "[B.broker] offers [B.share_amount] shares for borrowing, for a deposit of [B.deposit * 100]% of the shares' value.
" dat += "The broker expects the return of the shares after [B.lease_time / 600] minutes, with a grace period of [B.grace_time / 600] minute(s).
" - dat += "This offer expires in [(B.offer_expires - ticker.times_fired) / 600] minutes.
" + dat += "This offer expires in [(B.offer_expires - world.time) / 600] minutes.
" dat += "Note: 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!
" dat += "Note: You cannot withdraw or transfer money off your account while a borrow is active.
" dat += "Take offer (Estimated deposit: [B.deposit * S.current_value * B.share_amount] credits)

" @@ -85,10 +85,10 @@ a.updated { if (B.borrower == logged_in) dat += "You are borrowing [B.share_amount] shares from [B.broker].
" dat += "Your deposit riding on the deal is [B.deposit] credits.
" - if (ticker.times_fired < B.lease_expires) - dat += "You are expected to return the borrowed shares in [(B.lease_expires - ticker.times_fired) / 600] minutes.

" + if (world.time < B.lease_expires) + dat += "You are expected to return the borrowed shares in [(B.lease_expires - world.time) / 600] minutes.

" else - dat += "The brokering agency is collecting. You still owe them [B.share_debt] shares, which you have [(B.grace_expires - ticker.times_fired) / 600] minutes to present.

" + dat += "The brokering agency is collecting. You still owe them [B.share_debt] shares, which you have [(B.grace_expires - world.time) / 600] minutes to present.

" var/news = 0 if (logged_in) var/list/LR = stockExchange.last_read[S] @@ -133,7 +133,6 @@ a.updated { else dat += "+ - " dat += "(A) (H)" - dat += "" var/datum/browser/popup = new(user, "computer", "Stock Exchange", 600, 400) popup.set_content(dat) @@ -175,6 +174,7 @@ a.updated { user << "Could not complete transaction." return user << "Sold [amt] shares of [S.name] for [total] points." + stockExchange.add_log(/datum/stock_log/sell, user.name, S.name, amt, total) /obj/machinery/computer/stockexchange/proc/buy_some_shares(var/datum/stock/S, var/mob/user) if (!user || !S) @@ -214,10 +214,12 @@ a.updated { user << "Could not complete transaction." return user << "Bought [amt] shares of [S.name] for [total] points." + stockExchange.add_log(/datum/stock_log/buy, user.name, S.name, amt, total) /obj/machinery/computer/stockexchange/proc/do_borrowing_deal(var/datum/borrow/B, var/mob/user) if (B.stock.borrow(B, logged_in)) user << "You successfully borrowed [B.share_amount] shares. Deposit: [B.deposit]." + stockExchange.add_log(/datum/stock_log/borrow, user.name, B.stock.name, B.share_amount, B.deposit) else user << "Could not complete transaction. Check your account balance." @@ -251,11 +253,29 @@ a.updated { if (B && !B.lease_expires) do_borrowing_deal(B, usr) + if (href_list["show_logs"]) + var/dat = "Stock Transaction Logs

Stock Transaction Logs

Refresh

" + for(var/D in stockExchange.logs) + var/datum/stock_log/L = D + if(istype(L, /datum/stock_log/buy)) + dat += "[L.time] | [L.user_name] bought [L.stocks] stocks for [L.money] credits in [L.company_name].
" + continue + if(istype(L, /datum/stock_log/sell)) + dat += "[L.time] | [L.user_name] sold [L.stocks] stocks for [L.money] credits 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] credits in [L.company_name].
" + continue + var/datum/browser/popup = new(usr, "stock_logs", "Stock Transaction Logs", 600, 400) + popup.set_content(dat) + popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state)) + popup.open() + if (href_list["archive"]) var/datum/stock/S = locate(href_list["archive"]) if (logged_in && logged_in != "") var/list/LR = stockExchange.last_read[S] - LR[logged_in] = ticker.times_fired + LR[logged_in] = world.time var/dat = "News feed for [S.name]

News feed for [S.name]

Refresh
" dat += "

Events

" var/p = 0 diff --git a/code/modules/stock_market/events.dm b/code/modules/stock_market/events.dm index 5017e1050ba32..a0a7d8cc9219a 100644 --- a/code/modules/stock_market/events.dm +++ b/code/modules/stock_market/events.dm @@ -160,7 +160,12 @@ else position = ucfirsts(company.industry.detokenize("Lead %industrial% Engineer")) offenses = "" - var/list/O = list("corruption", "murder", "jaywalking", "assault", "battery", "drug possession", "burglary", "theft", "larceny", "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") + var/list/O = list("corruption", "murder", "jaywalking", "assault", "battery", "drug possession", "burglary", "theft", "larceny", "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", "boatjacking", + "aircraft piracy", "spacecraft piracy", "music piracy", "tabletop game piracy", "software piracy", "escaping from space prison", "seniornapping", "adultnapping", "horsenappinng", "corginapping", "catnapping", + "sleeping on the job", "terrorism", "counterterrorism", "drug distribution", "vouyerism", "owning a computer", "owning a cellphone", "owning a PDA", "owning a smartphone", "owning a pAI", "adultery", + "committing an unnatural act with another person", "corrupting public morals", "skateboarding without a license", "car piracy") while (prob(60) && O.len > 2) var/offense = pick(O) O -= offense diff --git a/code/modules/stock_market/industries.dm b/code/modules/stock_market/industries.dm index 1af5d4f0d3e63..34bd5f7181676 100644 --- a/code/modules/stock_market/industries.dm +++ b/code/modules/stock_market/industries.dm @@ -174,3 +174,16 @@ var/list/meat = list("chicken", "beef", "seal", "monkey", "goat", "insect", "pigeon", "human", "walrus", "wendigo", "bear", "horse", "turkey", "pork", "shellfish", "starfish", "mimic", "mystery") var/list/qualifier = list("synthetic", "organic", "bio", "diet", "sugar-free", "paleolithic", "homeopathic", "recycled", "reclaimed", "vat-grown") return "the [pick(qualifier)] [pick(meat)] meat product line" + +/datum/industry/mining + name = "Mining" + tokens = list( \ + "industry" = list("mines", "large scale mining operations"), \ + "industrial" = list("resource accusational"), \ + "jobs" = list("miners", "drill operators", "mining foremen", "explosives handlers") + ) + +/datum/industry/mining/generateProductName(var/company) + var/list/equipment = list("drill", "pickaxe", "shovel", "mini-pickaxe", "power hammer", "power gloves", "power armor", "hardsuit", "oxygen tank", "emergency bike horn") + var/list/material = list("mauxite", "pharosium", "molitz", "char", "ice", "cobryl", "bohrum", "claretine", "viscerite", "syreline", "cerenkite", "plasmastone", "gold", "koshmarite") + return "the [pick(material)] [pick(equipment)]" diff --git a/code/modules/stock_market/logs.dm b/code/modules/stock_market/logs.dm new file mode 100644 index 0000000000000..f5c247e91370b --- /dev/null +++ b/code/modules/stock_market/logs.dm @@ -0,0 +1,13 @@ +/datum/stock_log + var/user_name = "" + var/company_name = "" + var/money + var/stocks + var/time + + +/datum/stock_log/buy + +/datum/stock_log/sell + +/datum/stock_log/borrow \ No newline at end of file diff --git a/code/modules/stock_market/stockmarket.dm b/code/modules/stock_market/stockmarket.dm index 71e8136537374..2d3f87e4e53d7 100644 --- a/code/modules/stock_market/stockmarket.dm +++ b/code/modules/stock_market/stockmarket.dm @@ -5,6 +5,7 @@ var/list/balances = list() var/list/last_read = list() var/list/stockBrokers = list() + var/list/logs = list() /datum/stockMarket/New() ..() @@ -59,10 +60,10 @@ return d /datum/stockMarket/proc/generateStocks(var/amt = 15) - var/list/fruits = list("Banana", "Strawberry", "Watermelon", "Maracuja", "Pomegranate", "Papaya", "Mango", "Tomato", "Conkerberry", "Fig", "Lychee", "Mandarin", "Oroblanco", "Pumpkin", "Rhubarb", "Tamarillo", "Yantok", "Ziziphus") - var/list/tech_prefix = list("Nano", "Cyber", "Funk", "Astro", "Fusion", "Tera", "Exo", "Star", "Virtual", "Plasma", "Robust", "Bit", "Butt") + var/list/fruits = list("Banana", "Strawberry", "Watermelon", "Maracuja", "Pomegranate", "Papaya", "Mango", "Tomato", "Conkerberry", "Fig", "Lychee", "Mandarin", "Oroblanco", "Pumpkin", "Rhubarb", "Tamarillo", "Yantok", "Ziziphus", "Oranges") + var/list/tech_prefix = list("Nano", "Cyber", "Funk", "Astro", "Fusion", "Tera", "Exo", "Star", "Virtual", "Plasma", "Robust", "Bit", "Butt", "Fart", "Porn") var/list/tech_short = list("soft", "tech", "prog", "tec", "tek", "ware", "", "gadgets", "nics", "tric", "trasen", "tronic", "coin") - var/list/random_nouns = list("Johnson", "Cluwne", "General", "Specific", "Master", "King", "Queen", "Wayne", "Rupture", "Dynamic", "Massive", "Mega", "Giga", "Certain", "Stale", "State", "National", "International", "Interplanetary", "Sector", "Planet", "Burn", "Robust", "Exotic", "Solar", "Cheesecake") + var/list/random_nouns = list("Johnson", "Cluwne", "General", "Specific", "Master", "King", "Queen", "Wayne", "Rupture", "Dynamic", "Massive", "Mega", "Giga", "Certain", "Stale", "State", "National", "International", "Interplanetary", "Sector", "Planet", "Burn", "Robust", "Exotic", "Solar", "Cheesecake", "Chelp", "Corgi") var/list/company = list("Company", "Factory", "Incorporated", "Industries", "Group", "Consolidated", "GmbH", "LLC", "Ltd", "Inc.", "Association", "Limited", "Software", "Technology", "Programming", "IT Group", "Electronics", "Nanotechnology", "Farms", "Stores", "Mobile", "Motors", "Electric", "Energy", "Pharmaceuticals", "Communications", "Wholesale", "Holding", "Health", "Machines", "Astrotech", "Gadgets", "Kinetics") for (var/i = 1, i <= amt, i++) var/datum/stock/S = new @@ -112,6 +113,14 @@ var/datum/stock/S = stock S.process() +/datum/stockMarket/proc/add_log(var/log_type, var/user, var/company_name, var/stocks, var/money) + var/datum/stock_log/L = new log_type + L.user_name = user + L.company_name = company_name + L.stocks = stocks + L.money = money + L.time = time2text(world.timeofday, "hh:mm") + logs += L var/global/datum/stockMarket/stockExchange = new diff --git a/tgstation.dme b/tgstation.dme index b1b11d042ca21..76f6005a34b3b 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1617,6 +1617,7 @@ #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\stockmarket.dm" #include "code\modules\stock_market\stocks.dm" #include "code\modules\surgery\cavity_implant.dm"