alter_cache helper method on buffs

This commit is contained in:
Tegiminis 2022-08-05 11:30:28 -07:00
parent 6d3fdc512f
commit dce7fc8b1c

View file

@ -232,8 +232,18 @@ class BaseBuff:
def reset(self):
"""Resets the buff start time as though it were just applied; functionally identical to a refresh"""
self.start = time.time()
self.handler.buffcache[self.buffkey]["start"] = time.time()
def alter_cache(self, to_cache: dict = None):
"""Alters this buff's cache, both internally (this instance) and on the handler's buff cache."""
if not isinstance(to_cache, dict):
raise TypeError
_cache = dict(self.handler.buffcache[self.buffkey])
_cache.update(to_cache)
self.cache = _cache
self.handler.buffcache[self.buffkey] = _cache
# endregion
# region hook methods