-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathSE_Companion.cs
More file actions
67 lines (59 loc) · 1.78 KB
/
Copy pathSE_Companion.cs
File metadata and controls
67 lines (59 loc) · 1.78 KB
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
60
61
62
63
64
65
66
67
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace ValheimLegends
{
public class SE_Companion : SE_Stats
{
public static Sprite AbilityIcon;
public static GameObject GO_SEFX;
[Header("SE_VL_Companion")]
public static float m_baseTTL = 600f;
public float speedModifier = 1.2f;
public float healthRegen = 1f;
public float damageModifier = 1f;
private float m_timer = 0f;
private float m_interval = 5f;
public Player summoner;
public SE_Companion()
{
base.name = "SE_VL_Companion";
m_icon = AbilityIcon;
m_tooltip = "Companion";
m_name = "Companion";
m_ttl = m_baseTTL;
}
public override void ModifySpeed(float baseSpeed, ref float speed)
{
speed *= speedModifier;
}
public override void UpdateStatusEffect(float dt)
{
base.UpdateStatusEffect(dt);
m_timer -= dt;
if (m_timer <= 0f)
{
m_timer = m_interval;
m_character.Heal(healthRegen, true);
}
}
public override bool IsDone()
{
if(m_ttl > 0f && m_time > m_ttl)
{
ZLog.Log("killing " + m_character.m_name);
HitData hit = new HitData();
hit.m_damage.m_spirit = 99999f;
base.m_character.ApplyDamage(hit, true, true, HitData.DamageModifier.VeryWeak);
}
return base.IsDone();
}
public override bool CanAdd(Character character)
{
return !character.IsPlayer();
}
}
}