* Refactored 'IsAdvancedToolUser' into a macro plus relative trait. Tweaked 'can_hold_items'. (#54665)
The PR aims to allow advanced tool users to be defined by traits rather than a hardcoded proc.
Also necessary for the CanUseTopic refactor I'm working on, which will be PRed separately for atomization purposes.
This PR also fixes an inconsistency with can_hold_items (since monkeys can actually hold items).
* Refactored 'IsAdvancedToolUser' into a macro plus relative trait. Tweaked 'can_hold_items'.
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
* Fixes a few bugs with greyscale stacks. (#54858)
Fixes greyscale floor tiles merging regardless of their materials.
Fixes greyscale floor tiles voiding materials when splitting the stack.
Fixes greyscale floor tile stacks being created with no mats_per_unit and only enough custom materials for a single unit.
Fixes greyscale tile flooring being created with the wrong amount of materials.
Fixes greyscale tile flooring not producing floor tiles/producing floor tiles with 0 units.
* Fixes a few bugs with greyscale stacks.
Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
* Cell chargers now respect the law of conservation of energy. (#54886)
## About The Pull Request
Hopefully I can make this PR as knowledge filled as possible, so sit down and buckle up, because we're about to talk about POWER USE.
So, machines use power. The station uses power. Without power, key, critical aspects of the game don't function, and keeping the station's lifeblood pumped with electricity is the primary goal of the engineering department. Cool. So there's currently 2 methods of "power use" that machines can use, that is, through the passive use of power (Assigned by the `idle_power_usage` and `active_power_usage` variables), or through the `use_power()` proc. What's interesting, is that neither proc actually draws directly from the cell of the APC, which is sort of assumed by a proc called `use_power()`, after all. Where the passive power draw aspect of an APC is done automatically as machines are processed, and then applied to the APC seperately, taking power per cycle, use_power just applies a temporary blip of power usage to one of the APC's power tracks (Equipment, Lighting, or Enviroment). One would assume then that this temporary power drain would apply for long enough that it would apply the intended cost to the cell, and then turn off.
But I'm making this PR, right?
So the most egregious issue this brings is in terms of the cell recharger. If you place a power cell into a cell recharger, the recharger calls use_power every processing tick in order to reduce the APC cell by an equivalent amount to what the cell is intending to gain in charge. After all, you're just moving the charge from the APC to the power cell, plus the processing charge required by the cell_charger. However, lets look a bit closer at how use_power actually works. For this example we'll use a default, unupgraded cell recharger attempting to put it's default 250 watts into an empty bluespace cell.
Because power is heavily linked to the area that the machinery is placed in, we snag the area, determine the power channel, and call a use power proc on the area. The area use power proc simply adds that 250 watts, or rather joules into the equipment power channel of the APC, a part of power usage. All of this is parroted over to the APC's processing side, where the actual cost to the power cell is calcualted as follows:
`var/cellused = min(cell.charge, GLOB.CELLRATE * lastused_total) // clamp deduction to a max, amount left in cell
cell.use(cellused)`
So that number, the 250 joules of power we're calling to the cell, is actually being multiplied by a global cellrate, which is applied to every power drain on the station, actually charging the APC cell a total of 0.5 kj.
Based on some rumentary math and some experimentation, I filled a full bluespace power cell with 40Mj of power using 351 Kj of power from a standard, stock APC cell with no other drain except the 5 joules of power draw from the cell recharger.
So: What does this mean?
- Power draw is completely fucking busted (We knew this).
- Using two power cells, an APC, and an inducer, you can create infinite energy, anywhere, at zero cost to the station.
- We really need to make cell recharging a direct power draw.
Thankfully, that last one actually fits the portfolio of being a fix!
This adds a new proc to machines called `directly_use_power`. It does what it says on the tin, directly charges the APC for instances where power is going 1-1 from a power cell to another cell, in order to prevent infinite energy exploits.
## Why It's Good For The Game
Power is all kinds of unbalanced. Attempting to enforce the concept that a single unit of power is equal to itself is probably a good step in the right direction and in all likelyhood appears to have been the original intent with cell chargers in the first place.
I'm self-aware enough to see that this has ramifications beyond just fixing an issue within the cell charger alone, so if maintainers want to close this until december that's perfectly fine, but this is one of those things that could really easily snap basic station balance in twain.
* Cell chargers now respect the law of conservation of energy.
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
* Converting the EMP protection component into an element. (#54617)
* Converting the EMP protection component into an element.
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
* Increases the broken light spark cooldown 6 folds (#54579)
Whenever you stop to do something, and there's a broken light around, you would notice it spark, and if you stay, it sparks over and over again, becoming less of a nice rare occurance to something more annoying. This was very apparent during a shift yesterday on Manuel, where the entire station had lights broken, but they kept sparking over and over again and it never quite felt like we're in darkness.
* Increases the broken light spark cooldown 6 folds
Co-authored-by: Azarak <azarak10@gmail.com>
* Crystal invasion more rare (#54504)
This PR makes crystal invasion much rarer and confine it between 4500 and 5000 MeV
* Crystal invasion more rare
Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com>
* Standardizes attack chain signal returns and fixes a tk bug (#54475)
The attack chain is a bit of a mess, and the introduction of signals hasn't helped in simplifying it.
In order to take a step into untangling this, I re-ordered the attack signals to no longer be by source type and instead to be grouped more modularly, as they are all members of the attack chain and function similarly. They all share the trait of potentially ending the attack chain via a return, but had several different names for it. I joined it into one.
Additionally, fixed a tk bug reported by @ Timberpoes by adding a signal return check at the base of /mob/proc/RangedAttack
Lastly, removed the async call of /datum/mutation/human/telekinesis/proc/on_ranged_attack, which was added as a lazy patch to appease the linter complaining about a sleep on a signal handler (namely in /obj/singularity/attack_tk). Fixed the problem using timers.
Also cleaned some code here and there.
* Standardizes attack chain signal returns and fixes a tk bug
Co-authored-by: Rohesie <rohesie@gmail.com>
* Moves screen objects from mob to hud (#54400)
This moves screen images from icons/mob to icons/hud
Makes more sense and it is easier to find
* Moves screen objects from mob to hud
* Update radial.dm
Co-authored-by: nicbn <nicolas.nattis@gmail.com>
Co-authored-by: Azarak <azarak10@gmail.com>
* Converts A && A.B into A?.B (#54342)
Implements the ?. operator, replacing code like A && A.B with A?.B
BYOND Ref:
When reading A?.B, it's equivalent to A && A.B except that A is only evaluated once, even if it's a complex expression like a proc call.
* Converts all A && A.B into A?.B
Co-authored-by: ZeWaka <zewakagamer@gmail.com>
* Adds a bunch of looping audio to computers, grav-gen and telecomms. (#54324)
* Adds a bunch of looping audio to computers, gravegen and telecomms.
Co-authored-by: Qustinnus <Floydje123@hotmail.com>
* Yellow slime core nerfs and adjustments. (#54198)
Yellow slime extract can no longer turn into a self-charging yellow slime core. This functionality has been completely removed.
Hypercharged yellow slime cores no longer self-charge.
They now have a capacity of 50,000 (up from their previous 20,000). This is 10,000 more than a bluespace power cell.
Their recharge rate is 2500. This is relatively slow for the power capacity, as hyper and bluespace cells charge at 10% of their capacity respectively and this is 5%.
Motorised wheelchairs have had their power usage reduced to 5% of their previous value since they were basically only usable with rechargable cells before
* Yellow slime core nerfs and adjustments.
* Update special.dm
* Update special.dm
Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
Co-authored-by: Azarak <azarak10@gmail.com>
* Making holes in the SM chamber will provide a lot of +*=FUN=*+ (#53725)
Making a hole in the supermatter chamber to vent it and so to slow down the delamination will instead make the delamination way faster, more so if the SM power is very high and the power level is high too.
Fix an old unintended feature where you could just vent to space the SM chamber to slow down or even stop a delamination (sometimes you could just make a hole in the chamber and it would stabilize while delaminating), the SM is easily fixable just by looking at the pipe and the meters, no need to vent to space. (Lemons note, in some cases a vent to space is needed, but it should not be a long term thing)
* Making holes in the SM chamber will provide a lot of +*=FUN=*+
Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com>
* Fix incorrect Initialize arguments again (#54123)
Fixes#54013 because loc is not the second arg
* Fix Fix incorrect Initialize arguments
Co-authored-by: spookydonut <github@spooksoftware.com>
* Crystal invasion no longer random event but delamination event (#53921)
This PR makes the crystal invasion event a delamination event only, so no more random events (can still be admin triggered).
The chance for the delamination to trigger the event depends on the power of the SM, the closer it is to the tesla delamination (near 5000) the higher the chance.
* Crystal invasion no longer random event but delamination event
Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com>
* Scales ethereal power capacity and interactions upwards (#53984)
Basically, all ethereal charge capacity and interactions have been scaled upwards by 20x.
Power wise, ethereals now hold up to 3000, with the max safe threshold being 2000. For reference, upgraded powercells can hold 2500, with high capacity holding 10K).
All appropriate values have been tweaked to match this change. There shouldn't be ANY sort of noticeable difference in game, aside from power sources depleting faster, and a few values which I decided to tweak for balance reasons. They are: power cell draining time is 1.5 seconds longer, and light draining time is 0.5 shorter. Also, draining cells has less of a punishment multiplier upon the cell now, (originally, the the cell lost 33x as much as you received. now its 12x). (to avoid returning to this in why its good, I did this because now that ethereals are capable of holding more, I can afford to have less of a punishment, while still maintaining a reasonable level of punishment).
Also some minor code and grammar improvements.
* Scales ethereal power capacity and interactions upwards
Co-authored-by: wesoda25 <37246588+wesoda25@users.noreply.github.com>
* Enforce preserving parent proc return values across ui_act call stacks (#53964)
All ui_act procs should call parent by default. All procs should preserve the value of the parent proc when it's TRUTHY and pass it down the call stack. No UI should be interactible when its flags or state indicate it should not be, except when explicity overriden by child procs intentionally disregarding parent return values to achieve a specific goal.
* Enforce preserving parent proc return values across ui_act call stacks
Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
* Replaces some numbers with defines + grammar stuff in ethereal power draining code (#53924)
* Replaces some numbers with defines + grammar stuff in ethereal power draining code
Co-authored-by: wesoda25 <37246588+wesoda25@users.noreply.github.com>
* Disable some effect systems during init (#53929)
Instantly spread gib streaks rather than doing so over a delay
Completely skip broken light fixture sparking during init
* Disable some effect systems during init
Co-authored-by: Tad Hardesty <tad@platymuus.com>
* Machines now store their components in their contents. (#52970)
Machine parts are now located in the machine instead of nullspace.
* Machines now store their components in their contents.
Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
* Remove bad reference from atmos (#53781)
Change the name from Cyrion B to Zauker due to the easy connection the bad groups in the past
Not getting a repo ban is good
* Remove bad reference from atmos
Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com>
* Fixes processing of deleted objects in SSair (#53735)
qdel'd objects could still process in SSair because SSair utilises a cache whenever it has to resume processing runs from a partially completed state from running out of processing time.
Of all the things that processed on SSair, only one thing actually took care to remove itself from the cache as well on deletion.
This is an important subsystem and the processing lists should not be public. Objects don't need to know how SSair works, they just call the proc to add when they start processing and call the proc to remove when they finish.
Thanks to @ LemonInTheDark and @ willox for spending a lot of time helping me track down a proper fix to this issue.
* Fixes processing of deleted objects in SSair
Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
* Arcane finishes the fight and adds all the missing belt sprites and a worn sprite Admin Tool. (#53305)
* Arcane finishes the fight and adds all the missing belt sprites and a worn sprite Admin Tool.
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
* Prevent smashing of light tubes onto fixtures (#53705)
Previously, if you tried to put in a light tube at any point before fully finishing the fixture, it would break the light tube. This is no longer the case, and it will now simply prevent you from putting it in.
* You no longer smash light fixtures with light tubes
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
* Remove references to old singularity machines (#53509)
Removes the singularity generator and the particle accelerator. The former had no sprite, and the latter only existed because of a leftover type path. This does not affect gameplay at all.
Removes the "Start Singularity" verb that was only intended for debug use.
Fixes#53508.
* Remove references to old singularity machines
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
* Merge pull request #53013 from Ghilker/reactions-go-BRRRR
The scope of this PR is to add new and interesting stuff to the atmos crew and to bring more people to it both old and new.
This PR adds 5 new gases, a bunch of reactions (i'm still working on this but suggestions are useful), new recipes and items to the atmosians arsenal. These gases have high utility for everyone, atmosians will find them useful to do their job both as firefighters and air maintenance.
FINAL GAS NAMES (will change only if a maintainer ask about it)
Healium
Proto Nitrate
Cyrion B
Halon
Hexane
reactions avaiable in this PR: https://drive.google.com/file/d/1e6DZlBaKSCNdCADKnrH3F3aDWvl0iZr4/view
What the PR add:
-Healium: a red gas, stronger than n2o if breathed, with healing properties
-Proto Nitrate: a green inert gas if breathed but with different reactions with various gases at high temperatures
-Cyrion B: a black deadly gas if breathed that decompones very fast if exposed to N2 even at minimal amounts
-Halon: a light blue gas that when used in a fire it will suck up the O2 and will help cool the room, helping fighting the fire
-Hexane: a purple gas that has the ability to filter from the air plasma and n2o, useful to clean distro from the harmful gases quickly
-Healium Crystal: a reddish crystal that when broken will explode cooling the room and removing the plasma from the air (act like a grenade)
-Proto Nitrate Crystal: a greenish crystal that when broken will explode refilling a space with O2 and N2
-Cyrion B Crystal: a blackish crystal that when broken will explode dealing damage around it
-Metallic hydrogen recipe addition (atmosian armor and fireaxe)
-Statue of an elder atmosian (for bragging rights)
-Supermatter Interactions
-More gas interactions (Roinnel have multiple and different interactions)
-New RPD device: the pressure valve, a device that allow gas flow in a pipenet if the input pressure is higher than the set pressure it's getting atomized
-Fusion is a bit "easier" to start (minor changes to the math so that the instability is more reasonable)
-pluox can be also made without using rads
-cyrion-b bounty
-all 5 gases can be sold to cargo
More stuff needs to be added (like the SM interactions(added) and probably more reactions and breathe reactions)
Please leave suggestions and feedbacks as it helps improve the PR
Atmos desperately need more content and need to be proactive in the making of its tools, with this PR is a start to more atmos content
🆑
add: hydrogen + rads = trit
add: 5 new gases
add: Healium : made from Bz + Freon + cold, it knocks people down but have healing properties
add: Proto Nitrate : made from pluox and H2 + heat, it has different reaction with a bunch of other gases
add: Cyrion B : made from hypernoblium + stimulum around 0°C, it has heavy damage if breathed but is decomposed rapidly by N2
add: Halon : made from bz + trit + cold, it reacts with O2 at high temperature removing it and cooling the air, helping putting out fires
add: Hexane : made from bz + H2 + cold, it reacts with plasma and n2o and removes them from the air mix, filtering them.
tweak: stimulum no longer require plasma
add: canister sprites, gas sprites
add: crystal from gases formation and reaction
add: new metallic hydrogen recipes
add: elder atmosian statue
add: supermatter interactions
tweak: minor changes to fusion math to make it "easier" to start
add : pluoxium can be also made without using rads (not removing the rad production one) (this also produces a minimal amount of h2)
tweak: lowered hypernoblium min temperature of reaction
tweak: metallic hydrogen production more common
add: cyrion-b bounty
add: all 5 gases are up to selling
/🆑
* Add 5 new gases, related interactions/items/content, changes parts of fusion
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
* Readds the tesla, reworks it a bit (#53072)
* Makes tesla movement nicer, fixes some atmos concerns, changes how energy is handled, and readds the tesla
* readds delam and desc
* I fucked it
* flags
* holy fuck
* Constricts the zaps that can generate power from a tesla coil
* *kick?
* Readds the tesla, reworks it a bit
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
* Process procs now properly utilize deltatime when implementing rates, timers and probabilities (#52981)
* Process procs now properly use deltatime when implementing rates, timers and probabilities
* Review fixes
* Geiger counters cleanup
Made hardsuit geiger code more similar to geiger counter code
Geiger counters are more responsive now
* Moved SS*_DT defines to subsystems.dm
* Rebase fix
* Redefined the SS*_DT defines to use the subsystem wait vars
* Implemented suggested changes by @AnturK
* Commented /datum/proc/process about the deltatime stuff
* Send delta_time as a process parameter instead of the defines
Also DTfied acid_processing
* Dtfied new acid component
* Process procs now properly utilize deltatime when implementing rates, timers and probabilities
Co-authored-by: Donkie <daniel.cf.hultgren@gmail.com>
* ZK-Lambda-Class Remade (#52941)
This PR adds the crystal invasion event, a new event involving the Supermatter and the monsters from within.
When the event starts there will be a message from centcomm announcing it, then the supermatter explode leaving a destabilized crystal that emits radiations and harmful gases; after a bit portals will spawn around the station, that will produce a number of monsters each. there are 4 types of waves and 4 types of portals
The waves are: Small, Medium, Big, Huge (each have different kind of portals that can spawn and different amounts too)
The portals are the same types of the waves, they differ from each other for the number of monsters that can spawn and the kind of monsters that can spawn (bigger portals spawn stronger monsters)
To end the event the players should stabilize the crystal by destroying the portals (for now are indestructible and they are disabled by using an anomaly neutralizer, might change that) and collecting otherworld crystals; then those crystals are to be put in the crystal stabilizer, an item unlockable in the tech tree. After this just inject the destabilized crystal with it and the remaining portals will close on their own (the spawned monsters will still remain tho so you have to slay them)
All the numbers are mostly eyeballed and could change if requested/with feedbacks
* ZK-Lambda-Class Remade
Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com>
Replaces like 70-80% of 0 and such, as a side effect cleaned up a bunch of returns
Edit: Most left out ones are in mecha which should be done in mecha refactor already
Oh my look how clean it is
Co-authored-by: TiviPlus <TiviPlus>
Co-authored-by: Couls <coul422@gmail.com>
Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
Co-authored-by: Couls <coul422@gmail.com>
* Smooth Movement: Resurrection: Resurgence: Revengeance 4: The Return of Smooth Movement: Smooth Edition Director's Cut (#52515)
Automatic glide size adjustment based on move delay.
Essentially a port of https://github.com/yogstation13/Yogstation/pull/8132 but that was mostly my code with some fixes.
Why again? well it turns out the recent byond fixes to glide size actually worked and solved the issues that were unsolvable.
https://file.house/0B3u.mp4
Glide size no longer incorrectly scales at fps, so it works as intended at any framerate with the only stuttering being normal byond suck stuttering.
* Smooth Movement: Resurrection: Resurgence: Revengeance 4: The Return of Smooth Movement: Smooth Edition Director's Cut
Co-authored-by: Rob Bailey <actioninja@gmail.com>
* Refactors machine_stat and is_processing() to process on demand (#53150)
* Refactors machine_stat and is_processing() to process on demand
* Fixes master (#53193)
* fixes master, damn it me/mothblocks
* fuck again
* ANOTHER ONE
* Fixes master
Co-authored-by: Rohesie <rohesie@gmail.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
* Adds SIGNAL_HANDLER and SIGNAL_HANDLER_DOES_SLEEP to prevent signal callbacks from blocking (#52761)
Adds SIGNAL_HANDLER, a macro that sets SHOULD_NOT_SLEEP(TRUE). This should ideally be required on all new signal callbacks.
Adds BLOCKING_SIGNAL_HANDLER, a macro that does nothing except symbolize "this is an older signal that didn't necessitate a code rewrite". It should not be allowed for new work.
This comes from discussion around #52735, which yields by calling input, and (though it sets the return type beforehand) will not properly return the flag to prevent attack from slapping.
To fix 60% of the yielding cases, WrapAdminProcCall no longer waits for another admin's proc call to finish. I'm not an admin, so I don't know how many behinds this has saved, but if this is problematic for admins I can just make it so that it lets you do it anyway. I'm not sure what the point of this babysitting was anyway.
Requested by @optimumtact.
Changelog
cl
admin: Calling a proc while another admin is calling one will no longer wait for the first to finish. You will simply just have to call it again.
/cl
* Adds SIGNAL_HANDLER and SIGNAL_HANDLER_DOES_SLEEP to prevent signal callbacks from blocking
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
* Opacity refactor (#52881)
Moves all opacity var manipulation to a proc which sends a signal.
light_blocker element for movable opaque atoms made, which tracks its movement and updates the affected turfs for proper lighting updates.
has_opaque_atom boolean replaced by the opacity_sources lazylist to keep track of the sources, and a directional_opacity which serves a similar function but also allows for future expansion with on-border opaque objects (not yet implemented).
Some opacity-related sight procs optimized as a result of this.
Some variables moved to the object's definition.
A define or two added into the mix for clarity.
Some code cleaning, like turning booleans into their defines.
One file renamed for clarity.
Changelog
cl
balance: Mechs no longer block sight. It's a non-trivial cost for the lighting system with little to no gain.
/cl
* Opacity refactor
Co-authored-by: Rohesie <rohesie@gmail.com>
* Removes singularity, tesla, TEG and Mrs. Pacman. Changes supermatter overcharge delam. (#52873)
About The Pull Request
This PR removes the tesla and Mrs. Pacman from the game. The title is actually misleading, the TEG and singularity are still in the game but inaccessible and the singularity no longer has its generator.
Field generators and tesla coils have been kept because shocking your fellow man is the greatest sensation of power in the world.
The overcharging delamination for the supermatter has been replaced by the release of 2500 mols of tritium at 500,000 kelvin. An engineer who's really hateful of the station can use this for fusion, if they desire. Otherwise, its a tritium fire in engineering alongside the explosion. This will probably be changed in the future to be more potent since the explosion will pretty much just space all the tritium away.
Singularities no longer produce radiation. Now, keeping one is less about making power and more about making a statement, especially since you need to delaminate an SM shard for it.
Why It's Good For The Game
Having power optimized for one generator (SM+Turbine) will allow balancing to be feasible, also oranges wanted this. The other generators may later return but with tweaked values and different roles.
Changelog
🆑
del: Nanotrasen has removed their outdated teslas, singularities, TEGs and Mrs. Pacman generators from their servers and warehouse.
/🆑
* Removes singularity, tesla, TEG and Mrs. Pacman. Changes supermatter overcharge delam.
Co-authored-by: CRITAWAKETS <sebastienracicot@hotmail.com>
* Personalized combat messages part 2 (#52890)
Adds more "personalized" combat messages for all participants in a fight: the attacker, the victim and the spectators
* Personalized combat messages part 2
* Update misc.dm
Co-authored-by: kingofkosmos <riki.sundberg@gmail.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>