From de20cee784c2fc93484506b766e4d319b71a8f0a Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 17 Aug 2018 18:24:23 +0300 Subject: [PATCH] Add a script to generate some categories Currently only maps. --- generate-rules.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 generate-rules.py diff --git a/generate-rules.py b/generate-rules.py new file mode 100755 index 0000000..b830a06 --- /dev/null +++ b/generate-rules.py @@ -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() -- 2.45.2