All pastes #590301 Raw Edit

guarrades python

public python v1 · immutable
#590301 ·published 2007-06-26 14:06 UTC
rendered paste body
# temps_construccio retorna el temps que torbarà a pujar de nivell determinada construcció. Com a paràmetre d'entrada# passam el nom de l'edifici. Si no s'ha introduit un valor a la matriu temps, retorna 0, i si es vol pujar un edifici que # ha arribat al seu nivell màxim retorna -1def temps_construccio(EDIFICI):	t = {}	t[0] = [0, 0, 1054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]	#main	t[1] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]			#barracks	t[2] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]					#stable	t[3] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]							#garage	t[4] = [0, 0, 0]											#snob	t[5] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]					#smith	t[6] = [0]												#place	t[7] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]	#market	t[8] = [0, 0, 0, 0, 0, 0, 0, 2622, 3146, 3775, 4531, 5437, 6524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]	#wood	t[9] = [0, 0, 0, 0, 0, 0, 0, 2622, 3146, 3775, 4531, 5437, 6524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]	#stone	t[10] = [0, 0, 0, 0, 0, 2185, 2622, 3146, 3775, 4531, 5437, 6524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]	#iron	t[11] = [0, 0, 0, 1686, 2023, 2428, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]	#farm	t[12] = [0, 0, 0, 1433, 1720, 2063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]	#storage	t[13] = [0, 0, 0, 0, 3035, 0, 0, 0, 0, 0]									#hide		t[14] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]					#wall		edificis = [ "main", "barracks", "stable", "garage", "snob", "smith", "place", "market", "wood", "stone", "iron", "farm", "storage", "hide", "wall" ]		# quan el nivell de l'edifici principal puja, el temps que torben les construccions disminueix	modificador = [ 0.0, 1.0, 0.97, 0.95, 0.93, 0.90, 0.88, 0.86, 0.84, 0.82, 0.80, 0.78, 0.76, 0.75, 0.73, 0.71, 0.69, 0.68, 0.66, 0.65, 0.63, 0.62, 0.60, 0.59, 0.57, 0.56, 0.55, 0.53, 0.52, 0.51, 0.50 ]	if nivell_construccio(EDIFICI) > darrer_nivell(EDIFICI):		return -1;		return t.get(edificis.index(EDIFICI),nivell_construccio(EDIFICI))*modificador[nivell_construccio("main")];