Make transition exit at 50% of count depletion

speeds up exit states to look smoother
This commit is contained in:
Blabzillaweasel 2025-02-16 00:53:16 +13:00
parent 28b6c58a49
commit 55bcdec3cc
2 changed files with 6 additions and 3 deletions

View File

@ -33,4 +33,7 @@ class CycleCounter:
self.max_count = max_count
def force_complete(self):
self.count = self.max_count
self.count = self.max_count
def less_than_percentage(self,mult):
return self.count <= self.max_count * mult

View File

@ -179,7 +179,7 @@ class MirrorTrack:
elif cls.cyc_counter_stare.active():
cls.cyc_counter_stare.decrease()
if not cls.cyc_counter_stare.active():
if cls.cyc_counter_stare.less_than_percentage(0.5):
if cls.bypass_stare:
cls.bypass_stare = False
if not cls.is_tracking_mode():
@ -205,7 +205,7 @@ class MirrorTrack:
elif cls.cyc_counter_inv.active():
cls.cyc_counter_inv.decrease()
if not cls.cyc_counter_inv.active():
if cls.cyc_counter_inv.less_than_percentage(0.5):
if cls.bypass_stare:
cls.bypass_stare = False
if cls.is_inverted_mode():