-
Notifications
You must be signed in to change notification settings - Fork 1
/
LiveSplit.Rayman2.asl
71 lines (61 loc) · 2.11 KB
/
LiveSplit.Rayman2.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
state("Rayman2")
{
string8 levelID : "Rayman2.exe", 0x10039F;
float posX : "Rayman2.exe", 0x100578, 0x4, 0x0, 0x1C;
float posY : "Rayman2.exe", 0x100578, 0x4, 0x0, 0x20;
float posZ : "Rayman2.exe", 0x100578, 0x4, 0x0, 0x24;
byte finalBossHealth : "Rayman2.exe", 0x102D64, 0xE4, 0x0, 0x4, 0x741;
bool isLoading : "Rayman2.exe", 0x11663C;
uint customBits : "Rayman2.exe", 0x100578, 0x4, 0x4, 0x24;
}
init
{
vars.scanForBossHealth = false;
vars.inControl = false;
vars.inControlTimer = 0;
}
update
{
if (!vars.scanForBossHealth && current.levelID.ToLower() == "rhop_10" && current.finalBossHealth == 24)
vars.scanForBossHealth = true;
if (current.isLoading) {
vars.levelTimer = 0;
vars.inControlTimer = 0;
}
vars.inControl = ((current.customBits&0x10000) == 0);
vars.inControlTimer++;
if (!vars.inControl) {
vars.inControlTimer = 0;
}
//print("levelID: " + current.levelID);
//print("posX: " + current.posX);
//print("posY: " + current.posY);
//print("finalbossHealth: " + current.finalBossHealth);
//print("scanForBossHealth: " + vars.scanForBossHealth);
}
start
{
if (current.levelID.ToLower() == "jail_20" && old.levelID.ToLower() == "jail_20" && !old.isLoading && !current.isLoading && vars.inControlTimer>5 &&
(Math.Abs(current.posX - old.posX) > 0.01 || Math.Abs(current.posY - old.posY) > 0.01 || Math.Abs(current.posZ - old.posZ) > 0.01))
return true; // X/Y/Z position changed
}
reset
{
return current.levelID.ToLower() == "jail_10" &&
old.levelID.ToLower() != "jail_10";
}
isLoading
{
return current.isLoading;
}
split
{
if (current.levelID.ToLower() == "mapmonde" && old.levelID.ToLower() != "mapmonde" && old.levelID.ToLower() != "menu")
return true; // map screen entered
if (vars.scanForBossHealth && current.levelID.ToLower() == "rhop_10" && current.finalBossHealth == 0)
{
vars.scanForBossHealth = false;
return true; // final boss health 0
}
return false;
}