Small syndicate gear tweak (#13284)

This commit is contained in:
dontbetank
2023-01-20 19:11:24 +03:00
committed by GitHub
parent 8d65086184
commit 299180bf16
5 changed files with 35 additions and 29 deletions

View File

@@ -11,7 +11,6 @@ using Content.Shared.Toggleable;
using Content.Shared.Tools.Components;
using Content.Shared.Weapons.Melee;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio;
using Robust.Shared.Player;
using Robust.Shared.Random;
@@ -22,6 +21,8 @@ namespace Content.Server.Weapons.Melee.EnergySword
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedRgbLightControllerSystem _rgbSystem = default!;
[Dependency] private readonly SharedItemSystem _item = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
public override void Initialize()
{
@@ -42,7 +43,8 @@ namespace Content.Server.Weapons.Melee.EnergySword
private void OnMeleeHit(EntityUid uid, EnergySwordComponent comp, MeleeHitEvent args)
{
if (!comp.Activated) return;
if (!comp.Activated)
return;
// Overrides basic blunt damage with burn+slash as set in yaml
args.BonusDamage = comp.LitDamageBonus;
@@ -50,7 +52,8 @@ namespace Content.Server.Weapons.Melee.EnergySword
private void OnUseInHand(EntityUid uid, EnergySwordComponent comp, UseInHandEvent args)
{
if (args.Handled) return;
if (args.Handled)
return;
args.Handled = true;
@@ -91,7 +94,7 @@ namespace Content.Server.Weapons.Melee.EnergySword
if (comp.IsSharp)
RemComp<SharpComponent>(comp.Owner);
SoundSystem.Play(comp.DeActivateSound.GetSound(), Filter.Pvs(comp.Owner, entityManager: EntityManager), comp.Owner);
_audio.Play(comp.DeActivateSound, Filter.Pvs(comp.Owner, entityManager: EntityManager), comp.Owner, true, comp.DeActivateSound.Params);
comp.Activated = false;
}
@@ -115,8 +118,7 @@ namespace Content.Server.Weapons.Melee.EnergySword
if (comp.Secret)
weaponComp.HideFromExamine = false;
}
SoundSystem.Play(comp.ActivateSound.GetSound(), Filter.Pvs(comp.Owner, entityManager: EntityManager), comp.Owner);
_audio.Play(comp.ActivateSound, Filter.Pvs(comp.Owner, entityManager: EntityManager), comp.Owner, true, comp.ActivateSound.Params);
if (TryComp<DisarmMalusComponent>(comp.Owner, out var malus))
{
@@ -131,15 +133,17 @@ namespace Content.Server.Weapons.Melee.EnergySword
if (!TryComp(component.Owner, out AppearanceComponent? appearanceComponent))
return;
appearanceComponent.SetData(ToggleableLightVisuals.Enabled, component.Activated);
appearanceComponent.SetData(ToggleableLightVisuals.Color, component.BladeColor);
_appearance.SetData(component.Owner, ToggleableLightVisuals.Enabled, component.Activated, appearanceComponent);
_appearance.SetData(component.Owner, ToggleableLightVisuals.Color, component.BladeColor, appearanceComponent);
}
private void OnInteractUsing(EntityUid uid, EnergySwordComponent comp, InteractUsingEvent args)
{
if (args.Handled) return;
if (args.Handled)
return;
if (!TryComp(args.Used, out ToolComponent? tool) || !tool.Qualities.ContainsAny("Pulsing")) return;
if (!TryComp(args.Used, out ToolComponent? tool) || !tool.Qualities.ContainsAny("Pulsing"))
return;
args.Handled = true;
comp.Hacked = !comp.Hacked;