STWeightSystem.Throwing.cs 581 B

123456789101112131415161718
  1. using Content.Shared._Stalker.Throwing;
  2. using Content.Shared._Stalker.Weight;
  3. namespace Content.Server._Stalker.Weight;
  4. public sealed partial class STWeightSystem
  5. {
  6. private void InitializeThrowing()
  7. {
  8. SubscribeLocalEvent<STWeightComponent, STBeforeThrowedEvent>(OnBeforeThrow);
  9. }
  10. private void OnBeforeThrow(Entity<STWeightComponent> entity, ref STBeforeThrowedEvent args)
  11. {
  12. var modifier = Math.Max(entity.Comp.WeightThrowMinStrengthModifier, entity.Comp.Total * entity.Comp.WeightThrowModifier);
  13. args.Strength /= modifier;
  14. }
  15. }