Add comments in stored counter class definition

This commit is contained in:
katze 2024-03-09 15:58:37 +08:00
parent f5bc0d0ce1
commit 2bc797f3e2
3 changed files with 10 additions and 5 deletions

View File

@ -205,7 +205,12 @@ class StoredImmersifier(StoredCounter):
class StoredSimulatedUniverse(StoredCounter, StoredExpiredAtMonday0400): class StoredSimulatedUniverse(StoredCounter, StoredExpiredAtMonday0400):
# These variables are used in Rogue Farming feature.
# Times of boss drop chance per week. In current version of StarRail, this value is 100.
FIXED_DEFAULT = 100 FIXED_DEFAULT = 100
# Times left to farm. Resets to 100 every Monday 04:00, and decreases each time the elite boss is cleared.
FarmingCounter = FIXED_DEFAULT FarmingCounter = FIXED_DEFAULT
def farm_dec(self, value = 1): def farm_dec(self, value = 1):
@ -214,7 +219,7 @@ class StoredSimulatedUniverse(StoredCounter, StoredExpiredAtMonday0400):
def farm_reset(self,): def farm_reset(self,):
self.FarmingCounter = self.FIXED_DEFAULT self.FarmingCounter = self.FIXED_DEFAULT
def farm_not_full(self) -> bool: def farm_not_complete(self) -> bool:
return self.FarmingCounter > 0 return self.FarmingCounter > 0
def farm_get_remain(self) -> int: def farm_get_remain(self) -> int:

View File

@ -355,7 +355,7 @@ class RogueEntry(RouteBase, RogueRewardHandler, RoguePathHandler, DungeonUI):
if self.config.RogueWorld_UseImmersifier and self.config.stored.Immersifier.value > 0: if self.config.RogueWorld_UseImmersifier and self.config.stored.Immersifier.value > 0:
logger.info( logger.info(
'Reached weekly point limit but still have immersifiers left, continue to use them') 'Reached weekly point limit but still have immersifiers left, continue to use them')
elif self.config.RogueWorld_WeeklyFarming and self.config.stored.SimulatedUniverse.farm_not_full(): elif self.config.RogueWorld_WeeklyFarming and self.config.stored.SimulatedUniverse.farm_not_complete():
logger.attr( logger.attr(
"Farming Counter", self.config.stored.SimulatedUniverse.farm_get_remain()) "Farming Counter", self.config.stored.SimulatedUniverse.farm_get_remain())
logger.info( logger.info(

View File

@ -171,8 +171,8 @@ class RouteBase(RouteBase_, RogueExit, RogueEvent, RogueReward):
result = super().clear_enemy(*waypoints) result = super().clear_enemy(*waypoints)
# runs when one elite battle finishes (do not handle whether battle succeeded or failed), and decreases rogue farming count by 1 # runs when one elite battle finishes (do not handle whether the battle succeeded or failed), and decreases rogue farming count by 1
if self.config.RogueWorld_WeeklyFarming and self.config.stored.SimulatedUniverse.farm_not_full(): if self.config.RogueWorld_WeeklyFarming and self.config.stored.SimulatedUniverse.farm_not_complete():
self.config.stored.SimulatedUniverse.farm_dec() self.config.stored.SimulatedUniverse.farm_dec()
logger.info( logger.info(
f"Cleared elite boss, decrease farming count by 1, now {self.config.stored.SimulatedUniverse.FarmingCounter}") f"Cleared elite boss, decrease farming count by 1, now {self.config.stored.SimulatedUniverse.FarmingCounter}")