コード例 #1
0
ファイル: henchstats.py プロジェクト: Brennall/ackstools
                    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:
コード例 #2
0
ファイル: ackstools.py プロジェクト: Brennall/ackstools
from flask import render_template
from flask import request
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:
コード例 #3
0
ファイル: henchstats.py プロジェクト: jedavis-rpg/ackstools
parser.add_argument("-a", "--alignment", action="store_true", help="Generate alignments")
parser.add_argument("-s", "--spells", default="", help="File to draw arcane spell list from")
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: