コード例 #1
0
def afterGeneration():
    CvMapGeneratorUtil.placeC2CBonuses()
    # MIRRORIZE GOODIES
    gc = CyGlobalContext()
    map = CyMap()
    userInputPlots = map.getCustomMapOption(0)
    iW = map.getGridWidth()
    iH = map.getGridHeight()

    if userInputPlots == 0:  # Reflection
        reflect_x = lambda x: iW - iX - 1
        reflect_y = lambda y: iY
    elif userInputPlots == 1:  # Inversion
        reflect_x = lambda x: iW - iX - 1
        reflect_y = lambda y: iH - iY - 1
    elif userInputPlots == 2:  # Copy
        reflect_x = lambda x: iX + (iW / 2)
        reflect_y = lambda y: iY
    else:  # userInputPlots == 3: Opposite
        reflect_x = lambda x: iX + (iW / 2)
        reflect_y = lambda y: iH - iY - 1

    for iX in range(iW / 2):
        for iY in range(iH):
            pPlot = map.plot(iX, iY)
            rPlot = map.plot(reflect_x(iX), reflect_y(iY))
            pPlot.setImprovementType(rPlot.getImprovementType())

    # All done!
    return None
コード例 #2
0
def afterGeneration():
	CvMapGeneratorUtil.placeC2CBonuses()
	
コード例 #3
0
def afterGeneration():
    CvMapGeneratorUtil.placeC2CBonuses(
    )  # This does not place them correctly tilted