|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
if __name__ == "__main__": |
|
|
parser = argparse.ArgumentParser() |
|
|
parser = argparse.ArgumentParser() |
|
|
group = parser.add_mutually_exclusive_group() |
|
|
group = parser.add_mutually_exclusive_group() |
|
|
group.add_argument("-k", "--kobolds", help="print this many kobolds", type=int, default=1) |
|
|
|
|
|
group.add_argument("-n", "--names", help="print this many kobolds without stat blocks", type=int) |
|
|
|
|
|
group.add_argument("-s", "--ship", help="print only the ship name and description", action="store_true") |
|
|
|
|
|
group.add_argument("-c", "--campaign", help="print a full campaign block with 6 kobolds", action="store_true") |
|
|
|
|
|
|
|
|
group.add_argument("-c", "--campaign", help="print a full campaign block with N kobolds (default 6)", nargs="?", const=6, type=int, metavar="N") |
|
|
|
|
|
group.add_argument("-k", "--kobolds", help="print N kobolds", type=int, nargs="?", const=1, default=1, metavar="N") |
|
|
|
|
|
group.add_argument("-n", "--names", help="print N kobolds without stat blocks", nargs="?", const=1, type=int, metavar="N") |
|
|
group.add_argument("-p", "--params", help="print only the parameters of a campaign", action="store_true") |
|
|
group.add_argument("-p", "--params", help="print only the parameters of a campaign", action="store_true") |
|
|
|
|
|
group.add_argument("-s", "--ship", help="print only the ship name and description", action="store_true") |
|
|
args = parser.parse_args() |
|
|
args = parser.parse_args() |
|
|
|
|
|
# print(args) |
|
|
if args.campaign: |
|
|
if args.campaign: |
|
|
cmp = Campaign() |
|
|
|
|
|
|
|
|
cmp = Campaign(args.campaign) |
|
|
cmp.print_params() |
|
|
cmp.print_params() |
|
|
cmp.print_chars() |
|
|
cmp.print_chars() |
|
|
elif args.params: |
|
|
elif args.params: |
|
|
|
|
|
|
|
|
c.generate() |
|
|
c.generate() |
|
|
c.print_name() |
|
|
c.print_name() |
|
|
else: |
|
|
else: |
|
|
for _ in range(args.num): |
|
|
|
|
|
|
|
|
for _ in range(args.kobolds): |
|
|
c = Character() |
|
|
c = Character() |
|
|
c.generate() |
|
|
c.generate() |
|
|
c.print() |
|
|
c.print() |