0.1.5::wyckedsceptre::wyckedsceptre Namespace Reference

Classes

class  Die
 Object for simulating a set of an m-numbered set of n-sided dice. More...
class  Attack
 An object for simulating a single RPG attack. More...
class  Character
 An object that describes an individual character. More...
class  Encounter
 An object that describes a combat encounter between two parties. More...

Functions

def assert_positive_integer
 Verifies that a value is a positive integer or zero.
def abil_to_mod
 Converts an ability score to its modifier.
def roll_new_character
 Creates a new random character.
def load_file
 Loads a single object from a save file in pickle format.
def save_file
 Saves an object to a pickle file obj An object or variable to save out in pickle format filename The path to a file to save to (overwrite).

Function Documentation

def 0.1.5::wyckedsceptre::wyckedsceptre::abil_to_mod (   ability_score  ) 

Converts an ability score to its modifier.

Negative modifiers are possible

Parameters:
ability_score 
Returns:
the corresponding modifier for an ability score as an integer example: a Strength of 17 has a +3 strength modifier
def 0.1.5::wyckedsceptre::wyckedsceptre::assert_positive_integer (   val_to_test,
  val_name = 'Value' 
)

Verifies that a value is a positive integer or zero.

Parameters:
val_to_test Value to test if it is a positive integer or zero
val_name A string name to describe that variable, to be used in the exception text if raised ValueError If val_to_test is < 0 or not an integer
def 0.1.5::wyckedsceptre::wyckedsceptre::load_file (   filename  ) 

Loads a single object from a save file in pickle format.

Parameters:
filename the string path to a file in pickle format
Returns:
The object if it exists in the file
False if the object/file could not be read correctly
def 0.1.5::wyckedsceptre::wyckedsceptre::roll_new_character (   new_name,
  new_class 
)

Creates a new random character.

Parameters:
NewName A string that names the character
NewClass A string that is the class of the character
Returns:
a new Character object
def 0.1.5::wyckedsceptre::wyckedsceptre::save_file (   obj,
  filename 
)

Saves an object to a pickle file obj An object or variable to save out in pickle format filename The path to a file to save to (overwrite).

Returns:
True if the file was written correctly
False if the file could not be written to properly
Generated on Tue Nov 2 22:28:25 2010 for wyckedsceptre by  doxygen 1.6.3