0.2.0::wyckedsceptre::wyckedsceptre::Encounter Class Reference

An object that describes a combat encounter between two parties. More...

Inheritance diagram for 0.2.0::wyckedsceptre::wyckedsceptre::Encounter:
Inheritance graph
[legend]
Collaboration diagram for 0.2.0::wyckedsceptre::wyckedsceptre::Encounter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
 Default constructor for Encounter object sets all members to empty, no players or npc's.
def encounter_statistics
 runs the encounter num_rounds and returns percentage of the time that the Players won.
def run_encounter
 Start simulating an encounter after it has been properly initialized Will simulate the encounter until all members of one of the two parties are unconcious or dead.
def __run_round__
 Private function that simulates an individual round in an encounter RunRound iterates through each character's turn according to the run order.
def add_character
 Adds a single character to an Encounter object.
def players_any_concious
 Determines if any Player characters are currently concious.
def reset_all_health
 restores all characters to max hit points
def npcs_any_concious
 Determines if any NPC characters are currently concious.

Public Attributes

 players
 The list of Character objects that are Player controlled.
 npcs
 The list of Character objects that are NPC's.
 run_order
 The list of Character objects in order of initiative.
 active_turn
 An iterator pointing to the current player's turn.

Detailed Description

An object that describes a combat encounter between two parties.


Member Function Documentation

def 0.2.0::wyckedsceptre::wyckedsceptre::Encounter::__init__ (   self  ) 

Default constructor for Encounter object sets all members to empty, no players or npc's.

Returns:
an initialized Encounter object
def 0.2.0::wyckedsceptre::wyckedsceptre::Encounter::__run_round__ (   self  ) 

Private function that simulates an individual round in an encounter RunRound iterates through each character's turn according to the run order.

Assumes: initiatives have already been rolled the characters have been ordered accordingly

Todo:
implement __run_round__
def 0.2.0::wyckedsceptre::wyckedsceptre::Encounter::add_character (   self,
  new_char,
  group 
)

Adds a single character to an Encounter object.

Parameters:
NewChar A Character object to add to the encounter
group A string that is either 'players' or 'npcs'
Returns:
True if the character was added properly
False if the character couldn't be added or 'group' is not either 'players' or 'npcs'
Todo:
add return values
def 0.2.0::wyckedsceptre::wyckedsceptre::Encounter::encounter_statistics (   self,
  num_rounds = 100 
)

runs the encounter num_rounds and returns percentage of the time that the Players won.

Todo:
reset the player stats after a round
def 0.2.0::wyckedsceptre::wyckedsceptre::Encounter::npcs_any_concious (   self  ) 

Determines if any NPC characters are currently concious.

Returns:
True if at least 1 member of the npcs group is concious
False if there are no members in the npcs group or if none are concious
def 0.2.0::wyckedsceptre::wyckedsceptre::Encounter::players_any_concious (   self  ) 

Determines if any Player characters are currently concious.

Returns:
True if at least 1 member of the players group is concious
False if there are no members in the players group or if none are concious
Todo:
make it reference the current values
def 0.2.0::wyckedsceptre::wyckedsceptre::Encounter::reset_all_health (   self  ) 

restores all characters to max hit points

def 0.2.0::wyckedsceptre::wyckedsceptre::Encounter::run_encounter (   self  ) 

Start simulating an encounter after it has been properly initialized Will simulate the encounter until all members of one of the two parties are unconcious or dead.

Todo:
implement run_encounter

Member Data Documentation

An iterator pointing to the current player's turn.

The list of Character objects that are NPC's.

The list of Character objects that are Player controlled.

The list of Character objects in order of initiative.


The documentation for this class was generated from the following file:
Generated on Sat Nov 6 00:00:02 2010 for wyckedsceptre by  doxygen 1.6.3