Adds Double bladed Esword (#17227)

* Changed Energy Sword system to allow Wieldable eswords

Needed to add conditions to allow the wielding system to handle the esword if the component existed in the entity. The normal eswords work just fine still.

* Adds sprites for double bladed esword

* added double bladed esword to yml

* Add double bladed esword to uplink catalog

* fixed sprites on right handed wielding

* decresed speed a little and added a wielding time

* Reduced damage

* Damage change

* Balence change

* edited attack speed and heavy windup

* fixed readability issue and removed unwanted brackets

* reflectProp to .75

Co-authored-by: keronshb <54602815+keronshb@users.noreply.github.com>

* wieldTime to 0

Co-authored-by: keronshb <54602815+keronshb@users.noreply.github.com>

* litDisarmMalus to .7

Co-authored-by: keronshb <54602815+keronshb@users.noreply.github.com>

* changed heat and slash damage to 9 and structural damage to 20

* changed uplink desc

---------

Co-authored-by: keronshb <54602815+keronshb@users.noreply.github.com>
This commit is contained in:
FacePluslll
2023-06-18 14:35:23 -05:00
committed by GitHub
parent dd7032a860
commit 422a84e029
14 changed files with 165 additions and 0 deletions

View File

@@ -10,6 +10,8 @@ using Content.Shared.Toggleable;
using Content.Shared.Tools.Components;
using Content.Shared.Weapons.Melee;
using Content.Shared.Weapons.Melee.Events;
using Content.Shared.Wieldable;
using Content.Shared.Wieldable.Components;
using Robust.Shared.Player;
using Robust.Shared.Random;
@@ -34,6 +36,9 @@ public sealed class EnergySwordSystem : EntitySystem
SubscribeLocalEvent<EnergySwordComponent, IsHotEvent>(OnIsHotEvent);
SubscribeLocalEvent<EnergySwordComponent, EnergySwordDeactivatedEvent>(TurnOff);
SubscribeLocalEvent<EnergySwordComponent, EnergySwordActivatedEvent>(TurnOn);
SubscribeLocalEvent<EnergySwordComponent, ItemUnwieldedEvent>(TurnOffonUnwielded);
SubscribeLocalEvent<EnergySwordComponent, ItemWieldedEvent>(TurnOnonWielded);
}
private void OnMapInit(EntityUid uid, EnergySwordComponent comp, MapInitEvent args)
@@ -58,6 +63,9 @@ public sealed class EnergySwordSystem : EntitySystem
args.Handled = true;
if (TryComp<WieldableComponent>(uid, out var wieldableComp))
return;
if (comp.Activated)
{
var ev = new EnergySwordDeactivatedEvent();
@@ -72,6 +80,20 @@ public sealed class EnergySwordSystem : EntitySystem
UpdateAppearance(uid, comp);
}
private void TurnOffonUnwielded(EntityUid uid, EnergySwordComponent comp, ItemUnwieldedEvent args)
{
var ev = new EnergySwordDeactivatedEvent();
RaiseLocalEvent(uid, ref ev);
UpdateAppearance(uid, comp);
}
private void TurnOnonWielded(EntityUid uid, EnergySwordComponent comp, ref ItemWieldedEvent args)
{
var ev = new EnergySwordActivatedEvent();
RaiseLocalEvent(uid, ref ev);
UpdateAppearance(uid, comp);
}
private void TurnOff(EntityUid uid, EnergySwordComponent comp, ref EnergySwordDeactivatedEvent args)
{
if (TryComp(uid, out ItemComponent? item))