mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-05 12:29:39 +02:00
added primary ability and new AC and speed calculations
This commit is contained in:
@@ -26,11 +26,15 @@ class Feature():
|
||||
Provide full text of rules in documentation
|
||||
"""
|
||||
name = "Generic Feature"
|
||||
owner = None
|
||||
source = '' # race, class, background, etc.
|
||||
spells_known = ()
|
||||
spells_prepared = ()
|
||||
needs_implementation = False # Set to True if need to find way to compute stats
|
||||
|
||||
def __init__(self, owner):
|
||||
self.owner = owner
|
||||
|
||||
def __eq__(self, other):
|
||||
return (self.name == other.name) and (self.source == other.source)
|
||||
|
||||
@@ -62,26 +66,6 @@ class Feature():
|
||||
"""
|
||||
return weapon
|
||||
|
||||
def AC_func(self, char, **kwargs):
|
||||
"""
|
||||
Return the alternative AC from having this feat
|
||||
|
||||
The character will take max AC from all available feats / standard AC,
|
||||
so the default is to output very low AC
|
||||
|
||||
Parameters
|
||||
----------
|
||||
char
|
||||
Character object, to check for necessary abilities, etc.
|
||||
kwargs
|
||||
Any other key-word arguments the function may require
|
||||
|
||||
Returns
|
||||
-------
|
||||
AC : integer armor class from this feature
|
||||
"""
|
||||
return -100
|
||||
|
||||
|
||||
class FeatureSelector(Feature):
|
||||
"""
|
||||
@@ -89,11 +73,13 @@ class FeatureSelector(Feature):
|
||||
"""
|
||||
options = dict()
|
||||
|
||||
def __init__(self, feature_choices=[]):
|
||||
def __init__(self, owner, feature_choices=[]):
|
||||
self.owner = owner
|
||||
keep_source = self.source
|
||||
# Look for matching feature_choices
|
||||
for selection in feature_choices:
|
||||
if selection.lower() in self.options():
|
||||
feature_choices.remove(selection)
|
||||
new_feat = self.options[selection.lower()]
|
||||
self.__dict__.update(new_feat.__dict__)
|
||||
new_feat.__init__(self)
|
||||
|
||||
Reference in New Issue
Block a user