def perform(level, box, options):
    surface = Surface(box.minx, box.minz, box.maxx, box.maxz)
    calculateHeightMapAdv(level, surface)
    calculateSteepnessMap(surface)
    calculateWaterPlacement(level, surface)
    sections = calculateSections(surface, 1, 40)

    allPoints = []
    for section in sections:
        if section.isWater:
            continue
        for point in section.points:
            allPoints.append(point)

    length = len(allPoints)
    houseId = 0
    for s in range(100):
        i = randint(0, length - 1)
        x = allPoints[i].x
        z = allPoints[i].z
        rec = getRectangle(surface, x, z, 1)
        if not isValidRectangle(rec):
            continue
        registerAsOccupied(surface, rec)
        registerHouse(surface, rec, houseId)
        houseId += 1
        createPyramid(level, rec.xStart + 2 + box.minx,
                      rec.xEnd - 2 + box.minx, rec.zStart + 2 + box.minz,
                      rec.zEnd - 2 + box.minz, surface.surfaceMap[x][z].height)

    simpleSurface = SimpleSurface(box.minx, box.minz, box.maxx, box.maxz)
    calculateAttributes(simpleSurface, surface)
    printAttributes(simpleSurface)
Exemplo n.º 2
0
def perform(level, box, options):
	surface = Surface(box.minx, box.minz, box.maxx, box.maxz)
	calculateHeightMapAdv(level, surface)
	calculateSteepnessMap(surface)

	for x in range(surface.xLength):
		for z in range(surface.zLength):
			placeHeightBlocks(level, surface, x, z)
Exemplo n.º 3
0
def perform(level, box, options):
    surface = Surface(box.minx, box.minz, box.maxx, box.maxz)
    calculateHeightMapAdv(level, surface)
    calculateSteepnessMap(surface)
    calculateWaterPlacement(level, surface)
    calculateBiomeMap(level, surface)

    sections = calculateSections(surface, 1, 15)
    calculateSectionMids(surface, sections)

    smallLandSections = []
    mediumLandSections = []
    bigLandSections = []
    waterSections = []

    arrangeSections(sections, waterSections, bigLandSections,
                    mediumLandSections, smallLandSections)

    paintSections(level, surface, smallLandSections, mediumLandSections,
                  bigLandSections, waterSections)

    averageSurfaceHeight = calculateAverageSurfaceHeight(surface)
    calculateAverageSectionHeights(surface, sections)

    towerSections = getTowerSections(surface, averageSurfaceHeight,
                                     bigLandSections, mediumLandSections,
                                     smallLandSections)

    habitatSections = getHabitatSections(towerSections, mediumLandSections,
                                         bigLandSections)

    paths = getPathsInSections(surface, bigLandSections)

    paintPathPoints(level, surface, habitatSections)
    paintPaths(level, surface, paths, (35, 8))

    intersectionPaths = getPathsBetweenSections(surface, habitatSections)
    paths.extend(intersectionPaths)

    buildPaths(level, surface, paths)

    paintPaths(level, surface, intersectionPaths, (35, 2))

    houseProperties = getHouseProperties(surface, paths)
    farmProperties = getFarmProperties(surface, paths)

    paintTowerProperties(level, surface, towerSections)
    paintHouseProperties(level, surface, houseProperties)
    paintFarmProperties(level, surface, farmProperties)
Exemplo n.º 4
0
def perform(level, box, options):
    surface = Surface(box.minx, box.minz, box.maxx, box.maxz)
    calculateHeightMapAdv(level, surface)
    calculateSteepnessMap(surface)
    calculateWaterPlacement(level, surface)

    sections = calculateSections(surface, 1, 15)
    calculateSectionMids(surface, sections)

    smallLandSections = []
    mediumLandSections = []
    bigLandSections = []
    waterSections = []

    arrangeSections(sections, waterSections, bigLandSections,
                    mediumLandSections, smallLandSections)

    paintSections(level, surface, smallLandSections, mediumLandSections,
                  bigLandSections, waterSections)
Exemplo n.º 5
0
def perform(level, box, options):
    surface = Surface(box.minx, box.minz, box.maxx, box.maxz)
    calculateHeightMapAdv(level, surface)
    calculateSteepnessMap(surface)
    calculateWaterPlacement(level, surface)
    sections = calculateSections(surface, 1, 15)

    for section in sections:
        calculateSectionMid(surface, section)

    for x in range(surface.xLength):
        for z in range(surface.zLength):
            layer = surface.surfaceMap[x][z].layer
            # block = layerBlocks[min([layer + 1, len(layerBlocks) - 1])]
            block = layerBlocks[(layer + 1) % len(layerBlocks)]
            if surface.surfaceMap[x][z].isWater or surface.surfaceMap[x][
                    z].sectionId == -1:
                block = (35, 15)
            setBlock(level, surface, x, 249, z, 2, 0)
            setBlock(level, surface, x, 250, z, block)