Upgrade commented death animations with comments.

This commit is contained in:
Eric S. Raymond 2007-10-25 18:13:49 +00:00
parent 981477720c
commit cfbe4cae8b

View file

@ -914,27 +914,35 @@ def hack_syntax(filename, lines):
# Boucmanize death animations
if future:
in_death = None
frame_commented = in_death_commented = False
frame_start = frame_end = None
for i in range(len(lines)):
if "no-syntax-rewrite" in lines[i]:
break
elif "[death]" in lines[i]:
in_death = i
in_death_commented = lines[i].strip().startswith("#")
elif "[/death]" in lines[i]:
if frame_start is None:
print >>sys.stderr, '"%s", %d: [death] with no frames' % (filename, i)
continue
lines[i] = lines[i].replace("death", "animation")
inner = leader(lines[in_death])+baseindent
if in_death_commented:
inner = "#" + inner
lines[in_death] = lines[in_death].replace("death", "animation") \
+ leader(lines[in_death])+baseindent \
+ "apply_to=death" + "\n"
+ inner + "apply_to=death" + "\n"
inner = leader(lines[frame_start]) + baseindent
if frame_commented:
inner = "#" + inner
lines[frame_start] += inner+"duration=600\n"+inner+"alpha=1~0\n"
#print "Last frame: %d %d %d" % (in_death, frame_start, frame_end)
in_death = frame_start = frame_end = None
frame_commented = in_death_commented = False
modcount += 1
elif in_death and "[frame]" in lines[i]:
frame_start = i
frame_commented = lines[i].strip().startswith("#")
elif in_death and "[/frame]" in lines[i]:
frame_end = i
# Check for duplicated attack names -- may be a result of a naive