private void OnDoHit(EntityUid uid, DamageOtherOnHitComponent component, ThrowDoHitEvent args) { if (!args.Target.TryGetComponent(out IDamageableComponent? damageable)) { return; } damageable.TryChangeDamage(component.DamageType, component.Amount, component.IgnoreResistances); }
private void OnDoHit(EntityUid uid, DamageOtherOnHitComponent component, ThrowDoHitEvent args) { var dmg = _damageableSystem.TryChangeDamage(args.Target, component.Damage, component.IgnoreResistances); if (dmg != null) { _logSystem.Add(LogType.ThrowHit, $"{args.Target} received {dmg.Total} damage from collision"); } }
private void OnDoHit(EntityUid uid, DamageOtherOnHitComponent component, ThrowDoHitEvent args) { var dmg = _damageableSystem.TryChangeDamage(args.Target, component.Damage, component.IgnoreResistances); // 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)) { _logSystem.Add(LogType.ThrowHit, $"{ToPrettyString(args.Target):target} received {dmg.Total:damage} damage from collision"); } }
private void OnDoHit(EntityUid uid, DamageOtherOnHitComponent component, ThrowDoHitEvent args) { _damageableSystem.TryChangeDamage(args.Target.Uid, component.Damage, component.IgnoreResistances); }