* Converts everything to use setAnchored() + other fixes
* Fixed singulo debug
* singulo again
* forgot to move the vv_edit proc
* caught that this time :)
* changes
* Update code/game/atoms_movable.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
Co-authored-by: Rohesie <rohesie@gmail.com>
* Added si unit formatting proc, and unit tests for it
* Added canister examine note for what their max pressure is
* Fixed the siunit proc comment abit
* Improved canister frame code
Removed a bunch of code duplication
Properly uses <tool>_act and use_tool procs
Allow players to deconstruct frames using wrench
Fixed names not being improper
Fixed canister welder deconstruction
* Added another deconstruct chat note for canisters
About The Pull Request
This PR adds medical wounds, new forms of injuries that people can suffer that cause debilitation and complications, and often require more than what can be found in a medkit to treat. But let's be honest, big complicated walls of text about medical changes make people's eyes glaze over easily- so I created a handy infograph to explain the basics!
Also there's a full guide here!
dreamseeker_2020-04-18_20-42-19.png
The infograph may not be fully up to date with the specifics of the PR's status, but it'll be updated along with major changes so people have something to use as a crash course for familiarizing themselves with how wounds function. I also have another infograph with all 9 of the possible initial wounds coming, and will be up soon. You can also find the longform design doc here with more info on the broad details, including descriptions of treatments: hackmd whee
What this does
There's a lot to cover, but here's the bullet points of the main features and changes:
Getting lots of damage on a limb can result in wounds, with more damage causing worse wounds. These can range from dislocated joints and minor cuts to compound fractures and fourth degree burns, and can affect you in different ways depending on what bodypart they're applied to (namely with broken bones).
You can damage individual bodyparts on clothing (only jumpsuits for now) through the use of lasers and sharp weapons. Bodyparts that reach max damage are considered "shredded" and will not apply any protection for that zone until it is repaired with cloth. If all zones are disabled, the entire piece of clothing is shredded and unwearable until repaired with 3 cloth. Jumpsuits give a small amount of wound protection, and since sharp weapons and lasers generally get extra wound bonuses against bare flesh, even a plain jumpsuit provides decent protection from a few laser shots or scalpel stabs.
Lasers gain a powerful niche versus unarmored/lightly armored carbons! As noted above, lasers can shred clothing and burn away zones of jumpsuits in 2 shots each, after which the target's bare flesh is exposed (barring other clothing), and lasers excel at dealing burn wounds against uncovered skin. Think big, nasty charring!
Bleeding is now totally limb based, and gauze is as well. Bleeding is also 95% cut wound based, meaning sharp weapons make you bleed rather than just having 40+ brute on a limb.
The more wounds and damage you get on a bodypart, the easier it'll be to gain more severe wounds. Wounds are arranged from Moderate, to Severe, to Critical in increasing severity, and you'll generally have to suffer the lesser ones before getting the worse ones.
dreamseeker_2020-05-15_03-15-59.png
Above: Someone having an incredibly bad day from bloodloss
dreamseeker_2020-05-04_22-29-29.png
Above: Scars from healed wounds
ShareX_2020-05-15_06-55-20.png
Above: Actual combat involving someone's head getting cracked
Here's a quick, if non-exhaustive, list of things I have left to do before I consider it feature complete
Finish adding treatments for each wound type/severity (mostly surgeries/triage for critical wounds)
Add second winds for bad injuries to give the victim a chance to get away
Flesh out severe & critical injuries in general
Find sprites for the bonesetter, bone gel, and anything else that might be needed
Add the medical items for treating the less severe wounds to the station
Polish code and remove any redundancies I left behind
Quick balance pass to make sure nothing is horribly abuseable
Why It's Good For The Game
Adds a flexible new system for representing damage on carbons with injuries that can be treated in different ways. Moderate wounds from getting toolboxed or sliced with a scalpel can usually be treated by a buddy or even by yourself with the right tools, but getting flayed with a fireaxe or a laser gun emptied into your bare skin may require extra attention or even surgery in bad cases! Also makes laser guns cooler and more like 40k lasguns that can flash fry people (cool!)
This should also make spessmen more resilient and harder to kill outright, while still adding consequences and complications to getting hurt. Wounds aren't immediately fatal, but they can do things like slow down interactions, deal damage over time through infections, and generally make you more fragile until fixed. They can also give you a "second wind" on being applied that gives you a small adrenaline boost (or whatever) to help disengage and escape immediate danger.
Changelog
🆑 Ryll/Shaps
add: Introduces medical wounds, new injuries that can happen to fleshy carbons when they sustain lots of damage on a bodypart. There's quite a lot of change here, but you can read the guide at: https://tgstation13.org/wiki/Guide_to_wounds and an extended changelog is available here: https://hackmd.io/l_FI9b3tSqa_woDadewJXA
add: Introduces scars and temporal scarring! Healing a wound leaves a scar behind that can be seen by examining someone twice rapidly, and if Temporal Scarring is enabled in character prefs, surviving a round with scars will save them to be granted at roundstart another round! Let your body tell stories!
tweak: Bleeding is now fully bodypart-focused, and 95% of bleeding comes from cut wounds from sharp weapons. Gauze is applied on a limb-by-limb basis, and helps staunch bloodflow rather than totally stop it. Notably, you no longer bleed just from having 40+ brute damage on a limb.
del: Organic bodyparts are no longer disabled at maximum damage, but are easier to cause wounds to
add: O2 medkits in emergency lockers have been replaced with new emergency medkits with basic tools for diagnosing and treating wounds and basic damage
tweak: Herapin now rapidly increases bleeding on all open cuts, rather than causing bleeding by itself. The more cuts on the target, the more it will affect them.
tweak: Neckgrab table slams now hit the targeted limb rather than just the head, with a large chance to dislocate or break a bone
tweak: Sharp weapons and burning weapons can now shred zones on jumpsuits, disabling protection on that limb. Damaged clothes can be repaired with cloth.
tweak: Slaughter demons now deal less raw damage, but gain the ability to cause cut wounds, which becomes more powerful with each attack on a humanoid but resets when bloodcrawling.
/🆑
About The Pull Request
/area/proc/usage() attempts to give list-like access to a bunch of vars. Why not make it a list instead and avoid all the proc calls? Might be room for followup here, to do something to powered(), use_power() etc.
Some legacy machinery was ignoring the default machinery use_power pulling from the machine's power channel by default
Total power usage was unused, APCs ignored it in favor of calculating it themselves :)
I also renamed the defines because they were in the danger zone of being very common words.
Changelog
cl Naksu
code: optimized area power usage calculations.
/cl
About The Pull Request
Extools maptick stuff is in the game. Stolen from BeeStation/BeeStation-Hornet#1119, improves performance. Requires ex-tools on the server, though.
Explosions have been refactored to do the actual exploding in a subsystem.
Credit to goon.
Here's some videos!
Why It's Good For The Game
Basically instant max-caps now.
We can now give more of a tick over to the sending of map updates
Changelog
cl Goonstation Coders, Beestation, Extools devs
refactor: Explosions have been heavily optimized.
/cl
About The Pull Request
This is a massive rework that is coming down the pipe.
Removal of routes.js
This PR removes routes.js file in favor of filename-based routing. DM-code will now reference components directly.
For example, previously, DM code would use "ntos_main" as a key. Now you need to use "NtosMain" as a key, and it should match both the exported name and a file name of your component.
Flexible Layout System
As a result of the above, interfaces are now top-level components. To accomodate this change, we have created a new abstraction for the layout: the Window component.
You will now see, that interfaces, instead of returning window contents directly, return a tree that starts with a <Window /> component:
export const Apc = (props, context) => {
return (
<Window resizable>
<Window.Content scrollable>
<ApcContent />
</Window.Content>
</Window>
);
};
Metadata, which was previously added to routes.js (things like theme, wrapper, scrollable) can now be declared on the Window.
This also eliminates the need for a concept called wrapper, because now you can directly control where you render <Window.Content />, which allows adding things like toolbars, status bars, and modal windows.
We also have <NtosWindow /> for NtOS interfaces, and <Layout /> for completely custom, non window-based layouts. (Side-panel tguis, or maybe even goonchat or stat panel replacement, wink wink, nudge nudge, WYCI).
Modals
Now since we have a new layout system, modals are now easier to implement than ever! This is because now we have a clear slot for them, which would cover all area above the content with a Dimmer.
This avoids issues like Dimmer being scrollable together with the content, or covering content only partially, and things like that.
export const Apc = (props, context) => {
return (
<Window resizable>
{/* Dimmer/Modal slot starts here */}
{showModal && (
<Modal>
{...}
</Modal>
)}
{/* Dimmer/Modal slot ends here */}
<Window.Content scrollable>
<ApcContent />
</Window.Content>
</Window>
);
};
React Context
You have probably noticed, that we have a second argument to components: context.
This is a "magical" state container, that is available on all components without you doing anything extra to support it. It carries the Redux store and all tgui backend related data, meaning that things like useBackend(context) will now use context instead of props.
This also means, that you no longer have to pass around the state via the props:
<AnotherNestedComponent state={state} />
With context available on all components, this is all you need to do:
<AnotherNestedComponent />
Shared TGUI states
We introduce a new abstraction, that eliminates all previous use-cases for class-based React components - local component state.
You can now achieve the same thing with help of a useLocalState() function:
const AirAlarmControl = (props, context) => {
const [screen, setScreen] = useLocalState(context, 'screen');
// Use `screen` to access current screen.
// Use `setScreen(nextValue)` function to set screen to a new value.
};
This also removes the redundant tgui:view action, and config.ui_screen variable, because now this thingie can achieve the same thing in a more generic way.
But wait, there's more!
You can use useSharedState() function, to not only create a piece of state, but also sync it across all clients, which is a fantastic way to allow observers see how user interacts with the UI.
const AirAlarmControl = (props, context) => {
const [screen, setScreen] = useSharedState(context, 'screen');
// Now screen will change for everyone who observes the UI.
};
useSharedState() is JSON-serializable, which means you can use anything as a state, not only strings and primitive values.
Performance Improvements
We have sped up the initial render by about a full frame.
Miscellaneous
Fixed operating computer getting stuck on last step of the surgery.
All UIs refactored to use new Tabs API
Formatters
formatPower, outputs watts with SI units, kilo, mega, etc.
formatMoney, formats cash with thousand separators and shit. Code for this is stolen from real business applications.
Number helpers
round(number, precision) helper, with correct 0.5 rounding, and with other float nonsense fixed.
toFixed(number, precision) won't throw an exception on negative values
Moving stuff around in webpack
DOM polyfills get their own directory, and are bundled together with the rest of the code. 60KB -> 20KB, indirectly adds speed to initial render.
Stylesheets are now imported in index.js (well, everything is now imported in index.js now).
Achievements UI cleaned up, smaller, neater UI.
Black Market Uplink cleaned up
Generalized Uplinks, Malf Module Picker now uses this generic uplink UI, with custom theme still applied. Saved a few kilobytes.
Uplinks limit search results to 25, which helps reduce lag while typing into the search box.
Added padding props to Box, aka all this crap: p, px, py, pt, pr, pl, pb.
Reduced stats while building the bundle, now you can actually see the meaningful green text in console instead of all the child module spam.
Flattened Crafting Categories
New Kiosk UI
Modal Tweaks
You can track progress of other tgui ideas here: tgui: Roadmap
Information for downstreams
Your tgui modifications will not be easily mergeable because we have effectively shifted indentation of all interfaces by two, and added a new wrapping component called <Window />.
This will be a lot of manual work, but it's not that terrible though. If you can isolate your local contributions to tgui, you can just copy-paste them into the new tgui where needed, and it should just work.
If you're not yet using tgui 2.0 (or tgui-next) in your project - great news, this is the final big refactor, and everything will be quieter after this PR. Things are looking really solid now. This will serve as a great base for your future UI work.
Acknowledgements
Big thanks to @actioninja for converting half of the interfaces, that's a lot of work!
I added to portable pumps and scrubbers the same limit t1 canisters have in terms of heat and pressure (5000 K and 50000 Kpa). In hindsight i should've added this in the same PR as the canisters but i forgot about those and i see people use those instead of making t2 and t3 canisters.
Edit: i changed how the damage is calculated, it now uses a clamp() between 5 and 50 so that there will be no more instances where the damage is so low that is discarded and no damage is done
Why It's Good For The Game
Add the intended behaviour for all gas containers thinked in the Tiered Canisters PR to Portable Pumps and Scrubbers
Changelog
cl
add: Added heat and pressure limit to portable pumps and scrubbers
tweak: changed the damage calculation from a max() to a clamp() between 5 and 50
tweak: reduced max pressure output of t3 canisters to the same as t2
/cl
syndicate contractor
suit storage unit
dna console, spawners menu
Space Heater
solar control
scrollable dna console + spawners menu
smoke machine, smartvend
slime body swapper
sleeper
signaler
shuttle manipulator
scanner gate
satellite control
RPD
roulette
Robotics Control Console + Remote Robot Control
radioactive microlaser
radio
proximity sensor
Portable Atmos Devices
personal crafting + particle accelerator
pandemic
Ore Redemption Machine
Ore Box
operating computer
nuclear bomb
ntos supermatter monitor
ntos shipping
ntos robo control
ntos revelation
ntos chat + net dos
This PR will add 3 tiers (expandable) to the atmos canisters
Each tier will have a maximum temperature and pressure threshold that will cause the canister to burst if going over them.
How to build each tier
Tier 1: With 5 metal sheets you make a canister frame tier 0 (similar way of the old canister making) and then you put 5 more metal sheets onto the frame (similar to when building windows on grilles) to finish it and build a tier 1 canister
Tier 2: You first make the tier 0 canister frame, you put onto it 5 sheets of plasteel to make a tier 1 canister frame and you complete the tier 2 canister by using 5 sheets of titanium onto it
Tier 3: Make a tier 0 and then a tier 1 canister frame like shown above, then you put 1 bluespace crystal onto the canister frame to make it tier 2 and complete it with plastitanium for a tier 3 canister.
The maximum temperature and pressure that each canister can hold are:
Tier 1 5000 K and 50000 kPa
Tier 2 500000 K and 5e6 kPa
Tier 3 1e12 K and 1e14 kPa
All those are calculated based on a filled canister
The canisters won't instantly rupture when reached the temperature, instead they'll start to take damage (10, 5, 3 per tier for the time above the thresholds) untill rupture, so recovery is doable since the damage taken can be heard (is burn damage)
canister-tiers
Why It's Good For The Game
First there is more interaction between departments, then there is a stop to exploitable start round fusion and 50K bombs, since at least you have to wait for mining.
No more you can have the Sun heat inside of a normal canister.
Changelog
🆑
add: Added 3 tiers to the canisters
add: added canister frames (also tiered)
add: canisters rupture if there is too much pressure or heat inside (higher tiers have higher thresholds)
imageadd: added images for frames and overlays
/🆑
About The Pull Request
Nitryl formation is made more doable and hopefully we'll see it more used on the station; added N2O formation. Both have the same gases requirements (N2O uses bz as catalyst only) but they have different temperature of reaction (low temp for N2O, high temp for NO2)
N2O now can also hurt you if inhaled in high quantities (is still a toxic gas, let's not forget this)
Why It's Good For The Game
Made nitryl more common for uses and production, added a way to remake N2O. This is an atomized PR base for future works on those gases and more.
Changelog
🆑
add: N2O formation reaction (n2 + o2 + bz as catalyst + cold = n2o)
add: N2O toxic behaviour (if you inhale it you can die in your sleep)
changed: NO2 Formation reaction (n2 + o2 + bz + heat = no2)
/🆑