[RegisterComponent]
public sealed partial class DamageOnLandComponent : Component
{
+ /// <summary>
+ /// Should this entity be damaged when it lands regardless of its resistances?
+ /// </summary>
[DataField("ignoreResistances")]
[ViewVariables(VVAccess.ReadWrite)]
public bool IgnoreResistances = false;
+ /// <summary>
+ /// How much damage.
+ /// </summary>
[DataField("damage", required: true)]
[ViewVariables(VVAccess.ReadWrite)]
public DamageSpecifier Damage = default!;
using Content.Server.Damage.Components;
-using Content.Shared.CombatMode.Pacification;
using Content.Shared.Damage;
using Content.Shared.Throwing;
namespace Content.Server.Damage.Systems
{
+ /// <summary>
+ /// Damages the thrown item when it lands.
+ /// </summary>
public sealed class DamageOnLandSystem : EntitySystem
{
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
{
base.Initialize();
SubscribeLocalEvent<DamageOnLandComponent, LandEvent>(DamageOnLand);
- SubscribeLocalEvent<DamageOnLandComponent, AttemptPacifiedThrowEvent>(OnAttemptPacifiedThrow);
- }
-
- /// <summary>
- /// Prevent Pacified entities from throwing damaging items.
- /// </summary>
- private void OnAttemptPacifiedThrow(Entity<DamageOnLandComponent> ent, ref AttemptPacifiedThrowEvent args)
- {
- // Allow healing projectiles, forbid any that do damage:
- if (ent.Comp.Damage.AnyPositive())
- {
- args.Cancel("pacified-cannot-throw");
- }
}
private void DamageOnLand(EntityUid uid, DamageOnLandComponent component, ref LandEvent args)