Commit Graph

2509 Commits

Author SHA1 Message Date
san7890
91f6edee5a Fixes Unreadable APC Balloon Alerts for Ethereals (#70451)
* Fixes Unreadable APC Balloon Alerts as Ethereals

Hey there,

So basically, when an ethereal on combat mode would try and discharge an APC, they would get this, which is completely unreadable:

So, let's add a small sleep at the end of `togglelock()` for ethereals, and then proceed to continue on with the proc chain of whatever an ethereal might want to do with an APC.

* swaps the balloon alerts to add timers

less elegant, but it does do the job nicely
2022-10-12 12:43:26 -04:00
vincentiusvin
db83f6498d Simplifies SM damage calculation, tweaks the numbers. (#70347)
About The Pull Request

We apply the damage hardcap individually now, split off the old flat 1.8 into individual caps for heat, moles, and power.

Set it to 1.5 for heat, 1 for mole and 1 for power. This means for most delams it'll be a tad slower! But its possible to make SM delam nearly twice as fast if you combine all 3. (3.5). Be pretty hard tho.

Set the heat healing to -1 so you can counteract one factor at most (except heat since you'll never get both heat healing and heat damage at the same time anyway).

I'm not hell bent on any of the numbers, just picked round even ones and ones that i think will make sense. If you want them changed lmk.

Got rid of the cascade mole and power multipliers since there's probably like three people that are aware that it even exists. Ideally we just add another entry to the CIMS but its already pretty crowded. Figured nobody is gonna miss it anyway? Sorry ghil.

Got rid of the moles multiplier thing since its nicer to keep the temp damage fully based on temp damage instead of adding another multiplier. I just applied the .25 to the damage flatly, meaning it slows down delams again!

And some space exposure stuff: #70347 (comment)
Why It's Good For The Game

Hardcap: Discrete, less randomly interconnected factors are easier to present and remember. The calculation procs are also made to be additive so we had to hack a bit and do some rescaling to accomodate the old behavior in my original PR #69240. Can remove the hack if this pr goes through.

Cascade and mole multiplier: The rest are just getting rid of underutilized factors so we have a cleaner behavior to maintain, present, and understand. (In a perfect world modifiers that aren't visible to the players shouldn't have been merged in the first place smh smh)
Changelog

🆑
fix: Fixed sm space exposure damage going through walls
del: got rid of the molar multiplier for sm heating damage. It will now only impact molar damage and temp limit. We apply the lowest value directly so this slows down sm delams a tiny bit.
del: got rid of cascades making sm delam at 450 moles and 1250 mev. It delams normally now.
balance: Applied the sm damage hardcap of 1.8 individually to heat (1.5), moles (1), power (1). Meaning most sm delams are slower now, but the really bad ones can be faster.
balance: Halved sm temp healing across the board. Temp limits are still the same though so you shouldn't notice it that much.
balance: Halved SM power damage across the board.
balance: Changed sm space exposure damage to just check for the current tile and adjacent atmos connected tiles.
/🆑
2022-10-09 14:12:59 -07:00
MMMiracles
3388d5bae0 Cameras and lights now take power from adjacent walls if placed in external areas without power (#69975)
* cameras and lights can now be powered by adjacent walls if placed in areas where power normally isn't available.
2022-10-08 16:56:38 -04:00
ShizCalev
1a32f60cf4 [ready] adds unit test for missing inhand icons. fixes a bunch of missing inhand icons (#70037)
fix: Fixed a bunch of missing inhand icons.
fix: Fixed cables in electrical toolboxes not randomizing their colors.
fix: Fixed the wrong colored icon showing when trying to make cable cuffs out of cables.
fix: The collectable SWAT helmet is now using the proper icon again!
refactor: Pipecleaners and power cables now share a unified color system, so they're once again available in ALL the same colors.
imageadd: Updated the screwdriver belt overlay to represent the newer sprite.
imageadd: Added a bunch of new inhand icons. Special thanks to Twaticus for doing the helmets! <3
fix: Wirecutters now have an icon when inside a belt again!
admin: Added a new omnitool subtype that allows you to spawn all items in a typepath!
fix: Explorer gaskmasks now properly reflect their adjusted state when held.
fix: Fixed balaclavas having the wrong icon when pulled up.
fix: Fixed the base energy sword (admin spawn only) being invisible.
fix: The rainbow energy sword is now a little bit more rainbowy!
fix: Fixed an tk exploit with orange handcuffed shoes.
fix: The traitor outfit in the select equipment panel is now actually functional!
2022-10-04 10:20:24 -07:00
vincentiusvin
99b8d6b494 Changed Supermatter Internal Math + UI Additions (#69240)
Basically all what I'm doing is categorize and display whatever modifiers are currently applying to the SM. This way players can see powerloss, temperature generation, damage taking, temp limit adjustment etc all in live instead of diving code or looking it up in the wiki.

I have taken the liberty of making most of these modifiers additive instead of multiplicative since it's easier to illustrate how much a given modifier is doing when they are all additive. E.G: The gas you added gave you an extra 2500 joules instead of the gas you added gave you a 1.2x multiplier.

To make this job not CBT there are a few gameplay changes that are needed to make things fall into the framework and some general cleanup. Most noteworthy might be:

    Space damage taking (opted for 

SM damage and balance #66692 instead of SM can explode on space tiles again #35275 just because it's newer. Wont mind changing if asked). Also removed the power gen see the edit in
Changed Supermatter Internal Math + UI Additions #69240 (comment). Wont mind bringing it back and tweaking if asked.
SM will now use the same heat limit for everything that once used variations of it. Unified healing temp limit (influenced by psychologist) with damage heat limit (influenced by gases and low moles, yeah that's a thing). In practice this means your rock will heal at higher temps instead of the old one.
Heat output production. See:

    Changed Supermatter Internal Math + UI Additions #69240 (comment) and heat penalty from gases.
    I'm really sorry for tacking this on to this PR, but there's no good way to present the heat output effect of gases to the SM in a way I'm satisfied with if I don't do this. Kinda hard to atomize too since it relies on the cleanup. Rolled back!

Work left:

    Oh and need to make the NTOS things work.
    Ntos Done! Since the active crystal is now deprecated and we use localstate, the notification system got changed a bit. SM will now ping you if you subscribed to it. Only works when minimized and not closed, like the old one.
    Oh and also documentation.
    Think its in an ok spot now.
    Reimplement transmission view and low pressure power bonus. Yeah thats a thing.
    Looks like the low pressure power bonus is actually broken. It evaluates to ~2 for pretty much any x given. So im axing it.
    Reimplement moles doubling heat resistance. Yep thats also a thing.
    Readd the pluox and miasma pressure scaling thing.
    Done, also multiplied the reaction rate by half but multiplied the mole manipulation by 2 for pluox gen. Did this so it's easier to understand.
    Dump shit into the changelog.

Why It's Good For The Game

Future coders will now need to write a bit more code when they want to add another modifier. Meaning it's a tad more rigid if someone wants to go out of the existing framework. Also demands a little bit of math but nothing more than basic algebra.

But on the flipside, this means future coders that want to add a brand new modifier to the SM will need to justify and document it (with only a single string descriptor so its not even that much work). Makes the work of people maintaining the code waaay easier at the expense of feature coders. Also makes whatever change they want to apply be relayed immediately to the players.

I mean jesus christ we didnt even know PN was really good for SM until it's added to the wiki.
Changelog

🆑
del: Removed the broken pressure power multiplier which always evaluates to 2. Multiplied base SM power production by 2.
del: SM will no longer gain power when exposed to space. It actually used to do that, but only when the tile it's on has gas so you don't really notice it.
qol: added the factor breakdowns to the SM ui.
qol: added the gas effect breakdowns to the SM ui.
qol: Made the supermatter selection in NT CIMS ui frontend based. Notifications will be based on you pressing the bell button instead of opening a SM page.
code: Instead of showing the environment breakdown of the SM tile, the NT CIMS will show you the exact gas mixture that it uses for calculation.
code: Total moles in NT CIMS will now be substituted with absorbed moles, which is the thing we use to calculate scrung delams. Scrungs at 1800.
balance: Unified the SM taking damage on space (last modified 2018) with SM taking damage around space (added 2020, last modified 2022). Chose the latter formula, it's significantly stronger.
balance: SM will start healing at the same damage at which it stops taking heat damage. Instead of the old fixed healing at ~313K.
balance: made the low mole heat resistance thing on SM not scale with heat resistant gases.
balance: Made the supermatter temperature power gain multiplier thing linear at 1/6 instead of 50/273 or 30/273.
balance: Psychologist heat reduction is weaker on high heat gas.
refactor: rerouted how external damage (bullets) and external power (emitter) is applied to SM.
refactor: restructured the internal power calculations for SM. Power should be applied on each atmos tick instead of separately.
refactor: restructured how the SM calculates the damage that it takes. No changes expected except for the low mole temp limit multiplier thing.
refactor: Restructured SM pluox generation and miasma consumption. No changes expected though.
\🆑
2022-10-02 16:28:55 -07:00
John Willard
91f02f2a6b canUseTopic now uses TRUE/FALSE instead of defines that just say TRUE (#69790)
* canUseTopic now uses TRUE/FALSE instead of defines that just say TRUE

The most idiotic thing I've seen is canUseTopic's defines, they literally just define TRUE, you can use it however you want, it doesn't matter, it just means TRUE. You can mix and match the args and it will set that arg to true, despite the name.

It's so idiotic I decided to remove it, so now I can reclaim a little bit of my sanity.
2022-10-01 09:47:52 -07:00
Jacquerel
72a207cc04 "It has been 0 days since the last incident" sign (#70099)
Adds a fun sign to various places in engineering which tracks how many days (read: rounds) it has been since last time the engine delaminated.
2022-09-28 22:51:59 +00:00
John Willard
be450e12c8 Unit tests powernets to make sure the whole station is connected. (#70090) 2022-09-27 22:33:56 -07:00
John Willard
243231eb48 Properly checks flags with & instead of == (#70130)
* Makes flags properly check themselves

Byond ref: https://www.byond.com/docs/ref/#/operator/&
Basically, flags should use & instead of ==
We can have more than 1 slot on any item, so it's preferred that we do this instead. Even if it doesn't immediately fix any problems, it's something that should be the standard anyways to prevent it from ever being a problem.

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2022-09-27 21:51:45 +00:00
LemonInTheDark
23bfdec8f4 Multiz Rework: Human Suffering Edition (Contains PLANE CUBE) (#69115)
About The Pull Request

I've reworked multiz. This was done because our current implementation of multiz flattens planes down into just the openspace plane. This breaks any effects we attach to plane masters (including lighting), but it also totally kills the SIDE_MAP map format, which we NEED for wallening (A major 3/4ths resprite of all wall and wall adjacent things, making them more then one tile high. Without sidemap we would be unable to display things both in from of and behind objects on map. Stupid.)

This required MASSIVE changes. Both to all uses of the plane var for reasons I'll discuss later, and to a ton of different systems that interact with rendering.

I'll do my best to keep this compact, but there's only so much I can do. Sorry brother.
Core idea

OK: first thing.
vis_contents as it works now squishes the planes of everything inside it down into the plane of the vis_loc.
This is bad. But how to do better?

It's trivially easy to make copies of our existing plane masters but offset, and relay them to the bottom of the plane above. Not a problem. The issue is how to get the actual atoms on the map to "land" on them properly.

We could use FLOAT_PLANE to offset planes based off how they're being seen, in theory this would allow us to create lens for how objects are viewed.
But that's not a stable thing to do, because properly "landing" a plane on a desired plane master would require taking into account every bit of how it's being seen, would inherently break this effect.

Ok so we need to manually edit planes based off "z layer" (IE: what layer of a z stack are you on).

That's the key conceit of this pr. Implementing the plane cube, and ensuring planes are always offset properly.
Everything else is just gravy.
About the Plane Cube

Each plane master (except ones that opt out) is copied down by some constant value equal to the max absolute change between the first and the last plane.
We do this based off the max z stack size detected by SSmapping. This is also where updates come from, and where all our updating logic will live.

As mentioned, plane masters can choose to opt out of being mirrored down. In this case, anything that interacts with them assuming that they'll be offset will instead just get back the valid plane value. This works for render targets too, since I had to work them into the system as well.

Plane masters can also be temporarily hidden from the client's screen. This is done as an attempt at optimization, and applies to anything used in niche cases, or planes only used if there's a z layer below you.
About Plane Master Groups

BYOND supports having different "maps" on screen at once (IE: groups of items/turfs/etc)
Plane masters cannot cover 2 maps at once, since their location is determined by their screen_loc.
So we need to maintain a mirror of each plane for every map we have open.

This was quite messy, so I've refactored it (and maps too) to be a bit more modular.

Rather then storing a list of plane masters, we store a list of plane master group datums.
Each datum is in charge of the plane masters for its particular map, both creating them, and managing them.

Like I mentioned, I also refactored map views. Adding a new mapview is now as simple as newing a /atom/movable/screen/map_view, calling generate_view with the appropriate map id, setting things you want to display in its vis_contents, and then calling display_to on it, passing in the mob to show ourselves to.

Much better then the hardcoded pattern we used to use. So much duplicated code man.

Oh and plane master controllers, that system we have that allows for applying filters to sets of plane masters? I've made it use lookups on plane master groups now, rather then hanging references to all impacted planes. This makes logic easier, and prevents the need to manage references and update the controllers.

image

In addition, I've added a debug ui for plane masters.
It allows you to view all of your own plane masters and short descriptions of what they do, alongside tools for editing them and their relays.

It ALSO supports editing someone elses plane masters, AND it supports (in a very fragile and incomplete manner) viewing literally through someone else's eyes, including their plane masters. This is very useful, because it means you can debug "hey my X is yorked" issues yourself, on live.

In order to accomplish this I have needed to add setters for an ungodly amount of visual impacting vars. Sight flags, eye, see_invis, see_in_dark, etc.

It also comes with an info dump about the ui, and plane masters/relays in general.

Sort of on that note. I've documented everything I know that's niche/useful about our visual effects and rendering system. My hope is this will serve to bring people up to speed on what can be done more quickly, alongside making my sin here less horrible.
See https://github.com/LemonInTheDark/tgstation/blob/multiz-hell/.github/guides/VISUALS.md.
"Landing" planes

Ok so I've explained the backend, but how do we actually land planes properly?
Most of the time this is really simple. When a plane var is set, we need to provide some spokesperson for the appearance's z level. We can use this to derive their z layer, and thus what offset to use.

This is just a lot of gruntwork, but it's occasionally more complex.
Sometimes we need to cache a list of z layer -> effect, and then use that.
Also a LOT of updating on z move. So much z move shit.

Oh. and in order to make byond darkness work properly, I needed to add SEE_BLACKNESS to all sight flags.
This draws darkness to plane 0, which means I'm able to relay it around and draw it on different z layers as is possible. fun darkness ripple effects incoming someday

I also need to update mob overlays on move.
I do this by realiizing their appearances, mutating their plane, and then readding the overlay in the correct order.

The cost of this is currently 3N. I'm convinced this could be improved, but I've not got to it yet.
It can also occasionally cause overlays to corrupt. This is fixed by laying a protective ward of overlays.Copy in the sand, but that spell makes the compiler confused, so I'll have to bully lummy about fixing it at some point.
Behavior changes

We've had to give up on the already broken gateway "see through" effect. Won't work without managing gateway plane masters or something stupid. Not worth it.
So instead we display the other side as a ui element. It's worse, but not that bad.

Because vis_contents no longer flattens planes (most of the time), some uses of it now have interesting behavior.
The main thing that comes to mind is alert popups that display mobs. They can impact the lighting plane.
I don't really care, but it should be fixable, I think, given elbow grease.

Ah and I've cleaned up layers and plane defines to make them a bit easier to read/reason about, at least I think.
Why It's Good For The Game
<visual candy>

Fixes #65800
Fixes #68461
Changelog

cl
refactor: Refactored... well a lot really. Map views, anything to do with planes, multiz, a shit ton of rendering stuff. Basically if you see anything off visually report it
admin: VV a mob, and hit View/Edit Planes in the dropdown to steal their view, and modify it as you like. You can do the same to yourself using the Edit/Debug Planes verb
/cl
2022-09-27 20:11:04 +13:00
MrMelbert
b774f63b70 Replaces obj flag being_shocked and flag_1 shocked_1 with TRAIT_BEING_SHOCKED (#69978)
* Replaces `being_shocked` and `shocked_1` with `TRAIT_BEING_SHOCKED`, removing a flag_1, taking us away from the possibility of hitting the flag limit.
2022-09-22 23:52:37 -04:00
MrMelbert
6baebf47a1 Completely refactors hallucinations, and also adds a few (#69706)
* Refactors hallucinations slightly, organizes them

* Refactors hallucination into a status effect

* Further hallucination proper refactoring

* Refactors battle hallucinations

* Refactors "fake item other" hallucination

* Gets it a bit closer to working state

* Refactors screwydoll and fake alerts

* Refactors fake inhand items

* Refactors a few more.
- Fake death
- Fake messages
- Fake sounds
- Projectiles

* Refactoring delusions, hallucination effects

* Furthering the hallucination status effect
- removes copypaste of hallucination pulses

* Almost finalizes the changeover to status effect

* Last staus effect stuff

* Delusion business

* Airlocks, fire, and more delusion stuff

* Finishes screwyhud. It compiles now!

* Swaps screwyhud over to a grouped status effect

* Removes hal_screwyhud

* Comment

* Bugfixing

* image cleaning

* Get rid of this it came back

* What if I finished this branch?

* Oops

* Messing with the randomness

* Mass hallucination tweaks

* +

* Some more mass tweaks

* Review

* Updates

* Unit tests hallucination icons

* More tweaks

* Move folder

* Another re-name

* Minor tweaks

* Anomaly unity

* Mass hallucination buffs

* t

* Sig

* Merge

* Lints

* Unit test already coming in clutch

* Another failure

* Use named args for cause_hallucination via some define trickery

* Some cleanup

* This is better

* adds some hallucinations

* Oops

* More sounds

* Tweaks

* Some additional documentation

* Flash

* Fixes mass hallucination

* Json changes

* Updates documentation

* Json conflicts

* Makes it work

* Missed that one too

* Helpers

* More signalization (WIP)

* Fixes bump

* Missed a helper use

* Dumb
2022-09-21 01:30:04 -04:00
Rhials
13ca10b0bf Rigged to Blow: Lightbulb Rigging/Reagent Handling Overhaul (#69833)
About The Pull Request

First and foremost, guts out the previous, arguably cursed "rigged" functionality from light tubes. Light tubes now have a capacity of 20 reagents. Light tubes will now splash their contents upon shattering, instead of just releasing plasma gas into the air (if rigged). Lightbulbs with reagents inside of them will now transfer with them to the light fixture they're inserted into, which will slowly heat the contents to a maximum of 1000 degrees.

Heating the plasma reagent manually leads to it harmlessly boiling out of the container and dissipating, effectively ruining the original functionality. To account for plasma boiling over (when it should be bursting into flames) a SEALED_CONTAINER reagent container flag has been added. This is mostly just to prevent the plasma from leaving the container until it is ignition-ready. As a result, light tubes rigged the old way no longer harmlessly explode, and instead produce a small, (mostly) self-contained fire in the area surrounding the light.

Light tubes (and light fixtures with reagents in their lightbulb) now show their reagent contents upon examine. It's only fair to reward attentive people with a chance to avoid impending disaster, but on the other hand lightbulbs are transparent and you should just be able to look through them anyways.

As a bonus, all of this SHOULD be handled in a way that doesn't put any unnecessary strain on machine processing or anything. Rejoice.
Why It's Good For The Game

Lightbulbs being reagent holders was a huge missed opportunity, with their only use being for the disappointingly ineffective plasma-rigging functionality. This expands on the idea, and reworks the original functionality to be much more interactive. Bigger sandbox! Deeper sandbox!
Changelog

cl
add: Rigging light fixtures now works with more reagents than just plasma. Light fixtures will heat the reagents of their inserted lightbulb, up to a maximum of 1000 degrees. Lightbulb tubes now hold 20 reagents to make this more usable.
add: Lightbulbs will now splash their contents on whatever they're shattered by. Their contents are also now visible upon examination.
2022-09-20 13:02:47 +12:00
Seth Scherer
35300811ac Fixes a crystal mass harddel (#69803)
* Fixes crystal mass from hard delling
It didn't stop processing on destroy. Adds that so it um... does
2022-09-14 08:08:32 -07:00
ShizCalev
bb637588b7 Silences gravgen admin alerts / logging when the round is not in progress (#69802)
Just silencing minor nuisance messages.

admin: Silenced grav generator admin warnings / logging messages when the round is not currently in progress.
2022-09-10 17:43:27 -07:00
vincentiusvin
c825c10174 [NO GBP] Fix an edgecase runtime when SM delams into cascade in under 2 minutes. (#69757)
Feeex
2022-09-08 08:11:26 -04:00
LemonInTheDark
930c5e635e Moves "catch this var/flag" code from obj/init and datum/new into the types that use it (#69634)
* Optimizes away /obj/Initialize

We were spending like 0.15 seconds just checking for blueprints, obj
flags and network ids
All these things can just be applied where they're wanted, saves time

Oh and I replaced object flags with an emag injector. I'll give it a
sprite and name later I promise

* Requires a GenerateTag() call to set DF_USE_TAG, rather then doing a check in atom New

This is technically harder to use, but I don't really want people using
tags, and it saves 0.15 seconds

* Moves generatetag to /datum

* I am dumb

* Saves 0.5 seconds, makes init emissive blockers actually work

Ok so background. If an overlay is added with add_overlay, and not
"managed" somehow, it will effectively never be removed, because
nothing's tracking it.

Update_overlays uses the managed_overlays list/var (one of those) to do
this.
I'm gonna piggyback off this to make emissive overlays actually like,
respect overlay updates.

Oh and uh, I've saved maybe 0.5 seconds by caching the new emissive, and
not using add_overlay. There's a chance this will lead to overlay
corruption, but since we never readd the flattened, I think we'll be
safe

* Fixes plane not being set right, changes color logic too, since alpha will override past color sets

* Makes it actually work. also makes rand posters update appearance to clear away the overlay, since it shows on right click and looks bad

* Fixes blockers showing as emissives. It turns out alpha sets override the color list we use. Not sure why we pretend to support them

* Makes the injector support traits, adds an amazing sprite
2022-09-06 03:17:17 -07:00
John Willard
9555c7330b Supermatter cascade subsystems fire when it needs to (#69686)
Supermatter cascade by default is offline, and will fire when a supermatter cascade occurs.
2022-09-06 12:34:10 +12:00
ShizCalev
d6ec1c53d2 restores an old SM delam bug making you not get the mood debuff if you're inside a locker when it explodes (#69690)
* restores an old SM bug making you not get the mood debuff if you're inside a locker when it explodes

* lets hit those too.
2022-09-04 16:02:18 -04:00
ShizCalev
892c306204 Fixes cell explode null usr runtime (#69612) 2022-09-04 15:55:19 -04:00
skylord-a52
be0e6efdf6 [IDB IGNORE] [MDB IGNORE] Makes the icons/mob folder sane (#69302)
About The Pull Request

Reorganizes the entire icons/mob folder.

Added the following new subfolders:

    nonhuman-player (this was initially just called "antag", but then I realized guardians aren't technically antags)
    simplemob
    silicon
    effects (for bloodstains, fire, etc)
    simplemob/held-pets (for exactly that -- I wasn't sure if this should go in inhands instead)
    species/monkey

Moves the following stuff:

    All human parts moved into species, with moth, lizard, monkey, etc parts moved to corresponding subfolders. Previously, there were some moth parts in mob/species/moth, and others just loose in mob. Other species were similar.
    icemoon, lavaland, and jungle folders made into subfolders of simplemob
    All AI and silicon stuff, as well as Beepsky et al. into the silicon folder, simplemobs into the simplemob folder, aliens into the nonhuman-player folder, etc.
    Split up animal_parts.dmi into two bodyparts.dmi which were put in their respective folders (species/alien and species/monkey)

Code changes:

    Filepath changes to account for all of this
    Adds a check when performing surgery on monkeys and xenos, because we can no longer assume their limbs are in the same file
    Turns some hardcoded statues and showcases that were built into maps into objects instead

Things I'd like to do in the future but cant be assed right now:

    Remove primarily-antag sprites from simplemob/mob.dmi (Revenant, Morph, etc.) and put them in the nonhuman-player folder
    Split up mutant_bodyparts.dmi into different files for Tizirans, Felinids, monkeys, etc and put them in their own folders. Those may have once been meant primarily for mutated humans but that's now how they're being used right now.
2022-09-03 11:52:54 -07:00
vincentiusvin
e75283dee3 Refactors SM gas behavior to be datum based instead of list based + powerloss co2 buff (#69158)
About The Pull Request

Title!
The CO2 thing is there because it makes my job much easier. Can probably find a way to make it move slowly if a maint insist on it. Prefer not to though.

Drafting because I want to make a second PR that have more sweeping changes (clean vars up, make a simpler formula for damage and heat production, delete underused behaviors, etc). Would honestly prefer if both this and that gets merged at the same time but I'm separating it out since it might be rejected. Or maybe ill combine it here we'll see.
Ignore that, looks like i can keep this one absolutely atomic.
Why It's Good For The Game

Had a lot of trouble when trying to document the SM gas interactions into the wiki, the interactions are all scattered and tracking down everything a gas does is extremely annoying. Hopefully this fixes that.
Changelog

cl
balance: CO2 powerloss inhibition now works immediately based on gas composition instead of slowly ramping up.
refactor: refactored how the SM fetches it's gas info and data. No changes expected except for the co2 thing.
/cl
2022-09-02 10:13:21 +12:00
ShizCalev
578d9baeac Fixes APC rigged cell null runtimes (#69597)
* Fixes APC rigged cell runtimes

* adjust
2022-09-02 10:04:39 +12:00
distributivgesetz
714aa3b150 [MDB IGNORE] APC controller and Power Monitor/AmpCheck fixes, aka How do I write PR titles (#69146)
About The Pull Request

bgug fix stuff
APC controller UI has its elements section'ed off. The backend has been redone to make the behaviour of the APC controller a bit less janky. The console should be more stable, and all the soul has been removed from the code and the UI.

before this PR stales out from nobody wanting to review my pr, I should probably outline what exactly changed:

    APC controller consoles have had their APC code almost entirely reworked. They no longer have to hold a reference to the person using the controller currently, and APCs themselves no longer hold a reference to the controller, instead to the person directly. A lot of code was moved to APC themselves to make it a lot more stable.
    APC controller used to call toggle_breaker without passing args, causing a runtime. Fixed in 

    Fixes the power flow control console not actually being able to toggle breakers #69343
    APC controller UI has had the Window.Content tags moved up to the top component, and a lot has been sectioned off to make the UI more sane.
    AmpCheck used to look for a wire on it's turf, or as a fallback look for the Area APC. A check to see if the APC has a terminal did so on a weakref, causing a runtime and preventing the program from ever finding a valid APC in it's area, making it show nothing. This has been fixed. On the other hand, the power monitor console did not store the ground wire or APC terminal as a weakref, this has been updated. As a fallback, if there are still no APCs in the powernet, the UI will show a dimmer popup.
    There was a "secret" power monitor variation in code so PDAs could not access monitors in hidden places. With the removal of PDAs, this control console is useless.

Why It's Good For The Game

Tiny bit of (much needed) polish on some useful tools in the engineering department.
Changelog

cl
fix: Fixed runtime when using AmpCheck without connecting the console with a wire.
fix: Fixed a few runtimes that could occur when using APC controller consoles.
qol: Sucked soul out of APC controller code and UI.
del: Removed "secret" power monitor console.
/cl
2022-09-02 09:45:45 +12:00
Jacquerel
9d772c4f13 Dimensional Anomaly (#69512)
About The Pull Request

Everyone has been asking: "When will there be an anomaly like the bioscrambler, but for the space station? Please, we need more things which replace objects with different objects from the same typepath."
Well I made it and it looked like ass because non-tiling floor and walls look terrible, so then I made this instead.
Dimensional.mp4

The "dimensional anomaly" shifts matter into a parallel dimension where objects are made out of something else.
Like the Bioscrambler anomaly, it does not expire on its own and only leaves when someone signals it or uses an anomaly remover.
When it spawns it picks a "theme" and converts terrain around it until it covers a 7x7 square, then it teleports somewhere else and picks a new theme.

A lot of these themes are relatively benign like "meat", "fancy carpet", or "gold". Some of them are kind of annoying like "icebox" because it creates floor which slows you down, or "clown" because bananium is intentionally annoying. Some of them are actively dangerous, mostly "uranium" and "plasma".
The main problem this will usually cause for crewmembers is decreasing area security. When it replaces doors it replaces them with ones which don't have any access control, and it will also replace RWalls with normal and much more vulnerable walls which will make breaking and entering significantly easier until someone has taken the time to fix the damage. But also sometimes it will irradiate them, you never know.

The fact that sometimes the changes are benign (or provide uncommon materials) and might be happening in places you don't care about access to might encourage people to push their luck and leave it alone until it starts turning the captain's office into a bamboo room or repainting medbay a fetching shade of flammable purple, which I would consider a success.
Armour.mp4

If you successfully harvest the anomaly core you can place it into the reactive armour to get Reactive Barricade Armour, which shifts your dimension when you take damage and attempts to place some randomised (not terribly durable) objects between you and hopefully your attacker (it really just picks up to four random unoccupied tiles next to you). If you're EMPed then the changes it make to the environment will often be as unpleasant for you as they are for a pursuer, and significantly more likely to harm both of you rather than just provide obstacles.

Other changes:
I split anomalies out into their own dmi file, seems to be all the rage lately.
I moved the anomaly placing code into a datum instead of the event because I wanted to reuse it but if you have a better idea about where I could have put it let me know.
This also fixes a bug where the material spreader component wasn't working when I applied plasma materials to something, the extra whitespace was parsing as another argument for some reason and meant it would runtime.
Supermatter delamination was still pointing to Delimber anomalies instead of Bioscrambler.
2022-09-01 12:07:11 -07:00
Rhials
f57d294a96 Fixes a small typo in the APC construction balloon alerts (#69591)
CRITICAL FIX
2022-09-01 13:59:24 -05:00
ShizCalev
4cbdc3a2db Adds more multiz support (#69420)
* Adds more multiz support by making use of ``is_valid_z_level`` instead of simply checking if z is the same.
2022-09-01 00:07:14 -04:00
tattle
fd9f50c552 [IDB IGNORE] Renames the inhand/misc folder to inhand/items (#69573)
Also adds balloons to inhand/items
2022-09-01 03:29:10 +02:00
ORCACommander
e64c5cc8df [MDB IGNORE] Fix High Capacity APC Inheritance (#69526)
Doing some mapping work downstream and I noticed there were both directional and non directional high caps. Code dived to figure out which was the valid one to use and found the directional high caps were not actually inheriting the upgraded power cells do to bad name structure. Corrected inheritance structure. Updated Kilo and Icebox to use directional high caps as standard and updated several ruin and gateway missions to standard directional high caps
2022-08-31 10:19:52 -06:00
LemonInTheDark
482daf9be5 Unit tests range suck (#69352)
* Unit tests range suck

Ok so we currently rely on some undefined behavior in energy_ball code
Namely, the range() family will return turfs in least/greatest get_dist

This is VERY useful for optimizing the tesla, but it's also undefined,
and lummy could change it any day now.

So let's at least unit test it so if it breaks we can remove it
2022-08-28 18:12:02 -07:00
John Willard
f0b71cb84a Fixes double define of multilayer cable examine (#69460)
* One of the examines for multilayer cables were meant to be on the ``multiz`` subtype, since it's only for multiz stuff.
2022-08-26 08:21:29 -07:00
ShizCalev
0d832d9327 Makes APCs set lights to low power mode when < 30% (when equipment power turns off) (#69374)
* Makes lights turn to lower power mode when an APC's charge goes below 30%

* had a last minute change and forgot to simplify this

* Cleanup

* async
2022-08-25 18:49:56 -07:00
ShizCalev
da323ad2c5 Misc cell fixes (#69373)
* Fixes APCs runtiming from their cell being destroyed.
2022-08-25 06:24:07 -04:00
tattle
d91390a447 [IDB IGNORE] The Great Sweep: Moving dmis into subfolders (part 1) (#69416)
Moves singulo and supermatter dmis into obj/engine, renamed from obj/tesla_engine
Moves Halloween, Christmas, and misc holiday items to obj/holiday
Moves lollipops to obj/food
Moves crates, closets, and storage to obj/storage
Moves assemblies to obj/assemblies
Renames decals.dmi to signs.dmi ...because they're signs and not decals
Moves statues, cutouts, instruments, art supplies, and crayons to obj/art
Moves balloons, plushes, toys, cards, dice, the hourglass, and TCG to obj/toys
Moves guns, swords, shields to obj/weapons
2022-08-24 20:49:35 -03:00
Pickle-Coding
f9bd1351be Reduces CO2 heat penalty to 2, from 6, and halves the zap power boost. (#69145)
Reduces CO2 heat penalty to 2, from 6, and removes the power transmission bonus. A heat penalty of 2 seems low, but the heat produced is also scales power, which CO2 increases, and is still 4 times higher than old CO2 (0.1, but gets clamped to the minimum value of 0.5).

Most engineers have a skill issue with CO2 before they can let its powerloss inhibitors to have a significant effect. Unless someone tries to intentionally sabotage with CO2, the skill issues will just make CO2 look like another high heat penalty gas, which is boring as it masks its gimmick of reducing powerloss. The high heat penalty made it produce more gas, which lowered CO2 composition, so it hard a harder time staying in the high power levels, and the high power levels were a unique danger for CO2 engines due to its more destructive zaps and anomalies.

I think the effect of having a skill issue when it reaches the dangerous power levels is a lot more interesting than having a skill issue at normal power levels, as high power delams are significantly more dangerous than low power delams.

Removing its power transmission (multiplier for power gained when teslas absorb the zaps, not the supermatter's power) will mean that CO2 will provide no benefit unless it is put at the composition to raise its power levels, which should bring CO2 usage back to its more interesting purpose of powerloss inhibition.
2022-08-22 20:54:31 -07:00
Seth Scherer
f1a363c825 Converts a shitload of istypes to their more concise macros (#69260)
* Converts a lot of istypes() to use their istype macro helpers.
2022-08-18 22:08:44 -04:00
John Willard
952c3ee0d3 Removes ComponentInitialize() (#69118)
* Removes ComponentInitialize()

Completely removes ComponentInitialize() as a proc, which was called on every single atom in the game, twice in some instances (like new players), over something that can already be done with Initialize().
This is the second attempt at doing this, after the first attempt fell apart for some reason. This time it was way easier though, since storages are no longer a Component.

* update icon blocker added before calling parent

* Update code/game/machinery/porta_turret/portable_turret.dm

Co-authored-by: san7890 <the@san7890.com>

* adds a mapload while I'm here

* moves human mood

* Does some UNRELATED thing to the PR

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
2022-08-11 19:01:32 -04:00
Seth Scherer
34b4034777 Replaces the mood component with a mood datum (#68592)
About The Pull Request

Mood was abusing signals and get component pretty badly, so I redid it as a datum to stop this.
Why It's Good For The CODEBASE

Better code pratices, also gives admins easier tools to manage mood
Changelog

cl
admin: Added two new procs into the VV dropdown menu to add and remove mood events from living mobs.
/cl
2022-08-12 08:59:20 +12:00
vincentiusvin
8a945810ba Simplifies the SM transmission calculation a bit. (#68972)
Reframes the existing interactions into the transmission modifier framework. The code there is more robust than snowflaked separate checks like this.

BZ: #45676 Looks like it was intended to be a quite good gas for power buffing, but it has lost its intended purpose over the years. Current status quo is that it strengthens the modifier, either positive or negative. I've decided to use a pure BZ sm as a baseline, so its fully negative now.

Water: #49624 Intended to nerf the SM power, but it ended up as a transmission dampener (opposite of BZ) because of changes to the SM over the years. So it makes the weak a bit less weak and the strong a bit less strong. A pure water vapor has zero effect on power (since transmit modifier is zero) so i cant use it as a baseline. So i followed the author's original intention of it being a bad for power gas.

Freon: Nukes power when above 30%. Changed it to 33% because the transmit numbers are a bit nicer. It checks out try it in your head. (1 + (1/3 * -30 / 10) = 0. Difference is its affected by other gases now

CO2: Same with freon, barely any changes. Apparently doubles power when at 100% comp. Affected by other gases now.

Easier to maintain and explain, and we don't really lose out on much. I attempted to preserve the behavior as best as i can.

To be perfectly fair I have no quarrels with the number at all, don't really care which one is stronger than which. Just want to keep the old behavior. If you want any of them changed LMK.
2022-08-10 22:40:49 -07:00
vincentiusvin
9f2e106ee3 [NO GBP] Fixed an edge case when SM delam messages failed to update. (#68968)
About The Pull Request

Forgot to update the last delam var.
2022-08-10 18:35:29 -07:00
Mooshimi
a3121f15c4 [GBP No Update] Perish, individual logging runtime (#69024)
missed 2 or 3(lol it was more when I look back at the files), LOG_GAME tags on the log_message line, and did some cleaning up since i was looking through every log_message again

Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>

Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
2022-08-10 07:56:40 -07:00
XyzzyThePretender
5fe014e4d1 Fix grammar for solar panel construction (#69010)
About The Pull Request

Fixes #69001

"into place" only shows up when securing a solar panel using ? : conditional.
Why It's Good For The Game

Grammar fix.

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
2022-08-09 23:15:14 -07:00
Charlotte
b764557780 Emitter status shows minimum and maximum firing delay (#68921)
About The Pull Request

Emitter status display on examine will now display the minimum and maximum firing delay depending in place of an inaccurate static speed.

Why It's Good For The Game

Fixes #68820

As the emitter shoots at a random speed (inexplicably, it seems to create more issues than it solves), saying it'll fire "one beam every x seconds" is inaccurate as it's subject to change.
2022-08-09 23:06:37 -07:00
XyzzyThePretender
b41974a0ad silicons can interact with floodlights (#68858)
About The Pull Request

Uses attack_robot and attack_ai to let attack_hand receive silicons as mob/user.
Replaces some magic numbers using the given defines.
Adds some documentation for specified vars.

Fixes #66758
Why It's Good For The Game

Addresses an inconsistency for silicon interaction.
Standardization good.

Emergent Issues

Floodlights, fire alarms, the mining shuttle beacon, barsigns, and the advanced camera console redirect ai/borg attacks into an attack_hand proc using identical code.

Floodlight code does not use ISBROKEN or relevant interaction flags.

Floodlights are unbolted when broken.
Changelog

cl
fix: Silicons can now interact with floodlights.
/cl
2022-08-05 12:43:09 +12:00
Mooshimi
b09f3868f8 individual LOG_GAME (#68683)
About The Pull Request

    replaces a ton of log_game with user.log_message so the log is added to individual and global logs.
    adds a few logs for individual LOG_VICTIM, LOG_ATTACK etc logging.
    adds logging for bluespace launchpad's tele coords being changed.
    took the word "has" out of log_combat, as it's extra and just lengthens the log.

Why It's Good For The Admins

It's extremely laggy to open game.txt so an alternative is individual game logs
Changelog

cl
admin: A lot of game logs will now also be in individual game logs, for convenience in log diving.
admin: Added logging for bluespace launchpad x and y offset changes, which go to individual game logs.
admin: Attack logs will now be slightly shorter, one useless word was removed.
/cl
2022-08-05 09:32:02 +12:00
vincentiusvin
b8551336aa Refactors SM Delaminations to be strategies (#68599)
I'm a badmin, how do I force a specific delam?

To set the sm to delam in a specific way, do set_delam(2, delam_path) delam_path is stuffs like /datum/sm_delam_strat/cascade
To make the sm delam, call force_delam()
About The Pull Request

If you're boring enough to click on a refactor pr you probably already know what a strat is, otherwise https://refactoring.guru/design-patterns/strategy.
Behavior Rundown
Note that the actual delamination event is evaluated at the end of countdown. It's possible for say a tesla delam to explode normally if at the end of the countdown it loses enough power. See: and commit
Why It's Good For The Game

a7ce9e2
Changelog

cl
refactor: All four SM delams got recoded, no significant gameplay changes expected.
qol: SM healing is broadcasted on crew radio too now instead of just engi
qol: SM going singulo or tesla will be announced on common comms when the damage is getting severe enough.
code: Only engines considered to be a main engine can spawn stationwide anomalies and trigger cascades.
fix: Fixed the sm not having a boxy overlay on normal delams when counting down. This is what the radio message was referring to as "causality field".
/cl
2022-08-03 12:57:55 +12:00
Timberpoes
786ac5c855 [MDB Ignore][Bounty][Complete Refactor] Papercode Redux: Too Many Damn Files <Map Conflict Edition> (#68612)
Papercode refactor
2022-08-02 19:27:42 +02:00
distributivgesetz
f9a2dd01dd Fix APC constantly clicking during a grid check (#68835)
* apc update change

* apcs should probably force update
2022-07-30 04:31:07 -04:00
Mickyan
df855c9238 Tweaks brightness for red, blacklight presets. Adds dim red light preset (#68576)
Tweaked blacklight,red - Added dim red
2022-07-22 13:24:28 -04:00
Profakos
eebd0ef865 Some nightshift fixes (#68566)
Fixes APC night shift manual cycling balloon alert; update_nightshift uses the correct variable
2022-07-22 13:21:23 -04:00