class character():
def __init__(self):
self.name = " "
self.race = " "
self.characterClass = " "
self.gender = " "
self.strength = strength
self.dexterity = dexterity
self.constitution = constitution
self.intelligence = intelligence
self.wisdom = wisdom
self.charisma = charisma
self.advantage = advantage = False
self.languages = []
magic_sleep_immunity = 0
low_light_vision = 0
self.proficincy = []
Darkvision = 0
stonecunning = 0
stability = 0
strength = random.randint(3,18)
dexterity = random.randint(3,18)
constitution = random.randint(3,18)
intelligence = random.randint(3,18)
wisdom = random.randint(3,18)
charisma = random.randint(3,18)
def __getRace__(self):
races = ['human', 'elf', 'dwarf',]
racec = input()
if racec in races:
if racec == "human":
self.race = "human"
size = "medium"
self.languages.append("Common")
speed = 30
human_desc = "Humans are versitile in any role but do not have a specialized role"
print(human_desc)
elif racec == "elf":
race = "elf"
dexterity += 2
constitution -= 2
size = "medium"
speed = 30
magic_sleep_immunity = 1
low_light_vision = 1
proficincy.append("longsword")
proficincy.append("rapier")
proficincy.append("longbow")
proficincy.append("shortbow")
languages.append("Common", "Elvish")
elf_desc = "Elves are skillful but frail. They are good as wizards and marksman"
print(elf_desc)
elif racec == "dwarf":
race = "race"
self.constitution += 2
charisma -= 2
size = "medium"
speed = 20
Darkvision = 1
stonecunning = 1
stability = 1
self.proficincy.append("dwarven waraxe")
self.proficincy.append("dwarven urgrosh")
self.languages.append("Common", "Dwarvish")
dwarf_desc = "Dwarves are tougher but gruff and a bit slower, They are great warriors"
This is the class
import Actual_Functions as ac
This is how I import the file
ac.character.__getRace__()
This is me calling the method to the program and I get:
Traceback (most recent call last):
File "main.py", line 36, in <module>
ac.character.__getRace__()
TypeError: __getRace__() missing 1 required positional argument: 'self'
I know the answer is right there but I'm thankful for anyone's help
What I have tried:
Google, Documentation, and Blogs.