forked from TorannD/ValheimLegends
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSE_Regeneration.cs
59 lines (54 loc) · 1.92 KB
/
SE_Regeneration.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
51
52
53
54
55
56
57
58
59
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace ValheimLegends
{
public class SE_Regeneration : StatusEffect
{
public static Sprite AbilityIcon;
public static GameObject GO_SEFX;
[Header("SE_VL_Regeneration")]
public float m_damageInterval = 2f;
public static float m_baseTTL = 20f;
public float m_TTLPerDamagePlayer = 2f;
public float m_TTLPerDamage = 2f;
public float m_TTLPower = 0.5f;
public float m_HealAmount = 2f;
private float m_timer = 0f;
public bool doOnce = true;
public SE_Regeneration()
{
base.name = "SE_VL_Regeneration";
m_icon = AbilityIcon;
m_tooltip = "Regeneration";
m_name = "Regeneration";
m_activationAnimation = "vfx_Potion_health_medium";
m_ttl = m_baseTTL;
doOnce = true;
}
public override void UpdateStatusEffect(float dt)
{
base.UpdateStatusEffect(dt);
if(doOnce)
{
doOnce = false;
//ZLog.Log("setting up regeneration, average skill is " +);
m_HealAmount = (2f + (.25f * (m_character.GetSkills().GetTotalSkill() / m_character.GetSkills().GetSkillList().Count))) * VL_GlobalConfigs.g_DamageModifer * VL_GlobalConfigs.c_druidRegen;
}
m_timer -= dt;
if (m_timer <= 0f)
{
m_timer = m_damageInterval;
m_character.Heal(m_HealAmount, true);
//GO_SEFX = UnityEngine.Object.Instantiate(ZNetScene.instance.GetPrefab("vfx_Potion_health_medium"), m_character.GetCenterPoint(), Quaternion.identity);
}
}
public override bool CanAdd(Character character)
{
return true;
}
}
}