An object that describes a combat encounter between two parties. More...
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. |
An object that describes a combat encounter between two parties.
def 0.1.5::wyckedsceptre::wyckedsceptre::Encounter::__init__ | ( | self | ) |
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
def 0.1.5::wyckedsceptre::wyckedsceptre::Encounter::add_character | ( | self, | ||
new_char, | ||||
group | ||||
) |
Adds a single character to an Encounter object.
NewChar | A Character object to add to the encounter | |
group | A string that is either 'players' or 'npcs' |
def 0.1.5::wyckedsceptre::wyckedsceptre::Encounter::npcs_any_concious | ( | self | ) |
Determines if any NPC characters are currently concious.
def 0.1.5::wyckedsceptre::wyckedsceptre::Encounter::players_any_concious | ( | self | ) |
Determines if any Player characters are currently 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.
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.
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.