mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-02 19:08:47 +02:00
25 lines
704 B
Python
25 lines
704 B
Python
class Encounter:
|
|
"""A combat encounter between two parties -- good guys and bad guys"""
|
|
|
|
def __init__(self, group_a, group_b):
|
|
self.group_a = group_a
|
|
self.group_b = group_b
|
|
self.all_agents = group_a + group_b
|
|
|
|
def rating(self):
|
|
raise NotImplementedError() # Deadly for Python :/
|
|
|
|
def simulate(self):
|
|
"""Who will win?"""
|
|
|
|
# Initiative
|
|
for agent in self.all_agents:
|
|
agent.roll_initiative()
|
|
|
|
self.all_agents = sorted(self.all_agents, key=lambda a: a.initiative_roll)
|
|
|
|
|
|
def analyze(self):
|
|
"""So, really... how deadly *is* it?"""
|
|
raise NotImplementedError() # TODO: Run a Monte-Carlo simulation
|