-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpearmasterSpearShotMain.cs
82 lines (64 loc) · 2.16 KB
/
SpearmasterSpearShotMain.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using BepInEx;
using MoreSlugcats;
using UnityEngine;
using System.Security.Permissions;
using System.Drawing;
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
namespace Spearmaster_Spear_Shot
{
[BepInPlugin(PLUGIN_GUID, PLUGIN_NAME, PLUGIN_VERSION)]
public class SpearmasterSpearShotMain : BaseUnityPlugin
{
public const string PLUGIN_GUID = "sm_spear_shot";
public const string PLUGIN_NAME = "Spearmaster Spear Shot";
public const string PLUGIN_VERSION = "0.1";
private KeyCode abilityKey = KeyCode.RightControl;
private float lastTapTime = 0.6f;
private const float DOUBLETAP_THRESHOLD = 0.5f;
private void OnEnable()
{
On.Player.Update += TakeCustomInput;
}
private void TakeCustomInput(On.Player.orig_Update orig, Player self, bool eu)
{
orig(self, eu);
if (ModManager.MSC && self.SlugCatClass == MoreSlugcatsEnums.SlugcatStatsName.Spear) {
if (Input.GetKeyDown(abilityKey))
{
if (Time.captureDeltaTime - lastTapTime < DOUBLETAP_THRESHOLD)
{
if (Input.GetKey(abilityKey))
{
PlayerGraphics.TailSpeckles tailspecks = (self.graphicsModule as PlayerGraphics).tailSpecks;
GrowSpears(tailspecks);
}
}
lastTapTime = Time.captureDeltaTime;
}
}
}
private bool tapPressed(Player self, int n)
{
if (n < 9)
{
for (int i = n; i < 10; i++)
{
if (self.input[i].pckp)
{
return true;
}
}
}
return false;
}
private void GrowSpears(PlayerGraphics.TailSpeckles speckles)
{
}
private void SpawnSpears()
{
}
private void fireSpears()
{
}
}
}