* Merge MACHINE/port_gen/Initialize definitions (#62747)
This apparently happened in 58d0f12c5c, four year ago, where a New()
was renamed to Initialize().
Apparently in this case, the second definition runs first, and the first
definition runs in the second's parent call. Since the second immediately
calls the first as a parent call, just merging them with the first's body
first preserves behavior.
This is slightly horrifying.
* Merge MACHINE/port_gen/Initialize definitions
Co-authored-by: esainane <esainane+github@gmail.com>
* [MDB IGNORE] dir sanity, primarily on WALLITEMs (#62601)
About The Pull Request
Wall items mostly use the direction from the floor to the wall in the named mapping helper. Wall items mostly use the direction from the wall to the floor for the internal dir variable.
This leads to a headache when it comes to working out what conflicts with what, and what needs placing where.
Wall frames provided a member, inverse, which specified whether or not to invert the direction of the item when looking for conflicts. It was also used to specify whether to look for conflicts outside of the wall (cameras and lights appear external to the wall) or inside the wall (most wall items). This flag was set for Intercoms, APCs, and Lights. Since APCs and Lights expect a floor-to-wall direction, and Intercoms expect a wall-to-floor direction, this means that APCs and Lights were getting the correct direction, and Intercoms were getting the wrong direction.
Some implications of this setup were:
You could build an APC on top of another wall item, provided there was nothing external attached to the wall and the area didn't have an APC.
You could stack Intercoms indefinitely on top of the same wall, provided you weren't in a one-tile wide corridor with something on the opposite wall.
Or both! Here's twenty Intercoms placed on the wall, and a freshly placed APC frame after placing all Intercoms and deconstructing the old APC:
endless-stack-of-intercoms
Not everything used this inverse variable to adjust to the correct direction. For example, /obj/machinery/defibrillator_mount just used a negative pixel_offset to be visually placed in the correct direction, even though the internal direction was wrong, and never set! This also let you stack an indefinite number of defib mounts on the same wall, provided it wasn't a northern wall... except you could do this to northern walls too, since defibs weren't considered a wall item for the purposes of checking collisions at all!
Ultimately, every constructable interior wall item either used this inverse variable to adjust to the correct placement, set a negative pixel_offset variable to have its offset adjusted to the correct placement, or overrode New or Initialize to run its own checks and assignment to pixel_x and pixel_y!
Inventory: Table of various paths, related paths, and the adjustments they used
Unfortunately, untangling /obj/structure/sign is going to be another major headache, and this has already exploded in scope enough already, so we can't get rid of the get_turf_pixel call just yet. This also doesn't fix problems with the special 2x1 /obj/structure/sign/barsign.
Some non-wall items have been made to use the new MAPPING_DIRECTIONAL_HELPERS as part of the directional cleanup.
tl;dr: All wall mounted items and some directional objects now use the same direction that they were labelled as. More consistent directional types everywhere.
Why It's Good For The Game
fml
Changelog
cl
refactor: Wall mounted and directional objects have undergone major internal simplification. Please report anything unusual!
fix: You can no longer stack an indefinite amount of Intercoms on the same wall.
fix: Defibrillator Mounts, Bluespace Gas Vendors, Turret Controlers, and Ticket Machines are now considered wall items.
fix: Wall mounted items on top of the wall now consistently check against other items on top of the wall, and items coming out of the wall now consistently check against other items coming out of the wall.
fix: The various directional pixel offsets within an APC, Fire Extinguisher Cabinet, Intercom, or Newscaster have been made consistent with each other.
fix: The pixel offsets of Intercoms, Fire Alarms, Fire Extinguisher Cabinets, Flashers, and Newscasters have been made consistent between roundstart and constructed instances.
fix: Constructed Turret Controls will no longer oddly overhang the wall they were placed on.
qol: Defibrillator mounts now better indicate which side of the wall they are on.
fix: Some instances where there were multiple identical lights on the same tile have been fixed to only have one.
/cl
* [MDB IGNORE] dir sanity, primarily on WALLITEMs
* apc directionals
* bluespace vendor fix
* defib fix
Co-authored-by: esainane <esainane+github@gmail.com>
Co-authored-by: jjpark-kb <55967837+jjpark-kb@users.noreply.github.com>
* Stops the "You lack optic scanners, you get stunned" singularity proc from affecting blinded or dead mobs. (#62688)
* Stops the "You lack optic scanners, you get stunned" singularity proc from affecting blinded or dead mobs.
* oh dang
* Update singularity.dm
* Stops the "You lack optic scanners, you get stunned" singularity proc from affecting blinded or dead mobs.
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
* Adds feedback when successfully emaging a generator (#62524)
* Adds a span_notice when emaging a PACMAN
* Adds feedback when successfully emaging a generator.
* Adds feedback when successfully emaging a generator
Co-authored-by: Stonetear <89315023+Stonetear@users.noreply.github.com>
* Modernizing Radiation -- TL;DR: Radiation is now a status effect healed by tox healing, and contamination is removed
* Fixing conflicts
* Makes it compile, yeet all the RAD armor from everywhere (thanks RegEx!)
* Removing more lingering rad armor (woo)
* Damnit powerarmors
* Bye bye rad collectors!
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
* Fixes wires not being placeable (#62455)
So, uh, well, basically, the condition was checking for something that was true in BYOND's terms when it shouldn't've been. Whoops!
We all love working power, don't we?
Fixes#62446 (Not being able to place cables at all)
* [FUCK] Fixes wires not being placeable
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
* Refactor /turf/var/intact (#62331)
Turfs have a variable, intact, which conflates three meanings:
Determining whether there's something that can be pried out, such as directly with a crowbar or indirectly with a tile stack and a crowbar off-hand.
Determining whether underfloor pieces are visible.
Determining whether underfloor pieces can be interacted with - by players with tools, through interaction with effects like chemical acid, or foam.
When plating is hit with a stack of tiles, /turf/open/floor/attackby checks whether the turf is intact, and if so, ends the attack chain regardless of whether or not the attempt to hotswap a turf (with a crowbar) is successful or not. However, turfs which want the underfloor to be visible - such as catwalks and glass - set the intact variable to FALSE, and so can be repeatedly placed over one another, as if they were the first tile to be placed over the plating.
This refactors /turf/var/intact into two distinct variables:
/turf/var/overfloor_placed, for whether or not there is something over plating.
/turf/var/underfloor_visible, for whether or not the various underfloor pieces should be invisible, visible, or both visible and interactable.
All references to /turf/var/intact have been replaced with an equivalent overfloor_placed or underfloor_visible reference, depending on which check is appropriate. underfloor_accessibility can take one of UNDERFLOOR_HIDDEN, UNDERFLOOR_VISIBLE, or UNDERFLOOR_INTERACTABLE. This prevents cases such as acid foam or tools phasing through glass floors to affect the underfloor pieces underneath, and covers all kinds of unusual, not-wiring-visiblity usage such as Holodeck completeness, Revenant interaction, or station integrity checking.
* Refactor /turf/var/intact
* Thank
Co-authored-by: esainane <esainane+github@gmail.com>
Co-authored-by: Funce <funce.973@gmail.com>
* removes double spaces before symbols (#62397)
This can apparently cause some bugs on occasions, so I thought I might as well try to kill them all.
* removes double spaces before symbols
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
* SM: Fix pressure bonus system (#62255)
* SM: Fix pressure bonus system
Fixes#62124 (Pressure wasn't actually doing anything)
> This is a multiplier meant to be used at low pressures.
> The lower the pressure the higher the multiplier.
> This is to encourage low pressure setups and so cold setups.
> At higher pressures (from around 100 kpa and up) it will max to 1
Current behavior is what follows.
As pressure drops, the multiplier remained at 1 until it dropped to 5.96kPa.
It then very marginally increased until it reaches x1.17 at 0kPa.
This commit introduces a system that solves the constants for the equation
based on human readable parameters, and sets provisional parameters for it. Also makes behavior better match the stated intent.
You can varedit the parameters to see the real effects of changes, just be
sure to proc call update_constants().
Constants default to what amounts to 0 so it fails loud (I WANT TO HEAR SUFFERING -Lemon)
* SM: Fix pressure bonus system
Co-authored-by: esainane <esainane+github@gmail.com>
* Makes the American sausage a sausage subtype & Advanced roasting stick fixes (#62193)
Makes the American sausage a proper subtype of sausage, which makes it actually edible, apparently. It also makes it stick on the advanced roasting stick!
The advanced roasting stick will no longer try to grill itself over a bonfire with a griddle installed, allowing you to use the actual bonfire for your roasting needs.
There was actually a check that was supposed to limit the amount of times you could roast a sausage to a measly 1. It wasn't actually working. This PR removes that in favor of mad cooks creating these:
* Makes the American sausage a sausage subtype & Advanced roasting stick fixes
* fixes
Co-authored-by: Sealed101 <75863639+Sealed101@users.noreply.github.com>
Co-authored-by: jjpark-kb <55967837+jjpark-kb@users.noreply.github.com>
* Power generation (collectors, coils, grounding rods) cleanup (#62144)
* Energy collection: Mass rework
Radiation Collectors and Tesla Coils are now subtyles of a common
energy_accumulator type. This type combines common code such as smoothing
output over energy received, computing power output, and handling wire
connections.
Inline calculations using machine energy units are now performed by
common math functions in maths.dm. Rather than reference 0.1,
1 SECONDS is used to make it clear this is to calculate to and from
tickrate dependent units.
Constants which are written in terms of tickrate dependent units are now
written in terms of joules, and use these helpers to convert to and from
these units. With SSmachines.wait / (1 SECONDS) being 2, this usually
means doubling the values of constants which were previously defined in
terms of machine energy units.
* Energy collection: Map path update
> git ls-files | grep dmm | xargs sed -i 's1rad_collector1energy_accumulator/&1g'
> git ls-files | grep dmm | xargs sed -i 's1tesla_coil1energy_accumulator/&1g'
> git ls-files | grep dmm | xargs sed -i 's1grounding_rod1energy_accumulator/&1g'
* Power generation (collectors, coils, grounding rods) cleanup
* object path update (#8882)
* [MDB IGNORE] Missed some paths (#8886)
* object path update
* oops missed a couple paths
Co-authored-by: esainane <esainane+github@gmail.com>
Co-authored-by: ORCACommander <orcacommander1@gmail.com>
* SM: Randomly damage/heal on dusting a Clown (#62178)
When the SM dusts a true Clown (HoP assignment doesn't count), it randomly takes from -300 to 300 damage.
* SM: Randomly damage/heal on dusting a Clown
Co-authored-by: esainane <esainane+github@gmail.com>
* SM Zap: Fix forked target selection (#62143)
Supermatter forked lightning can now hit targets previously used by a sibling.
The default setup - and anything using two grounding rods - was still entirely safe, as "pass by ref begone" code did allow target reuse in ancestors. Any split could only exclude one grounding rod, and if one branch split again, neither branch's targets would be passed back to the target list of the first split.
The same issue was not present in `proc/tesla_zap`. Probably still shouldn't have two of these, though.
* SM Zap: Fix forked target selection
Co-authored-by: esainane <esainane+github@gmail.com>
* Bullets only directly damage the SM so much (#62079)
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
* Bullets only directly damage the SM so much
Co-authored-by: Maurukas <66576896+Maurukas@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
* The start
* More work
* firing modes
* Now displays ammo type when swapping and examining
* code refactoring
* replaces a bunch of code
* custom medicell text
* Update emitter.dm
* removes some testing stuff that isn't needed anymore
* repaths medicells
* This bothered me
* now uses conversion kit framework from https://github.com/Skyrat-SS13/Skyrat-tg/pull/8506/files instead of crafting
* no more regal rat runtimes, and, cheeeeeeeeeeeese can now be eaten by it (#62032)
* no more regal rat runtimes, and, cheeeeeeeeeeeese can now be eaten by it
Co-authored-by: Seris02 <49109742+Seris02@users.noreply.github.com>
* re-adds the yellow slimecore as an EMP-proof cell (#62013)
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
* re-adds the yellow slimecore as an EMP-proof cell
Co-authored-by: Invalid <51190031+InvalidArgument3@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
* lower sound level of coils, add a cooldown to avoid overlapping sounds (#62002)
Add a calculation to the coil sound and extrarange so that they are not deafening
Thanks to the discord user @ hawk#1896 for the sound calculations
Less deafening sounds and better feedback to the players (louder zaps mean higher power output)
* lower sound level of coils, add a cooldown to avoid overlapping sounds
Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com>
* Rad collectors gone, tesla coils to generate power (#61917)
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
* Rad collectors gone, tesla coils to generate power
* replaces rad collectors
Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
Co-authored-by: Kat <evesovereign@hotmail.co.uk>
* SM: Prevent unmovable SM variants from moving (#62000)
Previously, a hostile statue could move it by bumping into it. It would
still be dusted, but this left open the possibility of supposedly
immobile engines moving, albeit slowly and expensively.
* SM: Prevent unmovable SM variants from moving, round 2
Co-authored-by: esainane <esainane+github@gmail.com>
* SM: Prevent unmovable SM variants from moving (#61970)
Previously, a hostile statue could move it by bumping into it. It would still be dusted, but this left open the possibility of supposedly immobile engines moving, albeit slowly and expensively.
Hostile Statues have a move_force of 9000, but continued to be able to bump the SM until move_force was varedited to 1999 or below. This means (at least) immovable rods and all megafauna could all bump an "immobile" SM one tile per life.
* SM: Prevent unmovable SM variants from moving
Co-authored-by: esainane <esainane+github@gmail.com>
* Adds SHOULD_NOT_SLEEP to Destroy. Why didn't we do this before. (#61943)
* Adds SHOULD_NOT_SLEEP to Destroy. Why didn't we do this before.
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
* Fix cable restraint not rendering in crafting menu (#61842)
Fixed the cable restraints not showing up in the radial crafting menu. This was caused by the cable restraint (cuff) icon being moved to the restraint.dmi file - I didn't see this old reference elsewhere in the code. (first TG commit, please let me know if I am missing anything.
* Fix cable restraint not rendering in crafting menu
Co-authored-by: Peter <30943236+PeterMorrison1@users.noreply.github.com>
* Add local APC cache to /area (#61655)
About The Pull Request
for(var/obj/machinery/power/apc/APC in GLOB.apcs_list) in get_apc makes chuck norris shed a tear
Why It's Good For The Game
tears are bad
Changelog
cl
code: /area now retains a local reference to the APC in the area, if any
/cl
* Add local APC cache to /area
Co-authored-by: esainane <esainane+github@gmail.com>
* Fix being shocked while laying cables having a 50% chance to give you two cables instead of one. (#61754)
Title
deconstruct already gives cable
* Fix being shocked while laying cables having a 50% chance to give you two cables instead of one.
Co-authored-by: vincentiusvin <54709710+vincentiusvin@users.noreply.github.com>
* [TM Candidate] Overhauls orbit and POI code to fix part of issue #61508 where players could observe /mob/living/new_player on the lobby.
* E
* Missed merge
Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
Co-authored-by: Gandalf <jzo123@hotmail.com>
* memories are no longer added if the target isn't aware of them. (#61375)
Fixing an oversight with the memories system. Memories shouldn't be added to people who aren't possibly aware of them.
* memories are no longer added if the target isn't aware of them.
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
* Fixes (somehow) killing nar-sie in the last second not properly clearing the hostile environment (#61116)
Someone forgot to add GLOB.cult_narsie so I think what would happen is, despite narsie being dead, the shuttle wouldn't leave.
Was a non issue because the round ends if nar nar is last minute killed. There is not enough time for the shuttle to even leave.
That said, unimportant failures are still failures, so let's get going
* Fixes (somehow) killing nar-sie in the last second not properly clearing the hostile environment
Co-authored-by: FlamingLily <80451102+FlamingLily@users.noreply.github.com>
* Revert "Revert "[MIRROR] Refactor area and turf lighting (#7775)" (#7902)"
This reverts commit 64c4c52d12.
* This should probably fix it
* I love linters
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
* large refactor of machine/power code to cut down on processing time and wasted lists (#60317)
original pr here: #59789 (Closed because he didn't think it was good enough)
came back to this because i realized that
all machines were area sensitive, meaning they had a list with at least a reference to themselves (assuming they arent in the contents of another movable which most arent) for the purposes of handling power differences when their area changes
pipes are machines
there are ~14k machines and ~6k pipes
i made this problem worse with a recent pr by making it a nested list
so i needed to track what machines needed power, and this pr had work already done that could be used for that purpose. now machines that have use_power == NO_POWER_USE do not have this extra memory overhead for no reason
currently every machine that uses power draws that amount from its area from a dynamic channel via auto_use_power() which is called every SSmachines fire(), then in apc/process() the area's dynamic power draw is reset and the power is used. with static power its not calculated then reset every loop, its just taken from the grid. so now machines handle updating their static power usage from their current area (this doesnt touch power machines that require a wire connection). in order to allow this, use_power, idle_power_usage, and active_power_usage have setters to track state correctly and update the static power usage on the machines current area and handle area sensitivity.
also goes through a lot of heavy abusers of SSmachine processing time and tries to make it faster. makes airalarm/process() into a signal handler for COMSIG_TURF_EXPOSE since air alarms only need to process for changes.
Why It's Good For The Game
SSmachines isnt the heaviest hitter in terms of total cpu and certainly not in terms of overtime, but its not a lightweight. it frequently takes > 50ms to complete a run and seems to be in the top 5 or so of subsystem costs looking at some round profilers
also gets rid of a few thousand lists since every pipe no longer has two useless lists each (and any other machines that dont use power)
Love ya kyler
Co-authored-by: Rohesie <rohesie@ gmail.com>
* large refactor of machine/power code to cut down on processing time and wasted lists
Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
Co-authored-by: Rohesie <rohesie@ gmail.com>
* small refactor to can_interact() so that borg range is fully respected (#60693)
Its a relatively small refactor that changes the previous machinery "can_interact()" proc that literally did a full override despite half of their checks already existing in not one, but TWO parent procs, so i removed the redundant checks, added callbacks to its parents and then added the cyborg range check on the can_interact_with() itself. in doing so i also moved the interaction range var from silicons only, to mobs as a whole and defaulted it to a single tile, silicons override it to 7 (so pAIs and borgs like before) but then set AI and AI.eye to "null", because i have a check in can_interact that if there is no range set, then the range is effectively unlimited. and i even added code for when AI is carded and their wireless transmission is disabled it sets their range to "0" aka, it has no range to do anything even if it could
this was really complicated for me so despite my extensive testing it probably would be a bad thing if any of you want to test my code yourself to ensure there isnt a bug with this (theres no runtimes ive come across)
note: i did a lot of searching and going through machinery to ensure i caught all the little snowflake overrides and added can_interact() checks to them, but i may have missed one or two things, especially maybe a altclick or ctrlclick somewhere, however i believe i caught most of them
one nice side effect of this refactor is that you can actually set another mobs range to something other than 1 tile and they can interact at range, rather than only silicons getting this ability, an admin could VV a human to have a 3 tile arm reach as a meme if they want
* small refactor to can_interact() so that borg range is fully respected
Co-authored-by: 小月猫 <alina.r.starkova@gmail.com>
* Refactors connect_loc_behalf into a component (#60678)
See title. Also refactors caltrops into a component because they use connect_loc_behalf which requires them to hold the state.
This also fixes COMPONENT_DUPE_SELECTIVE from just outright not working.
connect_loc_behalf doesn't make sense as an element because it tries to hold states. There is also no way to maintain current behaviour and not have the states that it needs.
Due to the fact that it tries to hold states, it means the code itself is a lot more buggy because it's a lot harder to successfully manage these states without runtimes or bugs.
On metastation, there is only 2519 connect_loc_behalf components at roundstart. MrStonedOne has told me that datums take up this much space:
image
If we do the (oversimplified) math, there are only ever 5 variables that'll likely be changed on most connect_loc_behalf components at runtime:
connections,
tracked,
signal_atom,
parent,
signal_procs
This means that on metastation at roundstart, we take up this amount: (24 + 16 * 5) * 2519 = 261.97600 kilobytes
This is not really significant and the benefits of moving this to a component greatly outweighs the memory cost.
(Basically the memory cost is outweighed by the maint cost of tracking down issues with the thing. It's too buggy to be viable longterm basically)
* Update glass.dm
Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>