Difference between revisions of "Ability/Script"

From Wildermyth Wiki
m
Line 246: Line 246:
         if (req.endswith('leftArm') or req.endswith('rightArm')) and arms[themes[i]] != 1:
         if (req.endswith('leftArm') or req.endswith('rightArm')) and arms[themes[i]] != 1:
           if arms.get(themes[i]) >= 2:
           if arms.get(themes[i]) >= 2:
             reqname = re.sub(r'\(.*?\)', '(either)', aspectNames[req])
             reqname = re.sub(r' \([LR]\)', '', aspectNames[req])
             arms[themes[i]] = -1
             arms[themes[i]] = -1
           elif arms.get(themes[i]) < 0:
           elif arms.get(themes[i]) < 0:
Line 254: Line 254:
         elif (req.endswith('leftLeg') or req.endswith('rightLeg')) and legs[themes[i]] != 1:
         elif (req.endswith('leftLeg') or req.endswith('rightLeg')) and legs[themes[i]] != 1:
           if legs.get(themes[i]) >= 2:
           if legs.get(themes[i]) >= 2:
             reqname = re.sub(r'\(.*?\)', '(either)', aspectNames[req])
             reqname = re.sub(r' \([LR]\)', '', aspectNames[req])
             legs[themes[i]] = -1
             legs[themes[i]] = -1
           elif legs.get(themes[i]) < 0:
           elif legs.get(themes[i]) < 0:

Revision as of 08:59, 5 March 2022

This is a Python script to generate the Ability tables. Copy the code in the box below into a text file named abilityTable.py (or whatever you want) inside the Wildermyth directory. Then run it by calling python abilityTable.py from the command line. It will create a text file named abilityTable.txt with the appropriate wiki-formatted content.