Coder Social home page Coder Social logo

pyparty_manager's Introduction

pyparty_manager
Author: Jonah Miller ([email protected])
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().

pyparty_manager's People

Contributors

yurlungur avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.