mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-13 16:13:32 +02:00
Start Conditions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user