/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ using Content.Shared._Offbrand.Weapons; using Content.Shared.StatusEffectNew; namespace Content.Shared._Offbrand.StatusEffects; public sealed class MeleeModifiersStatusEffectSystem : EntitySystem { public override void Initialize() { base.Initialize(); SubscribeLocalEvent>(OnGetMeleeDamage); SubscribeLocalEvent>(OnGetMeleeAttackRate); } private void OnGetMeleeDamage(Entity ent, ref StatusEffectRelayedEvent args) { if (ent.Comp.DamageModifier is { } modifier) args.Args.Args.Modifiers.Add(modifier); } private void OnGetMeleeAttackRate(Entity ent, ref StatusEffectRelayedEvent args) { args.Args = args.Args with { Args = args.Args.Args with { Multipliers = args.Args.Args.Multipliers * ent.Comp.AttackRateMultiplier, Rate = args.Args.Args.Rate + ent.Comp.AttackRateConstant } }; } }