* Makes it so you cant apply component to qdeleted targets (#57773)
This shouldn't be happening but it seems it does in at least one case with forensics component being applied to some qdeleted gibs.
* Makes it so you cant apply component to qdeleted targets
Co-authored-by: Emmett Gaines <ninjanomnom@gmail.com>
* Moves /datum/var/signal_enabled to datum flags (#56372)
* Moves /datum/var/signal_enabled to datum flags
`signal_enabled` is a variable on /datum, so present almost every object
in the game. Folding it into the existing `datum_flags` variable will
save allocating a variable on every datum in the game.
- Clown weaponry was using the `signal_enabled` variable to turn their
attached slippery component on and off when the shield/sword was
toggled. They now just remove/add the component, rather than touching
deep datum internals.
* Moves /datum/var/signal_enabled to datum flags
Co-authored-by: coiax <yellowbounder@gmail.com>
About The Pull Request
It annoyed me that we have a perfectly good frag grenade item, and a perfectly good shrapnel component, but no crossover episode between the two. This remedies that, and does a lot, lot more.
dreamseeker_2020-03-30_05-01-13.png
dreamseeker_2020-03-30_05-01-26.png
Big points:
Adds new component: pellet_cloud, which can be used by ammo casings, guns, and landmines to spray shrapnel and display aggregate hit messages ("You're hit by 6 buckshot pellets!" vs "You're hit by the buckshot pellet in the X" x6). All gun ammo that shoot multiple pellets now use this component on firing.
Adds stingbangs, premium less-lethal grenades that shoot off lots of stinger pellets, to cargo. Frag grenades are also reworked to have smaller booms, but shoot off lots of shrapnel shards. You can jump on top of these grenades to absorb a portion of the shrapnel to save those around you! There's an achievement for dying this way, called "Look Out, Sir!"
Projectiles can now embed items/shrapnel. Adds .38 DumDum ammo to cargo that does less damage and has negative armor pen, but can embed in people. This is the only ammo that currently embeds.
Bullets can now ricochet off walls, structures, and machinery (harder surfaces are more likely to ricochet). Only standard .38 and Match Grade .38/.357/L6 ammo can ricochet, with Match Grade being much better at ricocheting. You can buy Match Grade .38 from cargo and Match Grade L6 ammo from the nuke uplink, while Match .357 is admin only.
Armor now protects you from harmful embeds, taking the better of the bullet/bomb armor on the affected limb. Armor penetration can modify this of course, and many blunt embeds like stingbangs and DumDum bullets are significantly worse if you have even 1 armor.
Other misc fixes/changes
Refactored the embed element a bunch and fixed it creating new elements for every instance rather than expected bespoke behavior. There are new /obj/item helpers for modifying and adding embedding.
Fixes#49989: Spears can no longer embed in turfs cause their sprite is annoying to me, it's generally harder for most things to embed in turfs
Fixes#49741: New carbon helpers for removing embedded objects
Fixes#46416: Handles embedded objects getting qdel'd or moved while embedded
Renamed the old shrapnel component for RPG loot to MIRV to avoid confusion
Repathed frag grenades from under minibombs to under base grenades, and added explosion vars to base grenades
Why It's Good For The Game
Fixes a bunch of janky design with embeds, adds lots of new avenues for projectile and grenade variety, ricochets and collateral damage are fun!
Changelog
🆑 Ryll/Shaps
add: Adds stingbangs to cargo (and one in the sec vendor premium), premium less-lethal grenades that shoot off a giant swarm of stingball pellets to help incapacitate swarms of people in tight quarters. You can jump on top of a live one to be a hero and absorb a bunch of shrapnel, same with frag grenades. There's even an achievement for dying to a grenade you jumped on!
add: Projectiles can now embed in people! Or at least grenade shrapnel and the new .38 DumDum ammo, now available in cargo, can. DumDum rounds excel against unarmored targets, but are pricey and do poorly against armored targets.
add: Bullets can now ricochet! Or at least, standard .38 and the new .38/L6 Match Grade ammo can. Match Grade ammo is finely tuned to ricochet easier and seek targets off bounces better, and can be purchased from cargo (for the .38) or nuke ops uplink (for the L6), but standard .38 ammo has a chance to ricochet as well.
tweak: Frag grenades now have smaller explosions but shoot off a bunch of devastating shrapnel, excellent for soft targets!
tweak: Shotguns and other multi-pellet guns now print aggregate messages, so you'll get one "You've been hit by 6 buckshot pellets!" rather than 6 "You've been hit by the buckshot pellet in the X!" messages. Bye bye lag!
balance: Armor can now protect against embedding weapons, taking the best of either the bullet or bomb armor for the limb in question away from the embed chance. Some weapons are better at piercing armor than others!
/🆑
AddComponent/AddElement now support named arguments. This requires passing around an argument list instead of using actual proc args which a bit gross but we can blame byond for forcing this.
InheritComponent uses mirrored init arguments instead of an argument list which means no more accessing it via index to get to the same arguments as in init.
As a small bonus I restructured dcs defines to be a bit more manageable. Mainly just splits them into separate files and gives them their own folder.
GetComponent gets a singular component, if you're trying to get a
component which allows duplicates on the object then you're doing
something that can very easily break. Stop it.
I'll straight up disable the capability once everything that does this
has been cleaned up but each and every one is its own project.
one of three things.
1. They don't use RegisterWithParent or UnregisterFromParent to unregister
and register signals
2. They use callbacks which refer to a source object, which is usually deleted
on transfer, or lost in some manner, or simply makes no sense at all to be
transferred
3. the component was never designed to be transferred at all
TransferComponents gave no shits about any of this and just blindly transferred
all components, if they were actually capable of it or not.
I only noticed this because it was causing chairs to break as they would not register signals
and verbs correctly for rotation after being picked up and then placed down, and a player
reported that issue via ahelp.
Luckily we caught it before the rot got anywhere, only chairs and the shuttle subystem
tend to use this proc (Shuttle uses it on turfs), can you imagine if everything was using
this LMAO
Which is good because it's more dangerous than a loaded gun
I have added a can_transfer var, that is true when a component is valid to
actually transfer, which means the dev has actually thought about what happens when
you take the parent object away and swap it for another and all the crazy that is entailed
by this
I have done my best to audit what components are actually
transferable, but things are basically a hot mess (Thanks @Cyberboss )
The following components required edits:
Forensics:
did not register/deregister the clean_act signal properly, did not checkblood on new parent
Rotation:
did not use RegisterWithParent or UnregisterFromParent, turned out
to not be transferable anyway due to having callbacks that can be
passed in to the parent with unknown sources that we can't feasibly
reuse (i.e if you're transferred from a chair to a bed, your old rotation
call backs are no longer valid). Turns out the use case it was for (just chairs)
didn't need it anyway, so I just made it non valid for transfer.
Wet Floor:
Honestly this one is just a hot mess, it should be a subtype of the slippery
component with the extra wet turf handling.
As it is it basically manages a slippery component on top of it's own extra
functionality, so that's a major code smell.
I added registration/unregistration of the signals, and made it's pretransfer
remove the slippery component and the posttransfer add it back (via update_flags)
Components that seem transferable without issues
mirage_border
orbiter
decal
spill
storage (I hope to earth)
* A Variety Of Updates
* Lovey Sprites!
* Adds implementation for listening status effects.
* Fixes implementation, uses defines instead of magic strings.
* Completely reworks status effect listeners
* Fixes Love Potions
* Fixes Approximately All The Things.jpg