-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcharacter.py
138 lines (119 loc) · 3.24 KB
/
character.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
from tools import *
from race import *
class Character(object):
def __init__(self):
self.STR = 0
self.RB_STR = 0 #RB = Race Bonus
self.DEX = 0
self.RB_DEX = 0
self.CON = 0
self.RB_CON = 0
self.INT = 0
self.RB_INT = 0
self.WIS = 0
self.RB_WIS = 0
self.CHA = 0
self.RB_CHA = 0
self.HP_MAX = 0
self.gender = "none"
self.character_name = "none"
self.race_name = "none"
self.class_name = "none" #Class level, experience points
self.axis = "none" #Lawful, nuetral, chaotic
self.alignment = "none" #Good, neutral, evil
self.age_title = "none"
self.age = 0
def fc_gender(self):
gender_var = raw_input("Choose a gender:\n\n\t[F]emale\n\t[M]ale\n\t[R]andom\n\n>>: ")
if gender_var.lower() == "f":
self.gender = "Female"
elif gender_var.lower() == "m":
self.gender = "Male"
elif gender_var.lower() == "r":
var = d(1,2)
if var == 1:
self.gender = "Female"
elif var == 2:
self.gender = "Male"
else:
self.gender = "none"
def fc_RB_reset(): #resets race bonus to 0
self.RB_STR = 0
self.RB_DEX = 0
self.RB_CON = 0
self.RB_INT = 0
self.RB_WIS = 0
self.RB_CHA = 0
def fc_race_dwarf(self):
self.race_name = "Dwarf"
self.RB_CON += 2
def fc_age_title(self):
age_title_var = raw_input("Select the age group of the NPC:\n\n\t[B]aby\n\t[Y]outh\n\t[M]iddle Age\n\t[E]lder\n\t[R]andom\n\n>>: ")
if age_title_var.lower() == "b":
self.age_title = "Baby"
elif age_title_var.lower() == "y":
self.age_title = "Youth"
elif age_title_var.lower() == "m":
self.age_title = "Middle Age"
elif age_title_var.lower() == "e":
self.age_title = "Elder"
elif age_title_var.lower() == "r":
var = d(1,100)
if var <= 5:
self.age_title = "Baby"
elif var > 5 and var <= 25:
self.age_title = "Youth"
elif var > 25 and var <= 85:
self.age_title = "Middle Age"
elif var > 85:
self.age_title = "Elder"
else:
self.age_title = "none"
def fc_stat_roll(self): #Manual entry, roll, ask if stats would like to be kept.
num = 3
if self.age_title == "Baby":
num = 1
elif self.age_title == "Youth":
num = 2
elif self.age_title == "Middle Age":
num = 3
elif self.age_title == "Elder":
num = 2
else:
num = 3
self.STR += d(num, 6)
self.DEX += d(num, 6)
self.CON += d(num, 6)
self.INT += d(num, 6)
self.WIS += d(num, 6)
self.CHA += d(num, 6)
def fc_name(self, name="none"):
if name == "none":
self.name = raw_input("What is your name?\n\n>>: ")
print self.name
else:
self.name = name
print name
def print_char(self):
print "Character Name:", self.character_name
print "Race:", self.race_name
print "Class/Occupation:", self.class_name
print "Age Title:", self.age_title
print "Gender:", self.gender
print " "
print "Character Stats:", "\n"
print "\tSTR:", self.STR
print "\tDEX:", self.DEX
print "\tCON:", self.CON
print "\tINT:", self.INT
print "\tWIS:", self.WIS
print "\tCHA:", self.CHA
print "\n\n"
#x = Character()
#while x.race_name == "none":
# x.fc_race()
#while x.age_title == "none":
# x.fc_age_title()
#while x.STR == 0:
# x.fc_stat_roll()
#x.print_char()