-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6210428
commit 7ab985f
Showing
4 changed files
with
64 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
namespace Content.Server.Abilities.Oni | ||
namespace Content.Shared._DV.Abilities.Oni; | ||
|
||
[RegisterComponent] | ||
public sealed partial class HeldByOniComponent : Component | ||
{ | ||
[RegisterComponent] | ||
public sealed partial class HeldByOniComponent : Component | ||
{ | ||
public EntityUid Holder = default!; | ||
} | ||
public EntityUid Holder = default!; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
using Content.Shared.Damage; | ||
|
||
namespace Content.Server.Abilities.Oni | ||
namespace Content.Shared._DV.Abilities.Oni; | ||
|
||
[RegisterComponent] | ||
public sealed partial class OniComponent : Component | ||
{ | ||
[RegisterComponent] | ||
public sealed partial class OniComponent : Component | ||
{ | ||
[DataField("modifiers", required: true)] | ||
public DamageModifierSet MeleeModifiers = default!; | ||
|
||
[DataField("stamDamageBonus")] | ||
public float StamDamageMultiplier = 1.25f; | ||
} | ||
[DataField("modifiers", required: true)] | ||
public DamageModifierSet MeleeModifiers = default!; | ||
|
||
[DataField("stamDamageBonus")] | ||
public float StamDamageMultiplier = 1.25f; | ||
|
||
[DataField] | ||
public float PryingSpeedModifier = 0.5f; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,50 @@ | ||
namespace Content.Shared.Nyanotrasen.Abilities.Oni; | ||
using Content.Shared._DV.Prying.Events; | ||
using Content.Shared.Hands; | ||
using Content.Shared.Weapons.Ranged.Events; | ||
using Content.Shared.Weapons.Ranged.Systems; | ||
|
||
public abstract class SharedOniSystem : EntitySystem | ||
namespace Content.Shared._DV.Abilities.Oni; | ||
|
||
public sealed class SharedOniSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedGunSystem _guns = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<OniComponent, GetUserPryTimeModifierEvent>(OnGetUserPryMod); | ||
SubscribeLocalEvent<OniComponent, DidEquipHandEvent>(OnHandEquipped); | ||
SubscribeLocalEvent<OniComponent, DidUnequipHandEvent>(OnHandUnequipped); | ||
|
||
SubscribeLocalEvent<HeldByOniComponent, GunRefreshModifiersEvent>(OnGunRefreshModifiers); | ||
} | ||
|
||
private void OnGetUserPryMod(Entity<OniComponent> ent, ref GetUserPryTimeModifierEvent args) | ||
{ | ||
args.PryTimeModifier *= ent.Comp.PryingSpeedModifier; | ||
} | ||
|
||
private void OnHandEquipped(Entity<OniComponent> ent, ref DidEquipHandEvent args) | ||
{ | ||
// Only apply the HeldByOni component to guns | ||
if (!_guns.TryGetGun(args.Equipped, out _, out var gun)) | ||
return; | ||
|
||
var heldComp = EnsureComp<HeldByOniComponent>(args.Equipped); | ||
heldComp.Holder = ent.Owner; | ||
} | ||
|
||
private void OnHandUnequipped(Entity<OniComponent> ent, ref DidUnequipHandEvent args) | ||
{ | ||
if (HasComp<HeldByOniComponent>(args.Unequipped)) | ||
RemComp<HeldByOniComponent>(args.Unequipped); | ||
} | ||
|
||
private void OnGunRefreshModifiers(Entity<HeldByOniComponent> end, ref GunRefreshModifiersEvent args) | ||
{ | ||
args.MinAngle *= 15f; | ||
args.AngleIncrease *= 15f; | ||
args.MaxAngle *= 15f; | ||
} | ||
} |