mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-16 03:56:20 +00:00
This PR covers 4 Key features:
Price Rebalancing
Passive Income
Gas Exports
Lathe Tax
Relevant Design Doc (Slightly out of date as a result of the discourse on the subject).
https://hackmd.io/WlWgyRafTaiAqz6ouOqC-Q
-- START DOCUMENT --
# Arconomy Version Two
This is mostly me organizing a long list of thoughts that I'm not sure if I can properly describe and get across, but lets just work with what we got and go from there.
## There should probably be a relationship to time and profit
So, part one of a series called "Arcane was completely wrong about game design", I made a rather large misstep in regards to designing arconomy, and nobody told me this until far, FAR after I had gone way too in on my own ideas:
"There needs to be a relationship between time and money". Because Space Station 13 is a game that is built around rounds, either long, LONG rounds on MRP or 30 min - 1 hour long rounds in LRP, your whole orientation of the game is built around time. The longer you spend in a single round, the more you can do and mold the station and the game in a specific direction, whether it's from an admin event, doing your job, or going off on a wierd character based tangent.
The issue here lies in a question I tried to answer in my previous design doc:
> "Command players start with lots of money, and make mountains of money, and as a result, have so much money by the end of the shift that they're practically immune to the effects of the economy.
> Assistant players start out with practically no money, find that the station is covered in costs that they'll never be able to practically afford, and decide that the economy is stupid and not worth utilizing altogether."
Two fundimentally different outlooks on the same problem, caused by the pay discrepency as it existed originally. Since we have so many different jobs all at different paygrades, the option that made the most sense at the time was to completely remove paychecks alltogether because they would multiplicitively exacerbate the previous issue.
While it would flood the in-game economy over time at high levels, it did add a sense of timescale to the existing in-game relationships. You **KNEW** that after x many minutes you would get that fancy hat, or that you would need to find cash in other ways to get it. Having that time-scale is helpful as we've moved to our 90 minute round average/goal. It also, similarly, means that we know exactly how many credits each job SHOULD have had access to before a major disaster calls for a shuttle call. But, in hindsight, that is a value that should be consistant for all players. If a single, unaided player looks at a 200 credit bill, that should have the same impact player to player, and not limit their access to jobs.
## Bounties just ain't that fun, but they stand to see improvement from where they are now
So, guilty as charged, bounty running doesn't quite have the same charm as it used to have. For our friends just joining us, cargo used to have a single, per round laundry list of items that would payout to the cargo budget each shift. Each list would start with 10 items, one of which would randomly be assigned higher priority with a higher payout, and it would be cargo's job to ~~Break into each department and steal that thing~~ cooperate with jobs around the station to aquire funds for station crisis or when you just want to dick around and make stacks of cash. This had a distinct charm to it, but one element of it that majorly reduced the replayability of bounties was that they were severely limited in scope. Once you did your ONE drink bounty or your ONE chemical bounty, you no longer needed to interact with that department.
My original goal was this: Make an unlimited bounty system, where crewmates were able to get a cut of their work as profit. To a degree, it's fairly successful! Crew do have a way to actively work with cargo to get paid for their labor, and they help cargo as a result by giving them free valuables. The issue lies in the fact that this has kinda flipped the relationship on it's head: Bounties stopped being cargo's job to outsource to the crew, and instead the crew's job that becomes dependent on cargo.
In general, many bounties simply weren't meant to be repeatable content in the first place. And certainly not meant to be used for every job. Offloading it as a kind of fetchquest minigame so that all jobs can offset the loss of passive income? It's not the best choice. For jobs like botanists or scientists it's tolerable at best, frustrating at worst. Just look at the state of things like experisci-slime experiments or scanning furniture.
It gets far worse when it's from the perspective of jobs that have *explicitly* limited supplies like security. No, a security player is not going to be allowed to haul away all the good metal handcuffs from the brig for a bounty, and no, you cannot take all the riot shotguns from the brig.
Now, a few of these things were fixed over time, with mixed successes. Bounties started to be cleaned up in order to prevent limited quantity items from being an option for repeat bounties. Jobs that lack exports started to get some content for still allowing them to have repeatable exports (Like the Scanners for Security Officers to go on patrols).
The BIG EXCEPTION to this is Restaurant Bots, but we'll hit that in a second.
## Getting everything on the same price scale has been a major improvement.
Unironically one of the best changes made has been the idea that even if we lack that good time-credit scale from before, we didn't really have a "standard" to work off of when something new is added to the game and the dev needs to determine how much to make that thing cost. That's why the current costs of objects and values on-station are scaled off of a single define, the value of a crate sold on the cargo shuttle.
> Yes, I'd like an APPLE. It's worth 3124151 CREDITS. NO, I don't know why the apple juice in the vendor is worth 415 CREDITS, nor do I CARE, GOOD MAN.
From the back end, everything is scaled off the same define now. Paygrades are defined off of a different scale still, but that's fine. You know, from the cargo end of things, that a cargo player needs to ship off X number of empty metal crates to purchase a laser crate, or a pizza crate. Definate relationships help in solidifying the singular value of a product.
If we decide that we want to rescale the in-game economy and provide space credits with more granularity, at least we know we can do it with a single line of code, and not looking at every single instance of something that charges the player money.
### Arconomy Tangent: We gotta nuke gas selling.
This has been a long time coming and I know people are going to be upset at me, but look man.
I have no idea how selling moles of gas works these days. It seems like with minimal resources, true atmos wizards are able to make singular cans of gasses with infinite moles of some kind of gas, and if it's exotic enough, they can make upwards of a million credits a can. I've seen multiple occasions where selling gas cans to cargo has allowed for players to buy a bike.
For our Gen-Z zoomers reading this, players were never meant to BUY the bike. The bike is just a reskinned scooter meant as a cute little pokemon joke. If a player can actually buy a bike in a round, that's a sign that someone, somewhere, fucked up.
We fucked up the whole system with atmos gas selling.
We've now gone through metas of extracting miasma from lavaland for credits, we've gone through a meta where cargo starts building their own hydrogen burn chambers for simply produced gasses, we've seen time and time again that processed gasses in the funny space simulator just tends to be abused to death and back. I've had talks with TheFinalPotato on this in the past, and it just feels like a system that would need to be rewritten from the ground up, or looked at in terms of the whole cargo department. If I don't get to it first, the next cargo design doc someone writes **SHOULD**.
## Giving jobs content that integrates into the economy can be really fun.
Tourism bots and the baked in ingredient shopping is fun! It's enabled for a fluff job that doesn't have too terribly much by way of serious responsibilites to integrate active income minigames into the gameplay of chefs and bartenders. It's fully optional, it's quick, and it's not even a full shift investment.
These secondary tasks, which utilize jobs core gameplay loops in a new way, while rewarding them within the in-game economy are a decent way to keep players engaged with their jobs, and allow for them to use credits as a player resource as well as a primary job resource.
**I AM NOT SAYING** that all jobs need to find tasks to arbitrarily reward players with credits for. The reason it works so well for jobs like the chef or bartender is because their job is already to make food and drinks, but they have so many options that they're not encouraged to make too wide of a variety of food, especially when botanists won't always make everything you need. The food market gives them an outlet to buy outlier ingredients and the tourists pay handsomely enough that you can offset your costs most or the time.
I'll break this down as well into the three different methods of money-making in game as well, to guide someone on how to make good, secondary income content.
| Primary | Secondary | Tertiary |
| -------- | -------- | -------- |
| This is something like passive paycheck income. You get this just purely for playing the game, and staying alive. | This is an active trade off between your job's specific content, where you are trading your time for something it is directly your responsibility to do. Eg. Tourist Bots. | An active task you are performing for income, but lacks the specialization of a job. EG. Bounties. |
Jobs that excell at more service based tasks and less production based tasks should aim to aquire more seconary style economy integration, like medical, science, or security.
## The options for moving money around the station are actually pretty decent, but could be streamlined
Bounty boards are pretty decent at being a way to pay crew members for single service jobs. However, bounty boards are pretty much dead content, in a sense. There's not much incentive to hunt down your department's bounty board.
Similarly, most crew would just prefer to hand credits out by hand to prevent most kinds of abuse of their own credit supply.
Long term and certainly a major personal outcome I'd like to see: Bounty boards and Newscasters should be merged together. Newscasters have some truely awful spaghetti and their being held together by shoe-strings and duct tape (This is slang for HTML). Bounty boards are... well they're functional, but they have the benefit of being built in TGUI. Merging the two's functions should cut down on wall-space, as well as improve the quality of a vast deal of code, and make money transfer on station slightly easier.
Honestly, pretty happy with vend-a-trays. They're pretty decent store-machines on station and do their job pretty well when they get used. All in all I'm happy with how they work.
Custom Vendors are clunky to a fairly major degree and I don't think most players get how to make them work on account of need a price tagger (not a sales tagger, that's the cargo item) to mark an object for it's sale value, then load it into a custom vendor sales unit, then load it into a custom vending machine, and that's only IF custom vending machines decide to work this year. Streamlining the tools, or perhaps just vending machines would certainly improve this as a service.
## Just ain't enough cool stuff to buy with credits.
An ever-present problem, that we're just kinda stuck with. There's a decent number of issues involved with making content that can safely be gated with just credits.
* If it's usable as a weapon, is it too dangerous to hand out to the crew at large?
* Does security get potential oversight?
* If it's illegal, does it go through cargo?
* Does it HAVE to go through cargo?
* If it's beneficial, is it going to invalidate the existance of a job? (Think old medkits!)
* Is there anything that players WANT that's not a weapon, benefical to the station but not too strong, or quite literally traitor equipment?
It's a tough question.
Some items make complete sense to implement on a per job basis as either uncommon or premium equipment, while other items could potentially be moved to station-wide unique purchasables.
# Takeaways:
Look, these are just some possible solutions that I'm considering. I think that working alongside a maintainer who could actually give a damn on getting this system orderly and possibly alligned with our current design philosophy (Who also understands that a not-insignificant amount of current economy was abitrarly written by goofball an actual decade ago) could help iron this out into a clear and consise set of goals and milestones to make the in-game economy workable. Not balanced, but workable.
* **Design a simple simulation for per round intake and outtake, to determine benchmark values for a 90 minute round.**

It would need to look something like this, as a kind of fucked up, Multi-Input Multi-Output Control Problem. Possibly could be done in simulink, but I'm not quite sure how to do that at this moment, so a less complex version might be fine.
* **Look back at implementing crewmember incomes, but at a flat, more consistant rate over all jobs**
My leading idea: 50 credit, uniform paygrade. No wild, unscaled pay rates based on what job is "important" or not.
That line of thinking means that certain jobs should have more expensive equipment over other jobs, but then we're right back to the captain thinking that a cup of coffee is practically free where an assistant thinks that a screwdriver from the vendor is going to put them out of house and home.
Improves time-relationship values with credits.
This could lead way to heads of staff having some degree of control to giving raises or paycuts to crew-members, but perhaps at a very, VERY gradual rate.
* **Perform another big-picture look at bounty cubes.**
Potentially try to put bounties back in the hands of cargo, while still providing payouts to crewmates who assist in completing jobs. This may require some minor refactoring of the pricetag component, perhaps to even allow for multiple crewmembers to recieve profit from a payout.
This means once again, look at making bounties workable for all jobs on the station, not making the objects requested literal lathe-fodder, and finding ways to benefit the station in some way with the task of bounty cubes, even if it's just for credits.
Deceptively hard task.
* **Add secondary tasks that integrate the economy into non-bounty-able jobs/departments**
Like it says on the tin, look into ways to add content that improves economy integration into existing jobs, without necessarily changing what those jobs DO. The bounties for those jobs can still exist as a tertiary thing, but should be made clear that they're... tertiary.
Chefs still make food and bartenders still serve drinks, but they have a way to hand them out for fun and profit.
Some thoughts and ways to handle this potentially:
*Science:* Perform intricate testing on anomalous materials using science equipment. Should NOT REWARD RESEARCH POINTS. Mr. OJ Headcoder will CHEMICALLY CASTRATE me, or you, if you do.
*Medical:* Complete tricky or non-standard surgeries on dummies for medical data. Think like that meme from the TV show, House.
"He needs Mouse bites to live. MORE MOUSE BITES."
*Engineering:* Repair wacky machines that use both station-standard parts as well as solving quick puzzles.
* **Look into more effective money sinks that are dynamic sensitive**
Think, for example, about the station ransom event that spawns space pirates.
What if instead of the captain just dumping credits from the cargo budget into the aether to prevent pirate spawns (They're bugged anyway to my knowledge to spawn anyway), crewmates had to cough up that dough before a time-limit, or risk a pirate spawn. For those of you who were scratching their heads at (Operational Costs!?) in the above controls diagram, this is the sort of thing I mean.
Little, smaller things that might need to be purchased, invested in, or otherwise drain credits from the station over the course of the round.
# Arconomy 2.0: Smarter, Better, Flashier.
## Roundstart
Players begin each shift with a set amount of money, with the value being mostly uniform over the course of a shift assuming no interaction with economy. Jobs are split up into only 3 paygrades, Minimal, Crew, and Command. Minimal is reserved for jobs that are meant to fill population counts but lack a specialization, like prisoner and assistant. When starting the shift, a player will start with 5 paychecks worth of savings. This system is not designed for persistance, so you will always be able to tell how much money a player starts out with. Every 5 minutes, aka every economy tick, the player will recieve one paycheck, which is capped out at the standard crew member paycheck. This means that even if you start the shift as the captain, and begin the shift with 500 credits, you will recieve the same 50 credits as regular crew members.
| Minimal Paycheck | Crew Paycheck | Command Paycheck | Frequency |
| -------- | -------- | -------- |--------|
| 125 Cr | 250 Cr | 500 Cr | Roundstart |
| 25 Cr | 50 Cr | 50 Cr | Passive Income |
## Product Prices
Products found in vending machines are defined by the amount of a player's paycheck they're meant to cost. Regular items use the PAYCHECK_CREW value, while more expensive or otherwise prohibitive items are defined by PAYCHECK_COMMAND. Items are defined in this uniform, horizontal fashion in order to maintain the equal value of credits over all jobs. A 100 credit medkit in medical should have the same value to a doctor as it does to a botanist.
Jobs apply a discount to vending within their own department, so an engineering would have a discount on tools, and a doctor would have a discount on sutures. Items that are important to gameplay progression in a role are less expensive to their intended users.
> **AUTHORS NOTE:** I am considering removing in-department discounts. In the benefit of making the value of purchasables more universal, deciding that credits shouldn't be spent within their own department just seems... rather fucking stupid.
> Possibly move the discount to only the first few minutes of the shift, or perhaps as some kind of gameplay benefit to slowly increase in-department discount through gameplay milestones? Who knows 👻
>
Some jobs have premium, high value items stocked in their vending machines that are not meant to be purchased at roundstart. These are meant to encourage players to save or combine resources to gain access. An example of this is insulated gloves. Other high value items can also be found in contraband through hacking vending machines. This remains unchanged.
## Markets
The cargo department has been changed in order to improve player involvement with the economy, as well as to give cargo more variety in their merchandise while preventing a singular stale meta of products to purchase from.
Yes, I'm looking at you, russian surplus crate.
Lets start with what's remaining the same:
* Cargo is a department that manages imports and exports of products, fulfilling departmental orders, and aquiring supplies dependent on the station's state.
* Cargo encompasses the station's mail, mining, and flow of orders, as well as drone exploration.
* A skilled cargo member is able to find high value items to sell back to centcom in exchange for more funds, to purchase those supplies.
* Centcom may request bounties which crew can fulfill in exchange for credits, if they wish for additional work.
**Now for the new design flow:**
Cargo starts out with a new mechanic called a market. Markets hold existing export datums as well as purchasable products. The values of items will fluxuate up and down based on the market status, with in-game events or player actions raising or lowering the values of specific markets.
At roundstart, cargo has a single market to sell to, which is Nanotransen. This will not incapsulate all the existing export datums in the game, just the *primary* exports that are used by players. Items that are exclusive to nanotrasen and required to play certain game modes, like mindshield implants or being able to sell crates, are included and will always be available to purchase.
Additional markets can be unlocked through gameplay sources, such as:
| Market Name | Source | Imports/Exports |
| -------- | -------- |- |
| The Syndicate | Emagging/Hacking the Console | Illegal Goods/Contraband |
| The Clown Planet Commerse | Discovering the clown planet ruin | Pies, Horns, Pranking Equipment |
|Terragov Sector Security Surplus | Killing any megafauna. | Weapons, Ammunition, Advanced Riot Gear. |
| Mekki Materials Co. | Recovered loot from Exodrones | Materials and industrial equipment. |
|Donk Co.| As a tip from tourist robots. | Foods and Drinks, Toys and Games.|
|Waffle Co.| As above. | Bootleg products and wacky merchandise. |
|The Research Consortium| Reward for completing any experiment tree. | Slime Cores, RnD Artifacts, Robotics Equipment |
...And more, if I can think of more.
The purpose being, of course, to split up cargo's purchasable goods to be more instanced and unique, while also create unique situations where due to profitable markets, very specific exports are needed to help the department make money.
End of document for now :@ArcaneMusic
-- END DOCUMENT
Price Shifting
So, in-game items that have prices have a major issue on their hands, being that they were decided by how much money that job should make. This means that many of the jobs in-game have been given prices scaled to their job's income. That income I adjusted by removing passive income in #54161. While this was helpful to moving towards an active in-game economy, it resulted in items falling into distinct price brackets. A high paying job like security's items could never be purchased by someone like a botanist, but a job like a security officer had more capital and buying power than most other jobs in-game combined when moving down those brackets. We've done a simple normalization of scale to help in bring things closer to a semblance of equality.
There are now 3 price brackets, PAYCHECK_LOW, PAYCHECK_CREW, and PAYCHECK_COMMAND. Command staff will still have a higher base level of money on-hand than other crew, and low paying wages that we on-station don't respect as being real jobs (assistant, prisoner) will have their items be intentionally cheaper to encourage active participation in the economy, but the difference in scale is now noticeably far closer to each other. This means that assistants can still interact with the economy as spenders, but if they want to be doing a lot of work with money, they'll need to put in work. Additionally, this means we arbitrarily enforce a system that allows for items to have uniformity in what they cost to other players. 50 credits for a wrench feels better when you know that other job critical items in-game are also around the same price, and it's equivalent to one paycheck.
Paychecks are reintroduced
Economy lost it's relationship to time. In a game where a single round takes 90+ minutes (Backed up not only by the head-coder's design direction as well as plenty of aggregate round data), having a relationship to time and how long it takes to afford something is a major consideration when you look at buying something. Also, we get to say that I was certifiably wrong in regards to the active economy thing, since we have very, VERY few active sources of content in-game that are very... fun? Bounties are literal fetch quests but something like tourists is at least more engaging and interactive with the round, and should be the direction we want economy-job integration to head in.
Between having inflation as a price manipulation mechanic already in the code, as well as prices being roughly equalized in terms of their costs between jobs and their impact on the round, this allows for the reintroduction of paychecks to an extent.
As an additional note, doing this meant tweaking down the syndicate briefcase of cash, so that instead of giving you 5000 credits for 1 TC, it now costs 5 TC to accompany the fact that this is now a rather significant amount of money, even on decently high population. Fun fact: the Syndicate Briefcase of Cash actually PREDATES the economy, and was NEVER ADJUSTED beyond the original implementation of the economy as a result!
Gas Exports.
ALRIGHT ARE YOU READY FOR SOME GRAPHS? I THOUGHT SO, YOU LOVE GRAPHS.
So, gas exports are fucked, have always been fucked, and consistently have proven to be capable of breaking the in-game economy for a long time. This is no secret, I've been pinged with players getting billions, actual billions of credits using it multiple times in as many years. See, any round where a player manages to buy the bicycle is a round where I've fucked up, or someone fucked and I let it get past me.
So here's how gas exports work right now.
So, all of this hinges on the value of a single mole of gas, and some gasses enable you to make extremely, EXTREMELY profitable gasses through atmospheric gas wizardry However, even those less profitable gasses are still in an extremely high magnitude of value.
Most gasses if you have a full can of it will net you OVER 10k credits. For scale, one crate being sold in cargo is 200 credits.
That's a minimum of crates for pumping gas into a hollow metal box and praying it doesn't explode.
So we adjusted the values accordingly.
The baseline value of a single gas has been tweaked downward significantly. Even these values are still arguably very high, but I can play with it at the discretion of LemonintheDark. The green line at the top represents gasses that previously sold for 100 credits per mole, antinobilium I believe, and working downwards. I am going to try and enforce 10 credits per mole as the absolute maximum hard cap on gas exports, regardless of how many gasses we try to add in the future. Because the alternative is getting a gunjillion credits by huffing miasma into a tank of steel. And we ain't having that shit.
Lathe Tax
Part of the testing for this PR involved me modeling the SS13 economy in a given round as a kind of controls problem, with each source of income introduced in the round as a kind of input (Passive Income, Bounties, Tourists) in order to get a handle on roughly how much income a single round of SS13 will see per player on the given designed round-length, in order to estimate how much things are going to cost. Modeling how much players spend on a given round is variable enough that it'd be too difficult to accurately test without just throwing this up on a server and getting live data.
However, from the appearance of my dataset, players would be making a LOT more money nowadays with all of the above changes implemented. In an attempt to curve that intake, I attempted to implement a small, low scale tax of printing items that would take a small amount of players income every time they print, as a way to add a basic economic side-effect to this mechanic.
This has made a lot of people very angry and been widely regarded as a mixed decision. So, maintainers came up with an intended direction they want to see it, as they wanted to make sure that economy would remain a secondary system, that could still have an impact on round direction and the changes they want to see in the game.
So, here's the intent:
Lathe tax should exist in the form of printing things from protolathes outside of your department, not on autolathes or your own protolathe.
We want to promote people talking and collaborating to access things if it's outside the scope of their department and they still want it, with theft still being a viable avenue of gameplay.
Players will be charged 10 credits for printing a set of items not from their own protolathe, each. Printing an item can be paid for from your own ID card's bank account automatically, but the payment component has been buffed to handle physical money alternatives, as well as pulled money, similar to the luxury shuttle scanner gate's behavior.
Borgs are still enabled to print from lathes, however instead of it costing them credits, they now take a self-significant power cost in order to do so, preventing them from being used as a roving bank account for printing. I'll look into this further as we don't want to invalidate mechanics like borgs being able to do organ based surgery or building machinery, but we don't want them to become credit cards, so place that under advisement.
Tweaks and Updates:
(Suggested by Ziiro) If the revolutionaries win, centcom will no longer enforce the Lathe Tax.
(Suggested by about ~1000 people independently between my DMs, Reddit threads, the Feedback Thread, and elsewhere)
Printing items only taxes you once per print. EG: If you print 10 Kitchen Knifes as an assistant from the service lathe, you will only be charged once instead of 10 times.
For many of the reasons that I outlined above, this is a good change in a positive direction.
Players get more ability to interact with the economy without having to do content that's becoming increasingly depreciated in my absence.
Players also have a baseline consensus on what values of credits are high and low because jobs have been given an equalized standard in regards to the cost of certain items.
Price fluctuations through inflation will now be more meaningful in situations where the economy becomes more relevant.
The system will still encourage you to play a job that's productive to the status of the station through lower paycheck jobs existing as well.
Gas exports are now reduced to the point that their value is appropriate for the first time... actually ever. Nice.
The values of nearly every item purchasable by players has been rebalanced.
Players will now start with less starting money, but will receive a paycheck once every 5 minutes.
The value of gasses exported through the cargo department have been skewed way, WAY down in terms of price.
The Syndicate briefcase of cash now contains now costs 5 TC, up from 1 TC, for 5000 credits.
Printing items from lathes on station now costs a fee of 10 credits per item printed if it's from a lathe not under your department.
The payment component has received additional handling for physical credits, as well as pulled credits/ID cards for those without hands.
463 lines
18 KiB
Plaintext
463 lines
18 KiB
Plaintext
// Skillchip categories
|
|
//Various skillchip categories. Use these when setting which categories a skillchip restricts being paired with
|
|
//while using the SKILLCHIP_RESTRICTED_CATEGORIES flag
|
|
/// General related skillchip category
|
|
#define SKILLCHIP_CATEGORY_GENERAL "general"
|
|
|
|
|
|
/obj/item/skillchip
|
|
name = "skillchip"
|
|
desc = "This biochip integrates with user's brain to enable mastery of specific skill. Consult certified Nanotrasen neurosurgeon before use."
|
|
|
|
icon = 'icons/obj/card.dmi'
|
|
icon_state = "data_3"
|
|
custom_price = PAYCHECK_CREW * 3
|
|
w_class = WEIGHT_CLASS_SMALL
|
|
|
|
/// Traits automatically granted by this chip, optional. Lazylist.
|
|
var/list/auto_traits
|
|
/// Skill name shown on UI
|
|
var/skill_name
|
|
/// Skill description shown on UI
|
|
var/skill_description
|
|
/// Category string. Used alongside SKILLCHIP_RESTRICTED_CATEGORIES flag to make a chip incompatible with chips from another category.
|
|
var/chip_category = SKILLCHIP_CATEGORY_GENERAL
|
|
/// List of any incompatible categories.
|
|
var/list/incompatibility_list
|
|
/// Fontawesome icon show on UI, list of possible icons https://fontawesome.com/icons?d=gallery&m=free
|
|
var/skill_icon = "brain"
|
|
/// Message shown when activating the chip
|
|
var/activate_message
|
|
/// Message shown when deactivating the chip
|
|
var/deactivate_message
|
|
//If set to FALSE, trying to extract the chip will destroy it instead
|
|
var/removable
|
|
/// How complex the skillchip is. Brains can only handle so much complexity at once and skillchips will start to deactivate when the brain's complexity limit is exceeded.
|
|
var/complexity = 1
|
|
/// How many slots taken up in the brain by this chip. Max brain slots are hard set and should not be changed at all.
|
|
var/slot_use = 1
|
|
/// Variable for flags. DANGEROUS - Child types overwrite flags instead of adding to them. If you change this, make sure all child types have the appropriate flags set too.
|
|
var/skillchip_flags = NONE
|
|
/// Cooldown before the skillchip can be extracted after it has been implanted.
|
|
var/cooldown = 5 MINUTES
|
|
/// Cooldown for chip actions.
|
|
COOLDOWN_DECLARE(chip_cooldown)
|
|
/// Used to determine if this is an abstract type or not. If this is meant to be an abstract type, set it to the type's path. Will be overridden by subsequent abstract parents. See /datum/action/item_action/chameleon/change/skillchip/initialize_disguises()
|
|
var/abstract_parent_type = /obj/item/skillchip
|
|
/// Set to TRUE when the skill chip's effects are applied. Set to FALSE when they're not.
|
|
var/active = FALSE
|
|
/// Brain that holds this skillchip.
|
|
var/obj/item/organ/brain/holding_brain
|
|
|
|
/obj/item/skillchip/Initialize(mapload, is_removable = TRUE)
|
|
. = ..()
|
|
removable = is_removable
|
|
|
|
/**
|
|
* Activates the skillchip, if possible.
|
|
*
|
|
* Returns a message containing the reason if activation is not possible.
|
|
* Arguments:
|
|
* * silent - Boolean. Whether or not an activation message should be shown to the user.
|
|
* * force - Boolean. Whether or not to just force de-activation if it would be prevented for any reason.
|
|
*/
|
|
/obj/item/skillchip/proc/try_activate_skillchip(silent = FALSE, force = FALSE)
|
|
// Should not happen. Holding brain is destroyed and the chip hasn't had its state set appropriately.
|
|
if(QDELETED(holding_brain))
|
|
stack_trace("Skillchip's owner is null or qdeleted brain.")
|
|
return "Skillchip cannot detect viable brain."
|
|
|
|
// Also should not happen. We're somehow activating skillchips in a bodyless brain.
|
|
if(QDELETED(holding_brain.owner))
|
|
stack_trace("Skillchip's brain has no owner, owner is null or owner qdeleted.")
|
|
return "Skillchip cannot detect viable body."
|
|
|
|
// We have a holding brain, the holding brain has an owner. If we're forcing this, do it hard and fast.
|
|
if(force)
|
|
on_activate(holding_brain.owner, silent)
|
|
return
|
|
|
|
// Is the chip still experiencing a cooldown period?
|
|
if(!COOLDOWN_FINISHED(src, chip_cooldown))
|
|
return "Skillchip is still recharging for [COOLDOWN_TIMELEFT(src, chip_cooldown) * 0.1]s"
|
|
|
|
// So, we have a brain and that brain has a body. Let's start checking for incompatibility.
|
|
var/activate_msg = has_activate_incompatibility(holding_brain)
|
|
|
|
// If there's an activate_msg it means we can't activate for some reason. Return the feedback message.
|
|
if(activate_msg)
|
|
return activate_msg
|
|
|
|
// Either there's no incompatibility or we're forcing the activation. We're good to go!
|
|
on_activate(holding_brain.owner, silent)
|
|
|
|
/**
|
|
* Deactivates the skillchip, if possible.
|
|
*
|
|
* Returns a message containing the reason if deactivation is not possible.
|
|
* Arguments:
|
|
* * silent - Boolean. Whether or not an activation message should be shown to the user.
|
|
* * force - Boolean. Whether or not to just force de-activation if it would be prevented for any reason.
|
|
*/
|
|
/obj/item/skillchip/proc/try_deactivate_skillchip(silent = FALSE, force = FALSE)
|
|
if(!active)
|
|
return "Skillchip is not active."
|
|
|
|
// Should not happen. Holding brain is destroyed and the chip hasn't had its state set appropriately.
|
|
if(QDELETED(holding_brain))
|
|
stack_trace("Skillchip's owner is null or qdeleted brain.")
|
|
return "Skillchip cannot detect viable brain."
|
|
|
|
// Also should not happen. We're somehow deactivating skillchips in a bodyless brain.
|
|
if(QDELETED(holding_brain.owner))
|
|
active = FALSE
|
|
stack_trace("Skillchip's brain has no owner, owner is null or owner qdeleted.")
|
|
return "Skillchip cannot detect viable body."
|
|
|
|
// We have a holding brain, the holding brain has an owner. If we're forcing this, do it hard and fast.
|
|
if(force)
|
|
on_deactivate(holding_brain.owner, silent)
|
|
return
|
|
|
|
// Is the chip still experiencing a cooldown period?
|
|
if(!COOLDOWN_FINISHED(src, chip_cooldown))
|
|
return "Skillchip is still recharging for [COOLDOWN_TIMELEFT(src, chip_cooldown) * 0.1]s"
|
|
|
|
// We're good to go. Deactive this chip.
|
|
on_deactivate(holding_brain.owner, silent)
|
|
|
|
/**
|
|
* Called when a skillchip is inserted in a user's brain.
|
|
*
|
|
* Arguments:
|
|
* * owner_brain - The brain that this skillchip was implanted in to.
|
|
*/
|
|
/obj/item/skillchip/proc/on_implant(obj/item/organ/brain/owner_brain)
|
|
if(holding_brain)
|
|
CRASH("Skillchip is trying to be implanted into [owner_brain], but it's already implanted in [holding_brain]")
|
|
|
|
holding_brain = owner_brain
|
|
|
|
/**
|
|
* Called when a skillchip is activated.
|
|
*
|
|
* Arguments:
|
|
* * user - The user to apply skillchip effects to.
|
|
* * silent - Boolean. Whether or not an activation message should be shown to the user.
|
|
*/
|
|
/obj/item/skillchip/proc/on_activate(mob/living/carbon/user, silent=FALSE)
|
|
if(!silent && activate_message)
|
|
to_chat(user, activate_message)
|
|
|
|
for(var/trait in auto_traits)
|
|
ADD_TRAIT(user, trait, SKILLCHIP_TRAIT)
|
|
|
|
active = TRUE
|
|
|
|
COOLDOWN_START(src, chip_cooldown, cooldown)
|
|
|
|
/**
|
|
* Called when a skillchip is removed from the user's brain.
|
|
*
|
|
* Always deactivates the skillchip.
|
|
* Arguments:
|
|
* * user - The user to remove skillchip effects from.
|
|
* * silent - Boolean. Whether or not a deactivation message should be shown to the user.
|
|
*/
|
|
/obj/item/skillchip/proc/on_removal(silent=FALSE)
|
|
if(active)
|
|
try_deactivate_skillchip(silent, TRUE)
|
|
|
|
COOLDOWN_RESET(src, chip_cooldown)
|
|
|
|
holding_brain = null
|
|
|
|
/**
|
|
* Called when a skillchip is deactivated.
|
|
*
|
|
* Arguments:
|
|
* * user - The user to remove skillchip effects from.
|
|
* * silent - Boolean. Whether or not a deactivation message should be shown to the user.
|
|
*/
|
|
/obj/item/skillchip/proc/on_deactivate(mob/living/carbon/user, silent=FALSE)
|
|
if(!silent && deactivate_message)
|
|
to_chat(user, deactivate_message)
|
|
|
|
for(var/trait in auto_traits)
|
|
REMOVE_TRAIT(user, trait, SKILLCHIP_TRAIT)
|
|
|
|
active = FALSE
|
|
|
|
COOLDOWN_START(src, chip_cooldown, cooldown)
|
|
|
|
/**
|
|
* Checks whether a given skillchip has an incompatibility with a brain that should render it impossible
|
|
* to activate.
|
|
*
|
|
* Returns a string with an explanation if the chip is not activatable. FALSE otherwise.
|
|
* Arguments:
|
|
* * skillchip - The skillchip you're intending to activate. Does not activate the chip.
|
|
*/
|
|
/obj/item/skillchip/proc/has_activate_incompatibility(obj/item/organ/brain/brain)
|
|
if(QDELETED(brain))
|
|
return "No brain detected."
|
|
|
|
// Check if there's enough complexity usage left to activate the skillchip.
|
|
var/max_complexity = brain.get_max_skillchip_complexity()
|
|
var/new_complexity = brain.get_used_skillchip_complexity() + get_complexity()
|
|
if(new_complexity > max_complexity)
|
|
return "Skillchip is too complex to activate: [new_complexity] total out of [max_complexity] max complexity."
|
|
|
|
return FALSE
|
|
|
|
|
|
/**
|
|
* Checks for skillchip incompatibility with another chip.
|
|
*
|
|
* Does *this* skillchip have incompatibility with the skillchip in the args?
|
|
* Override this with any snowflake chip-vs-chip incompatibility checks.
|
|
* Returns a string with an incompatibility explanation if the chip is not compatible, returns FALSE
|
|
* if it is compatible.
|
|
* Arguments:
|
|
* * skillchip - The skillchip to test for incompatability.
|
|
*/
|
|
/obj/item/skillchip/proc/has_skillchip_incompatibility(obj/item/skillchip/skillchip)
|
|
// Only allow multiple copies of a type if SKILLCHIP_ALLOWS_MULTIPLE flag is set
|
|
if(!(skillchip_flags & SKILLCHIP_ALLOWS_MULTIPLE) && (skillchip.type == type))
|
|
return "Duplicate chip detected: [skillchip.name]"
|
|
|
|
// Prevent implanting multiple chips of the same category.
|
|
if((skillchip_flags & SKILLCHIP_RESTRICTED_CATEGORIES) && (skillchip.chip_category in incompatibility_list))
|
|
return "Incompatible with implanted [skillchip.chip_category] chip [skillchip.name]."
|
|
|
|
return FALSE
|
|
|
|
/**
|
|
* Performs a full sweep of checks that dictate if this chip can be implanted in a given target.
|
|
*
|
|
* Override this with any snowflake chip checks. An example of which would be checking if a target is
|
|
* mindshielded if you've got a special security skillchip.
|
|
* Returns a string with an incompatibility explanation if the chip is not compatible, returns FALSE
|
|
* if it is compatible.
|
|
* Arguments:
|
|
* * target - The mob to check for implantability with.
|
|
*/
|
|
/obj/item/skillchip/proc/has_mob_incompatibility(mob/living/carbon/target)
|
|
// No carbon/carbon of incorrect type
|
|
if(!istype(target))
|
|
return "Incompatible lifeform detected."
|
|
|
|
// No brain
|
|
var/obj/item/organ/brain/brain = target.getorganslot(ORGAN_SLOT_BRAIN)
|
|
if(QDELETED(brain))
|
|
return "No brain detected."
|
|
|
|
// Check brain incompatibility. This also performs skillchip-to-skillchip incompatibility checks.
|
|
var/brain_message = has_brain_incompatibility(brain)
|
|
if(brain_message)
|
|
return brain_message
|
|
|
|
return FALSE
|
|
|
|
/**
|
|
* Performs a full sweep of checks that dictate if this chip can be implanted in a given brain.
|
|
*
|
|
* Override this with any snowflake chip checks.
|
|
* Returns TRUE if the chip is fully compatible, FALSE otherwise.
|
|
* Arguments:
|
|
* * brain - The brain to check for implantability with.
|
|
*/
|
|
/obj/item/skillchip/proc/has_brain_incompatibility(obj/item/organ/brain/brain)
|
|
if(!istype(brain))
|
|
stack_trace("Attempted to check incompatibility with invalid brain object [brain].")
|
|
return "Incompatible brain."
|
|
|
|
var/chip_message
|
|
|
|
// Slot capacity check!
|
|
var/max_slots = brain.get_max_skillchip_slots()
|
|
var/used_slots = brain.get_used_skillchip_slots()
|
|
|
|
if(used_slots + slot_use > max_slots)
|
|
return "Not enough free slots. You have [max_slots - used_slots] free and need [slot_use]."
|
|
|
|
// Check if this chip is incompatible with any other chips in the brain.
|
|
for(var/skillchip in brain.skillchips)
|
|
chip_message = has_skillchip_incompatibility(skillchip)
|
|
if(chip_message)
|
|
return chip_message
|
|
|
|
return FALSE
|
|
|
|
/**
|
|
* Returns whether the chip is on cooldown. Chips ordinarily go on cooldown when activated.
|
|
*
|
|
* This does not mean the chip should be impossible to do anything with.
|
|
* It's up to each individual piece of code to decide what it does with the result of this proc.
|
|
*
|
|
* Returns TRUE if the chip's extraction cooldown hasn't yet passed.
|
|
*/
|
|
/obj/item/skillchip/proc/is_on_cooldown()
|
|
return !COOLDOWN_FINISHED(src, chip_cooldown)
|
|
|
|
/**
|
|
* Returns whether the chip is active.
|
|
*
|
|
* Intended to be overriden.
|
|
* Returns TRUE if the chip is active.
|
|
*/
|
|
/obj/item/skillchip/proc/is_active()
|
|
return active
|
|
|
|
/**
|
|
* Returns the chip's complexity.
|
|
*
|
|
* Intended to be overriden.
|
|
*/
|
|
/obj/item/skillchip/proc/get_complexity()
|
|
return complexity
|
|
|
|
/**
|
|
* Returns a list of basic chip info. Used by the skill station.
|
|
*/
|
|
/obj/item/skillchip/proc/get_chip_data()
|
|
return list(
|
|
"name" = skill_name,
|
|
"icon" = skill_icon,
|
|
"desc" = skill_description,
|
|
"complexity" = get_complexity(),
|
|
"slot_use" = slot_use,
|
|
"removable" = removable,
|
|
"ref" = REF(src),
|
|
"active" = is_active(),
|
|
"active_error" = has_activate_incompatibility(holding_brain),
|
|
"cooldown" = COOLDOWN_TIMELEFT(src, chip_cooldown),
|
|
"actionable" = is_on_cooldown())
|
|
|
|
/**
|
|
* Gets key metadata from this skillchip in an assoc list.
|
|
*
|
|
* If you override this proc, don't forget to also override set_metadata, which takes the output of
|
|
* this proc and uses it to set the metadata.
|
|
* Does not copy over any owner or brain status. Handle that externally.
|
|
*/
|
|
/obj/item/skillchip/proc/get_metadata()
|
|
var/list/metadata = list()
|
|
metadata["type"] = type
|
|
metadata["chip_cooldown"] = chip_cooldown
|
|
metadata["active"] = active
|
|
metadata["removable"] = removable
|
|
|
|
return metadata
|
|
|
|
/**
|
|
* Sets key metadata for this skillchip from an assoc list.
|
|
*
|
|
* Best used with the output from get_metadata() of another chip.
|
|
* If you override this proc, don't forget to also override get_metadata, which is where you should
|
|
* usually get the assoc list that feeds into this proc.
|
|
* Does not set any owner or brain status. Handle that externally.
|
|
* Arguments:
|
|
* metadata - Ideally the output of another chip's get_metadata proc. Assoc list of metadata.
|
|
*/
|
|
/obj/item/skillchip/proc/set_metadata(list/metadata)
|
|
var/active_msg
|
|
// Start by trying to activate.
|
|
active = metadata["active"]
|
|
if(active)
|
|
active_msg = try_activate_skillchip(FALSE, TRUE)
|
|
|
|
// Whether it worked or not, set the rest of the metadata and then return any activate message.
|
|
chip_cooldown = metadata["chip_cooldown"]
|
|
removable = metadata["removable"]
|
|
|
|
return active_msg
|
|
|
|
/obj/item/skillchip/basketweaving
|
|
name = "Basketsoft 3000 skillchip"
|
|
desc = "Underwater edition."
|
|
auto_traits = list(TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE)
|
|
skill_name = "Underwater Basketweaving"
|
|
skill_description = "Master intricate art of using twine to create perfect baskets while submerged."
|
|
skill_icon = "shopping-basket"
|
|
activate_message = "<span class='notice'>You're one with the twine and the sea.</span>"
|
|
deactivate_message = "<span class='notice'>Higher mysteries of underwater basketweaving leave your mind.</span>"
|
|
|
|
/obj/item/skillchip/wine_taster
|
|
name = "WINE skillchip"
|
|
desc = "Wine.Is.Not.Equal version 5."
|
|
auto_traits = list(TRAIT_WINE_TASTER)
|
|
skill_name = "Wine Tasting"
|
|
skill_description = "Recognize wine vintage from taste alone. Never again lack an opinion when presented with an unknown drink."
|
|
skill_icon = "wine-bottle"
|
|
activate_message = "<span class='notice'>You recall wine taste.</span>"
|
|
deactivate_message = "<span class='notice'>Your memories of wine evaporate.</span>"
|
|
|
|
/obj/item/skillchip/bonsai
|
|
name = "Hedge 3 skillchip"
|
|
auto_traits = list(TRAIT_BONSAI)
|
|
skill_name = "Hedgetrimming"
|
|
skill_description = "Trim hedges and potted plants into marvelous new shapes with any old knife. Not applicable to plastic plants."
|
|
skill_icon = "spa"
|
|
activate_message = "<span class='notice'>Your mind is filled with plant arrangments.</span>"
|
|
deactivate_message = "<span class='notice'>You can't remember what a hedge looks like anymore.</span>"
|
|
|
|
/obj/item/skillchip/useless_adapter
|
|
name = "Skillchip adapter"
|
|
skill_name = "Useless adapter"
|
|
skill_description = "Allows you to insert another skillchip into this adapter after it has been inserted into your brain..."
|
|
skill_icon = "plug"
|
|
activate_message = "<span class='notice'>You can now activate another chip through this adapter, but you're not sure why you did this...</span>"
|
|
deactivate_message = "<span class='notice'>You no longer have the useless skillchip adapter.</span>"
|
|
skillchip_flags = SKILLCHIP_ALLOWS_MULTIPLE
|
|
// Literally does nothing.
|
|
complexity = 0
|
|
slot_use = 0
|
|
|
|
/obj/item/skillchip/light_remover
|
|
name = "N16H7M4R3 skillchip"
|
|
auto_traits = list(TRAIT_LIGHTBULB_REMOVER)
|
|
skill_name = "Lightbulb Removing"
|
|
skill_description = "Stop failing taking out lightbulbs today, no gloves needed!"
|
|
skill_icon = "lightbulb"
|
|
activate_message = "<span class='notice'>Your feel like your pain receptors are less sensitive to hot objects.</span>"
|
|
deactivate_message = "<span class='notice'>You feel like hot objects could stop you again...</span>"
|
|
|
|
/obj/item/skillchip/disk_verifier
|
|
name = "K33P-TH4T-D15K skillchip"
|
|
auto_traits = list(TRAIT_DISK_VERIFIER)
|
|
skill_name = "Nuclear Disk Verification"
|
|
skill_description = "Nuclear authentication disks have an extremely long serial number for verification. This skillchip stores that number, which allows the user to automatically spot forgeries."
|
|
skill_icon = "save"
|
|
activate_message = "<span class='notice'>You feel your mind automatically verifying long serial numbers on disk shaped objects.</span>"
|
|
deactivate_message = "<span class='notice'>The innate recognition of absurdly long disk-related serial numbers fades from your mind.</span>"
|
|
|
|
/obj/item/skillchip/entrails_reader
|
|
name = "3NTR41LS skillchip"
|
|
auto_traits = list(TRAIT_ENTRAILS_READER)
|
|
skill_name = "Entrails Reader"
|
|
skill_description = "Be able to learn about a person's life, by looking at their internal organs. Not to be confused with looking into the future."
|
|
skill_icon = "lungs"
|
|
activate_message = "<span class='notice'>You feel that you know a lot about interpreting organs.</span>"
|
|
deactivate_message = "<span class='notice'>Knowledge of liver damage, heart strain and lung scars fades from your mind.</span>"
|
|
|
|
/obj/item/skillchip/brainwashing
|
|
name = "suspicious skillchip"
|
|
auto_traits = list(TRAIT_BRAINWASHING)
|
|
skill_name = "Brainwashing"
|
|
skill_description = "WARNING: The integrity of this chip is compromised. Please discard this skillchip."
|
|
skill_icon = "soap"
|
|
activate_message = span_notice("...But all at once it comes to you... something involving putting a brain in a washing machine?")
|
|
deactivate_message = span_warning("All knowledge of the secret brainwashing technique is GONE.")
|
|
|
|
/obj/item/skillchip/brainwashing/examine(mob/user)
|
|
. = ..()
|
|
. += span_warning("It seems to have been corroded over time, putting this in your head may not be the best idea...")
|
|
|
|
/obj/item/skillchip/brainwashing/on_activate(mob/living/carbon/user, silent = FALSE)
|
|
to_chat(user, span_danger("You get a pounding headache as the chip sends corrupt memories into your head!"))
|
|
user.adjustOrganLoss(ORGAN_SLOT_BRAIN, 20)
|
|
. = ..()
|
|
|
|
#undef SKILLCHIP_CATEGORY_GENERAL
|