Skip to content

Yurlungur/pyparty_manager

Repository files navigation

pyparty_manager
Author: Jonah Miller (jonah.miller@colorado.edu)
Licensed under the GNU Public License

A party management system for D&D written in python.
Works only in command line. Best in ipython with python 3.
From within ipython run
from party_manager import *
Initializes the characters under characters.py and legacy.py immediately.

TODO: port characters from legacy.py to characters.py for consistency

USE:

Each character is an instance of the character object. You can access their attributes as 
charactername.ATTRIBUTE

each attribute is uppercase for consistency reasons (and so int and
INT don't conflict).

Skills are a little different.  

charactername.SKILLS is a dictionary

containing all skills the character knows. Keys are skill names
(upper-case strings) and values are skill modifier.

Similarly, each attack is an object (an instance of the weapon class)
which can make attacks and handle criticals. Attack objects are also
in a dictionary. The dictionary is

charactername.ATTACKS

The keys are strings (not uppercase. I know this is bad style). The
values are instances of the weapon class. 

The character object also has functions to roll skill and attributes.
character.roll_skill('SKILL')
returns an ordered pair. The first element is the result of the roll.
 The second is the bonus on the roll. Here 'SKILL' is the upper case name of 
the skill as a string. Untrained skills can be rolled, but the program doesn't 
prevent players from rolling skills they shouldn't be able to roll. That's up 
to the DM.

You can roll attributes analogously.
character.roll_att('ATTRIBUTE')

To make an attack
character.ATTACKS['attack name'].make_attack()

'attack name' is a string for the attack name. To list all attacks available,
 try character.ATTACKS.keys().

The make_attack() function returns a pair of lists. The first list
contains attack roll results for each attack allowed. The second
contains damage roll results. Criticals are accounted for.


There are also some nice shortcuts for rolling things for all
registered party members. roll_skill('SKILL') and roll_att('ATTRIBUTE') work 
like they do for the character class, but they print results and bonuses for 
every character.

Other nice shortcuts are:
initiative(),spot(),listen(),search(),hide(), and move_silently().

About

D&D Party Manager Written in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages