-
Notifications
You must be signed in to change notification settings - Fork 13
/
streak.py
28 lines (21 loc) · 807 Bytes
/
streak.py
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
"""
streak.py
for those who don't want to bother with the (currently broken) airstrike script
but still want the refills it gives and an easy framework for adding more
complicated stuff
maintainer: topo
"""
STREAK_REQUIREMENT = 8
def apply_script(protocol, connection, config):
class StreakConnection(connection):
last_streak = None
def add_score(self, score):
connection.add_score(self, score)
if (self.streak % STREAK_REQUIREMENT == 0
and self.streak != self.last_streak):
self.refill()
self.last_streak = self.streak
def on_kill(self, killer, type, grenade):
self.last_streak = None
connection.on_kill(self, killer, type, grenade)
return protocol, StreakConnection