0.1.5::wyckedsceptre::wyckedsceptre::Encounter Class Reference

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

Inheritance diagram for 0.1.5::wyckedsceptre::wyckedsceptre::Encounter:
Inheritance graph
[legend]
Collaboration diagram for 0.1.5::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 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 npcs_any_concious
 Determines if any NPC characters are currently concious.
def roll_initiatives
 Rolls initiatives for each character in the encounter and sorts them according to initiative.

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.1.5::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.1.5::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.1.5::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.1.5::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.1.5::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
def 0.1.5::wyckedsceptre::wyckedsceptre::Encounter::roll_initiatives (   self  ) 

Rolls initiatives for each character in the encounter and sorts them according to initiative.

Todo:
need pointers to character objs
def 0.1.5::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 Tue Nov 2 22:28:25 2010 for wyckedsceptre by  doxygen 1.6.3