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 | 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. |
An object that describes a combat encounter between two parties.
def 0.2.0::wyckedsceptre::wyckedsceptre::Encounter::__init__ | ( | self | ) |
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
def 0.2.0::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.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.
def 0.2.0::wyckedsceptre::wyckedsceptre::Encounter::npcs_any_concious | ( | self | ) |
Determines if any NPC characters are currently concious.
def 0.2.0::wyckedsceptre::wyckedsceptre::Encounter::players_any_concious | ( | self | ) |
Determines if any Player characters are currently concious.
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.
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.