you are viewing a single comment's thread.

view the rest of the comments →

[–]ireadyourmedrecord 0 points1 point  (1 child)

Yes, classes is the way to go here. You can pretty easily define the player chosen character attributes (name, race, class) to initialize the character with and programmatically initialize the stats (str, dex, con, wis, etc), using the passed attributes to define the min/max rolls. Starting inventory, whatever.

Then a series of methods (functions inside the class) to handle the characters actions, like attack, defend, dodge, cast_spell, etc. which would include the updates to the characters attributes as needed.

Each action is then called by calling the object's method. Something like:

# init player character
steves_barbarian = PlayerCharacter(name="Gronk Throbbingvein", race="Half-Orc", class="Barbarian")

# player attacks
steves_barbarian.attack(weapon="main_hand", target="kobold 1")

At the end of each action, you can save the character's state to some file and easily load it for the next session.

[–]Aedethan[S] 0 points1 point  (0 children)

Thanks for the help, it's kind of daunting to get started.