Stopping at -2 isn't really enough since a -2 map from a rare is actually
the same tier as the containing map.
def generate_map_rules():
out = open("maps.txt", "w")
def generate_map_rules():
out = open("maps.txt", "w")
- tiers = ["same_tier", "tier-1", "tier-2"]
+ n_tiers = 6
+ tier_names = ["same_tier"] + ["tier-{}".format(i) for i in range(1, n_tiers)]
+ tiers = [("same_tier", 0), ("tier-2", 2), ("tier-4", 4)]
rarities = ["Normal", "Magic", "Rare", "Unique"]
rarities = ["Normal", "Magic", "Rare", "Unique"]
- for i in range(len(tiers)):
- out.write('category "map.{}"\n'.format(tiers[i]))
+ for i, n in enumerate(tier_names):
+ out.write('category "map.{}"\n'.format(n))
out.write('{\n\tclass "Map";\n\tor\n\t{\n')
out.write("\t\tmax_item_level {};\n".format(68+i))
for t in range(2, 17):
out.write('{\n\tclass "Map";\n\tor\n\t{\n')
out.write("\t\tmax_item_level {};\n".format(68+i))
for t in range(2, 17):
out.write("\t\t};\n")
out.write("\t};\n};\n")
out.write("\t\t};\n")
out.write("\t};\n};\n")
- out.write('category "map.{}.{}"\n'.format(r.lower(), t))
+ out.write('category "map.{}.{}"\n'.format(r.lower(), n))
- out.write('\tcategory "map.{}";\n'.format(t))
+ out.write('\tcategory "map.{}";\n'.format(n))
out.write("\trarity {};\n".format(r))
out.write("};\n")
out.write("\trarity {};\n".format(r))
out.write("};\n")