forked from TorannD/ValheimLegends
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSE_Rogue.cs
66 lines (58 loc) · 2.05 KB
/
SE_Rogue.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
60
61
62
63
64
65
66
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace ValheimLegends
{
public class SE_Rogue : SE_Stats
{
public static Sprite AbilityIcon;
public static GameObject GO_SEFX;
[Header("SE_VL_Rogue")]
public static float m_baseTTL = 2f;
private float m_timer = 0f;
public int hitCount = 1;
private float m_interval = 20f;
private int maxHitCount = 1;
public SE_Rogue()
{
base.name = "SE_VL_Rogue";
m_icon = AbilityIcon;
m_tooltip = "Rogue";
m_name = "Rogue";
m_ttl = m_baseTTL;
}
public override void ModifySpeed(float baseSpeed, ref float speed)
{
if (m_character.IsSneaking())
{
speed *= 1.5f + (.01f * m_character.GetSkills().GetSkillList().FirstOrDefault((Skills.Skill x) => x.m_info == ValheimLegends.DisciplineSkillDef).m_level);
}
base.ModifySpeed(baseSpeed, ref speed);
}
public override void UpdateStatusEffect(float dt)
{
m_timer -= dt;
if (m_timer <= 0f)
{
maxHitCount = 1 + Mathf.RoundToInt(m_character.GetSkills().GetSkillList().FirstOrDefault((Skills.Skill x) => x.m_info == ValheimLegends.DisciplineSkillDef).m_level * .1f);
m_timer = m_interval * VL_GlobalConfigs.c_rogueTrickCharge;
hitCount++;
hitCount = Mathf.Clamp(hitCount, 0, maxHitCount);
}
m_ttl = hitCount;
m_time = 0;
base.UpdateStatusEffect(dt);
}
public override bool IsDone()
{
return ValheimLegends.vl_player.vl_class != ValheimLegends.PlayerClass.Rogue;
}
public override bool CanAdd(Character character)
{
return character.IsPlayer() && ValheimLegends.vl_player.vl_class == ValheimLegends.PlayerClass.Rogue;
}
}
}