-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOVT_ServerAdminTools_BaseCapturedEvent.c
More file actions
51 lines (39 loc) · 1.31 KB
/
OVT_ServerAdminTools_BaseCapturedEvent.c
File metadata and controls
51 lines (39 loc) · 1.31 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
[BaseContainerProps()]
class OVT_ServerAdminTools_BaseCapturedEvent: ServerAdminTools_EventsApiEvent {
string name = "overthrow_basecaptured";
string title = "Base Captured";
override string GetEventName() {
return name;
};
override void Initialize(ServerAdminTools_GamemodeComponent gamemodeComponent) {
super.Initialize(gamemodeComponent);
OVT_OccupyingFactionManager of = OVT_Global.GetOccupyingFaction();
of.m_OnBaseControlChanged.Insert(Event);
};
void Event(OVT_BaseControllerComponent base) {
OVT_ServerAdminTools_BaseCapturedEventData newEvent = new OVT_ServerAdminTools_BaseCapturedEventData();
OVT_BaseData data = base.GetData();
string townName = OVT_Global.GetTowns().GetTownName(data.location);
newEvent.name = townName + " Base";
string factionKey = OVT_Global.GetFactions().GetFactionByIndex(data.faction).GetFactionKey();
if(factionKey == "FIA")
{
newEvent.faction = "Resistance";
}else{
newEvent.faction = factionKey;
}
ServerAdminTools.PublishEvent(name, title, newEvent);
};
};
class OVT_ServerAdminTools_BaseCapturedEventData : ServerAdminTools_EventData {
string name;
string faction;
void OVT_ServerAdminTools_BaseCapturedEventData() {
RegV("name");
RegV("faction");
};
override string Repr()
{
return name + " captured by " + faction;
}
}