bring code up to latest standards, move many procs to named files inside _HELPERS
no idea where to put some of these procs, help is appreciated
made more files to contain some unique code, deleted unsorted.dm, we can rest now
Fixes#61782
Did a minor cleanup in the stationloving component to better represent what the proc the destination_in_bounds proc actually did. It is now atom_in_bounds since it's called after the atom has moved and works on the atom's turf. This doesn't fix the problem, but it obfuscated things a bit since it was deceptively named.
The issue is that when the e-shuttle leaves the station, for every turf on the shuttle it first moves the turf's contents to hyperspace, then moves the turf to hyperspace, then changes the area. Since the player holding disky enters Hyperspace first then has the shuttle turf constructed around them, disky teleports back to the station because it enters a non-whitelisted location.
Instead of whitelisting Hyperspace, I changed the order of operations to turf transfer, area transfer and finally atom transfer. This fixes the issue (as now disky moves from z=2 to z=12 /area/shuttle/escape, where escape shuttle is whitelisted instead of z=12 /area/transit, where /area/transit is not whitelisted).
Null rods were not calling parent on attack_self and thus not sending signals to the component. DUMB! STINKY!!!!
I have elected to make subtype picking a component itself so this mistake will never be remade
fixes#60712 (possessed blades cannot awaken a spirit)
also, fixes spirit holder not making sounds
## About The Pull Request
stop forgetting to include mapload, if you don't include it then every single subtype past it by default doesn't include it
for example, `obj/item` didn't include mapload so every single item by default didn't fill in mapload

## Regex used:
procs without args, not even regex
`/Initialize()`
procs with args
`\/Initialize\((?!mapload)((.)*\w)?`
cleanup of things i didn't want to mapload:
`\/datum\/(.)*\/Initialize\(mapload`
First off, I am aware of the Feature Freeze for this month. This PR was initially started in #60401 about a month ago to break the changes into smaller PRs. The end result for this PR is a poor man's attempt at roguelike procedural generation. Enjoy!
Link to the README for how the new spawner system works.
Added the following new random mapping spawners:
pen, crayon, stamp, paper, pamphlet, briefcase, folder, wardrobe closet, wardrobe closet colored, backpack, narcotics, permabrig_weapon, permabrig_gear, prison, material, carpet, ornament, generic decoration, statue, showcase, paint, tool, tool_advanced, tool_rare, material_cheap, material, material_rare, toolbox, flashlight, canister, tank, vending_restock, atmospherics_portable, tracking_beacon, musical_instrument, gambling, coin, money_small, money, money_large, drugs, dice, cigarette_pack, cigarette, cigar, wallet_lighter, lighter, wallet_storage, deck, toy, toy_figure, booze, snack, condiment, cups, minor_healing, injector, surgery_tool, surgery_tool_advanced, surgery_tool_rare, firstaid_rare, firstaid, patient_stretcher, medical supplies, crate, crate_abandoned, girder, grille, lattice, spare_parts, table_or_rack, table, table_fancy, tank_holder, crate_empty, crate_loot, closet_private, closet_hallway, closet_empty, closet_maintencne, chair, chair_maintence, chair_flipped, chair_comfy, barricade, data_disk, graffiti, mopbucket, caution_sign, bucket, soap, box, bin, janitor_supplies, soup, salad, dinner
Removed deprecated wizard trap, vault, and armory spawners.
Bluespace anomalies detonating Move() things. When something is Move()d, none of the logic in forceMove() or doMove() is called, and thus stationloving things can't tell when they've left the z-level (since that's where the logic for it is).
There are a number of approaches I could have taken: Refactoring anomalies to use different movement code. Refactoring Movement code to send more signals in various scenarios. Refactoring the stationloving component.
I settled on two steps. First, refactoring the component to bring it up to modern code standards. Second, moving the logic for COMSIG_MOVABLE_Z_CHANGED to Moved() so the signal always fires regardless of if Move() or forceMove() or doMove() is used, with an optional var for whether the z-change is communicated to contents. This means the ore box was changed to actually send the signal instead of just returning with no parent call or signal sent. Stationloving ore boxes when?
stationloving procs no longer call SIGNAL_HANDLERs directly. Var names are now more descriptive. Things are renamed and documented. At least for the parts of the code I know.
Probably some other code cleanups.
Originally the component only allowed food to decompose into the generic moldy mess. This PR changes the component so that what item the component decomposes something into can be changed per attached object. I've added a few examples; bread types > moldy bread, pizza slice types > moldy pizza slices, dead mice > moldy dead mice (they need a sprite still, I'll get to that later. Kinda catbrained rn.)
edit:
Makes sure that none of this moldy food touches cytology unnecessarily.
Rotten eggs have been added (decomposed eggs), along with rotten boiled eggs. The only way to determine if an egg is good or not requires using a container of water on the egg. If it floats, it's rotten! They also do not produce ants when they decompose, so chickens no longer get eaten alive by swarms of ants for producing all these eggs.
fixes#61188
Adds the sparring god. Your deity wants you to go out and spar people for self improvement.
Sparring
You can create contracts from paper as the chaplain. The contracts come with a set of conditions for the battle.
You can set which weapons are allowed.
You can set what you earn from winning.
You can set where you fight.
BOTH participants in the sparring match must agree to the terms for the fight to begin. Changing the terms will remove any other signatures on the contract, requiring them to review and willingly sign again.
Setting the stakes to be holy will give you favor for winning the fight. You can only do this once per person, so you can't farm points. You can use points on declaring new areas as arenas, or if you save up enough, buff your heart to keep fighting in dangerous conditions.
Fixes GetComponents() returning a list with a null entry when there's no component of a given type
This can cause runtimes. The lists should only contains instances of a specific component type.
Merged the item/melee/classic_baton and item/melee/baton families in this unholy matrimony.
Bad jokes aside. I have refactored the underlying code of both items with the scope of reducing potential copypasta,inconsistencies, logging, renewing some old code (like teleprods) and extending the anti-dual batoning and TRAIT_STUNRESISTANCE code** to all batons and not just security ones. Otherwise, I have tried to maintain the gameplay functionality of these items intact. They work just like they did for the most part.
** A badly designed feature that only considers one source of knockdowns - stunbatons - out of a multitude of different devices with corresponding purposes present in the game. The only thing it does is reduce the knockdown from them by 90%. The stamina damage and confusion are fully applied. The knockdown from batons is 5 seconds, standing up takes an extra 1 second and the baton cooldown is about 2.5. Doing the math, you'll have the grand advantage of one puny second of not lying horizontal on the floor with this trait before getting batoned again by the same guy because the stamina damage and the confusion have really hampered your chances of getting some distance. I wish to make the trait suck less in the future, but for now I'm including a slight gameplay change here, more for consistency than anything because as I already told you, it'll still be disappointingly bad per se.
The abductor baton is also no more a subtype of stun batons but batons, which don't use power cells to work. Its power cell is effectively infinite and can't be removed, and It overrides functions such as toggling the baton on/off. It hinders maintainability to keep it a subtype of stun batons.
Replaced the anchored check for mobs in teleprods with one for overwhelming move resistance and removed its clumsy_check copypasta (it was stunning clowns twices).
Wormhole jaunters will now save the user from a chasm if they fall in and it's on their belt. Wormhole jaunters also are affected by EMP correctly. Before it would only be affected by an EMP if it was in the belt storage area which made no sense.
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
(Lots of good work here, thank you tim)
Title, please say hello to the element "chemical_transfer" and the component "faction_granter"
Componentized behavior is easier for admins to make events out of, more modular for code maintainability, lowers the possibility of future copy and paste, set me up with my wife, and more
One of the things I personally like the most about it is the ability for each behavior to properly be described on examine, which I loooooove!
Also, these should be fantasy affixes after the freeze is done
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
One final change I wanted to make to ants was to rework their rather low damage values. While they by no means were ever intended to be a kill-chem, the fact that they only did 25 brute after being injected with 200u was just far too low.
To change this, I've reworked their damage formula, so now you do roughly 32 brute damage with 100u of ants. This scales significantly once you add more ants after that point.
This is still a rather low amount of damage for the amount of u it takes, so to balance that I made the chance for one to vomit out the ants also stun the user, however to balance that balance it will purge anywhere from 5-10u of ants upon doing so.
I have also changed how the debuff works somewhat. While it still does its normal damage over time, I have increased the damage done by the user scratching at themselves, which yielded an average of 100 brute when dumped with 200u ants during testing.
Finally, you can pour ants back onto the ground now, with the amount of ants being poured being directly proportional to the amount of damage they will do. You must pour more than 10 ants for it to appear, and the amount of ants will only change the maximum damage that the resulting caltrop will do, not the minimum damage. There is a hard-cap at a 10 damage maximum, with the minimum always being 0.5. The amount of damage this caltrop does is equal to `ant_volume * 0.2`
Finally to balance this a little more, breeding ants has gone from requiring 6u sugar to 8u sugar, making farming take a little longer.
I have replaced the mouse opacity setting for bees and hivelord, its brood and legion skulls with a component that adds an almost (has to be 1 alpha to catch the click) invisible underlay to its target that doesn't block the entire turf.
The component prevents the underlay from shrinking or expanding above/below certain boundaries when the attached atom transform matrix is vv'd by an admin or if it's a mob being resized.
The component can be added to any atom, though there's no common signal for when objects are resized.
Scanner gates will now properly function when anchored. This is done by having the signal id be COMSIG_MOVABLE_SET_ANCHORED instead of COMSIG_OBJ_DEFAULT_UNFASTEN_WRENCH.
Shells that require anchoring will now say they require anchoring.
Admins can now give players a popup if they are not responding to tickets.
Popup is cleared when player replies or ticket is resolved/closed.
As more and more of the chat screen is made irrelevant, new players read it less and less.
This means that a lot of new players are ignoring ahelps, which is something I've encountered myself.
This PR kills off the transforming subtype of /obj/item/melee and replaces it with a component to handle the transforming behavior, /datum/component/transforming.
The transforming component handles updating the variables of an item when it's transformed. Things like force, sharpness, whetstone force bonus, and attack verbs. Similar to the two-handed component, but instead of transforming into a two-hander it remains a one handed weapon.
The "nemesis" behavior (dealing addition damage to certain factions) of the transforming subtype was moved to the cleaving saw only, since it was the only transforming item that used it. In the future, this can be made into a bespoke element/component as well.
The following weapons and items have been updated to use this component:
Energy Swords / Sabers / Bananium Energy Sword
Energy Circular Saw
Energy Dagger
Energy Axe
Toy Energy Sword
Holographic Energy Sword
Switchblade
Advanced Medical Tools (Laser scalpel, Mechanical Pinches, Searing Tool)
Advanced Engineering Tools (Hand Drill, Jaws of Life / Syndicate Jaws of Life)
Combat Wrench
Cleaving Saw
Telescopic Batons / Contractor Batons
Roasting Stick
Telescopic Riot Shield
Energy Shield / Bananium Energy Shield
This PR also touches up the code around the various above items.
* Implements a combustible_flooder component on plasma and hot ice. Numbers made to preserve old behaviour as much as possible for plasma. Nerfs hot ice to be in line with the original tweak PR
* Limited to only hot ice, removed traces of override temp
* Renamed gas_name into gas_id
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)