Files
wwdpublic/Content.Server/Traits/Assorted/OniDamageModifierSystem.cs
Angelo Fallaria 65748934f1 New Trait: Oni Damage Bonuses (#676)
# Description

Adds three new 1-point traits for Onis that **redistribute** your damage
bonuses, allowing you to specialize in Slash or Piercing instead of
Blunt, or be a generalist who is equally effective with all melee Brute
weapons. The three new traits are **Swashbuckler**, **Spearmaster**, and
**Weapons Generalist**.

| Traits / Damage Bonus  | Blunt | Slash | Piercing |
|------------------------|-------|-------|----------|
| Base Oni (No Traits)   | 35%   | 20%   | 20%      |
| **Swashbuckler**       | 20%   | 35%   | 20%      |
| **Spearmaster**        | 20%   | 20%   | 35%      |
| **Weapons Generalist** | 25%   | 25%   | 25%      |

# Changelog

🆑 Skubman
- add: Add three new 1-point traits for Onis that allow you to
specialize in Slash or Piercing damage or be a melee weapons generalist.

---------

Signed-off-by: Angelo Fallaria <ba.fallaria@gmail.com>
Co-authored-by: Danger Revolution! <142105406+DangerRevolution@users.noreply.github.com>
2024-08-06 15:50:19 -04:00

32 lines
855 B
C#

using Content.Server.Abilities.Oni;
using Content.Shared.Damage;
namespace Content.Server.Traits.Assorted;
public sealed class OniDamageModifierSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<OniDamageModifierComponent, ComponentStartup>(OnStartup);
}
private void OnStartup(EntityUid uid, OniDamageModifierComponent component, ComponentStartup args)
{
if (!TryComp<OniComponent>(uid, out var oni))
return;
foreach (var (key, value) in component.MeleeModifierReplacers.Coefficients)
{
oni.MeleeModifiers.Coefficients[key] = value;
}
foreach (var (key, value) in component.MeleeModifierReplacers.FlatReduction)
{
oni.MeleeModifiers.FlatReduction[key] = value;
}
}
}