biological medicine now restricted to biological targets (#5276)
Co-authored-by: xRiriq <xRiriq.git@gmail.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -2,11 +2,13 @@ using System.Threading.Tasks;
|
|||||||
using Content.Server.Stack;
|
using Content.Server.Stack;
|
||||||
using Content.Shared.ActionBlocker;
|
using Content.Shared.ActionBlocker;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
|
using Content.Shared.Damage.Prototypes;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Interaction.Helpers;
|
using Content.Shared.Interaction.Helpers;
|
||||||
using Content.Shared.Stacks;
|
using Content.Shared.Stacks;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Medical.Components
|
namespace Content.Server.Medical.Components
|
||||||
@@ -20,6 +22,14 @@ namespace Content.Server.Medical.Components
|
|||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
public DamageSpecifier Damage = default!;
|
public DamageSpecifier Damage = default!;
|
||||||
|
|
||||||
|
/// <remarks>
|
||||||
|
/// The supported damage types are specified using a <see cref="DamageContainerPrototype"/>s. For a
|
||||||
|
/// HealingComponent this filters what damage container type this component should work on. If null,
|
||||||
|
/// all damage container types are supported.
|
||||||
|
/// </remarks>
|
||||||
|
[DataField("damageContainer", customTypeSerializer: typeof(PrototypeIdSerializer<DamageContainerPrototype>))]
|
||||||
|
public string? DamageContainerID;
|
||||||
|
|
||||||
async Task<bool> IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
|
async Task<bool> IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
|
||||||
{
|
{
|
||||||
if (eventArgs.Target == null)
|
if (eventArgs.Target == null)
|
||||||
@@ -27,7 +37,11 @@ namespace Content.Server.Medical.Components
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!eventArgs.Target.HasComponent<DamageableComponent>())
|
if (!eventArgs.Target.TryGetComponent<DamageableComponent>(out DamageableComponent? targetDamage))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (DamageContainerID is not null && !DamageContainerID.Equals(targetDamage.DamageContainerID))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
sprite: Objects/Specific/Medical/medical.rsi
|
sprite: Objects/Specific/Medical/medical.rsi
|
||||||
HeldPrefix: ointment
|
HeldPrefix: ointment
|
||||||
- type: Healing
|
- type: Healing
|
||||||
|
damageContainer: Biological
|
||||||
damage:
|
damage:
|
||||||
groups:
|
groups:
|
||||||
Burn: -10 # 5 for each type in the group
|
Burn: -10 # 5 for each type in the group
|
||||||
@@ -34,6 +35,7 @@
|
|||||||
- type: Sprite
|
- type: Sprite
|
||||||
state: brutepack
|
state: brutepack
|
||||||
- type: Healing
|
- type: Healing
|
||||||
|
damageContainer: Biological
|
||||||
damage:
|
damage:
|
||||||
groups:
|
groups:
|
||||||
Brute: -15 # 5 for each type in the group
|
Brute: -15 # 5 for each type in the group
|
||||||
@@ -52,6 +54,7 @@
|
|||||||
- type: Sprite
|
- type: Sprite
|
||||||
state: gauze
|
state: gauze
|
||||||
- type: Healing
|
- type: Healing
|
||||||
|
damageContainer: Biological
|
||||||
damage:
|
damage:
|
||||||
types:
|
types:
|
||||||
Slash: -5
|
Slash: -5
|
||||||
|
|||||||
Reference in New Issue
Block a user