@njit(fastmath=True)
def super_fast(width, height, mod, inc, posx, posy, posz, rot, rot_v, mr, mg, mb, lx, ly, lz, maph, exitx, exity, mapr, mapt, maps, pr, pg, pb, enx, eny, sx, sy, size):
    texture = [[0.95, 0.99, 0.97, 0.8], [0.97, 0.95, 0.96, 0.85], [0.8, 0.85, 0.8, 0.8], [0.93, 0.8, 0.98, 0.96], [0.99, 0.8, 0.97, 0.95], [0.8, 0.85, 0.8, 0.8]]
    idx = 0
    for j in range(height):
        rot_j = (rot_v + np.deg2rad((24 - (j / mod))))
        sinzo = (inc * np.sin(rot_j))
        coszo = (inc * np.sqrt(abs(np.cos(rot_j))))
        for i in range(width):
            rot_i = (rot + np.deg2rad(((i / mod) - 30)))
            (x, y, z) = (posx, posy, posz)
            (sin, cos, sinz) = ((coszo * np.sin(rot_i)), (coszo * np.cos(rot_i)), sinzo)
            modr = 1
            (cx, cy, c1r, c2r, c3r) = (1, 1, 1, 1, 1)
            (shot, enem, mapv) = (0, 0, 0)
            dtp = np.random.uniform(0.002, 0.01)
            while 1:
                if ((mapv == 0) or ((sinz > 0) and ((z > mapv) or ((mapv == 6) and ((z > 0.4) or (z < 0.2))) or ((z > 0.57) and (mapv > 1))))):
                    norm = np.sqrt((((cos ** 2) + (sin ** 2)) + (sinz ** 2)))
                    (rayDirX, rayDirY, rayDirZ) = (((cos / norm) + 1e-16), ((sin / norm) + 1e-16), ((sinz / norm) + 1e-16))
                    (mapX, mapY) = (int(x), int(y))
                    (deltaDistX, deltaDistY, deltaDistZ) = (abs((1 / rayDirX)), abs((1 / rayDirY)), abs((1 / rayDirZ)))
                    if (rayDirX < 0):
                        (stepX, sideDistX) = ((- 1), ((x - mapX) * deltaDistX))
                    else:
                        (stepX, sideDistX) = (1, (((mapX + 1.0) - x) * deltaDistX))
                    if (rayDirY < 0):
                        (stepY, sideDistY) = ((- 1), ((y - mapY) * deltaDistY))
                    else:
                        (stepY, sideDistY) = (1, (((mapY + 1) - y) * deltaDistY))
                    if (rayDirZ < 0):
                        sideDistZ = (z * deltaDistZ)
                    else:
                        sideDistZ = ((1 - z) * deltaDistZ)
                    while 1:
                        if (sideDistX < sideDistY):
                            sideDistX += deltaDistX
                            mapX += stepX
                            dist = sideDistX
                            side = 0
                            if ((mapX < 1) or (mapX > (size - 2))):
                                break
                        else:
                            sideDistY += deltaDistY
                            mapY += stepY
                            dist = sideDistY
                            side = 1
                            if ((mapY < 1) or (mapY > (size - 2))):
                                break
                        if (maph[mapX][mapY] != 0):
                            break
                    if side:
                        dist = (dist - deltaDistY)
                    else:
                        dist = (dist - deltaDistX)
                    if (dist > sideDistZ):
                        dist = sideDistZ
                    x = ((x + (rayDirX * dist)) - (cos / 2))
                    y = ((y + (rayDirY * dist)) - (sin / 2))
                    z = ((z + (rayDirZ * dist)) - (sinz / 2))
                x += cos
                y += sin
                z += sinz
                if ((z > 1) or (z < 0)):
                    break
                mapv = maph[int(x)][int(y)]
                if ((mapv > 1) and (z < 0.57)):
                    if ((mapv == 2) or (mapv == 8)):
                        if ((z > 0.45) and (((((x - posx) ** 2) + ((y - posy) ** 2)) + ((z - 0.5) ** 2)) < 0.005)):
                            break
                        if ((z < 0.45) and (z > 0.3) and ((((x - posx) ** 2) + ((y - posy) ** 2)) < ((z / 10) - 0.02))):
                            break
                        if ((z < 0.3) and (((((x - posx) ** 2) + ((y - posy) ** 2)) + ((z - 0.15) ** 2)) < 0.023)):
                            break
                    if ((mapv == 3) or (mapv == 9)):
                        enem = 1
                        if ((z > 0.45) and (((((x - enx) ** 2) + ((y - eny) ** 2)) + ((z - 0.5) ** 2)) < 0.005)):
                            break
                        if ((z < 0.45) and (z > 0.3) and ((((x - enx) ** 2) + ((y - eny) ** 2)) < ((z / 10) - 0.02))):
                            break
                        if ((z < 0.3) and (((((x - enx) ** 2) + ((y - eny) ** 2)) + ((z - 0.15) ** 2)) < 0.023)):
                            break
                    if ((mapv > 5) and (z < 0.4) and (z > 0.2)):
                        if (((((x - sx) ** 2) + ((y - sy) ** 2)) + ((z - 0.3) ** 2)) < dtp):
                            shot = 1
                            break
                if ((mapv > z) and (mapv < 2)):
                    if maps[int(x)][int(y)]:
                        if ((((((x - int(x)) - 0.5) ** 2) + (((y - int(y)) - 0.5) ** 2)) + (((z - int(z)) - 0.5) ** 2)) < 0.25):
                            if mapr[int(x)][int(y)]:
                                if (modr == 1):
                                    (cx, cy) = (int(x), int(y))
                                modr = (modr * 0.7)
                                if (modr < 0.2):
                                    break
                                if ((mapv - z) <= abs(sinz)):
                                    sinz = (- sinz)
                                else:
                                    nx = (((x - int(x)) - 0.5) / 0.5)
                                    ny = (((y - int(y)) - 0.5) / 0.5)
                                    nz = (((z - int(z)) - 0.5) / 0.5)
                                    dot = (2 * (((cos * nx) + (sin * ny)) + (sinz * nz)))
                                    cos = (cos - (nx * dot))
                                    sin = (sin - (ny * dot))
                                    sinz = (sinz - (nz * dot))
                                    x += cos
                                    y += sin
                                    z += sinz
                            else:
                                break
                    elif mapr[int(x)][int(y)]:
                        if (modr == 1):
                            (cx, cy) = (int(x), int(y))
                        modr = (modr * 0.7)
                        if (modr < 0.2):
                            break
                        if (abs((z - maph[int(x)][int(y)])) < abs(sinz)):
                            sinz = (- sinz)
                        elif (maph[int((x + cos))][int((y - sin))] == maph[int(x)][int(y)]):
                            cos = (- cos)
                        else:
                            sin = (- sin)
                    else:
                        break
            if (z > 1):
                deltaDistZ = ((lz - z) * deltaDistZ)
                x += (deltaDistZ * rayDirX)
                y += (deltaDistZ * rayDirY)
                z = lz
                dtol = np.sqrt((((x - lx) ** 2) + ((y - ly) ** 2)))
                if (dtol < 50):
                    shot = 1
                    (c1, c2, c3) = (1, 1, 0.5)
                else:
                    angle = (np.rad2deg(np.arctan(((y - ly) / (x - lx)))) / np.random.uniform(12, 15))
                    sh = ((0.8 + (abs((angle - int(angle))) / 5)) / (dtol / 1000))
                    if (sh > 1):
                        sh = 1
                    if ((int(angle) % 2) == 1):
                        (c1, c2, c3) = ((0.8 * (1 - sh)), (0.86 * (1 - (sh / 4))), (1 - (sh / 10)))
                    else:
                        (c1, c2, c3) = ((0.8 * (1 - sh)), (0.9 * (1 - (sh / 4))), (1 - (sh / 10)))
                if (sx != (- 1)):
                    (c1, c2, c3) = ((0.7 * c1), (0.7 * c2), (0.7 * c3))
            elif (z < 0):
                z = 0
                if ((int((x * 2)) % 2) == (int((y * 2)) % 2)):
                    (c1, c2, c3) = (0.8, 0.8, 0.8)
                elif ((int(x) == exitx) and (int(y) == exity)):
                    (c1, c2, c3) = (0, 0, 0.6)
                else:
                    (c1, c2, c3) = (0.1, 0.1, 0.1)
            elif (mapv < 2):
                (c1, c2, c3) = (mr[int(x)][int(y)], mg[int(x)][int(y)], mg[int(x)][int(y)])
                if mapt[int(x)][int(y)]:
                    if (((y % 1) < 0.05) or ((y % 1) > 0.95)):
                        ww = int((((x * 3) % 1) * 4))
                    else:
                        ww = int((((y * 3) % 1) * 4))
                    if (((x % 1) < 0.95) and ((x % 1) > 0.05) and ((y % 1) < 0.95) and ((y % 1) > 0.05)):
                        zz = int((((x * 5) % 1) * 6))
                    else:
                        zz = int((((z * 5) % 1) * 6))
                    text = texture[zz][ww]
                    (c1, c2, c3) = ((c1 * text), (c2 * text), (c3 * text))
                if ((mapv - z) <= abs(sinz)):
                    z = mapv
                elif (not maps[int(x)][int(y)]):
                    if (int((x - cos)) != int(x)):
                        x = max(int((x - cos)), int(x))
                        modr = (modr * 0.8)
                    else:
                        y = max(int((y - sin)), int(y))
                        modr = (modr * 0.9)
            elif shot:
                sh = (((((x - sx) ** 2) + ((y - sy) ** 2)) + ((z - 0.3) ** 2)) / 0.012)
                (c1, c2, c3) = (1, ((0.6 * sh) + 0.2), ((0.2 * sh) + 0.1))
            elif (z > 0.45):
                (c1, c2, c3) = (0.6, 0.3, 0.3)
            elif (z > 0.3):
                (c1, c2, c3) = (0.3, 0.5, 0.5)
            elif enem:
                (c1, c2, c3) = (1, 0.2, 0.2)
            else:
                (c1, c2, c3) = (0.2, 0.2, 1)
            if ((modr <= 0.7) and (not shot)):
                (c1r, c2r, c3r) = (mr[cx][cy], mg[cx][cy], mg[cx][cy])
            if ((not shot) and (z < 1)):
                dtp = np.sqrt(((((x - posx) ** 2) + ((y - posy) ** 2)) + ((z - posz) ** 2)))
                if (dtp > 7):
                    modr = (modr / np.log((((dtp - 6) / 4) + np.e)))
                if (z < 1):
                    if ((sx != (- 1)) and (maph[int(sx)][int(sy)] > 1)):
                        (shot, c3) = (1, (c3 * 0.9))
                        dtol = np.sqrt(((((x - sx) ** 2) + ((y - sy) ** 2)) + ((z - 0.35) ** 2)))
                        (cos, sin, sinz) = (((0.01 * (sx - x)) / dtol), ((0.01 * (sy - y)) / dtol), ((0.01 * (0.35 - z)) / dtol))
                    else:
                        dtol = np.sqrt(((((x - lx) ** 2) + ((y - ly) ** 2)) + ((z - lz) ** 2)))
                        (cos, sin, sinz) = (((0.01 * (lx - x)) / dtol), ((0.01 * (ly - y)) / dtol), ((0.01 * (lz - z)) / dtol))
                    x += cos
                    y += sin
                    z += sinz
                    mapv = maph[int(x)][int(y)]
                    if ((z < mapv) and (mapv < 1) and (not maps[int(x)][int(y)])):
                        modr = (modr * 0.39)
                    while (modr > 0.45):
                        if ((mapv == 0) or ((not shot) and ((z > mapv) or ((z > 0.57) and (mapv > 1))))):
                            norm = np.sqrt((((cos ** 2) + (sin ** 2)) + (sinz ** 2)))
                            (rayDirX, rayDirY, rayDirZ) = (((cos / norm) + 1e-16), ((sin / norm) + 1e-16), ((sinz / norm) + 1e-16))
                            (mapX, mapY) = (int(x), int(y))
                            (deltaDistX, deltaDistY, deltaDistZ) = (abs((1 / rayDirX)), abs((1 / rayDirY)), abs((1 / rayDirZ)))
                            if (rayDirX < 0):
                                (stepX, sideDistX) = ((- 1), ((x - mapX) * deltaDistX))
                            else:
                                (stepX, sideDistX) = (1, (((mapX + 1.0) - x) * deltaDistX))
                            if (rayDirY < 0):
                                (stepY, sideDistY) = ((- 1), ((y - mapY) * deltaDistY))
                            else:
                                (stepY, sideDistY) = (1, (((mapY + 1) - y) * deltaDistY))
                            if (rayDirZ < 0):
                                sideDistZ = (z * deltaDistZ)
                            else:
                                sideDistZ = ((1 - z) * deltaDistZ)
                            while 1:
                                if (sideDistX < sideDistY):
                                    sideDistX += deltaDistX
                                    mapX += stepX
                                    dist = sideDistX
                                    side = 0
                                    if ((mapX < 1) or (mapX > (size - 2))):
                                        break
                                else:
                                    sideDistY += deltaDistY
                                    mapY += stepY
                                    dist = sideDistY
                                    side = 1
                                    if ((mapY < 1) or (mapY > (size - 2))):
                                        break
                                if (maph[mapX][mapY] != 0):
                                    break
                            if side:
                                dist = (dist - deltaDistY)
                            else:
                                dist = (dist - deltaDistX)
                            if (dist > sideDistZ):
                                dist = sideDistZ
                            x = ((x + (rayDirX * dist)) - (cos / 2))
                            y = ((y + (rayDirY * dist)) - (sin / 2))
                            z = ((z + (rayDirZ * dist)) - (sinz / 2))
                        x += cos
                        y += sin
                        z += sinz
                        mapv = maph[int(x)][int(y)]
                        if shot:
                            if ((mapv > 5) or ((sinz > 0) and (z > 0.35)) or ((sinz < 0) and (z < 0.35))):
                                break
                        elif (z > 1):
                            break
                        if ((z < 0.57) and (mapv > 1)):
                            if ((mapv == 3) or (mapv == 9)):
                                if ((z > 0.45) and (((((x - enx) ** 2) + ((y - eny) ** 2)) + ((z - 0.5) ** 2)) < 0.005)):
                                    modr = (modr * 0.67)
                                elif ((z < 0.45) and (z > 0.3) and ((((x - enx) ** 2) + ((y - eny) ** 2)) < ((z / 10) - 0.02))):
                                    modr = (modr * 0.67)
                                elif ((z < 0.3) and (((((x - enx) ** 2) + ((y - eny) ** 2)) + ((z - 0.15) ** 2)) < 0.023)):
                                    modr = (modr * 0.67)
                            elif ((mapv == 2) or (mapv == 8)):
                                if ((z > 0.45) and (((((x - posx) ** 2) + ((y - posy) ** 2)) + ((z - 0.5) ** 2)) < 0.005)):
                                    modr = (modr * 0.67)
                                elif ((z < 0.45) and (z > 0.3) and ((((x - posx) ** 2) + ((y - posy) ** 2)) < ((z / 10) - 0.02))):
                                    modr = (modr * 0.67)
                                elif ((z < 0.3) and (((((x - posx) ** 2) + ((y - posy) ** 2)) + ((z - 0.15) ** 2)) < 0.023)):
                                    modr = (modr * 0.67)
                        if ((mapv > 0) and (z <= mapv) and (mapv < 2)):
                            if maps[int(x)][int(y)]:
                                if ((((((x - int(x)) - 0.5) ** 2) + (((y - int(y)) - 0.5) ** 2)) + (((z - int(z)) - 0.5) ** 2)) < 0.25):
                                    modr = (modr * 0.9)
                            else:
                                modr = (modr * 0.9)
            pr[idx] = (modr * np.sqrt((c1 * c1r)))
            pg[idx] = (modr * np.sqrt((c2 * c2r)))
            pb[idx] = (modr * np.sqrt((c3 * c3r)))
            idx += 1
    return (pr, pg, pb)
@njit(fastmath=True)
def super_fast(width, height, mod, inc, posx, posy, posz, rot, rot_v, mr, mg, mb, lx, ly, lz, maph, exitx, exity, mapr, mapt, maps, pr, pg, pb, enx, eny, sx, sy, size):
    texture = [[0.95, 0.99, 0.97, 0.8], [0.97, 0.95, 0.96, 0.85], [0.8, 0.85, 0.8, 0.8], [0.93, 0.8, 0.98, 0.96], [0.99, 0.8, 0.97, 0.95], [0.8, 0.85, 0.8, 0.8]]
    idx = 0
    for j in range(height):
        rot_j = (rot_v + np.deg2rad((24 - (j / mod))))
        sinzo = (inc * np.sin(rot_j))
        coszo = (inc * np.sqrt(abs(np.cos(rot_j))))
        for i in range(width):
            rot_i = (rot + np.deg2rad(((i / mod) - 30)))
            (x, y, z) = (posx, posy, posz)
            (sin, cos, sinz) = ((coszo * np.sin(rot_i)), (coszo * np.cos(rot_i)), sinzo)
            modr = 1
            (cx, cy, c1r, c2r, c3r) = (1, 1, 1, 1, 1)
            (shot, enem, mapv) = (0, 0, 0)
            dtp = np.random.uniform(0.002, 0.01)
            while 1:
                if ((mapv == 0) or ((sinz > 0) and ((z > mapv) or ((mapv == 6) and ((z > 0.4) or (z < 0.2))) or ((z > 0.57) and (mapv > 1))))):
                    norm = np.sqrt((((cos ** 2) + (sin ** 2)) + (sinz ** 2)))
                    (rayDirX, rayDirY, rayDirZ) = (((cos / norm) + 1e-16), ((sin / norm) + 1e-16), ((sinz / norm) + 1e-16))
                    (mapX, mapY) = (int(x), int(y))
                    (deltaDistX, deltaDistY, deltaDistZ) = (abs((1 / rayDirX)), abs((1 / rayDirY)), abs((1 / rayDirZ)))
                    if (rayDirX < 0):
                        (stepX, sideDistX) = ((- 1), ((x - mapX) * deltaDistX))
                    else:
                        (stepX, sideDistX) = (1, (((mapX + 1.0) - x) * deltaDistX))
                    if (rayDirY < 0):
                        (stepY, sideDistY) = ((- 1), ((y - mapY) * deltaDistY))
                    else:
                        (stepY, sideDistY) = (1, (((mapY + 1) - y) * deltaDistY))
                    if (rayDirZ < 0):
                        sideDistZ = (z * deltaDistZ)
                    else:
                        sideDistZ = ((1 - z) * deltaDistZ)
                    while 1:
                        if (sideDistX < sideDistY):
                            sideDistX += deltaDistX
                            mapX += stepX
                            dist = sideDistX
                            side = 0
                            if ((mapX < 1) or (mapX > (size - 2))):
                                break
                        else:
                            sideDistY += deltaDistY
                            mapY += stepY
                            dist = sideDistY
                            side = 1
                            if ((mapY < 1) or (mapY > (size - 2))):
                                break
                        if (maph[mapX][mapY] != 0):
                            break
                    if side:
                        dist = (dist - deltaDistY)
                    else:
                        dist = (dist - deltaDistX)
                    if (dist > sideDistZ):
                        dist = sideDistZ
                    x = ((x + (rayDirX * dist)) - (cos / 2))
                    y = ((y + (rayDirY * dist)) - (sin / 2))
                    z = ((z + (rayDirZ * dist)) - (sinz / 2))
                x += cos
                y += sin
                z += sinz
                if ((z > 1) or (z < 0)):
                    break
                mapv = maph[int(x)][int(y)]
                if ((mapv > 1) and (z < 0.57)):
                    if ((mapv == 2) or (mapv == 8)):
                        if ((z > 0.45) and (((((x - posx) ** 2) + ((y - posy) ** 2)) + ((z - 0.5) ** 2)) < 0.005)):
                            break
                        if ((z < 0.45) and (z > 0.3) and ((((x - posx) ** 2) + ((y - posy) ** 2)) < ((z / 10) - 0.02))):
                            break
                        if ((z < 0.3) and (((((x - posx) ** 2) + ((y - posy) ** 2)) + ((z - 0.15) ** 2)) < 0.023)):
                            break
                    if ((mapv == 3) or (mapv == 9)):
                        enem = 1
                        if ((z > 0.45) and (((((x - enx) ** 2) + ((y - eny) ** 2)) + ((z - 0.5) ** 2)) < 0.005)):
                            break
                        if ((z < 0.45) and (z > 0.3) and ((((x - enx) ** 2) + ((y - eny) ** 2)) < ((z / 10) - 0.02))):
                            break
                        if ((z < 0.3) and (((((x - enx) ** 2) + ((y - eny) ** 2)) + ((z - 0.15) ** 2)) < 0.023)):
                            break
                    if ((mapv > 5) and (z < 0.4) and (z > 0.2)):
                        if (((((x - sx) ** 2) + ((y - sy) ** 2)) + ((z - 0.3) ** 2)) < dtp):
                            shot = 1
                            break
                if ((mapv > z) and (mapv < 2)):
                    if maps[int(x)][int(y)]:
                        if ((((((x - int(x)) - 0.5) ** 2) + (((y - int(y)) - 0.5) ** 2)) + (((z - int(z)) - 0.5) ** 2)) < 0.25):
                            if mapr[int(x)][int(y)]:
                                if (modr == 1):
                                    (cx, cy) = (int(x), int(y))
                                modr = (modr * 0.7)
                                if (modr < 0.2):
                                    break
                                if ((mapv - z) <= abs(sinz)):
                                    sinz = (- sinz)
                                else:
                                    nx = (((x - int(x)) - 0.5) / 0.5)
                                    ny = (((y - int(y)) - 0.5) / 0.5)
                                    nz = (((z - int(z)) - 0.5) / 0.5)
                                    dot = (2 * (((cos * nx) + (sin * ny)) + (sinz * nz)))
                                    cos = (cos - (nx * dot))
                                    sin = (sin - (ny * dot))
                                    sinz = (sinz - (nz * dot))
                                    x += cos
                                    y += sin
                                    z += sinz
                            else:
                                break
                    elif mapr[int(x)][int(y)]:
                        if (modr == 1):
                            (cx, cy) = (int(x), int(y))
                        modr = (modr * 0.7)
                        if (modr < 0.2):
                            break
                        if (abs((z - maph[int(x)][int(y)])) < abs(sinz)):
                            sinz = (- sinz)
                        elif (maph[int((x + cos))][int((y - sin))] == maph[int(x)][int(y)]):
                            cos = (- cos)
                        else:
                            sin = (- sin)
                    else:
                        break
            if (z > 1):
                deltaDistZ = ((lz - z) * deltaDistZ)
                x += (deltaDistZ * rayDirX)
                y += (deltaDistZ * rayDirY)
                z = lz
                dtol = np.sqrt((((x - lx) ** 2) + ((y - ly) ** 2)))
                if (dtol < 50):
                    shot = 1
                    (c1, c2, c3) = (1, 1, 0.5)
                else:
                    angle = (np.rad2deg(np.arctan(((y - ly) / (x - lx)))) / np.random.uniform(12, 15))
                    sh = ((0.8 + (abs((angle - int(angle))) / 5)) / (dtol / 1000))
                    if (sh > 1):
                        sh = 1
                    if ((int(angle) % 2) == 1):
                        (c1, c2, c3) = ((0.8 * (1 - sh)), (0.86 * (1 - (sh / 4))), (1 - (sh / 10)))
                    else:
                        (c1, c2, c3) = ((0.8 * (1 - sh)), (0.9 * (1 - (sh / 4))), (1 - (sh / 10)))
                if (sx != (- 1)):
                    (c1, c2, c3) = ((0.7 * c1), (0.7 * c2), (0.7 * c3))
            elif (z < 0):
                z = 0
                if ((int((x * 2)) % 2) == (int((y * 2)) % 2)):
                    (c1, c2, c3) = (0.8, 0.8, 0.8)
                elif ((int(x) == exitx) and (int(y) == exity)):
                    (c1, c2, c3) = (0, 0, 0.6)
                else:
                    (c1, c2, c3) = (0.1, 0.1, 0.1)
            elif (mapv < 2):
                (c1, c2, c3) = (mr[int(x)][int(y)], mg[int(x)][int(y)], mg[int(x)][int(y)])
                if mapt[int(x)][int(y)]:
                    if (((y % 1) < 0.05) or ((y % 1) > 0.95)):
                        ww = int((((x * 3) % 1) * 4))
                    else:
                        ww = int((((y * 3) % 1) * 4))
                    if (((x % 1) < 0.95) and ((x % 1) > 0.05) and ((y % 1) < 0.95) and ((y % 1) > 0.05)):
                        zz = int((((x * 5) % 1) * 6))
                    else:
                        zz = int((((z * 5) % 1) * 6))
                    text = texture[zz][ww]
                    (c1, c2, c3) = ((c1 * text), (c2 * text), (c3 * text))
                if ((mapv - z) <= abs(sinz)):
                    z = mapv
                elif (not maps[int(x)][int(y)]):
                    if (int((x - cos)) != int(x)):
                        x = max(int((x - cos)), int(x))
                        modr = (modr * 0.8)
                    else:
                        y = max(int((y - sin)), int(y))
                        modr = (modr * 0.9)
            elif shot:
                sh = (((((x - sx) ** 2) + ((y - sy) ** 2)) + ((z - 0.3) ** 2)) / 0.012)
                (c1, c2, c3) = (1, ((0.6 * sh) + 0.2), ((0.2 * sh) + 0.1))
            elif (z > 0.45):
                (c1, c2, c3) = (0.6, 0.3, 0.3)
            elif (z > 0.3):
                (c1, c2, c3) = (0.3, 0.5, 0.5)
            elif enem:
                (c1, c2, c3) = (1, 0.2, 0.2)
            else:
                (c1, c2, c3) = (0.2, 0.2, 1)
            if ((modr <= 0.7) and (not shot)):
                (c1r, c2r, c3r) = (mr[cx][cy], mg[cx][cy], mg[cx][cy])
            if ((not shot) and (z < 1)):
                dtp = np.sqrt(((((x - posx) ** 2) + ((y - posy) ** 2)) + ((z - posz) ** 2)))
                if (dtp > 7):
                    modr = (modr / np.log((((dtp - 6) / 4) + np.e)))
                if (z < 1):
                    if ((sx != (- 1)) and (maph[int(sx)][int(sy)] > 1)):
                        (shot, c3) = (1, (c3 * 0.9))
                        dtol = np.sqrt(((((x - sx) ** 2) + ((y - sy) ** 2)) + ((z - 0.35) ** 2)))
                        (cos, sin, sinz) = (((0.01 * (sx - x)) / dtol), ((0.01 * (sy - y)) / dtol), ((0.01 * (0.35 - z)) / dtol))
                    else:
                        dtol = np.sqrt(((((x - lx) ** 2) + ((y - ly) ** 2)) + ((z - lz) ** 2)))
                        (cos, sin, sinz) = (((0.01 * (lx - x)) / dtol), ((0.01 * (ly - y)) / dtol), ((0.01 * (lz - z)) / dtol))
                    x += cos
                    y += sin
                    z += sinz
                    mapv = maph[int(x)][int(y)]
                    if ((z < mapv) and (mapv < 1) and (not maps[int(x)][int(y)])):
                        modr = (modr * 0.39)
                    while (modr > 0.45):
                        if ((mapv == 0) or ((not shot) and ((z > mapv) or ((z > 0.57) and (mapv > 1))))):
                            norm = np.sqrt((((cos ** 2) + (sin ** 2)) + (sinz ** 2)))
                            (rayDirX, rayDirY, rayDirZ) = (((cos / norm) + 1e-16), ((sin / norm) + 1e-16), ((sinz / norm) + 1e-16))
                            (mapX, mapY) = (int(x), int(y))
                            (deltaDistX, deltaDistY, deltaDistZ) = (abs((1 / rayDirX)), abs((1 / rayDirY)), abs((1 / rayDirZ)))
                            if (rayDirX < 0):
                                (stepX, sideDistX) = ((- 1), ((x - mapX) * deltaDistX))
                            else:
                                (stepX, sideDistX) = (1, (((mapX + 1.0) - x) * deltaDistX))
                            if (rayDirY < 0):
                                (stepY, sideDistY) = ((- 1), ((y - mapY) * deltaDistY))
                            else:
                                (stepY, sideDistY) = (1, (((mapY + 1) - y) * deltaDistY))
                            if (rayDirZ < 0):
                                sideDistZ = (z * deltaDistZ)
                            else:
                                sideDistZ = ((1 - z) * deltaDistZ)
                            while 1:
                                if (sideDistX < sideDistY):
                                    sideDistX += deltaDistX
                                    mapX += stepX
                                    dist = sideDistX
                                    side = 0
                                    if ((mapX < 1) or (mapX > (size - 2))):
                                        break
                                else:
                                    sideDistY += deltaDistY
                                    mapY += stepY
                                    dist = sideDistY
                                    side = 1
                                    if ((mapY < 1) or (mapY > (size - 2))):
                                        break
                                if (maph[mapX][mapY] != 0):
                                    break
                            if side:
                                dist = (dist - deltaDistY)
                            else:
                                dist = (dist - deltaDistX)
                            if (dist > sideDistZ):
                                dist = sideDistZ
                            x = ((x + (rayDirX * dist)) - (cos / 2))
                            y = ((y + (rayDirY * dist)) - (sin / 2))
                            z = ((z + (rayDirZ * dist)) - (sinz / 2))
                        x += cos
                        y += sin
                        z += sinz
                        mapv = maph[int(x)][int(y)]
                        if shot:
                            if ((mapv > 5) or ((sinz > 0) and (z > 0.35)) or ((sinz < 0) and (z < 0.35))):
                                break
                        elif (z > 1):
                            break
                        if ((z < 0.57) and (mapv > 1)):
                            if ((mapv == 3) or (mapv == 9)):
                                if ((z > 0.45) and (((((x - enx) ** 2) + ((y - eny) ** 2)) + ((z - 0.5) ** 2)) < 0.005)):
                                    modr = (modr * 0.67)
                                elif ((z < 0.45) and (z > 0.3) and ((((x - enx) ** 2) + ((y - eny) ** 2)) < ((z / 10) - 0.02))):
                                    modr = (modr * 0.67)
                                elif ((z < 0.3) and (((((x - enx) ** 2) + ((y - eny) ** 2)) + ((z - 0.15) ** 2)) < 0.023)):
                                    modr = (modr * 0.67)
                            elif ((mapv == 2) or (mapv == 8)):
                                if ((z > 0.45) and (((((x - posx) ** 2) + ((y - posy) ** 2)) + ((z - 0.5) ** 2)) < 0.005)):
                                    modr = (modr * 0.67)
                                elif ((z < 0.45) and (z > 0.3) and ((((x - posx) ** 2) + ((y - posy) ** 2)) < ((z / 10) - 0.02))):
                                    modr = (modr * 0.67)
                                elif ((z < 0.3) and (((((x - posx) ** 2) + ((y - posy) ** 2)) + ((z - 0.15) ** 2)) < 0.023)):
                                    modr = (modr * 0.67)
                        if ((mapv > 0) and (z <= mapv) and (mapv < 2)):
                            if maps[int(x)][int(y)]:
                                if ((((((x - int(x)) - 0.5) ** 2) + (((y - int(y)) - 0.5) ** 2)) + (((z - int(z)) - 0.5) ** 2)) < 0.25):
                                    modr = (modr * 0.9)
                            else:
                                modr = (modr * 0.9)
            pr[idx] = (modr * np.sqrt((c1 * c1r)))
            pg[idx] = (modr * np.sqrt((c2 * c2r)))
            pb[idx] = (modr * np.sqrt((c3 * c3r)))
            idx += 1
    return (pr, pg, pb)