Fixes Esword not changing hit sound and sharpComp. (#9005)
Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
@@ -24,6 +24,12 @@ namespace Content.Server.Weapon.Melee.EnergySword
|
|||||||
[DataField("deActivateSound")]
|
[DataField("deActivateSound")]
|
||||||
public SoundSpecifier DeActivateSound { get; set; } = new SoundPathSpecifier("/Audio/Weapons/ebladeoff.ogg");
|
public SoundSpecifier DeActivateSound { get; set; } = new SoundPathSpecifier("/Audio/Weapons/ebladeoff.ogg");
|
||||||
|
|
||||||
|
[DataField("onHitOn")]
|
||||||
|
public SoundSpecifier OnHitOn { get; set; } = new SoundPathSpecifier("/Audio/Weapons/eblade1.ogg");
|
||||||
|
|
||||||
|
[DataField("onHitOff")]
|
||||||
|
public SoundSpecifier OnHitOff { get; set; } = new SoundPathSpecifier("/Audio/Weapons/genhit1.ogg");
|
||||||
|
|
||||||
[DataField("colorOptions")]
|
[DataField("colorOptions")]
|
||||||
public List<Color> ColorOptions = new()
|
public List<Color> ColorOptions = new()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ using Content.Shared.Light.Component;
|
|||||||
using Content.Shared.Toggleable;
|
using Content.Shared.Toggleable;
|
||||||
using Content.Shared.Tools.Components;
|
using Content.Shared.Tools.Components;
|
||||||
using Content.Server.CombatMode.Disarm;
|
using Content.Server.CombatMode.Disarm;
|
||||||
|
using Content.Server.Kitchen.Components;
|
||||||
|
using Content.Server.Weapon.Melee.Components;
|
||||||
|
using Content.Shared.Sound;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
@@ -74,6 +77,11 @@ namespace Content.Server.Weapon.Melee.EnergySword
|
|||||||
malus.Malus -= comp.litDisarmMalus;
|
malus.Malus -= comp.litDisarmMalus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(TryComp<MeleeWeaponComponent>(comp.Owner, out var weaponComp))
|
||||||
|
weaponComp.HitSound = comp.OnHitOff;
|
||||||
|
|
||||||
|
RemComp<SharpComponent>(comp.Owner);
|
||||||
|
|
||||||
SoundSystem.Play(comp.DeActivateSound.GetSound(), Filter.Pvs(comp.Owner, entityManager: EntityManager), comp.Owner);
|
SoundSystem.Play(comp.DeActivateSound.GetSound(), Filter.Pvs(comp.Owner, entityManager: EntityManager), comp.Owner);
|
||||||
|
|
||||||
comp.Activated = false;
|
comp.Activated = false;
|
||||||
@@ -89,6 +97,11 @@ namespace Content.Server.Weapon.Melee.EnergySword
|
|||||||
item.Size = 9999;
|
item.Size = 9999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EnsureComp<SharpComponent>(comp.Owner);
|
||||||
|
|
||||||
|
if(TryComp<MeleeWeaponComponent>(comp.Owner, out var weaponComp))
|
||||||
|
weaponComp.HitSound = comp.OnHitOn;
|
||||||
|
|
||||||
SoundSystem.Play(comp.ActivateSound.GetSound(), Filter.Pvs(comp.Owner, entityManager: EntityManager), comp.Owner);
|
SoundSystem.Play(comp.ActivateSound.GetSound(), Filter.Pvs(comp.Owner, entityManager: EntityManager), comp.Owner);
|
||||||
|
|
||||||
if (TryComp<DisarmMalusComponent>(comp.Owner, out var malus))
|
if (TryComp<DisarmMalusComponent>(comp.Owner, out var malus))
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
Heat: 12.5
|
Heat: 12.5
|
||||||
Blunt: -7
|
Blunt: -7
|
||||||
litDisarmMalus: 0.6
|
litDisarmMalus: 0.6
|
||||||
- type: Sharp
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Weapons/Melee/e_sword.rsi
|
sprite: Objects/Weapons/Melee/e_sword.rsi
|
||||||
layers:
|
layers:
|
||||||
@@ -23,7 +22,7 @@
|
|||||||
map: [ "blade" ]
|
map: [ "blade" ]
|
||||||
- type: MeleeWeapon
|
- type: MeleeWeapon
|
||||||
hitSound:
|
hitSound:
|
||||||
path: /Audio/Weapons/eblade1.ogg
|
path: /Audio/Weapons/genhit1.ogg
|
||||||
damage:
|
damage:
|
||||||
types:
|
types:
|
||||||
Blunt: 7
|
Blunt: 7
|
||||||
|
|||||||
Reference in New Issue
Block a user