From 613e7937392d5d4fd9bf906f571adc237c706367 Mon Sep 17 00:00:00 2001 From: Skubman Date: Mon, 25 Nov 2024 02:44:47 +0800 Subject: [PATCH] [QoL] Show Oni Damage Bonus In Damage Examine (#1268) # Description Examining an item's damage values as an Oni now calculates your bonus damage, and it also works with all of the Oni combat traits. ## Technical details `OniSystem`, instead of adding melee damage through `MeleeHitEvent`, now adds damage through `GetMeleeDamageEvent`, the same event that examining melee weapon damage raises through `GetDamage`. ## Media **Normal damage values** **Oni damage values** # Changelog :cl: Skubman - tweak: As an Oni, examining the damage values of weapons now takes into account the melee damage bonus from your species or trait. --- .../Nyanotrasen/Abilities/Oni/OniSystem.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Content.Server/Nyanotrasen/Abilities/Oni/OniSystem.cs b/Content.Server/Nyanotrasen/Abilities/Oni/OniSystem.cs index 4fc078e85bc..a7e2295b751 100644 --- a/Content.Server/Nyanotrasen/Abilities/Oni/OniSystem.cs +++ b/Content.Server/Nyanotrasen/Abilities/Oni/OniSystem.cs @@ -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; @@ -19,8 +20,7 @@ public override void Initialize() base.Initialize(); SubscribeLocalEvent(OnEntInserted); SubscribeLocalEvent(OnEntRemoved); - SubscribeLocalEvent(OnOniMeleeHit); - SubscribeLocalEvent(OnHeldMeleeHit); + SubscribeLocalEvent(OnGetMeleeDamage); SubscribeLocalEvent(OnStamHit); } @@ -55,17 +55,12 @@ private void OnEntRemoved(EntityUid uid, OniComponent component, EntRemovedFromC RemComp(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(component.Holder, out var oni)) + if (!TryComp(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)