-
Notifications
You must be signed in to change notification settings - Fork 10
/
Earth2150.asl
225 lines (189 loc) · 6.14 KB
/
Earth2150.asl
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
//Earth 2150 Autosplitter + Load Remover by rythin
state("Earth2150") {
//name of the area the player is currently in
string30 areaName: 0x63D254, 0x58, 0x0C, 0x44, 0x0C;
//1 when in "freeroam" (able to start a mission), 0 otherwise
int freeroam: 0x5D0914;
//1 when on the mission-end stats screen and on fullscreen overlays (F1-3 buttons)
int overlay: 0x381454;
//1 on mission end screens, will sometimes flicker to 1 when starting a mission
int missionEnd: 0x5D08D4;
//1 when loading
int load: 0x5DB8F0;
//4 in (some)loads and in the menu
int menu: 0x345420;
//1 in the campaign-end cutscene
int fmv: 0x359F54;
}
startup {
//add settings groups
settings.Add("ED", true, "Eurasian Dynasty");
settings.Add("UCS", true, "United Civilized States");
settings.Add("LC", true, "Lunar Corporation");
//add settings for each mission
//since mission names repeat between campaigns, we add the campaign name as the prefix to the setting
vars.missionsLC = new Dictionary<string, string> {
{"LCUral", "Ural"},
{"LCArctic", "Arctic"},
{"LCHimalaya", "Himalaya"},
{"LCKamchatka", "Kamchatka"},
{"LCCanada", "Canada"},
{"LCBaikal", "Baikal"},
{"LCAmazon", "Amazon"},
{"LCThe Great Lakes", "The Great Lakes"},
{"LCMadagascar", "Madagascar"},
{"LCAustralia", "Australia"},
{"LCMozambique", "Mozambique"},
{"LCRio de Janeiro", "Rio de Janeiro"},
{"LCLesotho", "Lesotho"},
{"LCIndia", "India"},
{"LCEgypt", "Egypt"},
{"LCCongo", "Congo"},
{"LCPeru", "Peru"},
{"LCAmazon2", "Amazon 2"},
{"LCAndes", "Andes"},
{"ACME", "Split at the end of ACME Lab missions"}
};
foreach (var Tag in vars.missionsLC) {
settings.Add(Tag.Key, true, Tag.Value, "LC");
};
vars.missionsUCS = new Dictionary<string, string> {
{"UCSUral", "Ural"},
{"UCSArctic", "Arctic"},
{"UCSArctic II", "Arctic II"},
{"UCSBaikal", "Baikal"},
{"UCSAlaska", "Alaska"},
{"UCSJapan", "Japan"},
{"UCSKurtshatov FZ", "Kurtshatov FZ"},
{"UCSGreat Lakes", "Great Lakes"},
{"UCSNew York", "New York"},
{"UCSIndia", "India"},
{"UCSMadagascar", "Madagascar"},
{"UCSAustralia", "Australia"},
{"UCSEgypt", "Egypt"},
{"UCSMozambique", "Mozambique"},
{"UCSAndes", "Andes"},
{"UCSColumbia", "Columbia"},
{"UCSAchimania", "Achimania"},
{"UCSStanford Lab", "Split at the end of Stanford Lab missions"}
};
foreach (var Tag in vars.missionsUCS) {
settings.Add(Tag.Key, true, Tag.Value, "UCS");
};
vars.missionsED = new Dictionary<string, string> {
{"EDUral", "Ural"},
{"EDArctic", "Arctic"},
{"EDArctic 2", "Arctic 2"},
{"EDKamchatka", "Kamchatka"},
{"EDLeviathan", "Leviathan"},
{"EDAlaska", "Alaska"},
{"EDJapan", "Japan"},
{"EDCanada", "Canada"},
{"EDAmazon -N-", "Amazon -N-"},
{"EDGreat Lakes", "Great Lakes"},
{"EDNew York", "New York"}
};
foreach (var Tag in vars.missionsED) {
settings.Add(Tag.Key, true, Tag.Value, "ED");
};
//variable keeping track of the last played mission
vars.realMission = "";
//variable keeping track of progress in the campaign to use in lab splits
vars.currentProgress = 0;
//variable keeping track of the campaign being played at the moment
vars.campaign = "";
refreshRate = 30;
}
update {
if (current.areaName != old.areaName) {
//keeping track of the mission last played, since you can go to your Base mid-mission
//and also the value goes to null on stats screens
if (current.areaName != null && !current.areaName.Contains("Base")) {
vars.realMission = current.areaName;
print("realMission = " + vars.realMission);
}
//Ural happens to be the first mission of every campaign so we use it to reset the progress counter
if (current.areaName == "Ural") {
vars.currentProgress = 0;
}
}
//because in the LC campaign the mission Amazon happens twice, we need to keep track of
//when the player finished the first one and is on to the 2nd one
//so that the setting works
//since you have to complete The Great Lakes before you gain access to Amazon 2, we check if that mission
//has been completed, and if so, set the progress to 1
if (vars.realMission == "The Great Lakes" && vars.campaign == "LC") {
if (current.missionEnd == 1 && old.missionEnd == 0 && current.overlay == 1) {
vars.currentProgress = 1;
}
}
//at the beginning of each campaign you gain "freeroam" after some time spent in your base
//the base for each campaign has a unique name, allowing us to determine which campaign is being played
if (current.freeroam == 1 && old.freeroam == 0) {
string currentBase = current.areaName;
switch (currentBase) {
case "LC Base":
vars.campaign = "LC";
print("Campaign set to: " + vars.campaign);
break;
case "ED Base":
vars.campaign = "ED";
print("Campaign set to: " + vars.campaign);
break;
case "UCS Base":
vars.campaign = "UCS";
print("Campaign set to: " + vars.campaign);
break;
}
}
//debug stuff
//if (current.missionEnd != old.missionEnd) {
// print(old.missionEnd + " -> " + current.missionEnd + current.areaName);
//}
if (current.fmv == 1 && old.fmv == 0) {
print("FMV Started!");
}
//if (current.areaName != old.areaName) {
// print(old.areaName + " -> " + current.areaName);
//}
}
start {
if (current.menu == 0 && old.menu == 4) {
vars.realMission = "";
vars.campaign = "";
vars.currentProgress = 0;
return true;
}
}
split {
//regular mission splits
if (current.missionEnd == 1 && old.missionEnd == 0 && current.overlay == 1 || current.overlay == 1 && old.overlay == 0 && current.missionEnd == 1) {
if (settings[vars.campaign + vars.realMission]) {
return true;
}
}
//amazon2 split
if (settings["LCAmazon2"]) {
if (vars.realMission == "Amazon" && vars.currentProgress == 1) {
if (current.missionEnd == 1 && old.missionEnd == 0 && current.overlay == 1) {
return true;
}
}
}
//ACME Lab splits
if (vars.realMission == "ACME-Lab" || vars.realMission == "ACME-Laboratory") {
if (current.freeroam == 1 && old.freeroam == 0) {
if (settings["ACME"]) {
return true;
}
}
}
//campaign end splits
//i really hope this just works
if (current.fmv == 1 && old.fmv == 0) {
return true;
}
}
isLoading {
return (current.load == 1 || current.menu == 4);
}