-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClass1.cs
More file actions
225 lines (213 loc) · 7.81 KB
/
Copy pathClass1.cs
File metadata and controls
225 lines (213 loc) · 7.81 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
using System;
using BepInEx;
using BepInEx.Configuration;
using RoR2;
namespace Bandito
{
[BepInDependency("com.bepis.r2api")]
//Change these
[BepInPlugin("com.OldFaithless.PersistentDesperado", "Persistent Desperado", "1.1.1")]
public class BanditInfiniteScaling : BaseUnityPlugin
{
public static ConfigEntry<double> StackValue { get; set; }
public void Awake()
{
StackValue = Config.Bind<double>(
"Bandit",
"StackBonus",
0.02,
"The percentage damage increase per stack of Desperado, expressed as a decimal (0.02f is equivalent to 2% per stack)."
);
On.EntityStates.Bandit2.Weapon.FireSidearmSkullRevolver.ModifyBullet += (orig, self, bulletAttack) =>
{
float baseDamage = bulletAttack.damage;
orig(self, bulletAttack);
float stackBonus = (float)((bulletAttack.damage - baseDamage) * (StackValue.Value / 0.1));
bulletAttack.damage = baseDamage + stackBonus;
};
On.RoR2.PreGameController.StartRun += (orig, self) =>
{
BanditName1 = "";
BanditName2 = "";
BanditName3 = "";
BanditName4 = "";
BanditName5 = "";
BanditName6 = "";
BanditName7 = "";
BanditName8 = "";
BanditCount1 = 0;
BanditCount2 = 0;
BanditCount3 = 0;
BanditCount4 = 0;
BanditCount5 = 0;
BanditCount6 = 0;
BanditCount7 = 0;
BanditCount8 = 0;
orig(self);
};
On.RoR2.CharacterBody.RecalculateStats += (orig, self) =>
{
bool flag = self.isPlayerControlled && self.teamComponent.teamIndex == TeamIndex.Player;
bool flag2 = flag;
if (flag2)
{
String myBanditName = self.GetUserName();
int banditLoc11 = FindName(myBanditName);
//Logger.LogMessage("banditloc is " + banditLoc11);
//if (banditLoc11 == -1)
//{
// BanditNames.Add(myName);
// BanditCounts.Add(self.GetBuffCount(RoR2Content.Buffs.BanditSkull));
// banditLoc11 = BanditNames.IndexOf(myName);
// Logger.LogMessage("Added " + myName);
//}
int numCoins = GetCount(banditLoc11);
bool needCoins = self.GetBuffCount(RoR2Content.Buffs.BanditSkull) < numCoins;
if (needCoins)
{
int buffCount = self.GetBuffCount(RoR2Content.Buffs.BanditSkull);
for (int i = 0; i < numCoins - buffCount; i++)
{
self.AddBuff(RoR2Content.Buffs.BanditSkull);
//Logger.LogMessage(" aka " + myBanditName + "filled coin -- banditloc " + banditLoc11);
}
}
bool coinsUp = self.GetBuffCount(RoR2Content.Buffs.BanditSkull) > numCoins;
if (coinsUp)
{
//Logger.LogMessage(" aka " + myBanditName + "get coin -- banditloc " + banditLoc11);
if (banditLoc11 == 1)
{
BanditCount1 = self.GetBuffCount(RoR2Content.Buffs.BanditSkull);
}
if (banditLoc11 == 2)
{
BanditCount2 = self.GetBuffCount(RoR2Content.Buffs.BanditSkull);
}
if (banditLoc11 == 3)
{
BanditCount3 = self.GetBuffCount(RoR2Content.Buffs.BanditSkull);
}
if (banditLoc11 == 4)
{
BanditCount4 = self.GetBuffCount(RoR2Content.Buffs.BanditSkull);
}
if (banditLoc11 == 5)
{
BanditCount5 = self.GetBuffCount(RoR2Content.Buffs.BanditSkull);
}
if (banditLoc11 == 6)
{
BanditCount6 = self.GetBuffCount(RoR2Content.Buffs.BanditSkull);
}
if (banditLoc11 == 7)
{
BanditCount7 = self.GetBuffCount(RoR2Content.Buffs.BanditSkull);
}
if (banditLoc11 == 8)
{
BanditCount8 = self.GetBuffCount(RoR2Content.Buffs.BanditSkull);
}
}
}
orig(self);
};
}
public int FindName(string bName)
{
if (bName == BanditName1 || BanditName1 == "")
{
BanditName1 = bName;
return 1;
}
if (bName == BanditName2 || BanditName2 == "")
{
BanditName2 = bName;
return 2;
}
if (bName == BanditName3 || BanditName3 == "")
{
BanditName3 = bName;
return 3;
}
if (bName == BanditName4 || BanditName4 == "")
{
BanditName4 = bName;
return 4;
}
if (bName == BanditName5 || BanditName5 == "")
{
BanditName5 = bName;
return 5;
}
if (bName == BanditName6 || BanditName6 == "")
{
BanditName6 = bName;
return 6;
}
if (bName == BanditName7 || BanditName7 == "")
{
BanditName7 = bName;
return 7;
}
if (bName == BanditName8 || BanditName8 == "")
{
BanditName8 = bName;
return 8;
}
return -1;
}
public int GetCount(int num)
{
if (num == 1)
{
return BanditCount1;
}
if (num == 2)
{
return BanditCount2;
}
if (num == 3)
{
return BanditCount3;
}
if (num == 4)
{
return BanditCount4;
}
if (num == 5)
{
return BanditCount5;
}
if (num == 6)
{
return BanditCount6;
}
if (num == 7)
{
return BanditCount7;
}
if (num == 8)
{
return BanditCount8;
}
return -1;
}
public string BanditName1;
public string BanditName2;
public string BanditName3;
public string BanditName4;
public string BanditName5;
public string BanditName6;
public string BanditName7;
public string BanditName8;
public int BanditCount1;
public int BanditCount2;
public int BanditCount3;
public int BanditCount4;
public int BanditCount5;
public int BanditCount6;
public int BanditCount7;
public int BanditCount8;
}
}