def gen_creature(): name = gen_name() age = randage() species = get_species() profession = get_profession() an1 = an2 = "a" if species[0].lower() in "aeiou": an1 = "an" if profession[0].lower() in "aeiou": an2 = "an" try: c = creature(name=name, age=age) c.appearance = "An awkward looking %s." % species barf.save("%s is %s %s of %d years." % (c.name, an1, species, c.age), time=False) barf.save("They are %s %s from a civilization with a tech level of %d." % (an2, profession, c.tech_level), time=False) print("") barf.roll("(Acc.)\tAttr.\t Secondary Mod", time=False) barf.action("(%d)\tSTR: %d\t CHA: %d" % (c.points['accumulator']['STR'], c.STR, c.CHA), time=False) barf.action("(%d)\tDEX: %d\t SPD: %d" % (c.points['accumulator']['DEX'], c.DEX, c.SPD), time=False) barf.action("(%d)\tCON: %d\t RFX: %d" % (c.points['accumulator']['CON'], c.CON, c.RFX), time=False) barf.action("(%d)\tINT: %d\t LFT: %d" % (c.points['accumulator']['INT'], c.INT, c.LFT), time=False) barf.action("(%d)\tWIL: %d\t PER: %d" % (c.points['accumulator']['WIL'], c.WIL, c.PER), time=False) total = c.STR + c.DEX + c.CON + c.INT + c.WIL barf.message("Total Points: %d (Unspent: %d)\n" % (c.points['total'], c.points['unspent']), time=False) barf.roll("Contacts:", time=False) for contact in c.contacts: barf.action("%s" % contact, time=False) print("") barf.roll("Oddities:", time=False) for oddity in c.oddities: barf.action("%s (%d)" % (oddity, c.oddities[oddity]), time=False) print("") barf.roll("Skills:", time=False) for skill in c.skills: barf.action("%s (%d)" % (skill, c.skills[skill]), time=False) print("") barf.roll("Appearance:", time=False) barf.action("%s" % c.appearance, time=False) print("") barf.roll("Background:", time=False) barf.action("%s" % c.background, time=False) print("") barf.roll("Health:", time=False) for bar in c.health: barf.action("%s: %d" % (bar, c.health[bar]), time=False) print("") # barf.roll("Body Hit Chart:", time=False) # for part in c.body_parts: # barf.action("%s: %s" % (part, str(c.body_parts[part])), time=False) # print("") except: # Keep generating until a valid creature is created. gen_creature()
barf.roll("Appearance:", time=False) barf.action("%s" % c.appearance, time=False) print("") barf.roll("Background:", time=False) barf.action("%s" % c.background, time=False) print("") barf.roll("Health:", time=False) for bar in c.health: barf.action("%s: %d" % (bar, c.health[bar]), time=False) print("") # barf.roll("Body Hit Chart:", time=False) # for part in c.body_parts: # barf.action("%s: %s" % (part, str(c.body_parts[part])), time=False) # print("") except: # Keep generating until a valid creature is created. gen_creature() barf.message("CCARPS Character Generator v%s" % __version__, time=False) barf.message("Ruleset v%s\tccarps-python v%s\n" % (ccarps_version.__rulesetversion__, ccarps_version.__version__), time=False) i = 0 while i < num_creatures: gen_creature() if i is not num_creatures - 1: print(" ") i += 1