-
Notifications
You must be signed in to change notification settings - Fork 2
/
LiveSplit.GhostlandYard.asl
57 lines (47 loc) · 1.46 KB
/
LiveSplit.GhostlandYard.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
state("Ghost Land Yard")
{
}
startup
{
Assembly.Load(File.ReadAllBytes("Components/asl-help")).CreateInstance("Unity");
vars.Helper.GameName = "Ghostland Yard";
vars.Helper.LoadSceneManager = true;
vars.Helper.AlertLoadless();
settings.Add("GLY", true, "Ghostland Yard");
settings.Add("ANY", true, "Splits after Each Completed Level", "GLY");
}
init
{
vars.Helper.TryLoad = (Func<dynamic, bool>)(mono =>
{
vars.Helper["SpeedrunTimer"] = mono.Make<float>("SceneParameters", "SpeedrunTimer");
vars.Helper["LevelEnded"] = mono.Make<bool>("LevelManager", "Instance", "levelEnded");
// vars.Helper["LevelNumber"] = mono.Make<int>("LevelManager", "Instance", "lvl");
// vars.Helper["WorldNumber"] = mono.Make<int>("LevelManager", "Instance", "World");
return true;
});
}
update
{
current.activeScene = vars.Helper.Scenes.Active.Name ?? old.activeScene;
current.loadingScene = vars.Helper.Scenes.Loaded[0].Name ?? old.loadingScene;
}
start
{
return current.SpeedrunTimer > 0.0f && old.SpeedrunTimer == 0.0f;
}
split
{
if(current.LevelEnded && current.LevelEnded != old.LevelEnded)
{
return settings["ANY"];
};
}
gameTime
{
return TimeSpan.FromSeconds(current.SpeedrunTimer);
}
reset
{
return current.SpeedrunTimer == 0.0f || current.activeScene == "Menu_RELEASE" && old.activeScene == "Menu_RELEASE";
}