-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAegis.py
More file actions
26 lines (22 loc) · 832 Bytes
/
Aegis.py
File metadata and controls
26 lines (22 loc) · 832 Bytes
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
#!/usr/bin/python
import ParserBase
# This class implements the parser #
# for Aegis-style warp scripts. #
# Stupid Gravity and their stupid #
# script format. Stupid. #
class Parser(ParserBase.ParserBase):
def warp_parse(self,lines):
inwarp = 0
for line in lines:
if len(line) == 0 or line[0] == '/': continue
line = line.lstrip().rstrip().split(' ')
if inwarp and line[0] == 'moveto':
dst = src + [line[1].replace('"',''),line[2],line[3]]
self.warps.append(' '.join(dst))
inwarp = 0
elif not inwarp and line[0] == 'warp':
src = [line[1].replace('"',''),line[-4],line[-3]]
inwarp = 1
else:
continue
self.warpAmt = len(self.warps)