-
Notifications
You must be signed in to change notification settings - Fork 0
/
KitchenConfig.cs
81 lines (52 loc) · 2.18 KB
/
KitchenConfig.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
namespace TerrariaKitchen
{
public partial class KitchenConfig
{
public class KitchenEntry
{
public string MobName { get; set; }
public int InternalName { get; set; }
public List<string> MobAlias { get; set; }
public int Price { get; set; }
public int MaxBuys { get; set; }
public bool NoDay { get; set; }
public bool NoNight { get; set; }
public bool PriorityUnderground { get; set; }
public bool Pooling { get; set; }
}
public List<KitchenEntry> Entries { get; set; } = new List<KitchenEntry>();
public List<KitchenEvent> Events { get; set; } = new List<KitchenEvent>();
public int StartingMoney { get; set; } = 500;
public int Income { get; set; } = 10;
public int IncomeInterval { get; set; } = 60;
public int PlayerDeathIncome { get; set; } = 0;
public float PlayerDeathCreditRefund { get; set; } = 0f;
public string? SafeSpawnZoneName { get; set; }
public int MaxBalance { get; set; } = 5000;
public float SubscriberPriceMultiplier { get; set; } = 1;
public bool ModAbuse { get; set; } = false;
public int? XRange { get; set; }
public int? YRange { get; set; }
public int OverlayPort { get; set; } = 7770;
public int OverlayWsPort { get; set; } = 7771;
public KitchenEntry? FindEntry(string mobName)
{
var mob = Entries.FirstOrDefault(e => e.MobName == mobName);
if (mob == null)
{
mob = Entries.Where(e => e.MobAlias != null && e.MobAlias.Count > 0).FirstOrDefault(e => e.MobAlias.Contains(mobName) == true);
}
return mob;
}
public KitchenEvent? FindEvent(string eventName)
{
var kEvent = Events.FirstOrDefault(e => e.EventName == eventName);
if (kEvent == null)
{
kEvent = Events.Where(e => e.EventAlias != null && e.EventAlias.Count > 0).FirstOrDefault(e => e.EventAlias.Contains(eventName) == true);
}
return kEvent;
}
}
}