Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QoL] Show Oni Damage Bonus In Damage Examine #1268

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions Content.Server/Nyanotrasen/Abilities/Oni/OniSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Shared.Tools.Components;
using Content.Shared.Damage.Events;
using Content.Shared.Nyanotrasen.Abilities.Oni;
using Content.Shared.Weapons.Melee;
using Content.Shared.Weapons.Melee.Events;
using Content.Shared.Weapons.Ranged.Components;
using Robust.Shared.Containers;
Expand All @@ -19,8 +20,7 @@ public override void Initialize()
base.Initialize();
SubscribeLocalEvent<OniComponent, EntInsertedIntoContainerMessage>(OnEntInserted);
SubscribeLocalEvent<OniComponent, EntRemovedFromContainerMessage>(OnEntRemoved);
SubscribeLocalEvent<OniComponent, MeleeHitEvent>(OnOniMeleeHit);
SubscribeLocalEvent<HeldByOniComponent, MeleeHitEvent>(OnHeldMeleeHit);
SubscribeLocalEvent<MeleeWeaponComponent, GetMeleeDamageEvent>(OnGetMeleeDamage);
SubscribeLocalEvent<HeldByOniComponent, TakeStaminaDamageEvent>(OnStamHit);
}

Expand Down Expand Up @@ -55,17 +55,12 @@ private void OnEntRemoved(EntityUid uid, OniComponent component, EntRemovedFromC
RemComp<HeldByOniComponent>(args.Entity);
}

private void OnOniMeleeHit(EntityUid uid, OniComponent component, MeleeHitEvent args)
private void OnGetMeleeDamage(EntityUid uid, MeleeWeaponComponent component, ref GetMeleeDamageEvent args)
{
args.ModifiersList.Add(component.MeleeModifiers);
}

private void OnHeldMeleeHit(EntityUid uid, HeldByOniComponent component, MeleeHitEvent args)
{
if (!TryComp<OniComponent>(component.Holder, out var oni))
if (!TryComp<OniComponent>(args.User, out var oni))
return;

args.ModifiersList.Add(oni.MeleeModifiers);
args.Modifiers.Add(oni.MeleeModifiers);
}

private void OnStamHit(EntityUid uid, HeldByOniComponent component, TakeStaminaDamageEvent args)
Expand Down
Loading