]> git.tdb.fi Git - poefilter.git/commitdiff
Add a script to generate some categories
authorMikko Rasa <tdb@tdb.fi>
Fri, 17 Aug 2018 15:24:23 +0000 (18:24 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 17 Aug 2018 15:24:23 +0000 (18:24 +0300)
Currently only maps.

generate-rules.py [new file with mode: 0755]

diff --git a/generate-rules.py b/generate-rules.py
new file mode 100755 (executable)
index 0000000..b830a06
--- /dev/null
@@ -0,0 +1,38 @@
+#!/usr/bin/python3
+
+def generate_map_rules():
+       out = open("maps.txt", "w")
+
+       tiers = ["same_tier", "tier-1", "tier-2"]
+       rarities = ["Normal", "Magic", "Rare", "Unique"]
+
+       for i in range(len(tiers)):
+               out.write('category "map.{}"\n'.format(tiers[i]))
+               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\tand\n\t\t{\n")
+                       out.write("\t\t\tdrop_level {};\n".format(67+t))
+                       out.write("\t\t\tmax_item_level {};\n".format(67+t+i))
+                       out.write("\t\t};\n")
+               out.write("\t};\n};\n")
+
+       for t in tiers:
+               for r in rarities:
+                       out.write('category "map.{}.{}"\n'.format(r.lower(), t))
+                       out.write("{\n")
+                       out.write('\tcategory "map.{}";\n'.format(t))
+                       out.write("\trarity {};\n".format(r))
+                       out.write("};\n")
+
+       for r in rarities:
+               out.write('category "map.{}.any"\n'.format(r.lower()))
+               out.write('{\n\tclass "Map";\n')
+               out.write("\trarity {};\n".format(r))
+               out.write("};\n")
+
+def main():
+       generate_map_rules()
+
+if __name__=="__main__":
+       main()