-
Notifications
You must be signed in to change notification settings - Fork 10
/
Pulstario.asl
55 lines (44 loc) · 1.76 KB
/
Pulstario.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
state("Pulstario") {
int roomID: 0x6C2DB8;
double frameCount: 0x4B2780, 0x2C, 0x10, 0x4E0, 0x1D0;
double deathCount: 0x4B2780, 0x2C, 0x10, 0x0, 0x120;
}
startup {
settings.Add("deathDisp", false, "Display death count");
//display thing yoinked from the Defy Gravity autosplitter
vars.SetTextComponent = (Action<string, string>)((id, text) =>
{
var textSettings = timer.Layout.Components.Where(x => x.GetType().Name == "TextComponent").Select(x => x.GetType().GetProperty("Settings").GetValue(x, null));
var textSetting = textSettings.FirstOrDefault(x => (x.GetType().GetProperty("Text1").GetValue(x, null) as string) == id);
if (textSetting == null)
{
var textComponentAssembly = Assembly.LoadFrom("Components\\LiveSplit.Text.dll");
var textComponent = Activator.CreateInstance(textComponentAssembly.GetType("LiveSplit.UI.Components.TextComponent"), timer);
timer.Layout.LayoutComponents.Add(new LiveSplit.UI.Components.LayoutComponent("LiveSplit.Text.dll", textComponent as LiveSplit.UI.Components.IComponent));
textSetting = textComponent.GetType().GetProperty("Settings", BindingFlags.Instance | BindingFlags.Public).GetValue(textComponent, null);
textSetting.GetType().GetProperty("Text1").SetValue(textSetting, id);
}
if (textSetting != null)
textSetting.GetType().GetProperty("Text2").SetValue(textSetting, text);
});
}
update {
if (settings["deathDisp"] == true) {
vars.SetTextComponent("Deaths", (current.deathCount).ToString());
}
}
start {
return (old.roomID != 2 && current.roomID == 2);
}
split {
return (current.roomID != old.roomID && old.roomID != 25 && current.roomID != 1);
}
reset {
return (current.roomID == 1 && old.roomID != 1);
}
isLoading {
return true;
}
gameTime {
return TimeSpan.FromSeconds(current.frameCount / 60);
}