Files
wwdpublic/Content.Shared/Damage/Components/RequireProjectileTargetComponent.cs
VMSolidus 40d411bbbc Cherrypick "Shoot Over Bodies" And Related PRs (#479)
# Description
This is a manual cherry-pick of the following PRs:
https://github.com/space-wizards/space-station-14/pull/27905
https://github.com/space-wizards/space-station-14/pull/28072
https://github.com/space-wizards/space-station-14/pull/28571

I REQUIRE these for my work in PR #11 , and cannot complete said PR
without these cherry-picks. This set of PRs from Wizden adds a feature
where entities can selectively opt-out of being shot at unless a player
intentionally targets them, which I can use as a simple and elegant
solution to one of the largest glaring issues for Segmented Entities. I
could simply give Lamia segments the new
RequireProjectileTargetComponent, which adds them to the system. Future
segmented entities such as the hypothetical "Heretic Worm" may or may
not use this feature, depending on their intended implementation.

---------

Co-authored-by: Danger Revolution! <142105406+DangerRevolution@users.noreply.github.com>
2024-06-23 01:00:32 -04:00

15 lines
451 B
C#

using Robust.Shared.GameStates;
namespace Content.Shared.Damage.Components;
/// <summary>
/// Prevent the object from getting hit by projetiles unless you target the object.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(RequireProjectileTargetSystem))]
public sealed partial class RequireProjectileTargetComponent : Component
{
[DataField, AutoNetworkedField]
public bool Active = true;
}