import pygame as pg
class playable:
    class ulo:
        def __init__(self,player):
            self.hb = [pg.Rect(player["pos"][0] + 5, player["pos"][-1] + 100 ,50,  25)]
        UPP    = pg.image.load("./img/ulo/uloUPP.png")
        UP1    = pg.image.load("./img/ulo/uloUP1.png")  
        UP2    = pg.image.load("./img/ulo/uloUP2.png")
        RIGHTP = pg.image.load("./img/ulo/uloRIGHTP.png")
        RIGHT1 = pg.image.load("./img/ulo/uloRIGHT1.png")
        RIGHT2 = pg.image.load("./img/ulo/uloRIGHT2.png")
        LEFTP  = pg.image.load("./img/ulo/uloLEFTP.png")
        LEFT1  = pg.image.load("./img/ulo/uloLEFT1.png")
        LEFT2  = pg.image.load("./img/ulo/uloLEFT2.png")
        DOWNP  = pg.image.load("./img/ulo/uloDOWNP.png")
        DOWN1  = pg.image.load("./img/ulo/uloDOWN1.png")
        DOWN2  = pg.image.load("./img/ulo/uloDOWN2.png")
def npcmv(pos,lap,hb,idn):
    return "coll1("+str(pos)+","+str(lap)+",'["+str(["pg.R"+str(x)[2:-1] for x in hb])[2:-2]+"]',eval(\'maps.\'+player[\'maap\']+\'.hbmp\'),obon[0]+[x[0] for x in obon[3] if x[1] != \'"+idn[0]+"\']+chara.playable.ulo(player).hb)"
class npc:
    class test:
        name = "test"
        def __init__(self,x,y,idn=None,look=None):
            self.hb = [pg.Rect(x +5 , y + 100 , 50 , 25)]
            if idn != None:
                self.ib = [([pg.Rect(x , y + 95 , 60 , 35)],["UP","DOWN","LEFT","RIGHT"],self.action(idn))]
        actmx = 2
        def skn(look="DOWN",timer=0,stop=0):
            if stop:
                return pg.image.load("./img/ulo/ulo"+str(look)+"P.png")
            return pg.image.load("./img/ulo/ulo"+str(look)+["1","2"][int(timer%1//0.5)]+".png")
            
        def action(self,idn):
            return ["textbox(['test'])\ndidn('"+idn[0]+"',1)","textbox(['test1'])\ndidn('"+idn[0]+"',2)","textbox(['test2'])"][int(idn[1])]
        def mv(self,lap,pos,look,idn):
            return npcmv(pos,lap,self.hb,idn)
