sex=raw_input("First, which sex do you want your character to be? ") name=raw_input('What do you want to call your character? ') import random print "" print "" figures=[] for n in range(6): dice=[random.randint(1,6) for i in range(4)] dice.sort() d2=dice[1:] figures.append(d2[0]+d2[1]+d2[2]) print figures print "" print """These are random numbers given by the dice, you must now chose where to put them. This will affect your game, and you should bear in mind what kind of character you want to create.""" print "" print "" strength=int(raw_input("""Which one of them will you assign to strength? Strength is a measure of muscle, endurance and stamina combined. Strength affects the ability of characters to lift and carry weights and make effective melee attacks. """)) if int(strength) in figures: figures.remove(strength) else: print "Don't try to cheat! Naughty! Everlasting curses upon thee!!" while 1<2: print "Cheater!" print "" print "" print "" print figures print "" print "" dexterity=int(raw_input("""Which of them will you assign to Dexterity? Dexterity encompasses a number of physical attributes including hand-eye coordination, agility, reflexes, fine motor skills, balance and speed of movement; a high dexterity score indicates superiority in all these attributes. Dexterity affects characters with regard to initiative in attack, the projection of missiles from hand or other means, and in defensive measures. Dexterity is the ability most influenced by outside influences (such as armor) """)) if int(dexterity) in figures: figures.remove(dexterity) else: print "Don't try to cheat! Naughty! Everlasting curses upon thee!!" while 1<2: print "Cheater!" print "" print "" print "" print figures print "" print "" constitution=int(raw_input("""Which of them will you assign to Constitution? Constitution is a term which encompasses the character's physique, toughness, health and resistance to disease and poison. The higher a character's Constitution, the more hit points that character will have. Unlike the other ability scores, which knock the character unconscious when they hit 0, having 0 Constitution is fatal. """)) if int(constitution) in figures: figures.remove(constitution) else: print "Don't try to cheat! Naughty! Everlasting curses upon thee!!" while 1<2: print "Cheater!" print "" print "" print "" print figures print "" print "" intelligence=int(raw_input("""Which of them will to assign to Intelligence? Intelligence is similar to IQ, but also includes mnemonic ability, reasoning and learning ability outside those measured by the written word. Intelligence dictates the number of languages a character can learn and the number of spells a Wizard may know. """)) if int(intelligence) in figures: figures.remove(intelligence) else: print "Don't try to cheat! Naughty! Everlasting curses upon thee!!" while 1<2: print "Cheater!" print "" print "" print "" print figures print "" print "" wisdom=int(raw_input("""Which of them will you assign to Wisdom? Wisdom is a composite term for the characters enlightenment, judgement, wile, willpower and intuitiveness. """)) if int(wisdom) in figures: figures.remove(wisdom) else: print "Don't try to cheat! Naughty! Everlasting curses upon thee!!" while 1<2: print "Cheater!" print "" print "" print "" print figures print "" print "" print "Then the last one will be your character's Charisma." print """Charisma is the measure of the character's combined physical attractiveness, persuasiveness, and personal magnetism. A generally non-beautiful character can have a very high charisma due to strong measures of the other two aspects of charisma.""" charisma=figures[0] del figures print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '....... Physical Traits .......' print 'strength = %s ' % strength print 'dexterity = %s ' % dexterity print 'constitution = %s ' % constitution print '....... Mental Traits .......' print 'intelligence = %s ' % intelligence print 'charisma = %s ' % charisma print 'wisdom = %s ' % wisdom print '' if strength in (8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18) and dexterity in (3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17) and constitution in (11, 12, 13, 14, 15, 16, 17, 18) and charisma in (8, 9, 10, 11, 12, 13, 14, 15, 16, 17): print 'You are eligible to be a dwarf.' if dexterity in (6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18) and constitution in (7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18) and intelligence in (8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18) and charisma in (8, 9, 10, 11, 12, 13, 14, 15, 16, 17): print 'You are eligible to be an elf.' if strength in (6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18) and constitution in (8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18) and intelligence in (6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18): print 'You are eligilbe to be a gnome.' if dexterity in (6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18) and constitution in (6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18) and intelligence in (4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18): print 'You are eligilbe to be a half-elf.' if strength in (7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18) and dexterity in (7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18) and constitution in (10, 11, 12, 13, 14, 15, 16, 17, 18) and intelligence in (6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18) and wisdom in (3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17): print 'You are eligilbe to be a halfling.' print 'You are eligible to be a human.' print '' race=raw_input('Which race do you want your character to be? ') if race is 'dwarf' or 'Dwarf': constitution==constitution+1 charisma==charisma-1 if race is 'elf' or 'Elf': dexterity=dexterity+1 constitution=constitution-1 if race is 'gnome' or 'Gnome': intelligence=intelligence+1 wisdom=wisdom-1 if race is 'halfling' or 'Halfling': dexterity=dexterity+1 strength=strength-1 print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print "your character's sex is %s" % sex print "your character's race is %s" % race print '' print '....... Physical Traits .......' print 'strength = %s ' % strength print 'dexterity = %s ' % dexterity print 'constitution = %s ' % constitution print '....... Mental Traits .......' print 'intelligence = %s ' % intelligence print 'charisma = %s ' % charisma print 'wisdom = %s ' % wisdom print '' if strength in (9, 10, 11, 12, 13, 14, 15, 16, 17, 18): print 'you are eligible to be a warrior.' if intelligence in (9, 10, 11, 12, 13, 14, 15, 16, 17, 18): print 'you are eligilbe to be a mage.' if wisdom in (9, 10, 11, 12, 13, 14, 15, 16, 17, 18): print 'you are eligilbe to be a cleric.' if dexterity in (9, 10, 11, 12, 13, 14, 15, 16, 17, 18): print 'you are eligilbe to be a thief.' print '' class1=raw_input('Which class do you want to be? ') print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '--------------------------------------' print "Your character's sex is: %s" % sex print "Your character's name is: %s" % name print "Your character's race is: %s" % race print "Your character's class is: %s" % class1 print '--------------------------------------' print '....... Physical Traits .......' print 'strength = %s ' % strength print 'dexterity = %s ' % dexterity print 'constitution = %s ' % constitution print '....... Mental Traits .......' print 'intelligence = %s ' % intelligence print 'charisma = %s ' % charisma print 'wisdom = %s ' % wisdom print '' yes="yes" name2=raw_input("Now that you know this, do you wish to change your character's name? yes / no. ") if name2==yes: name=raw_input(" What do you wish to name your character? ") else: print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' print '' Lawful="Lawful" Chaotic="Chaotic" Neutral="Neutral" Good="Good" Evil="Evil" lawful="lawful" chaotic="chaotic" neutral="neutral" good="good" evil="evil" print '.......... Alignments 1: Law and Chaos .............' print '' for n in range(1,50): aligninfo=raw_input("You may choose to be Lawful, Neutral or Chaotic. For more information, type in the alignment you want more information about. If you do not want any information and just want to get on with choosing, just press enter. ") if aligninfo==Lawful: print "" print 'Lawful characters tell the truth, keep their words, respect authority, honor tradition and judge those who fall short of their duties.' print "" print "" elif aligninfo==Chaotic: print "" print 'Chaotic characters follow their consciences, resent being told what to do, favor new ideas over tradition and do what they promise if they feel like it.' print "" print "" elif aligninfo==Neutral: print "" print 'People who are neutral with respect to law and chaos have a normal respect for authority and feel neither a compulsion to obey nor to rebel, they are honest, but can be tempted into lying or decieving others.' print "" print "" elif aligninfo==lawful: print "" print 'Lawful characters tell the truth, keep their words, respect authority, honor tradition and judge those who fall short of their duties.' print "" print "" elif aligninfo==chaotic: print "" print 'Chaotic characters follow their consciences, resent being told what to do, favor new ideas over tradition and do what they promise if they feel like it.' print "" print "" elif aligninfo==neutral: print "" print 'People who are neutral with respect to law and chaos have a normal respect for authority and feel neither a compulsion to obey nor to rebel, they are honest, but can be tempted into lying or decieving others.' print "" print "" else: print "" print "" break al1=raw_input("Enter the alignment you have chosen. ") print "" print "Thank you! Moving on!" print "" print "" print ".......... Alignments 2: Good versus Evil .........." print "" for n in range(1,50): aligninfo=raw_input("You may choose to be either Good, Neutral or Evil. If you want some general info on the different alignments; type either Good, Neutral or Evil. If not, simply press enter. ") if aligninfo==Good: print "" print '"Good" implies altruism, respect for life, and a concern for the dignity of sentinent beings. Good characters make personal sacrifises to help others.' print "" print "" elif aligninfo==Neutral: print "" print "People who are neutral with respect to good and evil have compunctions against killing the innocent but lack the commitment to make sacrifices to protect or help others. Neutral people are committed to others through personal relationships. A neutral person may sacrifice himself to protect his family or even his homeland, but he would not do so for strangers who are not related to him." print "" print "" elif aligninfo==Evil: print "" print '"Evil" implies hurting, oppressing and killing others. Some evil creatures simply have no compassion for others and would kill without qualms if doing so is convenient. Others actively pursue evil, killing for sport or out of duty to some evil deity or master' print "" print "" elif aligninfo==good: print "" print '"Good" implies altruism, respect for life, and a concern for the dignity of sentinent beings. Good characters make personal sacrifises to help others.' print "" print "" elif aligninfo==neutral: print "" print "People who are neutral with respect to good and evil have compunctions against killing the innocent but lack the commitment to make sacrifices to protect or help others. Neutral people are committed to others through personal relationships. A neutral person may sacrifice himself to protect his family or even his homeland, but he would not do so for strangers who are not related to him." print "" print "" elif aligninfo==evil: print "" print '"Evil" implies hurting, oppressing and killing others. Some evil creatures simply have no compassion for others and would kill without qualms if doing so is convenient. Others actively pursue evil, killing for sport or out of duty to some evil deity or master' print "" print "" else: print "" print "" break al2=raw_input("Type the alignment which you have chosen. ") print "" print "" print "" print '' print '' print '' print '' print 'Congratulations, you have successfully created a dungeons and dragons character.' print '--------------------------------------' print "Your character's sex is: %s" % sex print "Your character's name is: %s" % name print "Your character's race is: %s" % race print "Your character's class is: %s" % class1 print '--------------------------------------' print '....... Physical Traits .......' print 'strength = %s ' % strength print 'dexterity = %s ' % dexterity print 'constitution = %s ' % constitution print '....... Mental Traits .......' print 'intelligence = %s ' % intelligence print 'charisma = %s ' % charisma print 'wisdom = %s ' % wisdom print '--------------------------------------' print 'Alignment:' , al1 , al2 print '' print '' print '' fn=r'c:\programfiler\python script\characters.txt' outlist=[name,sex,race,class1,strength,dexterity,constitution,intelligence,charisma,wisdom,(al1+" "+al2)] stuff=["Name","Sex","Race","Class","Strength","Dexterity","Constitution","Intelligence","Charisma","Wisdom","Alignment"] finallist=['%s=%s' % (stuff[n],outlist[n]) for n in range(len(stuff))] f=open(fn,'a') f.write('\n'.join(finallist)) f.close() fn=r'c:\programfiler\python script\characters.txt' f=open(fn,'a') f.write('\n'.join('\n')) f.close() fn=r'c:\programfiler\python script\characters.txt' f=open(fn,'a') f.write('\n'.join('\n')) f.close() fn=r'c:\programfiler\python script\characters.txt' f=open(fn,'a') f.write('\n'.join('\n')) f.close() for n in range(20): if strength is n: strength=str(n) if dexterity is n: dexterity=str(n) if constitution is n: constitution=str(n) if intelligence is n: intelligence=str(n) if wisdom is n: wisdom=str(n) if charisma is n: charisma=str(n) fn=r'c:\programfiler\python script\character-pro.txt' f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("--------------------------------") f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("This character's name is: ") f.close() f=open(fn, 'a') f.write(name) f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("It is a: ") f.close() f=open(fn, 'a') f.write(race) f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("It's sex is: ") f.close() f=open(fn, 'a') f.write(sex) f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() if sex=="female": f=open(fn, 'a') f.write("She is a: ") f.close() f=open(fn, 'a') f.write(class1) f.close() elif sex=="Female": f=open(fn, 'a') f.write("She is a: ") f.close() f=open(fn, 'a') f.write(class1) f.close() elif sex=="male": f=open(fn, 'a') f.write("He is a: ") f.close() f=open(fn, 'a') f.write(class1) f.close() elif sex=="Male": f=open(fn, 'a') f.write("He is a: ") f.close() f=open(fn, 'a') f.write(class1) f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("--------------------------------") f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("....... Physical Traits .......") f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("Strength: ") f.close() f=open(fn, 'a') f.write(strength) f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("Dexterity: ") f.close() f=open(fn, 'a') f.write(dexterity) f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("Constitution: ") f.close() f=open(fn, 'a') f.write(constitution) f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("........ Mental Traits ........") f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("Intelligence: ") f.close() f=open(fn, 'a') f.write(intelligence) f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("Charisma: ") f.close() f=open(fn, 'a') f.write(charisma) f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("Wisdom: ") f.close() f=open(fn, 'a') f.write(wisdom) f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("--------------------------------") f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write("Alignment: ") f.close() f=open(fn, 'a') f.write(al1) f.close() f=open(fn, 'a') f.write(" ") f.close() f=open(fn, 'a') f.write(al2) f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() f=open(fn, 'a') f.write('\n'.join('\n')) f.close() raw_input("You are finished! To quit this character-creator; press enter.")