Fixup failed enemy type conversions

--8<--
#!/usr/bin/env python

import sys
import os
import random

from lxml import etree

def replaceEnemyType(xmlroot, name, newname, filename):
	for obj in xmlroot.iterchildren(tag="objectgroup"):
		if obj.get('name') == 'enemy':
			for enemy in obj:
				t = enemy.get('type')
				if t == None:
					print "No enemy type set in ", filename
					raise
				if t == name:
					enemy.set('type', newname)
					t = enemy.get('type')
	return xmlroot

def getXMLRoot(filename):
	f = open(filename)
	lines = f.read()
	f.close()
	root = etree.fromstring(lines)
	return root

def writeXML(filename, root):
	f=open(filename, 'w')
	f.write(etree.tostring(root, pretty_print=True, xml_declaration=True, encoding='utf-8'))
	f.close()

def processMap(filename):
	root = getXMLRoot(filename)
	for enemyRepl in enemyReplacements:
		root = replaceEnemyType(root, enemyRepl[0], enemyRepl[1], filename)
	writeXML(filename, root)

enemyReplacements=[
("enemies/scathelocke", "enemies/scathelocke.txt"),
("enemies/antlion_burster", "enemies/antlion_burster.txt"),
("enemies/zombie_brute", "enemies/zombie_brute.txt"),
("enemies/antlion_spitter", "enemies/antlion_spitter.txt"),
("enemies/zombie_iceclaw", "enemies/zombie_iceclaw.txt"),
("enemies/antlion_blinker", "enemies/antlion_blinker.txt"),
];

lines = open("maps.txt").readlines()
for map in lines:
	processMap(map.strip())
Resave txt maps
Merge branch 'master' of https://github.com/stefanbeller/flare-game into testing

Conflicts:
	mods/alpha_demo/maps/averguard_complex.txt
	mods/alpha_demo/maps/averguard_prison.txt
	mods/alpha_demo/maps/averguard_temple.txt
	mods/alpha_demo/maps/brothers_lair_sacrifice_room.txt
	mods/alpha_demo/maps/cave1.txt
	mods/alpha_demo/maps/frontier_plains.txt
	mods/alpha_demo/maps/lost_mines1.txt
Update spawn for maps and spawn_type for powers
Merge pull request #417 from dorkster/enemy_type

Update usage of enemy type to file names