r2mods/ilspy_dump/ror2_csproj/RoR2.Projectile/ProjectileInflictTimedBuff.cs

28 lines
560 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
namespace RoR2.Projectile;
public class ProjectileInflictTimedBuff : MonoBehaviour, IOnDamageInflictedServerReceiver
{
public BuffDef buffDef;
public float duration;
public void OnDamageInflictedServer(DamageReport damageReport)
{
CharacterBody victimBody = damageReport.victimBody;
if ((bool)victimBody)
{
victimBody.AddTimedBuff(buffDef.buffIndex, duration);
}
}
private void OnValidate()
{
if (!buffDef)
{
Debug.LogWarningFormat(this, "ProjectileInflictTimedBuff {0} has no buff specified.", this);
}
}
}