Start Conditions

This commit is contained in:
Matthew DeMartino
2021-05-22 23:54:19 -04:00
parent 947623c42d
commit 285312c0a4
4 changed files with 32 additions and 13 deletions
+5 -10
View File
@@ -1,16 +1,10 @@
class Encounter:
"""A combat encounter between two parties -- good guys and bad guys"""
def __init__(self, *parties):
if len(parties) < 2:
raise ValueError("You need at least 2 parties to hold an encounter")
if len(parties) is not 2:
raise NotImplementedError("Haven't implemented AI for 3+ groups") # TODO: Implement this
# Combine all parties into a single group
self.all_agents = parties[0]
for party in parties[1:]:
self.all_agents += party
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 :/
@@ -21,6 +15,7 @@ class Encounter:
# Initiative
for agent in self.all_agents:
agent.roll_initiative()
self.all_agents = sorted(self.all_agents, key=lambda a: a.initiative_roll)
raise NotImplementedError() # Apparently the mind flayers win for now