-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathSE_SpiritDrain.cs
50 lines (45 loc) · 1.57 KB
/
SE_SpiritDrain.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace ValheimLegends
{
public class SE_SpiritDrain : StatusEffect
{
public static Sprite AbilityIcon;
public static GameObject GO_SEFX;
[Header("SE_VL_SpiritDrain")]
public float m_damageInterval = 1f;
public static float m_baseTTL = 10f;
private float m_timer = 0f;
public float damageModifier = 1f;
public SE_SpiritDrain()
{
base.name = "SE_VL_SpiritDrain";
m_icon = AbilityIcon;
m_tooltip = "Spirit Drain";
m_name = "Spirit Drain";
m_ttl = m_baseTTL;
}
public override void UpdateStatusEffect(float dt)
{
base.UpdateStatusEffect(dt);
m_timer -= dt;
if (m_timer <= 0f)
{
m_timer = m_damageInterval;
HitData hitData = new HitData();
hitData.m_damage.m_spirit = UnityEngine.Random.Range(2, 4) * damageModifier * VL_GlobalConfigs.g_DamageModifer;
hitData.m_point = m_character.GetEyePoint();
m_character.ApplyDamage(hitData, true, true, HitData.DamageModifier.Normal);
UnityEngine.Object.Instantiate(ZNetScene.instance.GetPrefab("vfx_wraith_hit"), m_character.GetCenterPoint(), Quaternion.identity);
}
}
public override bool CanAdd(Character character)
{
return true;
}
}
}