Compare commits
2 Commits
3de42211c2
...
74881a607c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74881a607c | ||
|
|
215361e4d9 |
13
main.py
13
main.py
@@ -3,12 +3,13 @@ import random
|
|||||||
|
|
||||||
class PlayerCharacter:
|
class PlayerCharacter:
|
||||||
def __init__(self, attributes={}) -> None:
|
def __init__(self, attributes={}) -> None:
|
||||||
self.strength = roll_dice(3,6) if not attributes else attributes['strength']
|
# using a get() method to pull an attribute else use a default value, https://python-academy.org/en/handbook/get
|
||||||
self.intelligence = roll_dice(3,6) if not attributes else attributes['intelligence']
|
self.strength = attributes.get('strength', roll_dice(3,6))
|
||||||
self.wisdom = roll_dice(3,6) if not attributes else attributes['wisdom']
|
self.intelligence = attributes.get('intelligence', roll_dice(3,6))
|
||||||
self.dexterity = roll_dice(3,6) if not attributes else attributes['dexterity']
|
self.wisdom = attributes.get('wisdom', roll_dice(3,6))
|
||||||
self.constitution = roll_dice(3,6) if not attributes else attributes['constitution']
|
self.dexterity = attributes.get('dexterity', roll_dice(3,6))
|
||||||
self.charisma = roll_dice(3,6) if not attributes else attributes['charisma']
|
self.constitution = attributes.get('constitution', roll_dice(3,6))
|
||||||
|
self.charisma = attributes.get('charisma', roll_dice(3,6))
|
||||||
|
|
||||||
def class_selector(self):
|
def class_selector(self):
|
||||||
# take the 4 primary attribtues
|
# take the 4 primary attribtues
|
||||||
|
|||||||
Reference in New Issue
Block a user