buff property that returns time left
This commit is contained in:
parent
03425df669
commit
6d3fdc512f
1 changed files with 10 additions and 0 deletions
|
|
@ -144,6 +144,16 @@ class BaseBuff:
|
||||||
return None
|
return None
|
||||||
return self.handler.owner
|
return self.handler.owner
|
||||||
|
|
||||||
|
@property
|
||||||
|
def timeleft(self):
|
||||||
|
"""Returns how much time this buff has left"""
|
||||||
|
_tl = 0
|
||||||
|
if not self.start:
|
||||||
|
_tl = self.duration
|
||||||
|
else:
|
||||||
|
_tl = self.duration - (time.time() - self.start)
|
||||||
|
return _tl
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ticking(self) -> bool:
|
def ticking(self) -> bool:
|
||||||
"""Returns if this buff ticks or not (tickrate => 1)"""
|
"""Returns if this buff ticks or not (tickrate => 1)"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue