diff --git a/config/template.json b/config/template.json index 8f8fb56d9..1ef395cea 100644 --- a/config/template.json +++ b/config/template.json @@ -194,8 +194,7 @@ "UseImmersifier": true, "DoubleEvent": true, "UseStamina": false, - "WeeklyFarming": false, - "WeeklyFarmingCount": 0 + "WeeklyFarming": false }, "RogueBlessing": { "PresetBlessingFilter": "preset", diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 0b2e25f14..e06a570af 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -1427,10 +1427,6 @@ "WeeklyFarming": { "type": "checkbox", "value": false - }, - "WeeklyFarmingCount": { - "type": "input", - "value": 0 } }, "RogueBlessing": { diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index ec4bd32e4..9e0274401 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -238,7 +238,6 @@ RogueWorld: DoubleEvent: true UseStamina: false WeeklyFarming: false - WeeklyFarmingCount: 0 RogueBlessing: PresetBlessingFilter: diff --git a/module/config/config_generated.py b/module/config/config_generated.py index 4f2d92239..450762d34 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -134,7 +134,6 @@ class GeneratedConfig: RogueWorld_DoubleEvent = True RogueWorld_UseStamina = False RogueWorld_WeeklyFarming = False - RogueWorld_WeeklyFarmingCount = 0 # Group `RogueBlessing` RogueBlessing_PresetBlessingFilter = 'preset' # preset, custom diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index 1b1e2cedb..af3f38303 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -943,11 +943,7 @@ }, "WeeklyFarming": { "name": "Boss Material Farming", - "help": "Not stop after point reward is full; farm the boss 33 times (i.e., 11 Simulated Universe) instead to obtain trace materials" - }, - "WeeklyFarmingCount": { - "name": "Material Attempts Remaining This Week: X", - "help": "Resets every Monday" + "help": "Do not stop after point reward is full; farm the boss 100 times instead to obtain trace materials" } }, "RogueBlessing": { diff --git a/module/config/i18n/es-ES.json b/module/config/i18n/es-ES.json index def4b7825..22be96fa2 100644 --- a/module/config/i18n/es-ES.json +++ b/module/config/i18n/es-ES.json @@ -943,11 +943,7 @@ }, "WeeklyFarming": { "name": "Recolección de Materiales de Jefes", - "help": "No detenerse después de que los puntos semanales estén llenos, farmear al jefe 33 veces (es decir, 11 simulaciones cósmicas) para obtener materiales de rastro" - }, - "WeeklyFarmingCount": { - "name": "Intentos de Material Restantes Esta Semana: X", - "help": "Se reinicia cada lunes" + "help": "No detenerse después de que los puntos semanales estén llenos, farmear al jefe 100 veces para obtener materiales de rastro" } }, "RogueBlessing": { diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 272429ca7..be59b56d2 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -943,11 +943,7 @@ }, "WeeklyFarming": { "name": "ボス素材を収集", - "help": "週間ポイントが満点に達しても停止せず、33回のボス(つまり11回の模擬宇宙)を収集して軌跡素材を入手" - }, - "WeeklyFarmingCount": { - "name": "今週の素材が残りX回", - "help": "毎週月曜日にリセット" + "help": "週間ポイントが満点に達しても停止せず、100回のボスをファームして軌跡素材を入手" } }, "RogueBlessing": { diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 185558a84..2658d658f 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -943,11 +943,7 @@ }, "WeeklyFarming": { "name": "刷取Boss材料", - "help": "每周积分满后不停止,刷取33次Boss(即11次模拟宇宙)以获取形迹材料" - }, - "WeeklyFarmingCount": { - "name": "本周材料剩余X次", - "help": "每周一重置" + "help": "每周积分满后不停止,刷取100次Boss以获取形迹材料" } }, "RogueBlessing": { diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 5f60af443..6af71b5f5 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -943,11 +943,7 @@ }, "WeeklyFarming": { "name": "刷取Boss材料", - "help": "每週積分滿後不停止,刷取33次Boss(即11次模擬宇宙)以獲取形跡材料" - }, - "WeeklyFarmingCount": { - "name": "本週材料剩餘X次", - "help": "每週一重置" + "help": "每週積分滿後不停止,刷取100次Boss以獲取形跡材料" } }, "RogueBlessing": { diff --git a/module/config/stored/classes.py b/module/config/stored/classes.py index 44e818826..de1c7cdf7 100644 --- a/module/config/stored/classes.py +++ b/module/config/stored/classes.py @@ -205,7 +205,20 @@ class StoredImmersifier(StoredCounter): class StoredSimulatedUniverse(StoredCounter, StoredExpiredAtMonday0400): - pass + FIXED_DEFAULT = 100 + FarmingCounter = FIXED_DEFAULT + + def farm_dec(self, value=1): + self.FarmingCounter -= value + + def farm_reset(self,): + self.FarmingCounter = self.FIXED_DEFAULT + + def farm_not_full(self) -> bool: + return self.FarmingCounter > 0 + + def farm_get_remain(self) -> int: + return self.FarmingCounter class StoredAssignment(StoredCounter): diff --git a/tasks/rogue/entry/entry.py b/tasks/rogue/entry/entry.py index 0ec0b4009..723a668d9 100644 --- a/tasks/rogue/entry/entry.py +++ b/tasks/rogue/entry/entry.py @@ -348,14 +348,16 @@ class RogueEntry(RouteBase, RogueRewardHandler, RoguePathHandler, DungeonUI): return if self.config.stored.SimulatedUniverse.is_expired(): - # Expired, do rogue and reset weekly farming count - self.config.RogueWorld_WeeklyFarmingCount = 11 + # Expired, do rogue and reset farming counter + self.config.stored.SimulatedUniverse.farm_reset() elif self.config.stored.SimulatedUniverse.is_full(): if self.config.RogueWorld_UseImmersifier and self.config.stored.Immersifier.value > 0: logger.info( 'Reached weekly point limit but still have immersifiers left, continue to use them') - elif self.config.RogueWorld_WeeklyFarming and self.config.RogueWorld_WeeklyFarmingCount > 0: + elif self.config.RogueWorld_WeeklyFarming and self.config.stored.SimulatedUniverse.farm_not_full(): + logger.attr( + "Farming Counter", self.config.stored.SimulatedUniverse.farm_get_remain()) logger.info( 'Reached weekly point limit but still continue to farm materials') else: diff --git a/tasks/rogue/rogue.py b/tasks/rogue/rogue.py index 6ba91504f..7635b25b8 100644 --- a/tasks/rogue/rogue.py +++ b/tasks/rogue/rogue.py @@ -28,11 +28,6 @@ class Rogue(RouteLoader, RogueEntry): self.rogue_run() self.rogue_reward_claim() - # runs when one rogue run finishes (do not handle whether the last rogue run finished or failed due to one who use this feature has less chance of failure -- would be better if check boss battle result instead of rogue result, but this version also works), and decreases rogue farming count by 1 - if self.config.RogueWorld_WeeklyFarming and self.config.RogueWorld_WeeklyFarmingCount > 0: - self.config.RogueWorld_WeeklyFarmingCount -= 1 - logger.attr("WeeklyFarmingCount", - self.config.RogueWorld_WeeklyFarmingCount) return True def run(self): diff --git a/tasks/rogue/route/base.py b/tasks/rogue/route/base.py index b68a4f793..fc8a34c77 100644 --- a/tasks/rogue/route/base.py +++ b/tasks/rogue/route/base.py @@ -170,6 +170,13 @@ class RouteBase(RouteBase_, RogueExit, RogueEvent, RogueReward): pass 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 + if self.config.RogueWorld_WeeklyFarming and self.config.stored.SimulatedUniverse.farm_not_full(): + self.config.stored.SimulatedUniverse.farm_dec() + logger.info( + f"Cleared elite boss, decrease farming count by 1, now {self.config.stored.SimulatedUniverse.FarmingCounter}") + return result def _domain_event_expected_end(self):