Skill={}





function Skill.new(x,y,fichier,man,ame,m)
     local skill={x=x or 0,
	        y=y or 0,
			pic=Animation.new(fichier,6,0,0,96,16,2),
			etat=true,
			mana=man or 0,
			pts=pts or 0,
			ame=ame or 0,
			m=m or "1 nouvel objet !"}
			
	 function skill:destroy()
	     skill.etat= false
	 end
	 
	 function skill:add()
	     if skill.etat==true then
		     --sonperso:play()
		     GameCursor.mana=GameCursor.mana+skill.mana
			 GameCursor.ame=GameCursor.ame+skill.ame
		     skill:destroy()
			 GameCursor:message(skill.m)
		 end
	 end
	 
	 function skill:playItem()
         skill:blit()
	     if GamePlayer.x==skill.x and (GamePlayer.y+1)==skill.y then
		     skill:add()
		 end
	 end
	 
	 function skill:blit()
	     if skill.etat then
	         --screen:blit(skill.x*20,skill.y*20,skill.pic)
			 skill.pic:play(screen,GameMap.xr+skill.x*20,GameMap.yr+skill.y*20)
		 end
	 end
     
	 return skill
end
