Exemple #1
0
	def __init__(self, xy, wh, health, attackArea=2000):
		LivingEntity.__init__(self, xy, wh, (0,255,0), health)

		self.attackArea = Sprite((0,0), (attackArea, attackArea))
		#print(self.attackArea)
		self.updateAttackArea()

		globs.currentgame.monsters.add(self)

		self.maxhealth = 100
		self.health = self.maxhealth
		self.lasthealth = None
		self.owner = None
		self.hitted = []

		self.attacking = None

		# Initialize healthbar
		self.healthbar = Entity((0,0), (self.image.get_width(), 5), add=False)
Exemple #2
0
	def __init__(self, xy, add, appearance=None, equipment=None):
		print(weapons)
		health = 50
		LivingEntity.__init__(self, xy, (40,90), health, add=add)

		if not equipment:
			equipment = {
						 'Head': None,
						 'Chest': None,
						 'Legs': None,
						 'Feet': None,
						 'Mainhand': None,
						 'Offhand': None
						}
		self.set_equipment(equipment)
		if not appearance:
			# Default appearance
			appearance = { 'hairstyle': "hair1", 'haircolor': (160,100,80), 'eyecolor': (0,0,0) }
		self.set_appearance(**appearance)
		self.facing = "left"
		self.draw_body()