예제 #1
0
    def onUnitBuilt(self, argsList):
        city, unit = argsList

        vic.onUnitBuilt(city, unit)

        if unit.getUnitType() == iSettler and city.getOwner(
        ) == iChina and utils.getHumanID() != iChina:
            utils.handleChineseCities(unit)

        # Leoreth: help AI by moving new slaves to the new world
        if unit.getUnitType() == iSlave and city.getRegionID() in [
                rIberia, rBritain, rEurope, rScandinavia, rRussia, rItaly,
                rBalkans, rMaghreb, rAnatolia
        ] and utils.getHumanID() != city.getOwner():
            utils.moveSlaveToNewWorld(city.getOwner(), unit)
    def onUnitBuilt(self, argsList):
        city, unit = argsList

        vic.onUnitBuilt(city, unit)

        if unit.getUnitType() == iSettler and city.getOwner(
        ) == iChina and utils.getHumanID() != iChina:
            utils.handleChineseCities(unit)

        # Leoreth: help AI by moving new slaves to the new world
        if unit.getUnitType() == iSlave and city.getRegionID() in [
                rIberia, rBritain, rEurope, rScandinavia, rRussia, rItaly,
                rBalkans, rMaghreb, rAnatolia
        ] and utils.getHumanID() != city.getOwner():
            utils.moveSlaveToNewWorld(city.getOwner(), unit)

        # Space Elevator effect: +1 commerce per satellite built
        if unit.getUnitType() == iSatellite:
            city = utils.getBuildingEffectCity(iSpaceElevator)
            if city:
                city.changeBuildingYieldChange(
                    gc.getBuildingInfo(iSpaceElevator).getBuildingClassType(),
                    YieldTypes.YIELD_COMMERCE, 1)