* Add powered crossbow

* Add spear embedding (#18578)

* Add spear embedding

* fuck this copy-paste

* Juicier

* the river

* Add crossbow embedding

* Fix crossbow construction

* Finish crossbow

* Remove unused

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Aviu00
2023-08-24 21:05:56 +03:00
committed by Aviu00
parent 7b9a36e4b6
commit d0431ee61e
31 changed files with 723 additions and 15 deletions

View File

@@ -2,6 +2,7 @@ using Content.Server.Administration.Logs;
using Content.Server.Damage.Components;
using Content.Server.Weapons.Ranged.Systems;
using Content.Shared.Camera;
using Content.Server.White.Crossbow;
using Content.Shared.Damage;
using Content.Shared.Damage.Events;
using Content.Shared.Damage.Systems;
@@ -32,7 +33,17 @@ namespace Content.Server.Damage.Systems
private void OnDoHit(EntityUid uid, DamageOtherOnHitComponent component, ThrowDoHitEvent args)
{
var dmg = _damageable.TryChangeDamage(args.Target, component.Damage, component.IgnoreResistances, origin: args.Component.Thrower);
// WD EDIT START
if (args.Handled)
return;
var damage = component.Damage;
if (TryComp(uid, out ThrowDamageModifierComponent? modifier))
damage += modifier.Damage;
var dmg = _damageable.TryChangeDamage(args.Target, damage, component.IgnoreResistances, origin: args.Component.Thrower);
// WD EDIT END
// Log damage only for mobs. Useful for when people throw spears at each other, but also avoids log-spam when explosions send glass shards flying.
if (dmg != null && HasComp<MobStateComponent>(args.Target))