@njit(fastmath=True)
def agents(enx, eny, maph, posx, posy, rot, et, shoot, sx, sy, sdir, mplayer, seenx, seeny, lock):
    if (enx != 0):
        if ((not lock) or (np.random.uniform(0, 1) > 0.99)):
            dtp = np.sqrt((((enx - posx) ** 2) + ((eny - posy) ** 2)))
            (cos, sin) = (((posx - enx) / dtp), ((posy - eny) / dtp))
            (x, y) = (enx, eny)
            for i in range(300):
                x += (0.04 * cos)
                y += (0.04 * sin)
                if (maph[int(x)][int(y)] != 0):
                    lock = 0
                    break
                if ((int(x) == int(posx)) and (int(y) == int(posy))):
                    (seenx, seeny) = (posx, posy)
                    lock = 1
                    break
        if ((int(enx) == int(seenx)) and (int(eny) == int(seeny))):
            if (not lock):
                if shoot:
                    (seenx, seeny) = (np.random.uniform(enx, posx), np.random.uniform(eny, posy))
                else:
                    (seenx, seeny) = (np.random.normal(enx, 2), np.random.normal(eny, 2))
            else:
                (seenx, seeny) = (np.random.normal(posx, 2), np.random.normal(posy, 2))
        dtp = np.sqrt((((enx - seenx) ** 2) + ((eny - seeny) ** 2)))
        (cos, sin) = (((seenx - enx) / dtp), ((seeny - eny) / dtp))
        (x, y) = ((enx + (et * (cos + np.random.normal(0, 0.5)))), (eny + (et * (sin + np.random.normal(0, 0.5)))))
        if (maph[int(x)][int(y)] == 0):
            (enx, eny) = (x, y)
        else:
            if (np.random.uniform(0, 1) > 0.5):
                (x, y) = ((enx - (et * (sin + np.random.normal(0, 0.5)))), (eny + (et * (cos + np.random.normal(0, 0.5)))))
            else:
                (x, y) = ((enx + (et * (sin + np.random.normal(0, 0.5)))), (eny - (et * (cos + np.random.normal(0, 0.5)))))
            if (maph[int(x)][int(y)] == 0):
                (enx, eny) = (x, y)
            else:
                (seenx, seeny) = ((enx + np.random.normal(0, 3)), (eny + np.random.normal(0, 3)))
                lock = 0
        mplayer[int(enx)][int(eny)] = 3
    mplayer[int(posx)][int(posy)] = 2
    if shoot:
        if (sx == (- 1)):
            sdir = (rot + np.random.uniform((- 0.1), 0.1))
            (sx, sy) = ((posx + (0.5 * np.cos(sdir))), (posy + (0.5 * np.sin(sdir))))
        (sx, sy) = ((sx + ((5 * et) * np.cos(sdir))), (sy + ((5 * et) * np.sin(sdir))))
        if ((enx != 0) and ((((sx - enx) ** 2) + ((sy - eny) ** 2)) < 0.02)):
            (shoot, sx, sy, enx, eny, seenx, seeny) = (0, (- 1), (- 1), 0, 0, 0, 0)
        if (maph[int(sx)][int(sy)] != 0):
            (shoot, sx, sy) = (0, (- 1), (- 1))
        else:
            mplayer[int(sx)][int(sy)] += 6
    mplayer = (maph + mplayer)
    return (enx, eny, mplayer, et, shoot, sx, sy, sdir, seenx, seeny, lock)
@njit(fastmath=True)
def agents(enx, eny, maph, posx, posy, rot, et, shoot, sx, sy, sdir, mplayer, seenx, seeny, lock):
    if (enx != 0):
        if ((not lock) or (np.random.uniform(0, 1) > 0.99)):
            dtp = np.sqrt((((enx - posx) ** 2) + ((eny - posy) ** 2)))
            (cos, sin) = (((posx - enx) / dtp), ((posy - eny) / dtp))
            (x, y) = (enx, eny)
            for i in range(300):
                x += (0.04 * cos)
                y += (0.04 * sin)
                if (maph[int(x)][int(y)] != 0):
                    lock = 0
                    break
                if ((int(x) == int(posx)) and (int(y) == int(posy))):
                    (seenx, seeny) = (posx, posy)
                    lock = 1
                    break
        if ((int(enx) == int(seenx)) and (int(eny) == int(seeny))):
            if (not lock):
                if shoot:
                    (seenx, seeny) = (np.random.uniform(enx, posx), np.random.uniform(eny, posy))
                else:
                    (seenx, seeny) = (np.random.normal(enx, 2), np.random.normal(eny, 2))
            else:
                (seenx, seeny) = (np.random.normal(posx, 2), np.random.normal(posy, 2))
        dtp = np.sqrt((((enx - seenx) ** 2) + ((eny - seeny) ** 2)))
        (cos, sin) = (((seenx - enx) / dtp), ((seeny - eny) / dtp))
        (x, y) = ((enx + (et * (cos + np.random.normal(0, 0.5)))), (eny + (et * (sin + np.random.normal(0, 0.5)))))
        if (maph[int(x)][int(y)] == 0):
            (enx, eny) = (x, y)
        else:
            if (np.random.uniform(0, 1) > 0.5):
                (x, y) = ((enx - (et * (sin + np.random.normal(0, 0.5)))), (eny + (et * (cos + np.random.normal(0, 0.5)))))
            else:
                (x, y) = ((enx + (et * (sin + np.random.normal(0, 0.5)))), (eny - (et * (cos + np.random.normal(0, 0.5)))))
            if (maph[int(x)][int(y)] == 0):
                (enx, eny) = (x, y)
            else:
                (seenx, seeny) = ((enx + np.random.normal(0, 3)), (eny + np.random.normal(0, 3)))
                lock = 0
        mplayer[int(enx)][int(eny)] = 3
    mplayer[int(posx)][int(posy)] = 2
    if shoot:
        if (sx == (- 1)):
            sdir = (rot + np.random.uniform((- 0.1), 0.1))
            (sx, sy) = ((posx + (0.5 * np.cos(sdir))), (posy + (0.5 * np.sin(sdir))))
        (sx, sy) = ((sx + ((5 * et) * np.cos(sdir))), (sy + ((5 * et) * np.sin(sdir))))
        if ((enx != 0) and ((((sx - enx) ** 2) + ((sy - eny) ** 2)) < 0.02)):
            (shoot, sx, sy, enx, eny, seenx, seeny) = (0, (- 1), (- 1), 0, 0, 0, 0)
        if (maph[int(sx)][int(sy)] != 0):
            (shoot, sx, sy) = (0, (- 1), (- 1))
        else:
            mplayer[int(sx)][int(sy)] += 6
    mplayer = (maph + mplayer)
    return (enx, eny, mplayer, et, shoot, sx, sy, sdir, seenx, seeny, lock)