-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConDrugAbuse.cs
76 lines (66 loc) · 1.78 KB
/
ConDrugAbuse.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
using Drugs;
class ConDrugAbuse : BadCondition
{
public override bool CanManualRemove => false;
public override string GetText() => "Withdrawal".lang();
public override void Tick()
{
base.Tick();
GetWithdrawalEffect();
}
public void GetWithdrawalEffect()
{
int typeRoll = EClass.rnd(101);
if (typeRoll <= 90)
{
}
else if (typeRoll <= 98)
{
int msgnum = EClass.rnd(3) + 1;
Msg.SetColor(Msg.colors.Negative);
Msg.Say($"withdrawal_badeffect{msgnum}".lang());
GetBadEffect();
}
else
{
GetGoodEffect();
}
}
private void GetBadEffect()
{
int badEffectRoll = EClass.rnd(101);
if (badEffectRoll <= 50)
{
// a bad effect
owner.AddCondition<ConConfuse>();
}
else if (badEffectRoll <= 80)
{
// a very bad effect
owner.AddCondition<ConParalyze>();
}
else
{
//a very unfortunate bad effect
owner.AddCondition<ConInsane>();
}
}
private void GetGoodEffect()
{
int goodEffectRoll = EClass.rnd(101); // 1 to 100
if (goodEffectRoll <= 70)
{
//effect
Msg.SetColor(Msg.colors.Ono);
Msg.Say($"withdrawal_goodeffect2".lang());
owner.sleepiness.Mod(owner.HasElement(69420) ? owner.elements.GetElement(69420).vBase * -5 : -5);
}
else
{
//effect
Msg.SetColor(Msg.colors.Ono);
Msg.Say($"withdrawal_goodeffect1".lang());
owner.stamina.Mod(owner.HasElement(69420) ? owner.elements.GetElement(69420).vBase * 5 : 5);
}
}
}