def classRace(self): return random.choice([ random.choice(races.elves), races.HalfElf(), races.Human(), random.choice(races.gnomes) ])
def classRace(self): return random.choice([ races.Tiefling(), races.Human(), races.HalfElf(), races.Dragonborn() ])
def classRace(self): return random.choice([ races.Dragonborn(), random.choice(races.dwarfs), races.HalfOrc(), races.Human() ])
def classRace(self): return random.choice([ random.choice(races.elves), races.HalfElf(), races.Human(), races.Tiefling() ])
async def make_race(ctx, race_cls, subrace: str = ""): if race_cls == races.Elf: return races.Elf(subrace) if race_cls == races.Human: return races.Human() if race_cls == races.Dragonborn: return races.Dragonborn(subrace) if race_cls == races.Dwarf: return races.Dwarf(subrace) if race_cls == races.Gnome: # you've been gnomed return races.Gnome(subrace) if race_cls == races.Halfling: return races.Halfling(subrace) if race_cls == races.HalfOrc: return races.HalfOrc() if race_cls == races.Tiefling: return races.Tiefling() raise ValueError(f'race {race_cls} does not exist')
import argparse import races # import goblin game = open("myGame.txt", "w") parser = argparse.ArgumentParser(description='SakaRPG') parser.add_argument('-c', '--create', type=str, metavar='', help="create a new character") args = parser.parse_args() if args.create: new = races.Human(args.create) game.write(f'{args.create} \n') game.write(f'{new.atribs}') game = open("myGame.txt") content = game.read() game.close() print(content)