mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
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 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
|
||||
def ticking(self) -> bool:
|
||||
"""Returns if this buff ticks or not (tickrate => 1)"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue