-
Notifications
You must be signed in to change notification settings - Fork 0
/
CoinAdder.cs
78 lines (70 loc) · 2.65 KB
/
CoinAdder.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
using ProjectT;
namespace CoinPlugin
{
public static class CoinAdder
{
public static CoinGainConfig Config = new CoinGainConfig();
public static void Bithandler(Viewer viewer, int bits)
{
if (bits > 0)
{
if (Config.CoinsPerBits > 0)
{
double coins = bits * Config.CoinsPerBits;
if (Config.globalBits)
{
foreach (var item in Viewermanager.getCurrentViewers())
{
Calls.addcoins(item, coins);
}
Calls.sendmessage("Thanks to " + viewer.Name + " for cheering " + bits + " Bits! You receive " + coins * 2 + " Coins and everyone else gets " + coins + " Coins too!");
}
else
{
//Calls.sendmessage("Thanks to " + viewer.Name + " for donating " + bits + "! You receive " + coins);
Calls.sendmessage("Thank you " + viewer.Name + " for cheering " + bits + " Bits! You have received " + coins + " Coins");
}
Calls.addcoins(viewer, coins);
}
}
}
public static void Subhandler(Viewer viewer, string tier)
{
double coins = 0;
switch(tier)
{
case "Prime":
coins = Config.CoinsPerPrime;
break;
case "Tier1":
coins = Config.CoinsPerT1;
break;
case "Tier2":
coins = Config.CoinsPerT2;
break;
case "Tier3":
coins = Config.CoinsPerT3;
break;
default:
coins = 0;
break;
}
if(coins > 0)
{
if(Config.globalSubs)
{
foreach(var item in Viewermanager.getCurrentViewers())
{
Calls.addcoins(item, coins);
}
Calls.sendmessage("Thanks to " + viewer.Name + " for subscribing with " + tier + "! You receive " + coins * 2 + " Coins and everyone else gets " + coins + " Coins too!");
}
else
{
Calls.sendmessage("Thanks to " + viewer.Name + " for subscribing with " + tier + "! You receive " + coins + " Coins!");
}
Calls.addcoins(viewer, coins);
}
}
}
}