Пример #1
0
def placement():
	if not api.mon_tour():
		return
	bestval = 0
	bestpos = (-1,-1)
	for i in range(TAILLE_CARTE):
		for j in range(TAILLE_CARTE):
			if api.type_case(j,i) == VIDE and api.construction_possible(j,i) != BLOCAGE:
				val = -plus_proche_route((0,i,j))/2
				r = api.portee_monument(api.monument_en_cours())
				prestige = api.prestige_monument(api.monument_en_cours())
				for y in range(i-r,i+r+1):	
					for x in range(j-r,j+r+1):
						if not api.type_case(x,y) == MAISON:
							continue
						if api.appartenance(x,y) == 0:
							val += prestige
						else:
							val -= prestige
				if val > bestval:
					bestval = val
					bestpos = (i,j)
	if bestpos[0] < 0:
		return
	Build((0,) + bestpos, "monument")
Пример #2
0
def enchere():
	api.encherir(1 + api.prestige_monument(api.monument_en_cours()) / 3)