Новые растения в ботанику (#416)
* add haloperidol, potassium iodide * review fixes * review and tuning * add: translation * new mutations * translation string fix * holymelons are holy now * add: translation * rename holymelon * Tomato killers don't kill the server anymore. (#28173) * tomato killer auto death * fix * Update miscellaneous.yml --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using Content.Shared.Damage.Prototypes;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Damage.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Applies the specified DamageModifierSets when the entity takes damage.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class DamageProtectionBuffComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The damage modifiers for entities with this component.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Dictionary<string, DamageModifierSetPrototype> Modifiers = new();
|
||||
}
|
||||
19
Content.Shared/Damage/Systems/DamageProtectionBuffSystem.cs
Normal file
19
Content.Shared/Damage/Systems/DamageProtectionBuffSystem.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Content.Shared.Damage.Components;
|
||||
|
||||
namespace Content.Shared.Damage.Systems;
|
||||
|
||||
public sealed class DamageProtectionBuffSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<DamageProtectionBuffComponent, DamageModifyEvent>(OnDamageModify);
|
||||
}
|
||||
|
||||
private void OnDamageModify(EntityUid uid, DamageProtectionBuffComponent component, DamageModifyEvent args)
|
||||
{
|
||||
foreach (var modifier in component.Modifiers.Values)
|
||||
args.Damage = DamageSpecifier.ApplyModifierSet(args.Damage, modifier);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user