kakozuzo/Code/swb_shared/DamageInfo.cs

28 lines
641 B
C#
Raw Permalink Normal View History

2024-10-30 19:01:58 +03:00
using System;
using System.Linq;
namespace SWB.Shared;
public class DamageInfo
{
public Guid AttackerId { get; set; }
public string Inflictor { get; set; }
public float Damage { get; set; }
public Vector3 Origin { get; set; }
public Vector3 Force { get; set; }
public string[] Tags { get; set; }
public static DamageInfo FromBullet( Guid attackerId, string inflictor, float damage, Vector3 origin, Vector3 force, string[] tags )
{
return new()
{
AttackerId = attackerId,
Inflictor = inflictor,
Damage = damage,
Origin = origin,
Force = force,
Tags = new[] { "bullet" }.Concat( tags ).ToArray(),
};
}
}