-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSniperElite4.asl
102 lines (88 loc) · 2.51 KB
/
SniperElite4.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
// Gotta love .exe changes so you don't need an identifer
state("SniperElite4_DX11")
{
string16 map : 0xEB0BEB;
float loading1 : 0xCFCAF0;
byte loading : 0xBE1F37;
byte fades : 0xC1555B;
float islandload : 0xC15A90;
int endscene : 0xB67E60;
}
state("SniperElite4_DX12")
{
string16 map : 0xE5A2AB;
byte loading1 : 0xB669FC;
byte loading : 0xB2007F;
byte fades : 0xB65D4D;
float islandload : 0xB683E0;
int endscene : 0xAA5E98;
}
startup
{
settings.Add("missions", true, "Missions");
vars.missions = new Dictionary<string,string>
{
{"Marina", "Bianti Village"},
{"Viaduct", "Regilino Viaduct"},
{"Dockyard", "Lorino Dockyard"},
{"Monte_Cassino", "Abrunza Monastery"},
{"Coastal_Facility", "Magazzeno Facility"},
{"Forest", "Giovi Fiorini Mansion"},
{"Fortress", "Allagra Fortress"},
};
foreach (var Tag in vars.missions)
{
settings.Add(Tag.Key, true, Tag.Value, "missions");
};
vars.onStart = (EventHandler)((s, e) =>
{
vars.doneMaps.Clear();
});
timer.OnStart += vars.onStart;
if (timer.CurrentTimingMethod == TimingMethod.RealTime) // stolen from dude simulator 3, basically asks the runner to set their livesplit to game time
{
var timingMessage = MessageBox.Show (
"This game uses Time without Loads (Game Time) as the main timing method.\n"+
"LiveSplit is currently set to show Real Time (RTA).\n"+
"Would you like to set the timing method to Game Time? This will make verification easier",
"LiveSplit | Sniper Elite 4",
MessageBoxButtons.YesNo,MessageBoxIcon.Question
);
if (timingMessage == DialogResult.Yes)
{
timer.CurrentTimingMethod = TimingMethod.GameTime;
}
}
}
init
{
vars.doneMaps = new List<string>(); // You get kicked to the main menu, so adding this just in case
}
start
{
if ((current.map == "Island") && (current.loading != 1) && (current.loading1 != 0))
{
vars.doneMaps.Clear();
return true;
}
}
split
{
if ((current.map != old.map) && (settings[current.map]) && (!vars.doneMaps.Contains(current.map)) || ((current.endscene == 1)) && ((current.map == "Fortress")))
{
vars.doneMaps.Add(current.map);
return true;
}
}
reset
{
return ((current.map == "Island") && (old.map != "Island"));
}
isLoading
{
return ((current.loading == 1) || (current.fades == 1));
}
exit
{
timer.OnStart -= vars.onStart;
}