Beispiel #1
0
def settingsOK():
    """
	Returns True if BUFFY is active and all game/map settings and CRCs are acceptable, 
	on Mac, or it's an XOTM game.
	"""
    game = gc.getGame()
    map = gc.getMap()

    # xOTM games are always okay
    # EF: Mac only?
    if isXOTMScenario():
        return True

    if not Buffy.isActive():
        return False

    if not Buffy.isDllInCorrectPath():
        return False

    if game.getWarningStatus() == 1:
        return False

    # Check that the map script used is a valid one
    if not isMapScriptOK():
        return False

    # Don't allow the balanced option
    if getBalanced():
        return False

    # Check that the world wrap setting is OK
    if not getWorldWrapSettingOK():
        return False

    # Check that all victory conditions are enabled
    for iVCLoop in range(gc.getNumVictoryInfos()):
        if not game.isVictoryValid(iVCLoop):
            return False

    # Ensure the game is single player
    if game.isGameMultiPlayer():
        return False

    # Check the options
    if len(getInvalidGameOptions()) > 0:
        return False

    opponentCount = -1
    seenLeaders = set()
    for player in PlayerUtil.players(barbarian=False, minor=False):
        opponentCount += 1
        iLeader = player.getLeaderType()
        if iLeader >= 0:
            if iLeader in seenLeaders:
                return False
            seenLeaders.add(iLeader)

    if not isOpponentCountOK(opponentCount):
        return False

    if game.isTeamGame():
        return False

    if crcResult != 0:
        return False

    return True
def settingsOK():
	"""
	Returns True if BUFFY is active and all game/map settings and CRCs are acceptable, 
	on Mac, or it's an XOTM game.
	"""
	game = gc.getGame()
	map = gc.getMap()
	
	# xOTM games are always okay
	# EF: Mac only?
	if isXOTMScenario():
		return True
	
	if not Buffy.isActive():
		return False

	if not Buffy.isDllInCorrectPath():
		return False
	
	if game.getWarningStatus() == 1:
		return False

	# Check that the map script used is a valid one
	if not isMapScriptOK():
		return False

	# Don't allow the balanced option
	if getBalanced():
		return False

	# Check that the world wrap setting is OK
	if not getWorldWrapSettingOK():
		return False

	# Check that all victory conditions are enabled
	for iVCLoop in range(gc.getNumVictoryInfos()):
		if not game.isVictoryValid(iVCLoop):
			return False

	# Ensure the game is single player
	if game.isGameMultiPlayer():
		return False

	# Check the options
	if len(getInvalidGameOptions()) > 0:
		return False

	opponentCount = -1
	seenLeaders = set()
	for player in PlayerUtil.players(barbarian=False, minor=False):
		opponentCount += 1
		iLeader = player.getLeaderType()
		if iLeader >= 0:
			if iLeader in seenLeaders:
				return False
			seenLeaders.add(iLeader)

	if not isOpponentCountOK(opponentCount):
		return False

	if game.isTeamGame():
		return False

	if crcResult != 0:
		return False

	return True