]> git.tdb.fi Git - poefilter.git/commitdiff
Add more map tier rules
authorMikko Rasa <tdb@tdb.fi>
Sun, 19 Aug 2018 19:26:12 +0000 (22:26 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 19 Aug 2018 19:26:12 +0000 (22:26 +0300)
Stopping at -2 isn't really enough since a -2 map from a rare is actually
the same tier as the containing map.

generate-rules.py

index b830a0637633f1763fd9c852b4aeaae0818a6db4..2d7f96e6e2f377dc5fb87da61e3926d770c5ba83 100755 (executable)
@@ -3,11 +3,13 @@
 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"]
 
-       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):
@@ -17,11 +19,11 @@ def generate_map_rules():
                        out.write("\t\t};\n")
                out.write("\t};\n};\n")
 
-       for t in tiers:
+       for n in tier_names:
                for r in rarities:
-                       out.write('category "map.{}.{}"\n'.format(r.lower(), t))
+                       out.write('category "map.{}.{}"\n'.format(r.lower(), n))
                        out.write("{\n")
-                       out.write('\tcategory "map.{}";\n'.format(t))
+                       out.write('\tcategory "map.{}";\n'.format(n))
                        out.write("\trarity {};\n".format(r))
                        out.write("};\n")