예제 #1
0
파일: GameManager.py 프로젝트: kks227/SP
	def initEnemyData(self):
		cnt = 0
		# get root node
		root = parse("Enemy.xml").getroot()
		for tag in root.getiterator("enemy"):
			# get name especially
			name = tag.find("name").text
			stamp = Enemy(0, 0, name)

			# get data
			stamp.eid = cnt
			stamp.lv = int(tag.find("lv").text)
			stamp.sort = tag.find("sort").text # species(machine, ghost, animal, ...)
			#stamp.type
			stamp.boss = bool(int(tag.find("boss").text))
			stamp.move = int(tag.find("move").text)
			stamp.maxHP = stamp.HP = int(tag.find("hp").text)
			stamp.maxMP = stamp.MP = int(tag.find("mp").text)
			stamp.ATK = int(tag.find("atk").text)
			stamp.DEF = int(tag.find("def").text)
			stamp.MATK = int(tag.find("matk").text)
			stamp.MDEF = int(tag.find("mdef").text)
			stamp.SPD = int(tag.find("speed").text)
			stamp.JMP = int(tag.find("jump").text)
			stamp.KB = int(tag.find("kb").text)
			stamp.EXP = int(tag.find("exp").text)
			stamp.GOLD = int(tag.find("gold").text)
			#stamp.drop
			stamp.imgFrame = int(tag.find("imgframe").text)
			stamp.rect.size = (int(tag.find("width").text), int(tag.find("height").text))
			#stamp.skill

			# append to list and dict
			self.enemyStamp.append(stamp)
			self.enemyId[name] = cnt
			cnt += 1