Example #1
0
parser.add_argument("-g",
                    "--genprofs",
                    default="",
                    help="File to draw general profs from")
args = parser.parse_args()

classes = []
spells = []
names = []
profs = []
if len(args.classes) > 0:
    classes = libhenches.parseClasses(args.classes)
    if len(args.spells) > 0:
        spells = libspellbook.parseSpells(args.spells)
if len(args.names) > 0:
    names = libhenches.parseNames(args.names)
if args.treasure != "":
    tables.loadtables(args.treasure)
if args.genprofs != "":
    profs = libhenches.parseProfs(args.genprofs)

if args.filterclass:
    cl = [t[0] for t in classes]
    if args.filterclass not in cl:
        print "Class %s not found in class file (used same case?)" % args.filterclass
        sys.exit(1)

if args.market == 10:
    if args.filterclass:
        ol = libhenches.genHenchesFiltered(args.filterclass, args.num,
                                           int(args.level), classes,
Example #2
0
import terrain

app = Flask(__name__)

classfile = './classes'
spellsfile = './spells'
profsfile = './genprofs'
namefile = './germans'
pcclassfile = './pcclasses'
pcspellsfile = './pcspells'

classes = libhenches.parseClasses(classfile)
pcclasses = libhenches.parseClasses(pcclassfile)
spells = libspellbook.parseSpells(spellsfile)
pcspells = libspellbook.parseSpells(pcspellsfile)
names = libhenches.parseNames(namefile)
profs = libhenches.parseProfs(profsfile)
marketvals = libhenches.marketClasses

@app.route('/')
def halp():
  return "halp hao do wobsit"

@app.route('/hench')
@app.route('/hench/')
def genhenches(market=None, pc=False):
  market = int(request.args.get('market',4))
  pc = request.args.get('pc','')
  if not market or 1 > market or 6 < market:
    market = 4
  useclasses = pcclasses if pc else classes
Example #3
0
parser.add_argument("-t", "--treasure", default="", help="File to draw magic loot from")
parser.add_argument("-l", "--level", default=1, help="Generate NPCs of particular level")
parser.add_argument("--names", default="", help="File to draw NPC names from")
parser.add_argument("-g", "--genprofs", default="", help="File to draw general profs from")
args = parser.parse_args()

classes = []
spells = []
names = []
profs = []
if len(args.classes) > 0:
    classes = libhenches.parseClasses(args.classes)
    if len(args.spells) > 0:
        spells = libspellbook.parseSpells(args.spells)
if len(args.names) > 0:
    names = libhenches.parseNames(args.names)
if args.treasure != "":
    tables.loadtables(args.treasure)
if args.genprofs != "":
    profs = libhenches.parseProfs(args.genprofs)

if args.filterclass:
    cl = [t[0] for t in classes]
    if args.filterclass not in cl:
        print "Class %s not found in class file (used same case?)" % args.filterclass
        sys.exit(1)


if args.market == 10:
    if args.filterclass:
        ol = libhenches.genHenchesFiltered(