Skip to content

Commit 2e3c301

Browse files
committed
Add slurpees
1 parent dfa5b55 commit 2e3c301

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

BuffStack/PlayerPatch.cs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,27 @@ public IEnumerable<Token> Modify(string path, IEnumerable<Token> tokens)
4444
t => t.Type is TokenType.OpAssign
4545
]);
4646

47+
// "speed":
48+
// boost_timer =
49+
var speedMatch = new MultiTokenWaiter([
50+
t => t is ConstantToken { Value: StringVariant { Value: "speed" } },
51+
t => t.Type is TokenType.Colon,
52+
t => t.Type is TokenType.Newline,
53+
t => t is IdentifierToken { Name: "boost_timer" },
54+
t => t.Type is TokenType.OpAssign
55+
]);
56+
57+
// "speed_burst":
58+
// boost_timer =
59+
var speedBurstMatch = new MultiTokenWaiter([
60+
t => t is ConstantToken { Value: StringVariant { Value: "speed_burst" } },
61+
t => t.Type is TokenType.Colon,
62+
t => t.Type is TokenType.Newline,
63+
t => t is IdentifierToken { Name: "boost_timer" },
64+
t => t.Type is TokenType.OpAssign
65+
]);
66+
67+
4768
var newlineConsumer = new TokenConsumer(t => t.Type is TokenType.Newline);
4869

4970
foreach (var token in tokens)
@@ -95,6 +116,30 @@ public IEnumerable<Token> Modify(string path, IEnumerable<Token> tokens)
95116
// Consume the "disabled or refreshing" and wait until newline
96117
newlineConsumer.SetReady();
97118
}
119+
else if (speedMatch.Check(token))
120+
{
121+
yield return token;
122+
yield return new IdentifierToken("boost_timer");
123+
yield return new Token(TokenType.OpAdd);
124+
yield return new ConstantToken(new IntVariant(18000));
125+
126+
// Reset since this matches multiple times
127+
catchDeluxeMatch.Reset();
128+
// Consume the "disabled or refreshing" and wait until newline
129+
newlineConsumer.SetReady();
130+
}
131+
else if (speedBurstMatch.Check(token))
132+
{
133+
yield return token;
134+
yield return new IdentifierToken("boost_timer");
135+
yield return new Token(TokenType.OpAdd);
136+
yield return new ConstantToken(new IntVariant(900));
137+
138+
// Reset since this matches multiple times
139+
catchDeluxeMatch.Reset();
140+
// Consume the "disabled or refreshing" and wait until newline
141+
newlineConsumer.SetReady();
142+
}
98143
else
99144
{
100145
yield return token;

0 commit comments

Comments
 (0)