mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-05-18 20:23:27 +02:00
Start Conditions
This commit is contained in:
+18
-3
@@ -1,8 +1,10 @@
|
||||
from dungeonsheets.stats import Ability, ArmorClass, Initiative, Speed, Skill
|
||||
from dungeonsheets.conditions.conditions import Blinded, Charmed
|
||||
from dungeonsheets.stats import Ability, ArmorClass, Initiative, Speed, Skill, CurrentInitiative, CurrentHP
|
||||
from abc import ABC
|
||||
|
||||
|
||||
class Agent:
|
||||
"""An actor in an encounter"""
|
||||
class Agent(ABC):
|
||||
"""An actor in an encounter. Use Monster or Character, not this class directly!"""
|
||||
|
||||
# General attributes
|
||||
name = ""
|
||||
@@ -51,6 +53,10 @@ class Agent:
|
||||
stealth = Skill(ability="dexterity")
|
||||
survival = Skill(ability="wisdom")
|
||||
|
||||
# Conditions
|
||||
blinded = Blinded()
|
||||
charmed = Charmed()
|
||||
# TODO finish me!
|
||||
|
||||
# Inventory
|
||||
cp = 0
|
||||
@@ -74,9 +80,18 @@ class Agent:
|
||||
custom_features = list()
|
||||
feature_choices = list()
|
||||
|
||||
# Current Status:
|
||||
initiative_roll = CurrentInitiative()
|
||||
current_hp = CurrentHP()
|
||||
statuses = list()
|
||||
|
||||
# TODO: Pull in the monster class-variables here too
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
# TODO: Perhaps these are better stored like the skills are as objects with a __get__?
|
||||
|
||||
@property
|
||||
def actions(self):
|
||||
"""All the things I can do in a turn"""
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class Condition:
|
||||
"""A condition that can be held by an agent"""
|
||||
pass
|
||||
|
||||
class Blinded(Condition):
|
||||
pass
|
||||
|
||||
class Charmed(Condition):
|
||||
pass
|
||||
@@ -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